@credal/sdk 0.0.10 → 0.0.11

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 (206) hide show
  1. package/api/resources/common/types/Collaborator.d.ts +8 -0
  2. package/api/resources/common/types/Collaborator.js +5 -0
  3. package/api/resources/common/types/Role.d.ts +8 -0
  4. package/api/resources/common/types/Role.js +10 -0
  5. package/api/resources/common/types/index.d.ts +2 -0
  6. package/api/resources/common/types/index.js +2 -0
  7. package/api/resources/copilots/client/Client.d.ts +75 -1
  8. package/api/resources/copilots/client/Client.js +309 -4
  9. package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +22 -0
  10. package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +5 -0
  11. package/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +1 -1
  12. package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +32 -0
  13. package/api/resources/copilots/client/requests/CreateCopilotRequest.js +5 -0
  14. package/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +13 -0
  15. package/api/resources/copilots/client/requests/DeleteCopilotRequest.js +5 -0
  16. package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
  17. package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +22 -0
  18. package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +5 -0
  19. package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
  20. package/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +27 -0
  21. package/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +5 -0
  22. package/api/resources/copilots/client/requests/index.d.ts +5 -0
  23. package/api/resources/copilots/types/AiEndpointConfiguration.d.ts +7 -0
  24. package/api/resources/copilots/types/AiEndpointConfiguration.js +5 -0
  25. package/api/resources/copilots/types/Configuration.d.ts +10 -0
  26. package/api/resources/copilots/types/Configuration.js +5 -0
  27. package/api/resources/copilots/types/CreateCopilotResponse.d.ts +6 -0
  28. package/api/resources/copilots/types/CreateCopilotResponse.js +5 -0
  29. package/api/resources/copilots/types/DeleteCopilotResponse.d.ts +6 -0
  30. package/api/resources/copilots/types/DeleteCopilotResponse.js +5 -0
  31. package/api/resources/copilots/types/index.d.ts +4 -0
  32. package/api/resources/copilots/types/index.js +4 -0
  33. package/api/resources/documentCatalog/client/Client.js +2 -2
  34. package/api/resources/documentCollections/client/Client.d.ts +51 -1
  35. package/api/resources/documentCollections/client/Client.js +193 -2
  36. package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
  37. package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +32 -0
  38. package/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +5 -0
  39. package/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
  40. package/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +5 -0
  41. package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +28 -0
  42. package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +5 -0
  43. package/api/resources/documentCollections/client/requests/index.d.ts +3 -0
  44. package/api/resources/documentCollections/index.d.ts +1 -0
  45. package/api/resources/documentCollections/index.js +1 -0
  46. package/api/resources/documentCollections/types/CreateCollectionResponse.d.ts +6 -0
  47. package/api/resources/documentCollections/types/CreateCollectionResponse.js +5 -0
  48. package/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +6 -0
  49. package/api/resources/documentCollections/types/DeleteCollectionResponse.js +5 -0
  50. package/api/resources/documentCollections/types/index.d.ts +2 -0
  51. package/api/resources/documentCollections/types/index.js +18 -0
  52. package/api/resources/index.d.ts +2 -1
  53. package/api/resources/index.js +3 -2
  54. package/api/resources/permissionsService/client/Client.js +3 -3
  55. package/api/resources/search/client/Client.js +1 -1
  56. package/api/resources/users/client/Client.js +1 -1
  57. package/dist/api/resources/common/types/Collaborator.d.ts +8 -0
  58. package/dist/api/resources/common/types/Collaborator.js +5 -0
  59. package/dist/api/resources/common/types/Role.d.ts +8 -0
  60. package/dist/api/resources/common/types/Role.js +10 -0
  61. package/dist/api/resources/common/types/index.d.ts +2 -0
  62. package/dist/api/resources/common/types/index.js +2 -0
  63. package/dist/api/resources/copilots/client/Client.d.ts +75 -1
  64. package/dist/api/resources/copilots/client/Client.js +309 -4
  65. package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +22 -0
  66. package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +5 -0
  67. package/dist/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +1 -1
  68. package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +32 -0
  69. package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.js +5 -0
  70. package/dist/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +13 -0
  71. package/dist/api/resources/copilots/client/requests/DeleteCopilotRequest.js +5 -0
  72. package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
  73. package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +22 -0
  74. package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +5 -0
  75. package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
  76. package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +27 -0
  77. package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +5 -0
  78. package/dist/api/resources/copilots/client/requests/index.d.ts +5 -0
  79. package/dist/api/resources/copilots/types/AiEndpointConfiguration.d.ts +7 -0
  80. package/dist/api/resources/copilots/types/AiEndpointConfiguration.js +5 -0
  81. package/dist/api/resources/copilots/types/Configuration.d.ts +10 -0
  82. package/dist/api/resources/copilots/types/Configuration.js +5 -0
  83. package/dist/api/resources/copilots/types/CreateCopilotResponse.d.ts +6 -0
  84. package/dist/api/resources/copilots/types/CreateCopilotResponse.js +5 -0
  85. package/dist/api/resources/copilots/types/DeleteCopilotResponse.d.ts +6 -0
  86. package/dist/api/resources/copilots/types/DeleteCopilotResponse.js +5 -0
  87. package/dist/api/resources/copilots/types/index.d.ts +4 -0
  88. package/dist/api/resources/copilots/types/index.js +4 -0
  89. package/dist/api/resources/documentCatalog/client/Client.js +2 -2
  90. package/dist/api/resources/documentCollections/client/Client.d.ts +51 -1
  91. package/dist/api/resources/documentCollections/client/Client.js +193 -2
  92. package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
  93. package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +32 -0
  94. package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +5 -0
  95. package/dist/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
  96. package/dist/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +5 -0
  97. package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +28 -0
  98. package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +5 -0
  99. package/dist/api/resources/documentCollections/client/requests/index.d.ts +3 -0
  100. package/dist/api/resources/documentCollections/index.d.ts +1 -0
  101. package/dist/api/resources/documentCollections/index.js +1 -0
  102. package/dist/api/resources/documentCollections/types/CreateCollectionResponse.d.ts +6 -0
  103. package/dist/api/resources/documentCollections/types/CreateCollectionResponse.js +5 -0
  104. package/dist/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +6 -0
  105. package/dist/api/resources/documentCollections/types/DeleteCollectionResponse.js +5 -0
  106. package/dist/api/resources/documentCollections/types/index.d.ts +2 -0
  107. package/dist/api/resources/documentCollections/types/index.js +18 -0
  108. package/dist/api/resources/index.d.ts +2 -1
  109. package/dist/api/resources/index.js +3 -2
  110. package/dist/api/resources/permissionsService/client/Client.js +3 -3
  111. package/dist/api/resources/search/client/Client.js +1 -1
  112. package/dist/api/resources/users/client/Client.js +1 -1
  113. package/dist/serialization/resources/common/types/Collaborator.d.ts +14 -0
  114. package/dist/serialization/resources/common/types/Collaborator.js +35 -0
  115. package/dist/serialization/resources/common/types/Role.d.ts +10 -0
  116. package/dist/serialization/resources/common/types/Role.js +34 -0
  117. package/dist/serialization/resources/common/types/index.d.ts +2 -0
  118. package/dist/serialization/resources/common/types/index.js +2 -0
  119. package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +13 -0
  120. package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +34 -0
  121. package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.d.ts +15 -0
  122. package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +36 -0
  123. package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +12 -0
  124. package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +33 -0
  125. package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +13 -0
  126. package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +34 -0
  127. package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +14 -0
  128. package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +35 -0
  129. package/dist/serialization/resources/copilots/client/requests/index.d.ts +5 -0
  130. package/dist/serialization/resources/copilots/client/requests/index.js +11 -1
  131. package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.d.ts +13 -0
  132. package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.js +34 -0
  133. package/dist/serialization/resources/copilots/types/Configuration.d.ts +16 -0
  134. package/dist/serialization/resources/copilots/types/Configuration.js +37 -0
  135. package/dist/serialization/resources/copilots/types/CreateCopilotResponse.d.ts +12 -0
  136. package/dist/serialization/resources/copilots/types/CreateCopilotResponse.js +33 -0
  137. package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.d.ts +12 -0
  138. package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.js +33 -0
  139. package/dist/serialization/resources/copilots/types/index.d.ts +4 -0
  140. package/dist/serialization/resources/copilots/types/index.js +4 -0
  141. package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +15 -0
  142. package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +36 -0
  143. package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
  144. package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +33 -0
  145. package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +14 -0
  146. package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +35 -0
  147. package/dist/serialization/resources/documentCollections/client/requests/index.d.ts +3 -0
  148. package/dist/serialization/resources/documentCollections/client/requests/index.js +7 -1
  149. package/dist/serialization/resources/documentCollections/index.d.ts +1 -0
  150. package/dist/serialization/resources/documentCollections/index.js +1 -0
  151. package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.d.ts +12 -0
  152. package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.js +33 -0
  153. package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.d.ts +12 -0
  154. package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +33 -0
  155. package/dist/serialization/resources/documentCollections/types/index.d.ts +2 -0
  156. package/dist/serialization/resources/documentCollections/types/index.js +18 -0
  157. package/dist/serialization/resources/index.d.ts +2 -1
  158. package/dist/serialization/resources/index.js +3 -2
  159. package/package.json +1 -1
  160. package/reference.md +757 -60
  161. package/serialization/resources/common/types/Collaborator.d.ts +14 -0
  162. package/serialization/resources/common/types/Collaborator.js +35 -0
  163. package/serialization/resources/common/types/Role.d.ts +10 -0
  164. package/serialization/resources/common/types/Role.js +34 -0
  165. package/serialization/resources/common/types/index.d.ts +2 -0
  166. package/serialization/resources/common/types/index.js +2 -0
  167. package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +13 -0
  168. package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +34 -0
  169. package/serialization/resources/copilots/client/requests/CreateCopilotRequest.d.ts +15 -0
  170. package/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +36 -0
  171. package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +12 -0
  172. package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +33 -0
  173. package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +13 -0
  174. package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +34 -0
  175. package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +14 -0
  176. package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +35 -0
  177. package/serialization/resources/copilots/client/requests/index.d.ts +5 -0
  178. package/serialization/resources/copilots/client/requests/index.js +11 -1
  179. package/serialization/resources/copilots/types/AiEndpointConfiguration.d.ts +13 -0
  180. package/serialization/resources/copilots/types/AiEndpointConfiguration.js +34 -0
  181. package/serialization/resources/copilots/types/Configuration.d.ts +16 -0
  182. package/serialization/resources/copilots/types/Configuration.js +37 -0
  183. package/serialization/resources/copilots/types/CreateCopilotResponse.d.ts +12 -0
  184. package/serialization/resources/copilots/types/CreateCopilotResponse.js +33 -0
  185. package/serialization/resources/copilots/types/DeleteCopilotResponse.d.ts +12 -0
  186. package/serialization/resources/copilots/types/DeleteCopilotResponse.js +33 -0
  187. package/serialization/resources/copilots/types/index.d.ts +4 -0
  188. package/serialization/resources/copilots/types/index.js +4 -0
  189. package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +15 -0
  190. package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +36 -0
  191. package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
  192. package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +33 -0
  193. package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +14 -0
  194. package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +35 -0
  195. package/serialization/resources/documentCollections/client/requests/index.d.ts +3 -0
  196. package/serialization/resources/documentCollections/client/requests/index.js +7 -1
  197. package/serialization/resources/documentCollections/index.d.ts +1 -0
  198. package/serialization/resources/documentCollections/index.js +1 -0
  199. package/serialization/resources/documentCollections/types/CreateCollectionResponse.d.ts +12 -0
  200. package/serialization/resources/documentCollections/types/CreateCollectionResponse.js +33 -0
  201. package/serialization/resources/documentCollections/types/DeleteCollectionResponse.d.ts +12 -0
  202. package/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +33 -0
  203. package/serialization/resources/documentCollections/types/index.d.ts +2 -0
  204. package/serialization/resources/documentCollections/types/index.js +18 -0
  205. package/serialization/resources/index.d.ts +2 -1
  206. package/serialization/resources/index.js +3 -2
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
9
+ * configuration: {
10
+ * name: "Customer Copilot",
11
+ * description: "This copilot is used to answer customer requests based on internal documentation.",
12
+ * prompt: "You are a polite, helpful assistant used to answer customer requests.",
13
+ * aiEndpointConfiguration: {
14
+ * baseUrl: "https://api.openai.com/v1/",
15
+ * apiKey: "<YOUR_API_KEY_HERE>"
16
+ * }
17
+ * }
18
+ * }
19
+ */
20
+ export interface UpdateConfigurationRequest {
21
+ /**
22
+ * Credal-generated copilot ID to add the collection to.
23
+ *
24
+ */
25
+ copilotId: string;
26
+ configuration: Credal.Configuration;
27
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,8 @@
1
+ export { type CreateCopilotRequest } from "./CreateCopilotRequest";
1
2
  export { type CreateConversationRequest } from "./CreateConversationRequest";
2
3
  export { type ProvideMessageFeedbackRequest } from "./ProvideMessageFeedbackRequest";
3
4
  export { type SendMessageRequest } from "./SendMessageRequest";
5
+ export { type AddCollectionToCopilotRequest } from "./AddCollectionToCopilotRequest";
6
+ export { type RemoveCollectionFromCopilotRequest } from "./RemoveCollectionFromCopilotRequest";
7
+ export { type UpdateConfigurationRequest } from "./UpdateConfigurationRequest";
8
+ export { type DeleteCopilotRequest } from "./DeleteCopilotRequest";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface AiEndpointConfiguration {
5
+ baseUrl: string;
6
+ apiKey: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../index";
5
+ export interface Configuration {
6
+ aiEndpointConfiguration?: Credal.AiEndpointConfiguration;
7
+ name?: string;
8
+ description?: string;
9
+ prompt?: string;
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface CreateCopilotResponse {
5
+ agentId: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface DeleteCopilotResponse {
5
+ copilotId: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,3 +9,7 @@ export * from "./MessageBlocked";
9
9
  export * from "./PolicyTrigger";
10
10
  export * from "./FeedbackEnum";
11
11
  export * from "./MessageFeedback";
12
+ export * from "./Configuration";
13
+ export * from "./AiEndpointConfiguration";
14
+ export * from "./CreateCopilotResponse";
15
+ export * from "./DeleteCopilotResponse";
@@ -25,3 +25,7 @@ __exportStar(require("./MessageBlocked"), exports);
25
25
  __exportStar(require("./PolicyTrigger"), exports);
26
26
  __exportStar(require("./FeedbackEnum"), exports);
27
27
  __exportStar(require("./MessageFeedback"), exports);
28
+ __exportStar(require("./Configuration"), exports);
29
+ __exportStar(require("./AiEndpointConfiguration"), exports);
30
+ __exportStar(require("./CreateCopilotResponse"), exports);
31
+ __exportStar(require("./DeleteCopilotResponse"), exports);
@@ -71,7 +71,7 @@ class DocumentCatalog {
71
71
  Authorization: yield this._getAuthorizationHeader(),
72
72
  "X-Fern-Language": "JavaScript",
73
73
  "X-Fern-SDK-Name": "@credal/sdk",
74
- "X-Fern-SDK-Version": "0.0.10",
74
+ "X-Fern-SDK-Version": "0.0.11",
75
75
  "X-Fern-Runtime": core.RUNTIME.type,
76
76
  "X-Fern-Runtime-Version": core.RUNTIME.version,
77
77
  },
@@ -154,7 +154,7 @@ class DocumentCatalog {
154
154
  Authorization: yield this._getAuthorizationHeader(),
155
155
  "X-Fern-Language": "JavaScript",
156
156
  "X-Fern-SDK-Name": "@credal/sdk",
157
- "X-Fern-SDK-Version": "0.0.10",
157
+ "X-Fern-SDK-Version": "0.0.11",
158
158
  "X-Fern-Runtime": core.RUNTIME.type,
159
159
  "X-Fern-Runtime-Version": core.RUNTIME.version,
160
160
  },
@@ -20,7 +20,7 @@ export declare class DocumentCollections {
20
20
  protected readonly _options: DocumentCollections.Options;
21
21
  constructor(_options?: DocumentCollections.Options);
22
22
  /**
23
- * Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the uploadDocumentContents endpoint.
23
+ * Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the `uploadDocumentContents` endpoint.
24
24
  *
25
25
  * @param {Credal.AddDocumentsToCollectionRequest} request
26
26
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
@@ -40,5 +40,55 @@ export declare class DocumentCollections {
40
40
  * })
41
41
  */
42
42
  addDocumentsToCollection(request: Credal.AddDocumentsToCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<void>;
43
+ /**
44
+ * Remove documents from a collection
45
+ *
46
+ * @param {Credal.RemoveDocumentsFromCollectionRequest} request
47
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
48
+ *
49
+ * @example
50
+ * await credal.documentCollections.removeDocumentsFromCollection({
51
+ * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
52
+ * resourceIdentifiers: [{
53
+ * type: "external-resource-id",
54
+ * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
55
+ * resourceType: Credal.ResourceType.GoogleDriveItem
56
+ * }, {
57
+ * type: "external-resource-id",
58
+ * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
59
+ * resourceType: Credal.ResourceType.GoogleDriveItem
60
+ * }]
61
+ * })
62
+ */
63
+ removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<void>;
64
+ /**
65
+ * Create a new copilot. The API key used will be added to the copilot for future Requests
66
+ *
67
+ * @param {Credal.CreateCollectionRequest} request
68
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
69
+ *
70
+ * @example
71
+ * await credal.documentCollections.createCollection({
72
+ * name: "Customer Collection",
73
+ * description: "This collection is used to answer customer requests based on internal documentation.",
74
+ * collaborators: [{
75
+ * email: "test@gmail.com",
76
+ * role: Credal.Role.Editor
77
+ * }]
78
+ * })
79
+ */
80
+ createCollection(request: Credal.CreateCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.CreateCollectionResponse>;
81
+ /**
82
+ * Delete the collection.
83
+ *
84
+ * @param {Credal.DeleteCollectionRequest} request
85
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
86
+ *
87
+ * @example
88
+ * await credal.documentCollections.deleteCollection({
89
+ * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
90
+ * })
91
+ */
92
+ deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.DeleteCollectionResponse>;
43
93
  protected _getAuthorizationHeader(): Promise<string>;
44
94
  }
@@ -49,7 +49,7 @@ class DocumentCollections {
49
49
  this._options = _options;
50
50
  }
51
51
  /**
52
- * Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the uploadDocumentContents endpoint.
52
+ * Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the `uploadDocumentContents` endpoint.
53
53
  *
54
54
  * @param {Credal.AddDocumentsToCollectionRequest} request
55
55
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
@@ -78,7 +78,7 @@ class DocumentCollections {
78
78
  Authorization: yield this._getAuthorizationHeader(),
79
79
  "X-Fern-Language": "JavaScript",
80
80
  "X-Fern-SDK-Name": "@credal/sdk",
81
- "X-Fern-SDK-Version": "0.0.10",
81
+ "X-Fern-SDK-Version": "0.0.11",
82
82
  "X-Fern-Runtime": core.RUNTIME.type,
83
83
  "X-Fern-Runtime-Version": core.RUNTIME.version,
84
84
  },
@@ -114,6 +114,197 @@ class DocumentCollections {
114
114
  }
115
115
  });
116
116
  }
117
+ /**
118
+ * Remove documents from a collection
119
+ *
120
+ * @param {Credal.RemoveDocumentsFromCollectionRequest} request
121
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
122
+ *
123
+ * @example
124
+ * await credal.documentCollections.removeDocumentsFromCollection({
125
+ * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
126
+ * resourceIdentifiers: [{
127
+ * type: "external-resource-id",
128
+ * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
129
+ * resourceType: Credal.ResourceType.GoogleDriveItem
130
+ * }, {
131
+ * type: "external-resource-id",
132
+ * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
133
+ * resourceType: Credal.ResourceType.GoogleDriveItem
134
+ * }]
135
+ * })
136
+ */
137
+ removeDocumentsFromCollection(request, requestOptions) {
138
+ var _a, _b;
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
141
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/removeDocumentsFromCollection"),
142
+ method: "DELETE",
143
+ headers: {
144
+ Authorization: yield this._getAuthorizationHeader(),
145
+ "X-Fern-Language": "JavaScript",
146
+ "X-Fern-SDK-Name": "@credal/sdk",
147
+ "X-Fern-SDK-Version": "0.0.11",
148
+ "X-Fern-Runtime": core.RUNTIME.type,
149
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
150
+ },
151
+ contentType: "application/json",
152
+ body: yield serializers.RemoveDocumentsFromCollectionRequest.jsonOrThrow(request, {
153
+ unrecognizedObjectKeys: "strip",
154
+ }),
155
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
156
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
157
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
158
+ });
159
+ if (_response.ok) {
160
+ return;
161
+ }
162
+ if (_response.error.reason === "status-code") {
163
+ throw new errors.CredalError({
164
+ statusCode: _response.error.statusCode,
165
+ body: _response.error.body,
166
+ });
167
+ }
168
+ switch (_response.error.reason) {
169
+ case "non-json":
170
+ throw new errors.CredalError({
171
+ statusCode: _response.error.statusCode,
172
+ body: _response.error.rawBody,
173
+ });
174
+ case "timeout":
175
+ throw new errors.CredalTimeoutError();
176
+ case "unknown":
177
+ throw new errors.CredalError({
178
+ message: _response.error.errorMessage,
179
+ });
180
+ }
181
+ });
182
+ }
183
+ /**
184
+ * Create a new copilot. The API key used will be added to the copilot for future Requests
185
+ *
186
+ * @param {Credal.CreateCollectionRequest} request
187
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
188
+ *
189
+ * @example
190
+ * await credal.documentCollections.createCollection({
191
+ * name: "Customer Collection",
192
+ * description: "This collection is used to answer customer requests based on internal documentation.",
193
+ * collaborators: [{
194
+ * email: "test@gmail.com",
195
+ * role: Credal.Role.Editor
196
+ * }]
197
+ * })
198
+ */
199
+ createCollection(request, requestOptions) {
200
+ var _a, _b;
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
203
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/createCollection"),
204
+ method: "POST",
205
+ headers: {
206
+ Authorization: yield this._getAuthorizationHeader(),
207
+ "X-Fern-Language": "JavaScript",
208
+ "X-Fern-SDK-Name": "@credal/sdk",
209
+ "X-Fern-SDK-Version": "0.0.11",
210
+ "X-Fern-Runtime": core.RUNTIME.type,
211
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
212
+ },
213
+ contentType: "application/json",
214
+ body: yield serializers.CreateCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
215
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
216
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
217
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
+ });
219
+ if (_response.ok) {
220
+ return yield serializers.CreateCollectionResponse.parseOrThrow(_response.body, {
221
+ unrecognizedObjectKeys: "passthrough",
222
+ allowUnrecognizedUnionMembers: true,
223
+ allowUnrecognizedEnumValues: true,
224
+ breadcrumbsPrefix: ["response"],
225
+ });
226
+ }
227
+ if (_response.error.reason === "status-code") {
228
+ throw new errors.CredalError({
229
+ statusCode: _response.error.statusCode,
230
+ body: _response.error.body,
231
+ });
232
+ }
233
+ switch (_response.error.reason) {
234
+ case "non-json":
235
+ throw new errors.CredalError({
236
+ statusCode: _response.error.statusCode,
237
+ body: _response.error.rawBody,
238
+ });
239
+ case "timeout":
240
+ throw new errors.CredalTimeoutError();
241
+ case "unknown":
242
+ throw new errors.CredalError({
243
+ message: _response.error.errorMessage,
244
+ });
245
+ }
246
+ });
247
+ }
248
+ /**
249
+ * Delete the collection.
250
+ *
251
+ * @param {Credal.DeleteCollectionRequest} request
252
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
253
+ *
254
+ * @example
255
+ * await credal.documentCollections.deleteCollection({
256
+ * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
257
+ * })
258
+ */
259
+ deleteCollection(request, requestOptions) {
260
+ var _a, _b;
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
263
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/deleteCollection"),
264
+ method: "DELETE",
265
+ headers: {
266
+ Authorization: yield this._getAuthorizationHeader(),
267
+ "X-Fern-Language": "JavaScript",
268
+ "X-Fern-SDK-Name": "@credal/sdk",
269
+ "X-Fern-SDK-Version": "0.0.11",
270
+ "X-Fern-Runtime": core.RUNTIME.type,
271
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
272
+ },
273
+ contentType: "application/json",
274
+ body: yield serializers.DeleteCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
275
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
276
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
277
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
+ });
279
+ if (_response.ok) {
280
+ return yield serializers.DeleteCollectionResponse.parseOrThrow(_response.body, {
281
+ unrecognizedObjectKeys: "passthrough",
282
+ allowUnrecognizedUnionMembers: true,
283
+ allowUnrecognizedEnumValues: true,
284
+ breadcrumbsPrefix: ["response"],
285
+ });
286
+ }
287
+ if (_response.error.reason === "status-code") {
288
+ throw new errors.CredalError({
289
+ statusCode: _response.error.statusCode,
290
+ body: _response.error.body,
291
+ });
292
+ }
293
+ switch (_response.error.reason) {
294
+ case "non-json":
295
+ throw new errors.CredalError({
296
+ statusCode: _response.error.statusCode,
297
+ body: _response.error.rawBody,
298
+ });
299
+ case "timeout":
300
+ throw new errors.CredalTimeoutError();
301
+ case "unknown":
302
+ throw new errors.CredalError({
303
+ message: _response.error.errorMessage,
304
+ });
305
+ }
306
+ });
307
+ }
117
308
  _getAuthorizationHeader() {
118
309
  var _a;
119
310
  return __awaiter(this, void 0, void 0, function* () {
@@ -21,7 +21,7 @@ export interface AddDocumentsToCollectionRequest {
21
21
  /** The ID of the document collection you want to add to. */
22
22
  collectionId: string;
23
23
  /**
24
- * The set of resource identifier for which you want to check authorization. Currently limited to 20 resources.
24
+ * The set of resource identifier for which you want to add to the collection.
25
25
  *
26
26
  */
27
27
  resourceIdentifiers: Credal.ResourceIdentifier[];
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * name: "Customer Collection",
9
+ * description: "This collection is used to answer customer requests based on internal documentation.",
10
+ * collaborators: [{
11
+ * email: "test@gmail.com",
12
+ * role: Credal.Role.Editor
13
+ * }]
14
+ * }
15
+ */
16
+ export interface CreateCollectionRequest {
17
+ /**
18
+ * A descriptive name for the collection.
19
+ *
20
+ */
21
+ name: string;
22
+ /**
23
+ * An in depth name for the copilot's function. Useful for routing requests to the right copilot.
24
+ *
25
+ */
26
+ description: string;
27
+ /**
28
+ * A list of collaborator emails and roles that will have access to the copilot.
29
+ *
30
+ */
31
+ collaborators: Credal.Collaborator[];
32
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
8
+ * }
9
+ */
10
+ export interface DeleteCollectionRequest {
11
+ collectionId: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
9
+ * resourceIdentifiers: [{
10
+ * type: "external-resource-id",
11
+ * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
12
+ * resourceType: Credal.ResourceType.GoogleDriveItem
13
+ * }, {
14
+ * type: "external-resource-id",
15
+ * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
16
+ * resourceType: Credal.ResourceType.GoogleDriveItem
17
+ * }]
18
+ * }
19
+ */
20
+ export interface RemoveDocumentsFromCollectionRequest {
21
+ /** The ID of the document collection you want to add to. */
22
+ collectionId: string;
23
+ /**
24
+ * The set of resource identifier for which you want to remove from the collection
25
+ *
26
+ */
27
+ resourceIdentifiers: Credal.ResourceIdentifier[];
28
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,4 @@
1
1
  export { type AddDocumentsToCollectionRequest } from "./AddDocumentsToCollectionRequest";
2
+ export { type RemoveDocumentsFromCollectionRequest } from "./RemoveDocumentsFromCollectionRequest";
3
+ export { type CreateCollectionRequest } from "./CreateCollectionRequest";
4
+ export { type DeleteCollectionRequest } from "./DeleteCollectionRequest";
@@ -1 +1,2 @@
1
+ export * from "./types";
1
2
  export * from "./client";
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
17
18
  __exportStar(require("./client"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface CreateCollectionResponse {
5
+ collectionId: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface DeleteCollectionResponse {
5
+ collectionId: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./CreateCollectionResponse";
2
+ export * from "./DeleteCollectionResponse";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CreateCollectionResponse"), exports);
18
+ __exportStar(require("./DeleteCollectionResponse"), exports);
@@ -4,13 +4,14 @@ export * as copilots from "./copilots";
4
4
  export * from "./copilots/types";
5
5
  export * as documentCatalog from "./documentCatalog";
6
6
  export * from "./documentCatalog/types";
7
+ export * as documentCollections from "./documentCollections";
8
+ export * from "./documentCollections/types";
7
9
  export * as permissionsService from "./permissionsService";
8
10
  export * from "./permissionsService/types";
9
11
  export * as search from "./search";
10
12
  export * from "./search/types";
11
13
  export * as users from "./users";
12
14
  export * from "./users/types";
13
- export * as documentCollections from "./documentCollections";
14
15
  export * from "./copilots/client/requests";
15
16
  export * from "./documentCatalog/client/requests";
16
17
  export * from "./documentCollections/client/requests";