@credal/sdk 0.0.14 → 0.0.16

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 (166) hide show
  1. package/Client.d.ts +3 -0
  2. package/api/resources/copilots/client/Client.d.ts +13 -10
  3. package/api/resources/copilots/client/Client.js +52 -40
  4. package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +1 -1
  5. package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
  6. package/api/resources/copilots/types/DataFilter.d.ts +1 -1
  7. package/api/resources/copilots/types/FinalChunk.d.ts +1 -1
  8. package/api/resources/copilots/types/StreamingChunk.d.ts +15 -1
  9. package/api/resources/documentCatalog/client/Client.d.ts +7 -4
  10. package/api/resources/documentCatalog/client/Client.js +13 -13
  11. package/api/resources/documentCollections/client/Client.d.ts +14 -11
  12. package/api/resources/documentCollections/client/Client.js +39 -29
  13. package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +2 -2
  14. package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +1 -1
  15. package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +2 -2
  16. package/api/resources/permissionsService/client/Client.d.ts +8 -5
  17. package/api/resources/permissionsService/client/Client.js +20 -14
  18. package/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +1 -1
  19. package/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +1 -1
  20. package/api/resources/search/client/Client.d.ts +5 -2
  21. package/api/resources/search/client/Client.js +7 -7
  22. package/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +1 -1
  23. package/api/resources/users/client/Client.d.ts +4 -1
  24. package/api/resources/users/client/Client.js +5 -3
  25. package/core/fetcher/Fetcher.d.ts +4 -1
  26. package/core/fetcher/Fetcher.js +19 -176
  27. package/core/fetcher/createRequestUrl.d.ts +1 -0
  28. package/core/fetcher/createRequestUrl.js +13 -0
  29. package/core/fetcher/getFetchFn.d.ts +4 -0
  30. package/core/fetcher/getFetchFn.js +59 -0
  31. package/core/fetcher/getRequestBody.d.ts +7 -0
  32. package/core/fetcher/getRequestBody.js +23 -0
  33. package/core/fetcher/getResponseBody.d.ts +1 -0
  34. package/core/fetcher/getResponseBody.js +55 -0
  35. package/core/fetcher/makeRequest.d.ts +1 -0
  36. package/core/fetcher/makeRequest.js +42 -0
  37. package/core/fetcher/requestWithRetries.d.ts +1 -0
  38. package/core/fetcher/requestWithRetries.js +41 -0
  39. package/core/fetcher/signals.d.ts +12 -0
  40. package/core/fetcher/signals.js +37 -0
  41. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  42. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  43. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  44. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  45. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  46. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  47. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  48. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  49. package/core/runtime/runtime.d.ts +2 -1
  50. package/core/runtime/runtime.js +12 -1
  51. package/core/schemas/Schema.d.ts +8 -4
  52. package/core/schemas/Schema.js +1 -0
  53. package/core/schemas/builders/bigint/bigint.d.ts +2 -0
  54. package/core/schemas/builders/bigint/bigint.js +50 -0
  55. package/core/schemas/builders/bigint/index.d.ts +1 -0
  56. package/core/schemas/builders/bigint/index.js +5 -0
  57. package/core/schemas/builders/index.d.ts +1 -0
  58. package/core/schemas/builders/index.js +1 -0
  59. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  60. package/core/schemas/builders/lazy/lazy.js +8 -19
  61. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  62. package/core/schemas/builders/list/list.js +31 -44
  63. package/core/schemas/builders/object/object.js +90 -111
  64. package/core/schemas/builders/object/types.d.ts +2 -2
  65. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  66. package/core/schemas/builders/record/record.js +49 -60
  67. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  68. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  69. package/core/schemas/builders/set/set.js +6 -15
  70. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  71. package/core/schemas/builders/union/union.js +51 -62
  72. package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  73. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  74. package/core/streaming-fetcher/Stream.js +6 -6
  75. package/dist/Client.d.ts +3 -0
  76. package/dist/api/resources/copilots/client/Client.d.ts +13 -10
  77. package/dist/api/resources/copilots/client/Client.js +52 -40
  78. package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +1 -1
  79. package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
  80. package/dist/api/resources/copilots/types/DataFilter.d.ts +1 -1
  81. package/dist/api/resources/copilots/types/FinalChunk.d.ts +1 -1
  82. package/dist/api/resources/copilots/types/StreamingChunk.d.ts +15 -1
  83. package/dist/api/resources/documentCatalog/client/Client.d.ts +7 -4
  84. package/dist/api/resources/documentCatalog/client/Client.js +13 -13
  85. package/dist/api/resources/documentCollections/client/Client.d.ts +14 -11
  86. package/dist/api/resources/documentCollections/client/Client.js +39 -29
  87. package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +2 -2
  88. package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +1 -1
  89. package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +2 -2
  90. package/dist/api/resources/permissionsService/client/Client.d.ts +8 -5
  91. package/dist/api/resources/permissionsService/client/Client.js +20 -14
  92. package/dist/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +1 -1
  93. package/dist/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +1 -1
  94. package/dist/api/resources/search/client/Client.d.ts +5 -2
  95. package/dist/api/resources/search/client/Client.js +7 -7
  96. package/dist/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +1 -1
  97. package/dist/api/resources/users/client/Client.d.ts +4 -1
  98. package/dist/api/resources/users/client/Client.js +5 -3
  99. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  100. package/dist/core/fetcher/Fetcher.js +19 -176
  101. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  102. package/dist/core/fetcher/createRequestUrl.js +13 -0
  103. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  104. package/dist/core/fetcher/getFetchFn.js +59 -0
  105. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  106. package/dist/core/fetcher/getRequestBody.js +23 -0
  107. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  108. package/dist/core/fetcher/getResponseBody.js +55 -0
  109. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  110. package/dist/core/fetcher/makeRequest.js +42 -0
  111. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  112. package/dist/core/fetcher/requestWithRetries.js +41 -0
  113. package/dist/core/fetcher/signals.d.ts +12 -0
  114. package/dist/core/fetcher/signals.js +37 -0
  115. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  116. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  117. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  118. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  119. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  120. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  121. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  122. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  123. package/dist/core/runtime/runtime.d.ts +2 -1
  124. package/dist/core/runtime/runtime.js +12 -1
  125. package/dist/core/schemas/Schema.d.ts +8 -4
  126. package/dist/core/schemas/Schema.js +1 -0
  127. package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
  128. package/dist/core/schemas/builders/bigint/bigint.js +50 -0
  129. package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
  130. package/dist/core/schemas/builders/bigint/index.js +5 -0
  131. package/dist/core/schemas/builders/index.d.ts +1 -0
  132. package/dist/core/schemas/builders/index.js +1 -0
  133. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  134. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  135. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  136. package/dist/core/schemas/builders/list/list.js +31 -44
  137. package/dist/core/schemas/builders/object/object.js +90 -111
  138. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  139. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  140. package/dist/core/schemas/builders/record/record.js +49 -60
  141. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  142. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  143. package/dist/core/schemas/builders/set/set.js +6 -15
  144. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  145. package/dist/core/schemas/builders/union/union.js +51 -62
  146. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  147. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  148. package/dist/core/streaming-fetcher/Stream.js +6 -6
  149. package/dist/serialization/resources/copilots/types/DataFilter.d.ts +1 -1
  150. package/dist/serialization/resources/copilots/types/DataFilter.js +1 -1
  151. package/dist/serialization/resources/copilots/types/FinalChunk.d.ts +1 -1
  152. package/dist/serialization/resources/copilots/types/FinalChunk.js +1 -1
  153. package/dist/serialization/resources/copilots/types/StreamingChunk.d.ts +13 -1
  154. package/dist/serialization/resources/copilots/types/StreamingChunk.js +11 -1
  155. package/dist/version.d.ts +1 -0
  156. package/dist/version.js +4 -0
  157. package/package.json +12 -2
  158. package/reference.md +155 -534
  159. package/serialization/resources/copilots/types/DataFilter.d.ts +1 -1
  160. package/serialization/resources/copilots/types/DataFilter.js +1 -1
  161. package/serialization/resources/copilots/types/FinalChunk.d.ts +1 -1
  162. package/serialization/resources/copilots/types/FinalChunk.js +1 -1
  163. package/serialization/resources/copilots/types/StreamingChunk.d.ts +13 -1
  164. package/serialization/resources/copilots/types/StreamingChunk.js +11 -1
  165. package/version.d.ts +1 -0
  166. package/version.js +4 -0
