@credal/sdk 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/Client.d.ts +10 -9
  2. package/Client.js +12 -17
  3. package/api/resources/common/types/Operator.d.ts +1 -1
  4. package/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
  5. package/api/resources/common/types/ResourceType.d.ts +1 -1
  6. package/api/resources/common/types/Role.d.ts +1 -1
  7. package/api/resources/copilots/client/Client.d.ts +4 -0
  8. package/api/resources/copilots/client/Client.js +55 -117
  9. package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +2 -8
  10. package/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +2 -8
  11. package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +3 -12
  12. package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +4 -16
  13. package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +2 -8
  14. package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +5 -20
  15. package/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +19 -20
  16. package/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
  17. package/api/resources/copilots/types/ErrorChunk.d.ts +7 -0
  18. package/{dist/api/resources/actions/types/DirectMessage.d.ts → api/resources/copilots/types/ErrorChunkData.d.ts} +2 -2
  19. package/api/resources/copilots/types/FeedbackEnum.d.ts +1 -1
  20. package/api/resources/copilots/types/Filter.d.ts +1 -1
  21. package/api/resources/copilots/types/SendMessageResponse.d.ts +3 -5
  22. package/api/resources/copilots/types/StreamingChunk.d.ts +4 -1
  23. package/api/resources/copilots/types/index.d.ts +2 -0
  24. package/api/resources/copilots/types/index.js +2 -0
  25. package/api/resources/documentCatalog/client/Client.d.ts +4 -0
  26. package/api/resources/documentCatalog/client/Client.js +31 -45
  27. package/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +10 -40
  28. package/api/resources/documentCollections/client/Client.d.ts +4 -0
  29. package/api/resources/documentCollections/client/Client.js +43 -81
  30. package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
  31. package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +3 -12
  32. package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
  33. package/api/resources/index.d.ts +0 -3
  34. package/api/resources/index.js +18 -11
  35. package/api/resources/permissionsService/client/Client.d.ts +4 -0
  36. package/api/resources/permissionsService/client/Client.js +31 -45
  37. package/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +3 -12
  38. package/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +3 -12
  39. package/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +4 -16
  40. package/api/resources/permissionsService/types/Action.d.ts +1 -1
  41. package/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +1 -1
  42. package/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +1 -1
  43. package/api/resources/permissionsService/types/Principal.d.ts +1 -1
  44. package/api/resources/search/client/Client.d.ts +4 -0
  45. package/api/resources/search/client/Client.js +23 -21
  46. package/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +3 -12
  47. package/api/resources/users/client/Client.d.ts +4 -0
  48. package/api/resources/users/client/Client.js +23 -21
  49. package/core/auth/BearerToken.d.ts +1 -1
  50. package/core/fetcher/APIResponse.d.ts +1 -1
  51. package/core/fetcher/Fetcher.d.ts +2 -2
  52. package/core/fetcher/Fetcher.js +6 -5
  53. package/core/fetcher/Supplier.d.ts +1 -1
  54. package/core/fetcher/createRequestUrl.d.ts +1 -1
  55. package/core/fetcher/createRequestUrl.js +1 -2
  56. package/core/fetcher/getFetchFn.js +18 -9
  57. package/core/fetcher/getHeader.js +1 -2
  58. package/core/fetcher/getRequestBody.js +5 -5
  59. package/core/fetcher/getResponseBody.js +1 -2
  60. package/core/fetcher/makeRequest.d.ts +1 -1
  61. package/core/fetcher/requestWithRetries.js +4 -5
  62. package/core/fetcher/signals.d.ts +0 -1
  63. package/core/fetcher/signals.js +2 -3
  64. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
  65. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
  66. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
  67. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
  68. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
  69. package/core/index.js +17 -7
  70. package/core/json.d.ts +15 -0
  71. package/core/json.js +24 -0
  72. package/core/runtime/runtime.d.ts +1 -1
  73. package/core/runtime/runtime.js +51 -41
  74. package/core/schemas/Schema.d.ts +7 -5
  75. package/core/schemas/Schema.js +2 -0
  76. package/core/schemas/builders/bigint/bigint.d.ts +1 -1
  77. package/core/schemas/builders/bigint/bigint.js +22 -19
  78. package/core/schemas/builders/date/date.js +1 -2
  79. package/core/schemas/builders/enum/enum.js +1 -2
  80. package/core/schemas/builders/lazy/lazy.d.ts +1 -1
  81. package/core/schemas/builders/lazy/lazy.js +3 -4
  82. package/core/schemas/builders/lazy/lazyObject.js +1 -2
  83. package/core/schemas/builders/list/list.js +1 -2
  84. package/core/schemas/builders/literals/booleanLiteral.js +1 -2
  85. package/core/schemas/builders/literals/stringLiteral.js +1 -2
  86. package/core/schemas/builders/object/object.d.ts +1 -1
  87. package/core/schemas/builders/object/object.js +31 -3
  88. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
  89. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
  90. package/core/schemas/builders/object/property.js +2 -3
  91. package/core/schemas/builders/object/types.d.ts +16 -11
  92. package/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
  93. package/core/schemas/builders/object-like/types.d.ts +1 -1
  94. package/core/schemas/builders/record/record.js +2 -4
  95. package/core/schemas/builders/record/types.d.ts +2 -2
  96. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
  97. package/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
  98. package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
  99. package/core/schemas/builders/set/set.js +1 -2
  100. package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
  101. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
  102. package/core/schemas/builders/union/discriminant.js +1 -2
  103. package/core/schemas/builders/union/types.d.ts +6 -6
  104. package/core/schemas/builders/union/union.d.ts +1 -1
  105. package/core/schemas/builders/union/union.js +1 -2
  106. package/core/schemas/utils/MaybePromise.d.ts +1 -1
  107. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
  108. package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
  109. package/core/schemas/utils/entries.d.ts +1 -1
  110. package/core/schemas/utils/entries.js +1 -2
  111. package/core/schemas/utils/filterObject.d.ts +1 -1
  112. package/core/schemas/utils/filterObject.js +1 -2
  113. package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
  114. package/core/schemas/utils/isPlainObject.js +1 -2
  115. package/core/schemas/utils/keys.d.ts +1 -1
  116. package/core/schemas/utils/keys.js +1 -2
  117. package/core/schemas/utils/maybeSkipValidation.js +1 -2
  118. package/core/schemas/utils/partition.js +1 -2
  119. package/core/streaming-fetcher/Stream.d.ts +0 -1
  120. package/core/streaming-fetcher/Stream.js +20 -21
  121. package/dist/Client.d.ts +10 -9
  122. package/dist/Client.js +12 -17
  123. package/dist/api/resources/common/types/Operator.d.ts +1 -1
  124. package/dist/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
  125. package/dist/api/resources/common/types/ResourceType.d.ts +1 -1
  126. package/dist/api/resources/common/types/Role.d.ts +1 -1
  127. package/dist/api/resources/copilots/client/Client.d.ts +4 -0
  128. package/dist/api/resources/copilots/client/Client.js +55 -117
  129. package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +2 -8
  130. package/dist/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +2 -8
  131. package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +3 -12
  132. package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +4 -16
  133. package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +2 -8
  134. package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +5 -20
  135. package/dist/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +19 -20
  136. package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
  137. package/dist/api/resources/copilots/types/ErrorChunk.d.ts +7 -0
  138. package/{api/resources/actions/types/DirectMessage.d.ts → dist/api/resources/copilots/types/ErrorChunkData.d.ts} +2 -2
  139. package/dist/api/resources/copilots/types/FeedbackEnum.d.ts +1 -1
  140. package/dist/api/resources/copilots/types/Filter.d.ts +1 -1
  141. package/dist/api/resources/copilots/types/SendMessageResponse.d.ts +3 -5
  142. package/dist/api/resources/copilots/types/StreamingChunk.d.ts +4 -1
  143. package/dist/api/resources/copilots/types/index.d.ts +2 -0
  144. package/dist/api/resources/copilots/types/index.js +2 -0
  145. package/dist/api/resources/documentCatalog/client/Client.d.ts +4 -0
  146. package/dist/api/resources/documentCatalog/client/Client.js +31 -45
  147. package/dist/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +10 -40
  148. package/dist/api/resources/documentCollections/client/Client.d.ts +4 -0
  149. package/dist/api/resources/documentCollections/client/Client.js +43 -81
  150. package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
  151. package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +3 -12
  152. package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
  153. package/dist/api/resources/index.d.ts +0 -3
  154. package/dist/api/resources/index.js +18 -11
  155. package/dist/api/resources/permissionsService/client/Client.d.ts +4 -0
  156. package/dist/api/resources/permissionsService/client/Client.js +31 -45
  157. package/dist/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +3 -12
  158. package/dist/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +3 -12
  159. package/dist/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +4 -16
  160. package/dist/api/resources/permissionsService/types/Action.d.ts +1 -1
  161. package/dist/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +1 -1
  162. package/dist/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +1 -1
  163. package/dist/api/resources/permissionsService/types/Principal.d.ts +1 -1
  164. package/dist/api/resources/search/client/Client.d.ts +4 -0
  165. package/dist/api/resources/search/client/Client.js +23 -21
  166. package/dist/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +3 -12
  167. package/dist/api/resources/users/client/Client.d.ts +4 -0
  168. package/dist/api/resources/users/client/Client.js +23 -21
  169. package/dist/core/auth/BearerToken.d.ts +1 -1
  170. package/dist/core/fetcher/APIResponse.d.ts +1 -1
  171. package/dist/core/fetcher/Fetcher.d.ts +2 -2
  172. package/dist/core/fetcher/Fetcher.js +6 -5
  173. package/dist/core/fetcher/Supplier.d.ts +1 -1
  174. package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
  175. package/dist/core/fetcher/createRequestUrl.js +1 -2
  176. package/dist/core/fetcher/getFetchFn.js +18 -9
  177. package/dist/core/fetcher/getHeader.js +1 -2
  178. package/dist/core/fetcher/getRequestBody.js +5 -5
  179. package/dist/core/fetcher/getResponseBody.js +1 -2
  180. package/dist/core/fetcher/makeRequest.d.ts +1 -1
  181. package/dist/core/fetcher/requestWithRetries.js +4 -5
  182. package/dist/core/fetcher/signals.d.ts +0 -1
  183. package/dist/core/fetcher/signals.js +2 -3
  184. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
  185. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
  186. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
  187. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
  188. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
  189. package/dist/core/index.js +17 -7
  190. package/dist/core/json.d.ts +15 -0
  191. package/dist/core/json.js +24 -0
  192. package/dist/core/runtime/runtime.d.ts +1 -1
  193. package/dist/core/runtime/runtime.js +51 -41
  194. package/dist/core/schemas/Schema.d.ts +7 -5
  195. package/dist/core/schemas/Schema.js +2 -0
  196. package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
  197. package/dist/core/schemas/builders/bigint/bigint.js +22 -19
  198. package/dist/core/schemas/builders/date/date.js +1 -2
  199. package/dist/core/schemas/builders/enum/enum.js +1 -2
  200. package/dist/core/schemas/builders/lazy/lazy.d.ts +1 -1
  201. package/dist/core/schemas/builders/lazy/lazy.js +3 -4
  202. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -2
  203. package/dist/core/schemas/builders/list/list.js +1 -2
  204. package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
  205. package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
  206. package/dist/core/schemas/builders/object/object.d.ts +1 -1
  207. package/dist/core/schemas/builders/object/object.js +31 -3
  208. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
  209. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
  210. package/dist/core/schemas/builders/object/property.js +2 -3
  211. package/dist/core/schemas/builders/object/types.d.ts +16 -11
  212. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
  213. package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
  214. package/dist/core/schemas/builders/record/record.js +2 -4
  215. package/dist/core/schemas/builders/record/types.d.ts +2 -2
  216. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
  217. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
  218. package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
  219. package/dist/core/schemas/builders/set/set.js +1 -2
  220. package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
  221. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
  222. package/dist/core/schemas/builders/union/discriminant.js +1 -2
  223. package/dist/core/schemas/builders/union/types.d.ts +6 -6
  224. package/dist/core/schemas/builders/union/union.d.ts +1 -1
  225. package/dist/core/schemas/builders/union/union.js +1 -2
  226. package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
  227. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
  228. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
  229. package/dist/core/schemas/utils/entries.d.ts +1 -1
  230. package/dist/core/schemas/utils/entries.js +1 -2
  231. package/dist/core/schemas/utils/filterObject.d.ts +1 -1
  232. package/dist/core/schemas/utils/filterObject.js +1 -2
  233. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
  234. package/dist/core/schemas/utils/isPlainObject.js +1 -2
  235. package/dist/core/schemas/utils/keys.d.ts +1 -1
  236. package/dist/core/schemas/utils/keys.js +1 -2
  237. package/dist/core/schemas/utils/maybeSkipValidation.js +1 -2
  238. package/dist/core/schemas/utils/partition.js +1 -2
  239. package/dist/core/streaming-fetcher/Stream.d.ts +0 -1
  240. package/dist/core/streaming-fetcher/Stream.js +20 -21
  241. package/dist/environments.d.ts +1 -1
  242. package/dist/errors/CredalError.js +2 -1
  243. package/dist/errors/CredalTimeoutError.d.ts +1 -1
  244. package/dist/errors/CredalTimeoutError.js +2 -2
  245. package/dist/index.d.ts +1 -0
  246. package/dist/index.js +19 -8
  247. package/dist/serialization/resources/common/types/Collaborator.js +17 -7
  248. package/dist/serialization/resources/common/types/ExternalResourceId.js +17 -7
  249. package/dist/serialization/resources/common/types/Operator.js +17 -7
  250. package/dist/serialization/resources/common/types/ResourceIdentifier.js +17 -7
  251. package/dist/serialization/resources/common/types/ResourceType.js +17 -7
  252. package/dist/serialization/resources/common/types/Role.js +17 -7
  253. package/dist/serialization/resources/common/types/Url.js +17 -7
  254. package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +17 -7
  255. package/dist/serialization/resources/copilots/client/requests/CreateConversationRequest.js +17 -7
  256. package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +17 -7
  257. package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +17 -7
  258. package/dist/serialization/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +17 -7
  259. package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +17 -7
  260. package/dist/serialization/resources/copilots/client/requests/SendMessageRequest.js +17 -7
  261. package/dist/serialization/resources/copilots/client/requests/StreamMessageRequest.js +17 -7
  262. package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +17 -7
  263. package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.js +17 -7
  264. package/dist/serialization/resources/copilots/types/BlockedChunk.js +17 -7
  265. package/dist/serialization/resources/copilots/types/BooleanFieldSchema.js +17 -7
  266. package/dist/serialization/resources/copilots/types/CollectionFilteredData.js +17 -7
  267. package/dist/serialization/resources/copilots/types/Configuration.js +17 -7
  268. package/dist/serialization/resources/copilots/types/CreateConversationResponse.js +17 -7
  269. package/dist/serialization/resources/copilots/types/CreateCopilotResponse.js +17 -7
  270. package/dist/serialization/resources/copilots/types/DataChunk.js +17 -7
  271. package/dist/serialization/resources/copilots/types/DataFilter.js +17 -7
  272. package/dist/serialization/resources/copilots/types/DatetimeFieldSchema.js +17 -7
  273. package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.js +17 -7
  274. package/dist/serialization/resources/copilots/types/EndOfMessageChunk.js +17 -7
  275. package/dist/serialization/resources/{actions/types/SlackThread.d.ts → copilots/types/ErrorChunk.d.ts} +4 -4
  276. package/dist/serialization/resources/{actions/types/HumanConfirmationChannel.js → copilots/types/ErrorChunk.js} +21 -20
  277. package/dist/serialization/resources/{actions/types/DirectMessage.d.ts → copilots/types/ErrorChunkData.d.ts} +3 -3
  278. package/dist/serialization/resources/{actions/types/InvokeActionResponse.js → copilots/types/ErrorChunkData.js} +20 -12
  279. package/dist/serialization/resources/copilots/types/FeedbackEnum.js +17 -7
  280. package/dist/serialization/resources/copilots/types/Filter.js +17 -7
  281. package/dist/serialization/resources/copilots/types/FinalChunk.js +17 -7
  282. package/dist/serialization/resources/copilots/types/InitialChunk.js +17 -7
  283. package/dist/serialization/resources/copilots/types/InputVariable.js +17 -7
  284. package/dist/serialization/resources/copilots/types/InsertedAuditLog.js +17 -7
  285. package/dist/serialization/resources/copilots/types/MessageBlocked.js +17 -7
  286. package/dist/serialization/resources/copilots/types/MessageFeedback.js +17 -7
  287. package/dist/serialization/resources/copilots/types/MessageReply.js +17 -7
  288. package/dist/serialization/resources/copilots/types/NumberFieldSchema.js +17 -7
  289. package/dist/serialization/resources/copilots/types/PolicyTrigger.js +17 -7
  290. package/dist/serialization/resources/copilots/types/ReferencedSource.js +17 -7
  291. package/dist/serialization/resources/copilots/types/ResponseChunk.js +17 -7
  292. package/dist/serialization/resources/copilots/types/SendAgentMessageResponse.js +17 -7
  293. package/dist/serialization/resources/copilots/types/SendMessageResponse.js +17 -7
  294. package/dist/serialization/resources/copilots/types/StreamingChunk.d.ts +5 -1
  295. package/dist/serialization/resources/copilots/types/StreamingChunk.js +19 -7
  296. package/dist/serialization/resources/copilots/types/StringFieldSchema.js +17 -7
  297. package/dist/serialization/resources/copilots/types/WebSearchResult.js +17 -7
  298. package/dist/serialization/resources/copilots/types/index.d.ts +2 -0
  299. package/dist/serialization/resources/copilots/types/index.js +2 -0
  300. package/dist/serialization/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +17 -7
  301. package/dist/serialization/resources/documentCatalog/types/DocumentMetadataPatch.js +17 -7
  302. package/dist/serialization/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +17 -7
  303. package/dist/serialization/resources/documentCatalog/types/SyncSourceByUrlRequest.js +17 -7
  304. package/dist/serialization/resources/documentCatalog/types/SyncSourceByUrlResponse.js +17 -7
  305. package/dist/serialization/resources/documentCatalog/types/UploadDocumentResponse.js +17 -7
  306. package/dist/serialization/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +17 -7
  307. package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +17 -7
  308. package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +17 -7
  309. package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +17 -7
  310. package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +17 -7
  311. package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +17 -7
  312. package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.js +17 -7
  313. package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +17 -7
  314. package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +17 -7
  315. package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +17 -7
  316. package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +17 -7
  317. package/dist/serialization/resources/index.d.ts +0 -3
  318. package/dist/serialization/resources/index.js +18 -11
  319. package/dist/serialization/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js +17 -7
  320. package/dist/serialization/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +17 -7
  321. package/dist/serialization/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +17 -7
  322. package/dist/serialization/resources/permissionsService/types/Action.js +17 -7
  323. package/dist/serialization/resources/permissionsService/types/AuthorizedResource.js +17 -7
  324. package/dist/serialization/resources/permissionsService/types/AuthorizedResourceListPage.js +17 -7
  325. package/dist/serialization/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +17 -7
  326. package/dist/serialization/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +17 -7
  327. package/dist/serialization/resources/permissionsService/types/Group.js +17 -7
  328. package/dist/serialization/resources/permissionsService/types/Principal.js +17 -7
  329. package/dist/serialization/resources/permissionsService/types/PrincipalListPage.js +17 -7
  330. package/dist/serialization/resources/permissionsService/types/ResourceAuthorizationResult.js +17 -7
  331. package/dist/serialization/resources/permissionsService/types/User.js +17 -7
  332. package/dist/serialization/resources/search/client/requests/SearchDocumentCollectionRequest.js +17 -7
  333. package/dist/serialization/resources/search/types/DocumentCollectionSearchOptions.js +17 -7
  334. package/dist/serialization/resources/search/types/DocumentCollectionSearchResult.js +17 -7
  335. package/dist/serialization/resources/search/types/SearchDocumentCollectionResponse.js +17 -7
  336. package/dist/serialization/resources/search/types/SearchResultChunk.js +17 -7
  337. package/dist/serialization/resources/search/types/SingleFieldFilter.js +17 -7
  338. package/dist/serialization/resources/users/client/index.js +17 -7
  339. package/dist/serialization/resources/users/client/metadata.js +17 -7
  340. package/dist/serialization/resources/users/types/UserMetadataPatch.js +17 -7
  341. package/dist/version.d.ts +1 -1
  342. package/dist/version.js +1 -1
  343. package/environments.d.ts +1 -1
  344. package/errors/CredalError.js +2 -1
  345. package/errors/CredalTimeoutError.d.ts +1 -1
  346. package/errors/CredalTimeoutError.js +2 -2
  347. package/index.d.ts +1 -0
  348. package/index.js +19 -8
  349. package/{jest.config.js → jest.config.mjs} +4 -1
  350. package/package.json +16 -17
  351. package/reference.md +0 -79
  352. package/scripts/rename-to-esm-files.js +115 -0
  353. package/serialization/resources/common/types/Collaborator.js +17 -7
  354. package/serialization/resources/common/types/ExternalResourceId.js +17 -7
  355. package/serialization/resources/common/types/Operator.js +17 -7
  356. package/serialization/resources/common/types/ResourceIdentifier.js +17 -7
  357. package/serialization/resources/common/types/ResourceType.js +17 -7
  358. package/serialization/resources/common/types/Role.js +17 -7
  359. package/serialization/resources/common/types/Url.js +17 -7
  360. package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +17 -7
  361. package/serialization/resources/copilots/client/requests/CreateConversationRequest.js +17 -7
  362. package/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +17 -7
  363. package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +17 -7
  364. package/serialization/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +17 -7
  365. package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +17 -7
  366. package/serialization/resources/copilots/client/requests/SendMessageRequest.js +17 -7
  367. package/serialization/resources/copilots/client/requests/StreamMessageRequest.js +17 -7
  368. package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +17 -7
  369. package/serialization/resources/copilots/types/AiEndpointConfiguration.js +17 -7
  370. package/serialization/resources/copilots/types/BlockedChunk.js +17 -7
  371. package/serialization/resources/copilots/types/BooleanFieldSchema.js +17 -7
  372. package/serialization/resources/copilots/types/CollectionFilteredData.js +17 -7
  373. package/serialization/resources/copilots/types/Configuration.js +17 -7
  374. package/serialization/resources/copilots/types/CreateConversationResponse.js +17 -7
  375. package/serialization/resources/copilots/types/CreateCopilotResponse.js +17 -7
  376. package/serialization/resources/copilots/types/DataChunk.js +17 -7
  377. package/serialization/resources/copilots/types/DataFilter.js +17 -7
  378. package/serialization/resources/copilots/types/DatetimeFieldSchema.js +17 -7
  379. package/serialization/resources/copilots/types/DeleteCopilotResponse.js +17 -7
  380. package/serialization/resources/copilots/types/EndOfMessageChunk.js +17 -7
  381. package/serialization/resources/{actions/types/Conversation.d.ts → copilots/types/ErrorChunk.d.ts} +4 -3
  382. package/{dist/serialization/resources/actions/types/Conversation.js → serialization/resources/copilots/types/ErrorChunk.js} +21 -10
  383. package/{dist/serialization/resources/actions/types/Conversation.d.ts → serialization/resources/copilots/types/ErrorChunkData.d.ts} +3 -3
  384. package/{dist/serialization/resources/actions/types/SlackThread.js → serialization/resources/copilots/types/ErrorChunkData.js} +20 -11
  385. package/serialization/resources/copilots/types/FeedbackEnum.js +17 -7
  386. package/serialization/resources/copilots/types/Filter.js +17 -7
  387. package/serialization/resources/copilots/types/FinalChunk.js +17 -7
  388. package/serialization/resources/copilots/types/InitialChunk.js +17 -7
  389. package/serialization/resources/copilots/types/InputVariable.js +17 -7
  390. package/serialization/resources/copilots/types/InsertedAuditLog.js +17 -7
  391. package/serialization/resources/copilots/types/MessageBlocked.js +17 -7
  392. package/serialization/resources/copilots/types/MessageFeedback.js +17 -7
  393. package/serialization/resources/copilots/types/MessageReply.js +17 -7
  394. package/serialization/resources/copilots/types/NumberFieldSchema.js +17 -7
  395. package/serialization/resources/copilots/types/PolicyTrigger.js +17 -7
  396. package/serialization/resources/copilots/types/ReferencedSource.js +17 -7
  397. package/serialization/resources/copilots/types/ResponseChunk.js +17 -7
  398. package/serialization/resources/copilots/types/SendAgentMessageResponse.js +17 -7
  399. package/serialization/resources/copilots/types/SendMessageResponse.js +17 -7
  400. package/serialization/resources/copilots/types/StreamingChunk.d.ts +5 -1
  401. package/serialization/resources/copilots/types/StreamingChunk.js +19 -7
  402. package/serialization/resources/copilots/types/StringFieldSchema.js +17 -7
  403. package/serialization/resources/copilots/types/WebSearchResult.js +17 -7
  404. package/serialization/resources/copilots/types/index.d.ts +2 -0
  405. package/serialization/resources/copilots/types/index.js +2 -0
  406. package/serialization/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +17 -7
  407. package/serialization/resources/documentCatalog/types/DocumentMetadataPatch.js +17 -7
  408. package/serialization/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +17 -7
  409. package/serialization/resources/documentCatalog/types/SyncSourceByUrlRequest.js +17 -7
  410. package/serialization/resources/documentCatalog/types/SyncSourceByUrlResponse.js +17 -7
  411. package/serialization/resources/documentCatalog/types/UploadDocumentResponse.js +17 -7
  412. package/serialization/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +17 -7
  413. package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +17 -7
  414. package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +17 -7
  415. package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +17 -7
  416. package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +17 -7
  417. package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +17 -7
  418. package/serialization/resources/documentCollections/types/CreateCollectionResponse.js +17 -7
  419. package/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +17 -7
  420. package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +17 -7
  421. package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +17 -7
  422. package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +17 -7
  423. package/serialization/resources/index.d.ts +0 -3
  424. package/serialization/resources/index.js +18 -11
  425. package/serialization/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js +17 -7
  426. package/serialization/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +17 -7
  427. package/serialization/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +17 -7
  428. package/serialization/resources/permissionsService/types/Action.js +17 -7
  429. package/serialization/resources/permissionsService/types/AuthorizedResource.js +17 -7
  430. package/serialization/resources/permissionsService/types/AuthorizedResourceListPage.js +17 -7
  431. package/serialization/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +17 -7
  432. package/serialization/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +17 -7
  433. package/serialization/resources/permissionsService/types/Group.js +17 -7
  434. package/serialization/resources/permissionsService/types/Principal.js +17 -7
  435. package/serialization/resources/permissionsService/types/PrincipalListPage.js +17 -7
  436. package/serialization/resources/permissionsService/types/ResourceAuthorizationResult.js +17 -7
  437. package/serialization/resources/permissionsService/types/User.js +17 -7
  438. package/serialization/resources/search/client/requests/SearchDocumentCollectionRequest.js +17 -7
  439. package/serialization/resources/search/types/DocumentCollectionSearchOptions.js +17 -7
  440. package/serialization/resources/search/types/DocumentCollectionSearchResult.js +17 -7
  441. package/serialization/resources/search/types/SearchDocumentCollectionResponse.js +17 -7
  442. package/serialization/resources/search/types/SearchResultChunk.js +17 -7
  443. package/serialization/resources/search/types/SingleFieldFilter.js +17 -7
  444. package/serialization/resources/users/client/index.js +17 -7
  445. package/serialization/resources/users/client/metadata.js +17 -7
  446. package/serialization/resources/users/types/UserMetadataPatch.js +17 -7
  447. package/version.d.ts +1 -1
  448. package/version.js +1 -1
  449. package/api/resources/actions/client/Client.d.ts +0 -50
  450. package/api/resources/actions/client/Client.js +0 -138
  451. package/api/resources/actions/client/index.d.ts +0 -1
  452. package/api/resources/actions/client/index.js +0 -17
  453. package/api/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -55
  454. package/api/resources/actions/client/requests/index.d.ts +0 -1
  455. package/api/resources/actions/client/requests/index.js +0 -2
  456. package/api/resources/actions/index.d.ts +0 -2
  457. package/api/resources/actions/index.js +0 -18
  458. package/api/resources/actions/types/ActionStatus.d.ts +0 -13
  459. package/api/resources/actions/types/ActionStatus.js +0 -15
  460. package/api/resources/actions/types/Conversation.d.ts +0 -6
  461. package/api/resources/actions/types/HumanConfirmationChannel.d.ts +0 -16
  462. package/api/resources/actions/types/InvokeActionResponse.d.ts +0 -8
  463. package/api/resources/actions/types/InvokeActionResponse.js +0 -5
  464. package/api/resources/actions/types/SlackThread.d.ts +0 -7
  465. package/api/resources/actions/types/SlackThread.js +0 -5
  466. package/api/resources/actions/types/index.d.ts +0 -6
  467. package/api/resources/actions/types/index.js +0 -22
  468. package/dist/api/resources/actions/client/Client.d.ts +0 -50
  469. package/dist/api/resources/actions/client/Client.js +0 -138
  470. package/dist/api/resources/actions/client/index.d.ts +0 -1
  471. package/dist/api/resources/actions/client/index.js +0 -17
  472. package/dist/api/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -55
  473. package/dist/api/resources/actions/client/requests/InvokeActionRequest.js +0 -5
  474. package/dist/api/resources/actions/client/requests/index.d.ts +0 -1
  475. package/dist/api/resources/actions/client/requests/index.js +0 -2
  476. package/dist/api/resources/actions/index.d.ts +0 -2
  477. package/dist/api/resources/actions/index.js +0 -18
  478. package/dist/api/resources/actions/types/ActionStatus.d.ts +0 -13
  479. package/dist/api/resources/actions/types/ActionStatus.js +0 -15
  480. package/dist/api/resources/actions/types/Conversation.d.ts +0 -6
  481. package/dist/api/resources/actions/types/Conversation.js +0 -5
  482. package/dist/api/resources/actions/types/DirectMessage.js +0 -5
  483. package/dist/api/resources/actions/types/HumanConfirmationChannel.d.ts +0 -16
  484. package/dist/api/resources/actions/types/HumanConfirmationChannel.js +0 -5
  485. package/dist/api/resources/actions/types/InvokeActionResponse.d.ts +0 -8
  486. package/dist/api/resources/actions/types/InvokeActionResponse.js +0 -5
  487. package/dist/api/resources/actions/types/SlackThread.d.ts +0 -7
  488. package/dist/api/resources/actions/types/SlackThread.js +0 -5
  489. package/dist/api/resources/actions/types/index.d.ts +0 -6
  490. package/dist/api/resources/actions/types/index.js +0 -22
  491. package/dist/serialization/resources/actions/client/index.d.ts +0 -1
  492. package/dist/serialization/resources/actions/client/index.js +0 -17
  493. package/dist/serialization/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -19
  494. package/dist/serialization/resources/actions/client/requests/InvokeActionRequest.js +0 -40
  495. package/dist/serialization/resources/actions/client/requests/index.d.ts +0 -1
  496. package/dist/serialization/resources/actions/client/requests/index.js +0 -5
  497. package/dist/serialization/resources/actions/index.d.ts +0 -2
  498. package/dist/serialization/resources/actions/index.js +0 -18
  499. package/dist/serialization/resources/actions/types/ActionStatus.d.ts +0 -10
  500. package/dist/serialization/resources/actions/types/ActionStatus.js +0 -39
  501. package/dist/serialization/resources/actions/types/DirectMessage.js +0 -33
  502. package/dist/serialization/resources/actions/types/HumanConfirmationChannel.d.ts +0 -22
  503. package/dist/serialization/resources/actions/types/InvokeActionResponse.d.ts +0 -14
  504. package/dist/serialization/resources/actions/types/index.d.ts +0 -6
  505. package/dist/serialization/resources/actions/types/index.js +0 -22
  506. package/serialization/resources/actions/client/index.d.ts +0 -1
  507. package/serialization/resources/actions/client/index.js +0 -17
  508. package/serialization/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -19
  509. package/serialization/resources/actions/client/requests/InvokeActionRequest.js +0 -40
  510. package/serialization/resources/actions/client/requests/index.d.ts +0 -1
  511. package/serialization/resources/actions/client/requests/index.js +0 -5
  512. package/serialization/resources/actions/index.d.ts +0 -2
  513. package/serialization/resources/actions/index.js +0 -18
  514. package/serialization/resources/actions/types/ActionStatus.d.ts +0 -10
  515. package/serialization/resources/actions/types/ActionStatus.js +0 -39
  516. package/serialization/resources/actions/types/Conversation.js +0 -33
  517. package/serialization/resources/actions/types/DirectMessage.d.ts +0 -12
  518. package/serialization/resources/actions/types/DirectMessage.js +0 -33
  519. package/serialization/resources/actions/types/HumanConfirmationChannel.d.ts +0 -22
  520. package/serialization/resources/actions/types/HumanConfirmationChannel.js +0 -43
  521. package/serialization/resources/actions/types/InvokeActionResponse.d.ts +0 -14
  522. package/serialization/resources/actions/types/InvokeActionResponse.js +0 -35
  523. package/serialization/resources/actions/types/SlackThread.d.ts +0 -13
  524. package/serialization/resources/actions/types/SlackThread.js +0 -34
  525. package/serialization/resources/actions/types/index.d.ts +0 -6
  526. package/serialization/resources/actions/types/index.js +0 -22
  527. /package/api/resources/{actions/client/requests/InvokeActionRequest.js → copilots/types/ErrorChunk.js} +0 -0
  528. /package/api/resources/{actions/types/Conversation.js → copilots/types/ErrorChunkData.js} +0 -0
  529. /package/{api/resources/actions/types/DirectMessage.js → dist/api/resources/copilots/types/ErrorChunk.js} +0 -0
  530. /package/{api/resources/actions/types/HumanConfirmationChannel.js → dist/api/resources/copilots/types/ErrorChunkData.js} +0 -0
package/Client.d.ts CHANGED
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
- import { Actions } from "./api/resources/actions/client/Client";
7
6
  import { Copilots } from "./api/resources/copilots/client/Client";
8
7
  import { DocumentCatalog } from "./api/resources/documentCatalog/client/Client";
9
8
  import { DocumentCollections } from "./api/resources/documentCollections/client/Client";
@@ -13,6 +12,8 @@ import { Users } from "./api/resources/users/client/Client";
13
12
  export declare namespace CredalClient {
14
13
  interface Options {
15
14
  environment?: core.Supplier<environments.CredalEnvironment | string>;
15
+ /** Specify a custom URL to connect the client to. */
16
+ baseUrl?: core.Supplier<string>;
16
17
  apiKey?: core.Supplier<core.BearerToken | undefined>;
17
18
  fetcher?: core.FetchFunction;
18
19
  }
@@ -23,23 +24,23 @@ export declare namespace CredalClient {
23
24
  maxRetries?: number;
24
25
  /** A hook to abort the request. */
25
26
  abortSignal?: AbortSignal;
27
+ /** Additional headers to include in the request. */
28
+ headers?: Record<string, string>;
26
29
  }
27
30
  }
28
31
  export declare class CredalClient {
29
32
  protected readonly _options: CredalClient.Options;
30
- constructor(_options?: CredalClient.Options);
31
- protected _actions: Actions | undefined;
32
- get actions(): Actions;
33
33
  protected _copilots: Copilots | undefined;
34
- get copilots(): Copilots;
35
34
  protected _documentCatalog: DocumentCatalog | undefined;
36
- get documentCatalog(): DocumentCatalog;
37
35
  protected _documentCollections: DocumentCollections | undefined;
38
- get documentCollections(): DocumentCollections;
39
36
  protected _permissionsService: PermissionsService | undefined;
40
- get permissionsService(): PermissionsService;
41
37
  protected _search: Search | undefined;
42
- get search(): Search;
43
38
  protected _users: Users | undefined;
39
+ constructor(_options?: CredalClient.Options);
40
+ get copilots(): Copilots;
41
+ get documentCatalog(): DocumentCatalog;
42
+ get documentCollections(): DocumentCollections;
43
+ get permissionsService(): PermissionsService;
44
+ get search(): Search;
44
45
  get users(): Users;
45
46
  }