@@ -55,16 +55,16 @@ class DocumentCollections {
55
55
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
57
57
  * @example
58
- * await credal.documentCollections.addDocumentsToCollection({
58
+ * await client.documentCollections.addDocumentsToCollection({
59
59
  * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
60
60
  * resourceIdentifiers: [{
61
61
  * type: "external-resource-id",
62
62
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
63
- * resourceType: Credal.ResourceType.GoogleDriveItem
63
+ * resourceType: "GOOGLE_DRIVE_ITEM"
64
64
  * }, {
65
65
  * type: "external-resource-id",
66
66
  * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
67
- * resourceType: Credal.ResourceType.GoogleDriveItem
67
+ * resourceType: "GOOGLE_DRIVE_ITEM"
68
68
  * }]
69
69
  * })
70
70
  */
@@ -78,14 +78,14 @@ 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.14",
81
+ "X-Fern-SDK-Version": "0.0.16",
82
+ "User-Agent": "@credal/sdk/0.0.16",
82
83
  "X-Fern-Runtime": core.RUNTIME.type,
83
84
  "X-Fern-Runtime-Version": core.RUNTIME.version,
84
85
  },
85
86
  contentType: "application/json",
86
- body: yield serializers.AddDocumentsToCollectionRequest.jsonOrThrow(request, {
87
- unrecognizedObjectKeys: "strip",
88
- }),
87
+ requestType: "json",
88
+ body: serializers.AddDocumentsToCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
89
89
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
90
90
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
91
91
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -121,16 +121,16 @@ class DocumentCollections {
121
121
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
122
122
  *
123
123
  * @example
124
- * await credal.documentCollections.removeDocumentsFromCollection({
124
+ * await client.documentCollections.removeDocumentsFromCollection({
125
125
  * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
126
126
  * resourceIdentifiers: [{
127
127
  * type: "external-resource-id",
128
128
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
129
- * resourceType: Credal.ResourceType.GoogleDriveItem
129
+ * resourceType: "GOOGLE_DRIVE_ITEM"
130
130
  * }, {
131
131
  * type: "external-resource-id",
132
132
  * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
133
- * resourceType: Credal.ResourceType.GoogleDriveItem
133
+ * resourceType: "GOOGLE_DRIVE_ITEM"
134
134
  * }]
135
135
  * })
136
136
  */
@@ -144,12 +144,14 @@ class DocumentCollections {
144
144
  Authorization: yield this._getAuthorizationHeader(),
145
145
  "X-Fern-Language": "JavaScript",
146
146
  "X-Fern-SDK-Name": "@credal/sdk",
147
- "X-Fern-SDK-Version": "0.0.14",
147
+ "X-Fern-SDK-Version": "0.0.16",
148
+ "User-Agent": "@credal/sdk/0.0.16",
148
149
  "X-Fern-Runtime": core.RUNTIME.type,
149
150
  "X-Fern-Runtime-Version": core.RUNTIME.version,
150
151
  },
151
152
  contentType: "application/json",
152
- body: yield serializers.RemoveDocumentsFromCollectionRequest.jsonOrThrow(request, {
153
+ requestType: "json",
154
+ body: serializers.RemoveDocumentsFromCollectionRequest.jsonOrThrow(request, {
153
155
  unrecognizedObjectKeys: "strip",
154
156
  }),
155
157
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -187,12 +189,12 @@ class DocumentCollections {
187
189
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
188
190
  *
189
191
  * @example
190
- * await credal.documentCollections.createCollection({
192
+ * await client.documentCollections.createCollection({
191
193
  * name: "Customer Collection",
192
194
  * description: "This collection is used to answer customer requests based on internal documentation.",
193
195
  * collaborators: [{
194
196
  * email: "test@gmail.com",
195
- * role: Credal.Role.Editor
197
+ * role: "editor"
196
198
  * }]
197
199
  * })
198
200
  */
@@ -206,18 +208,20 @@ class DocumentCollections {
206
208
  Authorization: yield this._getAuthorizationHeader(),
207
209
  "X-Fern-Language": "JavaScript",
208
210
  "X-Fern-SDK-Name": "@credal/sdk",
209
- "X-Fern-SDK-Version": "0.0.14",
211
+ "X-Fern-SDK-Version": "0.0.16",
212
+ "User-Agent": "@credal/sdk/0.0.16",
210
213
  "X-Fern-Runtime": core.RUNTIME.type,
211
214
  "X-Fern-Runtime-Version": core.RUNTIME.version,
212
215
  },
213
216
  contentType: "application/json",
214
- body: yield serializers.CreateCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
217
+ requestType: "json",
218
+ body: serializers.CreateCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
215
219
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
216
220
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
217
221
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
222
  });
219
223
  if (_response.ok) {
220
- return yield serializers.CreateCollectionResponse.parseOrThrow(_response.body, {
224
+ return serializers.CreateCollectionResponse.parseOrThrow(_response.body, {
221
225
  unrecognizedObjectKeys: "passthrough",
222
226
  allowUnrecognizedUnionMembers: true,
223
227
  allowUnrecognizedEnumValues: true,
@@ -252,7 +256,7 @@ class DocumentCollections {
252
256
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
253
257
  *
254
258
  * @example
255
- * await credal.documentCollections.deleteCollection({
259
+ * await client.documentCollections.deleteCollection({
256
260
  * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
257
261
  * })
258
262
  */
@@ -266,18 +270,20 @@ class DocumentCollections {
266
270
  Authorization: yield this._getAuthorizationHeader(),
267
271
  "X-Fern-Language": "JavaScript",
268
272
  "X-Fern-SDK-Name": "@credal/sdk",
269
- "X-Fern-SDK-Version": "0.0.14",
273
+ "X-Fern-SDK-Version": "0.0.16",
274
+ "User-Agent": "@credal/sdk/0.0.16",
270
275
  "X-Fern-Runtime": core.RUNTIME.type,
271
276
  "X-Fern-Runtime-Version": core.RUNTIME.version,
272
277
  },
273
278
  contentType: "application/json",
274
- body: yield serializers.DeleteCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
279
+ requestType: "json",
280
+ body: serializers.DeleteCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
275
281
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
276
282
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
277
283
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
284
  });
279
285
  if (_response.ok) {
280
- return yield serializers.DeleteCollectionResponse.parseOrThrow(_response.body, {
286
+ return serializers.DeleteCollectionResponse.parseOrThrow(_response.body, {
281
287
  unrecognizedObjectKeys: "passthrough",
282
288
  allowUnrecognizedUnionMembers: true,
283
289
  allowUnrecognizedEnumValues: true,
@@ -312,7 +318,7 @@ class DocumentCollections {
312
318
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
313
319
  *
314
320
  * @example
315
- * await credal.documentCollections.createMongoCollectionSync({
321
+ * await client.documentCollections.createMongoCollectionSync({
316
322
  * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
317
323
  * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
318
324
  * config: {
@@ -342,12 +348,14 @@ class DocumentCollections {
342
348
  Authorization: yield this._getAuthorizationHeader(),
343
349
  "X-Fern-Language": "JavaScript",
344
350
  "X-Fern-SDK-Name": "@credal/sdk",
345
- "X-Fern-SDK-Version": "0.0.14",
351
+ "X-Fern-SDK-Version": "0.0.16",
352
+ "User-Agent": "@credal/sdk/0.0.16",
346
353
  "X-Fern-Runtime": core.RUNTIME.type,
347
354
  "X-Fern-Runtime-Version": core.RUNTIME.version,
348
355
  },
349
356
  contentType: "application/json",
350
- body: yield serializers.CreateMongoCollectionSyncRequest.jsonOrThrow(request, {
357
+ requestType: "json",
358
+ body: serializers.CreateMongoCollectionSyncRequest.jsonOrThrow(request, {
351
359
  unrecognizedObjectKeys: "strip",
352
360
  }),
353
361
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -355,7 +363,7 @@ class DocumentCollections {
355
363
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
356
364
  });
357
365
  if (_response.ok) {
358
- return yield serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
366
+ return serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
359
367
  unrecognizedObjectKeys: "passthrough",
360
368
  allowUnrecognizedUnionMembers: true,
361
369
  allowUnrecognizedEnumValues: true,
@@ -390,7 +398,7 @@ class DocumentCollections {
390
398
  * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
391
399
  *
392
400
  * @example
393
- * await credal.documentCollections.updateMongoCollectionSync({
401
+ * await client.documentCollections.updateMongoCollectionSync({
394
402
  * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
395
403
  * mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
396
404
  * config: {
@@ -420,12 +428,14 @@ class DocumentCollections {
420
428
  Authorization: yield this._getAuthorizationHeader(),
421
429
  "X-Fern-Language": "JavaScript",
422
430
  "X-Fern-SDK-Name": "@credal/sdk",
423
- "X-Fern-SDK-Version": "0.0.14",
431
+ "X-Fern-SDK-Version": "0.0.16",
432
+ "User-Agent": "@credal/sdk/0.0.16",
424
433
  "X-Fern-Runtime": core.RUNTIME.type,
425
434
  "X-Fern-Runtime-Version": core.RUNTIME.version,
426
435
  },
427
436
  contentType: "application/json",
428
- body: yield serializers.UpdateMongoCollectionSyncRequest.jsonOrThrow(request, {
437
+ requestType: "json",
438
+ body: serializers.UpdateMongoCollectionSyncRequest.jsonOrThrow(request, {
429
439
  unrecognizedObjectKeys: "strip",
430
440
  }),
431
441
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -433,7 +443,7 @@ class DocumentCollections {
433
443
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
434
444
  });
435
445
  if (_response.ok) {
436
- return yield serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
446
+ return serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
437
447
  unrecognizedObjectKeys: "passthrough",
438
448
  allowUnrecognizedUnionMembers: true,
439
449
  allowUnrecognizedEnumValues: true,
@@ -9,11 +9,11 @@ import * as Credal from "../../../../index";
9
9
  * resourceIdentifiers: [{
10
10
  * type: "external-resource-id",
11
11
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
12
- * resourceType: Credal.ResourceType.GoogleDriveItem
12
+ * resourceType: "GOOGLE_DRIVE_ITEM"
13
13
  * }, {
14
14
  * type: "external-resource-id",
15
15
  * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
16
- * resourceType: Credal.ResourceType.GoogleDriveItem
16
+ * resourceType: "GOOGLE_DRIVE_ITEM"
17
17
  * }]
18
18
  * }
19
19
  */
@@ -9,7 +9,7 @@ import * as Credal from "../../../../index";
9
9
  * description: "This collection is used to answer customer requests based on internal documentation.",
10
10
  * collaborators: [{
11
11
  * email: "test@gmail.com",
12
- * role: Credal.Role.Editor
12
+ * role: "editor"
13
13
  * }]
14
14
  * }
15
15
  */
@@ -9,11 +9,11 @@ import * as Credal from "../../../../index";
9
9
  * resourceIdentifiers: [{
10
10
  * type: "external-resource-id",
11
11
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
12
- * resourceType: Credal.ResourceType.GoogleDriveItem
12
+ * resourceType: "GOOGLE_DRIVE_ITEM"
13
13
  * }, {
14
14
  * type: "external-resource-id",
15
15
  * externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
16
- * resourceType: Credal.ResourceType.GoogleDriveItem
16
+ * resourceType: "GOOGLE_DRIVE_ITEM"
17
17
  * }]
18
18
  * }
19
19
  */
@@ -11,8 +11,11 @@ export declare namespace PermissionsService {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -26,11 +29,11 @@ export declare class PermissionsService {
26
29
  * @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
27
30
  *
28
31
  * @example
29
- * await credal.permissionsService.checkResourceAuthorizationForUser({
32
+ * await client.permissionsService.checkResourceAuthorizationForUser({
30
33
  * resourceIdentifier: {
31
34
  * type: "external-resource-id",
32
35
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
33
- * resourceType: Credal.ResourceType.GoogleDriveItem
36
+ * resourceType: "GOOGLE_DRIVE_ITEM"
34
37
  * },
35
38
  * userEmail: "john.smith@foo.com"
36
39
  * })
@@ -43,14 +46,14 @@ export declare class PermissionsService {
43
46
  * @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
44
47
  *
45
48
  * @example
46
- * await credal.permissionsService.checkBulkResourcesAuthorizationForUser({
49
+ * await client.permissionsService.checkBulkResourcesAuthorizationForUser({
47
50
  * resourceIdentifiers: [{
48
51
  * type: "url",
49
52
  * url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit"
50
53
  * }, {
51
54
  * type: "external-resource-id",
52
55
  * externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
53
- * resourceType: Credal.ResourceType.ZendeskTicket
56
+ * resourceType: "ZENDESK_TICKET"
54
57
  * }],
55
58
  * userEmail: "john.smith@foo.com"
56
59
  * })
@@ -63,7 +66,7 @@ export declare class PermissionsService {
63
66
  * @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
64
67
  *
65
68
  * @example
66
- * await credal.permissionsService.listCachedAuthorizedResourcesForUser({
69
+ * await client.permissionsService.listCachedAuthorizedResourcesForUser({
67
70
  * userEmail: "john.smith@foo.com"
68
71
  * })
69
72
  */
@@ -55,11 +55,11 @@ class PermissionsService {
55
55
  * @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
57
57
  * @example
58
- * await credal.permissionsService.checkResourceAuthorizationForUser({
58
+ * await client.permissionsService.checkResourceAuthorizationForUser({
59
59
  * resourceIdentifier: {
60
60
  * type: "external-resource-id",
61
61
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
62
- * resourceType: Credal.ResourceType.GoogleDriveItem
62
+ * resourceType: "GOOGLE_DRIVE_ITEM"
63
63
  * },
64
64
  * userEmail: "john.smith@foo.com"
65
65
  * })
@@ -74,12 +74,14 @@ class PermissionsService {
74
74
  Authorization: yield this._getAuthorizationHeader(),
75
75
  "X-Fern-Language": "JavaScript",
76
76
  "X-Fern-SDK-Name": "@credal/sdk",
77
- "X-Fern-SDK-Version": "0.0.14",
77
+ "X-Fern-SDK-Version": "0.0.16",
78
+ "User-Agent": "@credal/sdk/0.0.16",
78
79
  "X-Fern-Runtime": core.RUNTIME.type,
79
80
  "X-Fern-Runtime-Version": core.RUNTIME.version,
80
81
  },
81
82
  contentType: "application/json",
82
- body: yield serializers.CheckResourceAuthorizationForUserRequest.jsonOrThrow(request, {
83
+ requestType: "json",
84
+ body: serializers.CheckResourceAuthorizationForUserRequest.jsonOrThrow(request, {
83
85
  unrecognizedObjectKeys: "strip",
84
86
  }),
85
87
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -87,7 +89,7 @@ class PermissionsService {
87
89
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
88
90
  });
89
91
  if (_response.ok) {
90
- return yield serializers.CheckResourceAuthorizationResponse.parseOrThrow(_response.body, {
92
+ return serializers.CheckResourceAuthorizationResponse.parseOrThrow(_response.body, {
91
93
  unrecognizedObjectKeys: "passthrough",
92
94
  allowUnrecognizedUnionMembers: true,
93
95
  allowUnrecognizedEnumValues: true,
@@ -122,14 +124,14 @@ class PermissionsService {
122
124
  * @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
123
125
  *
124
126
  * @example
125
- * await credal.permissionsService.checkBulkResourcesAuthorizationForUser({
127
+ * await client.permissionsService.checkBulkResourcesAuthorizationForUser({
126
128
  * resourceIdentifiers: [{
127
129
  * type: "url",
128
130
  * url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit"
129
131
  * }, {
130
132
  * type: "external-resource-id",
131
133
  * externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
132
- * resourceType: Credal.ResourceType.ZendeskTicket
134
+ * resourceType: "ZENDESK_TICKET"
133
135
  * }],
134
136
  * userEmail: "john.smith@foo.com"
135
137
  * })
@@ -144,12 +146,14 @@ class PermissionsService {
144
146
  Authorization: yield this._getAuthorizationHeader(),
145
147
  "X-Fern-Language": "JavaScript",
146
148
  "X-Fern-SDK-Name": "@credal/sdk",
147
- "X-Fern-SDK-Version": "0.0.14",
149
+ "X-Fern-SDK-Version": "0.0.16",
150
+ "User-Agent": "@credal/sdk/0.0.16",
148
151
  "X-Fern-Runtime": core.RUNTIME.type,
149
152
  "X-Fern-Runtime-Version": core.RUNTIME.version,
150
153
  },
151
154
  contentType: "application/json",
152
- body: yield serializers.CheckBulkResourcesAuthorizationForUserRequest.jsonOrThrow(request, {
155
+ requestType: "json",
156
+ body: serializers.CheckBulkResourcesAuthorizationForUserRequest.jsonOrThrow(request, {
153
157
  unrecognizedObjectKeys: "strip",
154
158
  }),
155
159
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -157,7 +161,7 @@ class PermissionsService {
157
161
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
158
162
  });
159
163
  if (_response.ok) {
160
- return yield serializers.CheckBulkResourcesAuthorizationResponse.parseOrThrow(_response.body, {
164
+ return serializers.CheckBulkResourcesAuthorizationResponse.parseOrThrow(_response.body, {
161
165
  unrecognizedObjectKeys: "passthrough",
162
166
  allowUnrecognizedUnionMembers: true,
163
167
  allowUnrecognizedEnumValues: true,
@@ -192,7 +196,7 @@ class PermissionsService {
192
196
  * @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
193
197
  *
194
198
  * @example
195
- * await credal.permissionsService.listCachedAuthorizedResourcesForUser({
199
+ * await client.permissionsService.listCachedAuthorizedResourcesForUser({
196
200
  * userEmail: "john.smith@foo.com"
197
201
  * })
198
202
  */
@@ -206,12 +210,14 @@ class PermissionsService {
206
210
  Authorization: yield this._getAuthorizationHeader(),
207
211
  "X-Fern-Language": "JavaScript",
208
212
  "X-Fern-SDK-Name": "@credal/sdk",
209
- "X-Fern-SDK-Version": "0.0.14",
213
+ "X-Fern-SDK-Version": "0.0.16",
214
+ "User-Agent": "@credal/sdk/0.0.16",
210
215
  "X-Fern-Runtime": core.RUNTIME.type,
211
216
  "X-Fern-Runtime-Version": core.RUNTIME.version,
212
217
  },
213
218
  contentType: "application/json",
214
- body: yield serializers.ListCachedAuthorizedResourcesForUserRequest.jsonOrThrow(request, {
219
+ requestType: "json",
220
+ body: serializers.ListCachedAuthorizedResourcesForUserRequest.jsonOrThrow(request, {
215
221
  unrecognizedObjectKeys: "strip",
216
222
  }),
217
223
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -219,7 +225,7 @@ class PermissionsService {
219
225
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
220
226
  });
221
227
  if (_response.ok) {
222
- return yield serializers.AuthorizedResourceListPage.parseOrThrow(_response.body, {
228
+ return serializers.AuthorizedResourceListPage.parseOrThrow(_response.body, {
223
229
  unrecognizedObjectKeys: "passthrough",
224
230
  allowUnrecognizedUnionMembers: true,
225
231
  allowUnrecognizedEnumValues: true,
@@ -11,7 +11,7 @@ import * as Credal from "../../../../index";
11
11
  * }, {
12
12
  * type: "external-resource-id",
13
13
  * externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
14
- * resourceType: Credal.ResourceType.ZendeskTicket
14
+ * resourceType: "ZENDESK_TICKET"
15
15
  * }],
16
16
  * userEmail: "john.smith@foo.com"
17
17
  * }
@@ -8,7 +8,7 @@ import * as Credal from "../../../../index";
8
8
  * resourceIdentifier: {
9
9
  * type: "external-resource-id",
10
10
  * externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
11
- * resourceType: Credal.ResourceType.GoogleDriveItem
11
+ * resourceType: "GOOGLE_DRIVE_ITEM"
12
12
  * },
13
13
  * userEmail: "john.smith@foo.com"
14
14
  * }
@@ -11,8 +11,11 @@ export declare namespace Search {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -26,12 +29,12 @@ export declare class Search {
26
29
  * @param {Search.RequestOptions} requestOptions - Request-specific configuration.
27
30
  *
28
31
  * @example
29
- * await credal.search.searchDocumentCollection({
32
+ * await client.search.searchDocumentCollection({
30
33
  * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
31
34
  * searchQuery: "ABC Corp",
32
35
  * structuredQueryFilters: [{
33
36
  * field: "status",
34
- * operator: Credal.Operator.Equal,
37
+ * operator: "==",
35
38
  * value: "Open"
36
39
  * }],
37
40
  * userEmail: "jack@credal.ai",
@@ -55,12 +55,12 @@ class Search {
55
55
  * @param {Search.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
57
57
  * @example
58
- * await credal.search.searchDocumentCollection({
58
+ * await client.search.searchDocumentCollection({
59
59
  * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
60
60
  * searchQuery: "ABC Corp",
61
61
  * structuredQueryFilters: [{
62
62
  * field: "status",
63
- * operator: Credal.Operator.Equal,
63
+ * operator: "==",
64
64
  * value: "Open"
65
65
  * }],
66
66
  * userEmail: "jack@credal.ai",
@@ -84,20 +84,20 @@ class Search {
84
84
  Authorization: yield this._getAuthorizationHeader(),
85
85
  "X-Fern-Language": "JavaScript",
86
86
  "X-Fern-SDK-Name": "@credal/sdk",
87
- "X-Fern-SDK-Version": "0.0.14",
87
+ "X-Fern-SDK-Version": "0.0.16",
88
+ "User-Agent": "@credal/sdk/0.0.16",
88
89
  "X-Fern-Runtime": core.RUNTIME.type,
89
90
  "X-Fern-Runtime-Version": core.RUNTIME.version,
90
91
  },
91
92
  contentType: "application/json",
92
- body: yield serializers.SearchDocumentCollectionRequest.jsonOrThrow(request, {
93
- unrecognizedObjectKeys: "strip",
94
- }),
93
+ requestType: "json",
94
+ body: serializers.SearchDocumentCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
95
95
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
96
96
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
97
97
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
98
98
  });
99
99
  if (_response.ok) {
100
- return yield serializers.SearchDocumentCollectionResponse.parseOrThrow(_response.body, {
100
+ return serializers.SearchDocumentCollectionResponse.parseOrThrow(_response.body, {
101
101
  unrecognizedObjectKeys: "passthrough",
102
102
  allowUnrecognizedUnionMembers: true,
103
103
  allowUnrecognizedEnumValues: true,
@@ -9,7 +9,7 @@ import * as Credal from "../../../../index";
9
9
  * searchQuery: "ABC Corp",
10
10
  * structuredQueryFilters: [{
11
11
  * field: "status",
12
- * operator: Credal.Operator.Equal,
12
+ * operator: "==",
13
13
  * value: "Open"
14
14
  * }],
15
15
  * userEmail: "jack@credal.ai",
@@ -11,8 +11,11 @@ export declare namespace Users {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -26,7 +29,7 @@ export declare class Users {
26
29
  * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
27
30
  *
28
31
  * @example
29
- * await credal.users.metadata([{
32
+ * await client.users.metadata([{
30
33
  * metadata: {
31
34
  * "State": "NY",
32
35
  * "Job Role": "CEO"
@@ -55,7 +55,7 @@ class Users {
55
55
  * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
57
57
  * @example
58
- * await credal.users.metadata([{
58
+ * await client.users.metadata([{
59
59
  * metadata: {
60
60
  * "State": "NY",
61
61
  * "Job Role": "CEO"
@@ -79,12 +79,14 @@ class Users {
79
79
  Authorization: yield this._getAuthorizationHeader(),
80
80
  "X-Fern-Language": "JavaScript",
81
81
  "X-Fern-SDK-Name": "@credal/sdk",
82
- "X-Fern-SDK-Version": "0.0.14",
82
+ "X-Fern-SDK-Version": "0.0.16",
83
+ "User-Agent": "@credal/sdk/0.0.16",
83
84
  "X-Fern-Runtime": core.RUNTIME.type,
84
85
  "X-Fern-Runtime-Version": core.RUNTIME.version,
85
86
  },
86
87
  contentType: "application/json",
87
- body: yield serializers.users.metadata.Request.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
88
+ requestType: "json",
89
+ body: serializers.users.metadata.Request.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
88
90
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
89
91
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
90
92
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -12,7 +12,9 @@ export declare namespace Fetcher {
12
12
  maxRetries?: number;
13
13
  withCredentials?: boolean;
14
14
  abortSignal?: AbortSignal;
15
- responseType?: "json" | "blob" | "streaming" | "text";
15
+ requestType?: "json" | "file" | "bytes";
16
+ responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer";
17
+ duplex?: "half";
16
18
  }
17
19
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
18
20
  interface FailedStatusCodeError {
@@ -33,4 +35,5 @@ export declare namespace Fetcher {
33
35
  errorMessage: string;
34
36
  }
35
37
  }
38
+ export declare function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>>;
36
39
  export declare const fetcher: FetchFunction;