package/Client.js CHANGED
@@ -4,44 +4,39 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CredalClient = void 0;
7
- const Client_1 = require("./api/resources/actions/client/Client");
8
- const Client_2 = require("./api/resources/copilots/client/Client");
9
- const Client_3 = require("./api/resources/documentCatalog/client/Client");
10
- const Client_4 = require("./api/resources/documentCollections/client/Client");
11
- const Client_5 = require("./api/resources/permissionsService/client/Client");
12
- const Client_6 = require("./api/resources/search/client/Client");
13
- const Client_7 = require("./api/resources/users/client/Client");
7
+ const Client_1 = require("./api/resources/copilots/client/Client");
8
+ const Client_2 = require("./api/resources/documentCatalog/client/Client");
9
+ const Client_3 = require("./api/resources/documentCollections/client/Client");
10
+ const Client_4 = require("./api/resources/permissionsService/client/Client");
11
+ const Client_5 = require("./api/resources/search/client/Client");
12
+ const Client_6 = require("./api/resources/users/client/Client");
14
13
  class CredalClient {
15
14
  constructor(_options = {}) {
16
15
  this._options = _options;
17
16
  }
18
- get actions() {
19
- var _a;
20
- return ((_a = this._actions) !== null && _a !== void 0 ? _a : (this._actions = new Client_1.Actions(this._options)));
21
- }
22
17
  get copilots() {
23
18
  var _a;
24
- return ((_a = this._copilots) !== null && _a !== void 0 ? _a : (this._copilots = new Client_2.Copilots(this._options)));
19
+ return ((_a = this._copilots) !== null && _a !== void 0 ? _a : (this._copilots = new Client_1.Copilots(this._options)));
25
20
  }
26
21
  get documentCatalog() {
27
22
  var _a;
28
- return ((_a = this._documentCatalog) !== null && _a !== void 0 ? _a : (this._documentCatalog = new Client_3.DocumentCatalog(this._options)));
23
+ return ((_a = this._documentCatalog) !== null && _a !== void 0 ? _a : (this._documentCatalog = new Client_2.DocumentCatalog(this._options)));
29
24
  }
30
25
  get documentCollections() {
31
26
  var _a;
32
- return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new Client_4.DocumentCollections(this._options)));
27
+ return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new Client_3.DocumentCollections(this._options)));
33
28
  }
34
29
  get permissionsService() {
35
30
  var _a;
36
- return ((_a = this._permissionsService) !== null && _a !== void 0 ? _a : (this._permissionsService = new Client_5.PermissionsService(this._options)));
31
+ return ((_a = this._permissionsService) !== null && _a !== void 0 ? _a : (this._permissionsService = new Client_4.PermissionsService(this._options)));
37
32
  }
38
33
  get search() {
39
34
  var _a;
40
- return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_6.Search(this._options)));
35
+ return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_5.Search(this._options)));
41
36
  }
42
37
  get users() {
43
38
  var _a;
44
- return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_7.Users(this._options)));
39
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_6.Users(this._options)));
45
40
  }
46
41
  }
47
42
  exports.CredalClient = CredalClient;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type Operator = "<" | ">" | "<=" | ">=" | "!=" | "==" | "contains";
4
+ export type Operator = "<" | ">" | "<=" | ">=" | "!=" | "==" | "contains";
5
5
  export declare const Operator: {
6
6
  readonly LessThan: "<";
7
7
  readonly GreaterThan: ">";
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Credal from "../../../index";
5
- export declare type ResourceIdentifier = Credal.ResourceIdentifier.ExternalResourceId | Credal.ResourceIdentifier.Url;
5
+ export type ResourceIdentifier = Credal.ResourceIdentifier.ExternalResourceId | Credal.ResourceIdentifier.Url;
6
6
  export declare namespace ResourceIdentifier {
7
7
  interface ExternalResourceId extends Credal.ExternalResourceId {
8
8
  type: "external-resource-id";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "ZENDESK_ARTICLE_CATEGORY" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "NOTION_DATABASE" | "SLACK_CHANNEL" | "MONGO_COLLECTION_SYNC" | "UNKNOWN";
4
+ export type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "ZENDESK_ARTICLE_CATEGORY" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "NOTION_DATABASE" | "SLACK_CHANNEL" | "MONGO_COLLECTION_SYNC" | "UNKNOWN";
5
5
  export declare const ResourceType: {
6
6
  readonly GoogleDriveItem: "GOOGLE_DRIVE_ITEM";
7
7
  readonly MicrosoftDriveItem: "MICROSOFT_DRIVE_ITEM";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type Role = "viewer" | "editor";
4
+ export type Role = "viewer" | "editor";
5
5
  export declare const Role: {
6
6
  readonly Viewer: "viewer";
7
7
  readonly Editor: "editor";
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
7
7
  export declare namespace Copilots {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.CredalEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
10
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
11
13
  fetcher?: core.FetchFunction;
12
14
  }
@@ -17,6 +19,8 @@ export declare namespace Copilots {
17
19
  maxRetries?: number;
18
20
  /** A hook to abort the request. */
19
21
  abortSignal?: AbortSignal;
22
+ /** Additional headers to include in the request. */
23
+ headers?: Record<string, string>;
20
24
  }
21
25
  }
22
26
  export declare class Copilots {
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  }) : function(o, v) {
19
19
  o["default"] = v;
20
20
  });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
28
38
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
39
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
40
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -65,20 +75,12 @@ class Copilots {
65
75
  * })
66
76
  */
67
77
  createCopilot(request, requestOptions) {
68
- var _a, _b;
69
78
  return __awaiter(this, void 0, void 0, function* () {
79
+ var _a, _b, _c;
70
80
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/createCopilot"),
81
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/createCopilot"),
72
82
  method: "POST",
73
- headers: {
74
- Authorization: yield this._getAuthorizationHeader(),
75
- "X-Fern-Language": "JavaScript",
76
- "X-Fern-SDK-Name": "@credal/sdk",
77
- "X-Fern-SDK-Version": "0.0.23",
78
- "User-Agent": "@credal/sdk/0.0.23",
79
- "X-Fern-Runtime": core.RUNTIME.type,
80
- "X-Fern-Runtime-Version": core.RUNTIME.version,
81
- },
83
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
84
  contentType: "application/json",
83
85
  requestType: "json",
84
86
  body: serializers.CreateCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -107,7 +109,7 @@ class Copilots {
107
109
  body: _response.error.rawBody,
108
110
  });
109
111
  case "timeout":
110
- throw new errors.CredalTimeoutError();
112
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/createCopilot.");
111
113
  case "unknown":
112
114
  throw new errors.CredalError({
113
115
  message: _response.error.errorMessage,
@@ -128,20 +130,12 @@ class Copilots {
128
130
  * })
129
131
  */
130
132
  createConversation(request, requestOptions) {
131
- var _a, _b;
132
133
  return __awaiter(this, void 0, void 0, function* () {
134
+ var _a, _b, _c;
133
135
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
134
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/createConversation"),
136
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/createConversation"),
135
137
  method: "POST",
136
- headers: {
137
- Authorization: yield this._getAuthorizationHeader(),
138
- "X-Fern-Language": "JavaScript",
139
- "X-Fern-SDK-Name": "@credal/sdk",
140
- "X-Fern-SDK-Version": "0.0.23",
141
- "User-Agent": "@credal/sdk/0.0.23",
142
- "X-Fern-Runtime": core.RUNTIME.type,
143
- "X-Fern-Runtime-Version": core.RUNTIME.version,
144
- },
138
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
145
139
  contentType: "application/json",
146
140
  requestType: "json",
147
141
  body: serializers.CreateConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -170,7 +164,7 @@ class Copilots {
170
164
  body: _response.error.rawBody,
171
165
  });
172
166
  case "timeout":
173
- throw new errors.CredalTimeoutError();
167
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/createConversation.");
174
168
  case "unknown":
175
169
  throw new errors.CredalError({
176
170
  message: _response.error.errorMessage,
@@ -195,20 +189,12 @@ class Copilots {
195
189
  * })
196
190
  */
197
191
  provideMessageFeedback(request, requestOptions) {
198
- var _a, _b;
199
192
  return __awaiter(this, void 0, void 0, function* () {
193
+ var _a, _b, _c;
200
194
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
201
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/provideMessageFeedback"),
195
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/provideMessageFeedback"),
202
196
  method: "POST",
203
- headers: {
204
- Authorization: yield this._getAuthorizationHeader(),
205
- "X-Fern-Language": "JavaScript",
206
- "X-Fern-SDK-Name": "@credal/sdk",
207
- "X-Fern-SDK-Version": "0.0.23",
208
- "User-Agent": "@credal/sdk/0.0.23",
209
- "X-Fern-Runtime": core.RUNTIME.type,
210
- "X-Fern-Runtime-Version": core.RUNTIME.version,
211
- },
197
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
212
198
  contentType: "application/json",
213
199
  requestType: "json",
214
200
  body: serializers.ProvideMessageFeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -232,7 +218,7 @@ class Copilots {
232
218
  body: _response.error.rawBody,
233
219
  });
234
220
  case "timeout":
235
- throw new errors.CredalTimeoutError();
221
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/provideMessageFeedback.");
236
222
  case "unknown":
237
223
  throw new errors.CredalError({
238
224
  message: _response.error.errorMessage,
@@ -259,20 +245,12 @@ class Copilots {
259
245
  * })
260
246
  */
261
247
  sendMessage(request, requestOptions) {
262
- var _a, _b;
263
248
  return __awaiter(this, void 0, void 0, function* () {
249
+ var _a, _b, _c;
264
250
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
265
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/sendMessage"),
251
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/sendMessage"),
266
252
  method: "POST",
267
- headers: {
268
- Authorization: yield this._getAuthorizationHeader(),
269
- "X-Fern-Language": "JavaScript",
270
- "X-Fern-SDK-Name": "@credal/sdk",
271
- "X-Fern-SDK-Version": "0.0.23",
272
- "User-Agent": "@credal/sdk/0.0.23",
273
- "X-Fern-Runtime": core.RUNTIME.type,
274
- "X-Fern-Runtime-Version": core.RUNTIME.version,
275
- },
253
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
276
254
  contentType: "application/json",
277
255
  requestType: "json",
278
256
  body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -301,7 +279,7 @@ class Copilots {
301
279
  body: _response.error.rawBody,
302
280
  });
303
281
  case "timeout":
304
- throw new errors.CredalTimeoutError();
282
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/sendMessage.");
305
283
  case "unknown":
306
284
  throw new errors.CredalError({
307
285
  message: _response.error.errorMessage,
@@ -313,20 +291,12 @@ class Copilots {
313
291
  * This endpoint allows you to send a message to a specific copilot and get the response back as a streamed set of Server-Sent Events.
314
292
  */
315
293
  streamMessage(request, requestOptions) {
316
- var _a, _b;
317
294
  return __awaiter(this, void 0, void 0, function* () {
295
+ var _a, _b, _c;
318
296
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
319
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/streamMessage"),
297
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/streamMessage"),
320
298
  method: "POST",
321
- headers: {
322
- Authorization: yield this._getAuthorizationHeader(),
323
- "X-Fern-Language": "JavaScript",
324
- "X-Fern-SDK-Name": "@credal/sdk",
325
- "X-Fern-SDK-Version": "0.0.23",
326
- "User-Agent": "@credal/sdk/0.0.23",
327
- "X-Fern-Runtime": core.RUNTIME.type,
328
- "X-Fern-Runtime-Version": core.RUNTIME.version,
329
- },
299
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
330
300
  contentType: "application/json",
331
301
  requestType: "json",
332
302
  body: serializers.StreamMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -366,7 +336,7 @@ class Copilots {
366
336
  body: _response.error.rawBody,
367
337
  });
368
338
  case "timeout":
369
- throw new errors.CredalTimeoutError();
339
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/streamMessage.");
370
340
  case "unknown":
371
341
  throw new errors.CredalError({
372
342
  message: _response.error.errorMessage,
@@ -387,20 +357,12 @@ class Copilots {
387
357
  * })
388
358
  */
389
359
  addCollectionToCopilot(request, requestOptions) {
390
- var _a, _b;
391
360
  return __awaiter(this, void 0, void 0, function* () {
361
+ var _a, _b, _c;
392
362
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
393
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/addCollectionToCopilot"),
363
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/addCollectionToCopilot"),
394
364
  method: "POST",
395
- headers: {
396
- Authorization: yield this._getAuthorizationHeader(),
397
- "X-Fern-Language": "JavaScript",
398
- "X-Fern-SDK-Name": "@credal/sdk",
399
- "X-Fern-SDK-Version": "0.0.23",
400
- "User-Agent": "@credal/sdk/0.0.23",
401
- "X-Fern-Runtime": core.RUNTIME.type,
402
- "X-Fern-Runtime-Version": core.RUNTIME.version,
403
- },
365
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
404
366
  contentType: "application/json",
405
367
  requestType: "json",
406
368
  body: serializers.AddCollectionToCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -424,7 +386,7 @@ class Copilots {
424
386
  body: _response.error.rawBody,
425
387
  });
426
388
  case "timeout":
427
- throw new errors.CredalTimeoutError();
389
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/addCollectionToCopilot.");
428
390
  case "unknown":
429
391
  throw new errors.CredalError({
430
392
  message: _response.error.errorMessage,
@@ -445,20 +407,12 @@ class Copilots {
445
407
  * })
446
408
  */
447
409
  removeCollectionFromCopilot(request, requestOptions) {
448
- var _a, _b;
449
410
  return __awaiter(this, void 0, void 0, function* () {
411
+ var _a, _b, _c;
450
412
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
451
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/removeCollectionFromCopilot"),
413
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/removeCollectionFromCopilot"),
452
414
  method: "POST",
453
- headers: {
454
- Authorization: yield this._getAuthorizationHeader(),
455
- "X-Fern-Language": "JavaScript",
456
- "X-Fern-SDK-Name": "@credal/sdk",
457
- "X-Fern-SDK-Version": "0.0.23",
458
- "User-Agent": "@credal/sdk/0.0.23",
459
- "X-Fern-Runtime": core.RUNTIME.type,
460
- "X-Fern-Runtime-Version": core.RUNTIME.version,
461
- },
415
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
462
416
  contentType: "application/json",
463
417
  requestType: "json",
464
418
  body: serializers.RemoveCollectionFromCopilotRequest.jsonOrThrow(request, {
@@ -484,7 +438,7 @@ class Copilots {
484
438
  body: _response.error.rawBody,
485
439
  });
486
440
  case "timeout":
487
- throw new errors.CredalTimeoutError();
441
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/removeCollectionFromCopilot.");
488
442
  case "unknown":
489
443
  throw new errors.CredalError({
490
444
  message: _response.error.errorMessage,
@@ -513,20 +467,12 @@ class Copilots {
513
467
  * })
514
468
  */
515
469
  updateConfiguration(request, requestOptions) {
516
- var _a, _b;
517
470
  return __awaiter(this, void 0, void 0, function* () {
471
+ var _a, _b, _c;
518
472
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
519
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/updateConfiguration"),
473
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/updateConfiguration"),
520
474
  method: "POST",
521
- headers: {
522
- Authorization: yield this._getAuthorizationHeader(),
523
- "X-Fern-Language": "JavaScript",
524
- "X-Fern-SDK-Name": "@credal/sdk",
525
- "X-Fern-SDK-Version": "0.0.23",
526
- "User-Agent": "@credal/sdk/0.0.23",
527
- "X-Fern-Runtime": core.RUNTIME.type,
528
- "X-Fern-Runtime-Version": core.RUNTIME.version,
529
- },
475
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
530
476
  contentType: "application/json",
531
477
  requestType: "json",
532
478
  body: serializers.UpdateConfigurationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -550,7 +496,7 @@ class Copilots {
550
496
  body: _response.error.rawBody,
551
497
  });
552
498
  case "timeout":
553
- throw new errors.CredalTimeoutError();
499
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/updateConfiguration.");
554
500
  case "unknown":
555
501
  throw new errors.CredalError({
556
502
  message: _response.error.errorMessage,
@@ -568,20 +514,12 @@ class Copilots {
568
514
  * })
569
515
  */
570
516
  deleteCopilot(request, requestOptions) {
571
- var _a, _b;
572
517
  return __awaiter(this, void 0, void 0, function* () {
518
+ var _a, _b, _c;
573
519
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
574
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/deleteCopilot"),
520
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/deleteCopilot"),
575
521
  method: "DELETE",
576
- headers: {
577
- Authorization: yield this._getAuthorizationHeader(),
578
- "X-Fern-Language": "JavaScript",
579
- "X-Fern-SDK-Name": "@credal/sdk",
580
- "X-Fern-SDK-Version": "0.0.23",
581
- "User-Agent": "@credal/sdk/0.0.23",
582
- "X-Fern-Runtime": core.RUNTIME.type,
583
- "X-Fern-Runtime-Version": core.RUNTIME.version,
584
- },
522
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
585
523
  contentType: "application/json",
586
524
  requestType: "json",
587
525
  body: serializers.DeleteCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -610,7 +548,7 @@ class Copilots {
610
548
  body: _response.error.rawBody,
611
549
  });
612
550
  case "timeout":
613
- throw new errors.CredalTimeoutError();
551
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling DELETE /v0/copilots/deleteCopilot.");
614
552
  case "unknown":
615
553
  throw new errors.CredalError({
616
554
  message: _response.error.errorMessage,
@@ -619,12 +557,12 @@ class Copilots {
619
557
  });
620
558
  }
621
559
  _getAuthorizationHeader() {
622
- var _a;
623
560
  return __awaiter(this, void 0, void 0, function* () {
561
+ var _a;
624
562
  const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["CREDAL_API_KEY"];
625
563
  if (bearer == null) {
626
564
  throw new errors.CredalError({
627
- message: "Please specify CREDAL_API_KEY when instantiating the client.",
565
+ message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
628
566
  });
629
567
  }
630
568
  return `Bearer ${bearer}`;
@@ -9,14 +9,8 @@
9
9
  * }
10
10
  */
11
11
  export interface AddCollectionToCopilotRequest {
12
- /**
13
- * Credal-generated copilot ID to add the collection to.
14
- *
15
- */
12
+ /** Credal-generated copilot ID to add the collection to. */
16
13
  copilotId: string;
17
- /**
18
- * Credal-generated collection ID to add.
19
- *
20
- */
14
+ /** Credal-generated collection ID to add. */
21
15
  collectionId: string;
22
16
  }
@@ -9,14 +9,8 @@
9
9
  * }
10
10
  */
11
11
  export interface CreateConversationRequest {
12
- /**
13
- * Credal-generated Copilot ID to specify which agent to route the request to.
14
- *
15
- */
12
+ /** Credal-generated Copilot ID to specify which agent to route the request to. */
16
13
  agentId: string;
17
- /**
18
- * End-user for the conversation.
19
- *
20
- */
14
+ /** End-user for the conversation. */
21
15
  userEmail: string;
22
16
  }
@@ -14,19 +14,10 @@ import * as Credal from "../../../../index";
14
14
  * }
15
15
  */
16
16
  export interface CreateCopilotRequest {
17
- /**
18
- * A descriptive name for the copilot.
19
- *
20
- */
17
+ /** A descriptive name for the copilot. */
21
18
  name: string;
22
- /**
23
- * An in depth name for the copilot's function. Useful for routing requests to the right copilot.
24
- *
25
- */
19
+ /** An in depth name for the copilot's function. Useful for routing requests to the right copilot. */
26
20
  description: string;
27
- /**
28
- * A list of collaborator emails and roles that will have access to the copilot.
29
- *
30
- */
21
+ /** A list of collaborator emails and roles that will have access to the copilot. */
31
22
  collaborators: Credal.Collaborator[];
32
23
  }
@@ -16,24 +16,12 @@ import * as Credal from "../../../../index";
16
16
  * }
17
17
  */
18
18
  export interface ProvideMessageFeedbackRequest {
19
- /**
20
- * Credal-generated Copilot ID to specify which agent to route the request to.
21
- *
22
- */
19
+ /** Credal-generated Copilot ID to specify which agent to route the request to. */
23
20
  agentId: string;
24
- /**
25
- * The user profile you want to use when providing feedback.
26
- *
27
- */
21
+ /** The user profile you want to use when providing feedback. */
28
22
  userEmail: string;
29
- /**
30
- * The message ID for which feedback is being provided.
31
- *
32
- */
23
+ /** The message ID for which feedback is being provided. */
33
24
  messageId: string;
34
- /**
35
- * The feedback provided by the user.
36
- *
37
- */
25
+ /** The feedback provided by the user. */
38
26
  messageFeedback: Credal.MessageFeedback;
39
27
  }
@@ -9,14 +9,8 @@
9
9
  * }
10
10
  */
11
11
  export interface RemoveCollectionFromCopilotRequest {
12
- /**
13
- * Credal-generated copilot ID to add the collection to.
14
- *
15
- */
12
+ /** Credal-generated copilot ID to add the collection to. */
16
13
  copilotId: string;
17
- /**
18
- * Credal-generated collection ID to add.
19
- *
20
- */
14
+ /** Credal-generated collection ID to add. */
21
15
  collectionId: string;
22
16
  }