@credal/sdk 0.1.1 → 0.1.3

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 (54) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/copilots/client/Client.js +36 -27
  3. package/dist/cjs/api/resources/documentCatalog/client/Client.js +12 -9
  4. package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +1 -1
  5. package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatch.d.ts +1 -1
  6. package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +13 -0
  7. package/dist/cjs/api/resources/documentCollections/client/Client.js +84 -18
  8. package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.ts +13 -0
  9. package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.js +5 -0
  10. package/dist/cjs/api/resources/documentCollections/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.ts +7 -0
  12. package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.js +5 -0
  13. package/dist/cjs/api/resources/documentCollections/types/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/documentCollections/types/index.js +1 -0
  15. package/dist/cjs/api/resources/permissionsService/client/Client.js +12 -9
  16. package/dist/cjs/api/resources/search/client/Client.js +4 -3
  17. package/dist/cjs/api/resources/users/client/Client.js +4 -3
  18. package/dist/cjs/api/resources/users/types/UserMetadataPatch.d.ts +1 -1
  19. package/dist/cjs/core/auth/AuthProvider.d.ts +4 -0
  20. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  21. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  22. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  23. package/dist/cjs/core/auth/index.d.ts +2 -0
  24. package/dist/cjs/core/fetcher/index.d.ts +1 -1
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/Client.mjs +2 -2
  28. package/dist/esm/api/resources/copilots/client/Client.mjs +36 -27
  29. package/dist/esm/api/resources/documentCatalog/client/Client.mjs +12 -9
  30. package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +1 -1
  31. package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatch.d.mts +1 -1
  32. package/dist/esm/api/resources/documentCollections/client/Client.d.mts +13 -0
  33. package/dist/esm/api/resources/documentCollections/client/Client.mjs +84 -18
  34. package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.mts +13 -0
  35. package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.mjs +4 -0
  36. package/dist/esm/api/resources/documentCollections/client/requests/index.d.mts +1 -0
  37. package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.mts +7 -0
  38. package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.mjs +4 -0
  39. package/dist/esm/api/resources/documentCollections/types/index.d.mts +1 -0
  40. package/dist/esm/api/resources/documentCollections/types/index.mjs +1 -0
  41. package/dist/esm/api/resources/permissionsService/client/Client.mjs +12 -9
  42. package/dist/esm/api/resources/search/client/Client.mjs +4 -3
  43. package/dist/esm/api/resources/users/client/Client.mjs +4 -3
  44. package/dist/esm/api/resources/users/types/UserMetadataPatch.d.mts +1 -1
  45. package/dist/esm/core/auth/AuthProvider.d.mts +4 -0
  46. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  47. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  48. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  49. package/dist/esm/core/auth/index.d.mts +2 -0
  50. package/dist/esm/core/fetcher/index.d.mts +1 -1
  51. package/dist/esm/version.d.mts +1 -1
  52. package/dist/esm/version.mjs +1 -1
  53. package/package.json +1 -1
  54. package/reference.md +65 -0
@@ -50,8 +50,8 @@ class CredalClient {
50
50
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
51
51
  "X-Fern-Language": "JavaScript",
52
52
  "X-Fern-SDK-Name": "@credal/sdk",
53
- "X-Fern-SDK-Version": "0.1.1",
54
- "User-Agent": "@credal/sdk/0.1.1",
53
+ "X-Fern-SDK-Version": "0.1.3",
54
+ "User-Agent": "@credal/sdk/0.1.3",
55
55
  "X-Fern-Runtime": core.RUNTIME.type,
56
56
  "X-Fern-Runtime-Version": core.RUNTIME.version,
57
57
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -76,10 +76,11 @@ class Copilots {
76
76
  __createCopilot(request, requestOptions) {
77
77
  return __awaiter(this, void 0, void 0, function* () {
78
78
  var _a, _b, _c, _d;
79
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
- url: core.url.join((_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"),
79
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/createCopilot"),
81
82
  method: "POST",
82
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
+ headers: _headers,
83
84
  contentType: "application/json",
84
85
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
85
86
  requestType: "json",
@@ -133,10 +134,11 @@ class Copilots {
133
134
  __createConversation(request, requestOptions) {
134
135
  return __awaiter(this, void 0, void 0, function* () {
135
136
  var _a, _b, _c, _d;
136
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
137
- url: core.url.join((_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"),
137
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
138
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
139
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/createConversation"),
138
140
  method: "POST",
139
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
141
+ headers: _headers,
140
142
  contentType: "application/json",
141
143
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
142
144
  requestType: "json",
@@ -194,10 +196,11 @@ class Copilots {
194
196
  __provideMessageFeedback(request, requestOptions) {
195
197
  return __awaiter(this, void 0, void 0, function* () {
196
198
  var _a, _b, _c, _d;
197
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
198
- url: core.url.join((_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"),
199
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
200
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
201
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/provideMessageFeedback"),
199
202
  method: "POST",
200
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
203
+ headers: _headers,
201
204
  contentType: "application/json",
202
205
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
203
206
  requestType: "json",
@@ -257,10 +260,11 @@ class Copilots {
257
260
  __sendMessage(request, requestOptions) {
258
261
  return __awaiter(this, void 0, void 0, function* () {
259
262
  var _a, _b, _c, _d;
260
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
261
- url: core.url.join((_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"),
263
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
264
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
265
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/sendMessage"),
262
266
  method: "POST",
263
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
267
+ headers: _headers,
264
268
  contentType: "application/json",
265
269
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
266
270
  requestType: "json",
@@ -305,10 +309,11 @@ class Copilots {
305
309
  __streamMessage(request, requestOptions) {
306
310
  return __awaiter(this, void 0, void 0, function* () {
307
311
  var _a, _b, _c, _d;
308
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
309
- url: core.url.join((_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"),
312
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
313
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
314
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/streamMessage"),
310
315
  method: "POST",
311
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
316
+ headers: _headers,
312
317
  contentType: "application/json",
313
318
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
314
319
  requestType: "json",
@@ -374,10 +379,11 @@ class Copilots {
374
379
  __addCollectionToCopilot(request, requestOptions) {
375
380
  return __awaiter(this, void 0, void 0, function* () {
376
381
  var _a, _b, _c, _d;
377
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
378
- url: core.url.join((_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"),
382
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
383
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
384
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/addCollectionToCopilot"),
379
385
  method: "POST",
380
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
386
+ headers: _headers,
381
387
  contentType: "application/json",
382
388
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
383
389
  requestType: "json",
@@ -431,10 +437,11 @@ class Copilots {
431
437
  __removeCollectionFromCopilot(request, requestOptions) {
432
438
  return __awaiter(this, void 0, void 0, function* () {
433
439
  var _a, _b, _c, _d;
434
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
435
- url: core.url.join((_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"),
440
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
441
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
442
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/removeCollectionFromCopilot"),
436
443
  method: "POST",
437
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
444
+ headers: _headers,
438
445
  contentType: "application/json",
439
446
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
440
447
  requestType: "json",
@@ -496,10 +503,11 @@ class Copilots {
496
503
  __updateConfiguration(request, requestOptions) {
497
504
  return __awaiter(this, void 0, void 0, function* () {
498
505
  var _a, _b, _c, _d;
499
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
500
- url: core.url.join((_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"),
506
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
507
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
508
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/updateConfiguration"),
501
509
  method: "POST",
502
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
510
+ headers: _headers,
503
511
  contentType: "application/json",
504
512
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
505
513
  requestType: "json",
@@ -550,10 +558,11 @@ class Copilots {
550
558
  __deleteCopilot(request, requestOptions) {
551
559
  return __awaiter(this, void 0, void 0, function* () {
552
560
  var _a, _b, _c, _d;
553
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
554
- url: core.url.join((_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"),
561
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
562
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
563
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/deleteCopilot"),
555
564
  method: "DELETE",
556
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
565
+ headers: _headers,
557
566
  contentType: "application/json",
558
567
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
559
568
  requestType: "json",
@@ -73,10 +73,11 @@ class DocumentCatalog {
73
73
  __uploadDocumentContents(request, requestOptions) {
74
74
  return __awaiter(this, void 0, void 0, function* () {
75
75
  var _a, _b, _c, _d;
76
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
- url: core.url.join((_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/catalog/uploadDocumentContents"),
76
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
77
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
78
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/catalog/uploadDocumentContents"),
78
79
  method: "POST",
79
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
80
+ headers: _headers,
80
81
  contentType: "application/json",
81
82
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
82
83
  requestType: "json",
@@ -130,10 +131,11 @@ class DocumentCatalog {
130
131
  __syncSourceByUrl(request, requestOptions) {
131
132
  return __awaiter(this, void 0, void 0, function* () {
132
133
  var _a, _b, _c, _d;
133
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
134
- url: core.url.join((_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/catalog/syncSourceByUrl"),
134
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
135
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
136
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/catalog/syncSourceByUrl"),
135
137
  method: "POST",
136
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
+ headers: _headers,
137
139
  contentType: "application/json",
138
140
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
139
141
  requestType: "json",
@@ -207,10 +209,11 @@ class DocumentCatalog {
207
209
  __metadata(request, requestOptions) {
208
210
  return __awaiter(this, void 0, void 0, function* () {
209
211
  var _a, _b, _c, _d;
210
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
211
- url: core.url.join((_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/catalog/metadata"),
212
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
213
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
214
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/catalog/metadata"),
212
215
  method: "PATCH",
213
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
216
+ headers: _headers,
214
217
  contentType: "application/json",
215
218
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
216
219
  requestType: "json",
@@ -25,7 +25,7 @@ export interface UploadDocumentContentsRequest {
25
25
  /** The external URL of the document you want to upload. If provided Credal will link to this URL. */
26
26
  documentExternalUrl?: string;
27
27
  /** Optional JSON representing any custom metadata for this document */
28
- customMetadata?: unknown;
28
+ customMetadata?: Record<string, unknown>;
29
29
  /** If specified, document will also be added to a particular document collection */
30
30
  collectionId?: string;
31
31
  /** If specified, document contents will be re-uploaded and re-embedded even if the document already exists in Credal */
@@ -6,5 +6,5 @@ export interface DocumentMetadataPatch {
6
6
  /** The identifier for the resource you want to patch */
7
7
  resourceIdentifier: Credal.ResourceIdentifier;
8
8
  /** Key-value object of metadata for document. Keys will be merged with any existing values but can also be set to `null` to effectively remove */
9
- metadata?: unknown;
9
+ metadata: Record<string, unknown>;
10
10
  }
@@ -74,6 +74,19 @@ export declare class DocumentCollections {
74
74
  */
75
75
  removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<void>;
76
76
  private __removeDocumentsFromCollection;
77
+ /**
78
+ * List documents in a collection
79
+ *
80
+ * @param {Credal.ListDocumentsInCollectionRequest} request
81
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
82
+ *
83
+ * @example
84
+ * await client.documentCollections.listDocumentsInCollection({
85
+ * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24"
86
+ * })
87
+ */
88
+ listDocumentsInCollection(request: Credal.ListDocumentsInCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<Credal.ListDocumentsInCollectionResponse>;
89
+ private __listDocumentsInCollection;
77
90
  /**
78
91
  * Create a new collection. The API key used will be added to the collection for future Requests
79
92
  *
@@ -80,10 +80,11 @@ class DocumentCollections {
80
80
  __addDocumentsToCollection(request, requestOptions) {
81
81
  return __awaiter(this, void 0, void 0, function* () {
82
82
  var _a, _b, _c, _d;
83
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
84
- url: core.url.join((_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/documentCollections/addDocumentsToCollection"),
83
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
84
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
85
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/addDocumentsToCollection"),
85
86
  method: "POST",
86
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: _headers,
87
88
  contentType: "application/json",
88
89
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
89
90
  requestType: "json",
@@ -145,10 +146,11 @@ class DocumentCollections {
145
146
  __removeDocumentsFromCollection(request, requestOptions) {
146
147
  return __awaiter(this, void 0, void 0, function* () {
147
148
  var _a, _b, _c, _d;
148
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
149
- url: core.url.join((_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/documentCollections/removeDocumentsFromCollection"),
149
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
150
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
151
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/removeDocumentsFromCollection"),
150
152
  method: "DELETE",
151
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: _headers,
152
154
  contentType: "application/json",
153
155
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
154
156
  requestType: "json",
@@ -184,6 +186,66 @@ class DocumentCollections {
184
186
  }
185
187
  });
186
188
  }
189
+ /**
190
+ * List documents in a collection
191
+ *
192
+ * @param {Credal.ListDocumentsInCollectionRequest} request
193
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
194
+ *
195
+ * @example
196
+ * await client.documentCollections.listDocumentsInCollection({
197
+ * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24"
198
+ * })
199
+ */
200
+ listDocumentsInCollection(request, requestOptions) {
201
+ return core.HttpResponsePromise.fromPromise(this.__listDocumentsInCollection(request, requestOptions));
202
+ }
203
+ __listDocumentsInCollection(request, requestOptions) {
204
+ return __awaiter(this, void 0, void 0, function* () {
205
+ var _a, _b, _c, _d;
206
+ const { collectionId } = request;
207
+ const _queryParams = {};
208
+ _queryParams["collectionId"] = collectionId;
209
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
210
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
211
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/listDocumentsInCollection"),
212
+ method: "GET",
213
+ headers: _headers,
214
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
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 {
221
+ data: _response.body,
222
+ rawResponse: _response.rawResponse,
223
+ };
224
+ }
225
+ if (_response.error.reason === "status-code") {
226
+ throw new errors.CredalError({
227
+ statusCode: _response.error.statusCode,
228
+ body: _response.error.body,
229
+ rawResponse: _response.rawResponse,
230
+ });
231
+ }
232
+ switch (_response.error.reason) {
233
+ case "non-json":
234
+ throw new errors.CredalError({
235
+ statusCode: _response.error.statusCode,
236
+ body: _response.error.rawBody,
237
+ rawResponse: _response.rawResponse,
238
+ });
239
+ case "timeout":
240
+ throw new errors.CredalTimeoutError("Timeout exceeded when calling GET /v0/documentCollections/listDocumentsInCollection.");
241
+ case "unknown":
242
+ throw new errors.CredalError({
243
+ message: _response.error.errorMessage,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ });
248
+ }
187
249
  /**
188
250
  * Create a new collection. The API key used will be added to the collection for future Requests
189
251
  *
@@ -206,10 +268,11 @@ class DocumentCollections {
206
268
  __createCollection(request, requestOptions) {
207
269
  return __awaiter(this, void 0, void 0, function* () {
208
270
  var _a, _b, _c, _d;
209
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
210
- url: core.url.join((_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/documentCollections/createCollection"),
271
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
272
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
273
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/createCollection"),
211
274
  method: "POST",
212
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
275
+ headers: _headers,
213
276
  contentType: "application/json",
214
277
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
215
278
  requestType: "json",
@@ -262,10 +325,11 @@ class DocumentCollections {
262
325
  __deleteCollection(request, requestOptions) {
263
326
  return __awaiter(this, void 0, void 0, function* () {
264
327
  var _a, _b, _c, _d;
265
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
266
- url: core.url.join((_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/documentCollections/deleteCollection"),
328
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
329
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
330
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/deleteCollection"),
267
331
  method: "DELETE",
268
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
332
+ headers: _headers,
269
333
  contentType: "application/json",
270
334
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
271
335
  requestType: "json",
@@ -334,10 +398,11 @@ class DocumentCollections {
334
398
  __createMongoCollectionSync(request, requestOptions) {
335
399
  return __awaiter(this, void 0, void 0, function* () {
336
400
  var _a, _b, _c, _d;
337
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
338
- url: core.url.join((_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/documentCollections/mongodb/createMongoSync"),
401
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
402
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
403
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/createMongoSync"),
339
404
  method: "POST",
340
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
405
+ headers: _headers,
341
406
  contentType: "application/json",
342
407
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
343
408
  requestType: "json",
@@ -406,10 +471,11 @@ class DocumentCollections {
406
471
  __updateMongoCollectionSync(request, requestOptions) {
407
472
  return __awaiter(this, void 0, void 0, function* () {
408
473
  var _a, _b, _c, _d;
409
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
410
- url: core.url.join((_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/documentCollections/mongodb/updateMongoSync"),
474
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
475
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
476
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/updateMongoSync"),
411
477
  method: "POST",
412
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
478
+ headers: _headers,
413
479
  contentType: "application/json",
414
480
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
415
481
  requestType: "json",
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24"
8
+ * }
9
+ */
10
+ export interface ListDocumentsInCollectionRequest {
11
+ /** The ID of the document collection to list documents from. */
12
+ collectionId: string;
13
+ }
@@ -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,5 +1,6 @@
1
1
  export { type AddDocumentsToCollectionRequest } from "./AddDocumentsToCollectionRequest.js";
2
2
  export { type RemoveDocumentsFromCollectionRequest } from "./RemoveDocumentsFromCollectionRequest.js";
3
+ export { type ListDocumentsInCollectionRequest } from "./ListDocumentsInCollectionRequest.js";
3
4
  export { type CreateCollectionRequest } from "./CreateCollectionRequest.js";
4
5
  export { type DeleteCollectionRequest } from "./DeleteCollectionRequest.js";
5
6
  export { type CreateMongoCollectionSyncRequest } from "./CreateMongoCollectionSyncRequest.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../index.js";
5
+ export interface ListDocumentsInCollectionResponse {
6
+ resourceIdentifiers: Credal.ResourceIdentifier[];
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 });
@@ -1,5 +1,6 @@
1
1
  export * from "./CreateCollectionResponse.js";
2
2
  export * from "./DeleteCollectionResponse.js";
3
+ export * from "./ListDocumentsInCollectionResponse.js";
3
4
  export * from "./MongoSourceFieldsConfig.js";
4
5
  export * from "./MongoCollectionSyncConfig.js";
5
6
  export * from "./MongoCollectionSyncResponse.js";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CreateCollectionResponse.js"), exports);
18
18
  __exportStar(require("./DeleteCollectionResponse.js"), exports);
19
+ __exportStar(require("./ListDocumentsInCollectionResponse.js"), exports);
19
20
  __exportStar(require("./MongoSourceFieldsConfig.js"), exports);
20
21
  __exportStar(require("./MongoCollectionSyncConfig.js"), exports);
21
22
  __exportStar(require("./MongoCollectionSyncResponse.js"), exports);
@@ -76,10 +76,11 @@ class PermissionsService {
76
76
  __checkResourceAuthorizationForUser(request, requestOptions) {
77
77
  return __awaiter(this, void 0, void 0, function* () {
78
78
  var _a, _b, _c, _d;
79
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
- url: core.url.join((_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/permissions/checkResourceAuthorizationForUser"),
79
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/permissions/checkResourceAuthorizationForUser"),
81
82
  method: "POST",
82
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
+ headers: _headers,
83
84
  contentType: "application/json",
84
85
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
85
86
  requestType: "json",
@@ -143,10 +144,11 @@ class PermissionsService {
143
144
  __checkBulkResourcesAuthorizationForUser(request, requestOptions) {
144
145
  return __awaiter(this, void 0, void 0, function* () {
145
146
  var _a, _b, _c, _d;
146
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
147
- url: core.url.join((_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/permissions/checkBulkResourcesAuthorizationForUser"),
147
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
148
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
149
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/permissions/checkBulkResourcesAuthorizationForUser"),
148
150
  method: "POST",
149
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
151
+ headers: _headers,
150
152
  contentType: "application/json",
151
153
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
152
154
  requestType: "json",
@@ -202,10 +204,11 @@ class PermissionsService {
202
204
  __listCachedAuthorizedResourcesForUser(request, requestOptions) {
203
205
  return __awaiter(this, void 0, void 0, function* () {
204
206
  var _a, _b, _c, _d;
205
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
206
- url: core.url.join((_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/permissions/listCachedAuthorizedResourcesForUser"),
207
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
208
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
209
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/permissions/listCachedAuthorizedResourcesForUser"),
207
210
  method: "POST",
208
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
211
+ headers: _headers,
209
212
  contentType: "application/json",
210
213
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
211
214
  requestType: "json",
@@ -86,10 +86,11 @@ class Search {
86
86
  __searchDocumentCollection(request, requestOptions) {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  var _a, _b, _c, _d;
89
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
90
- url: core.url.join((_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/search/searchDocumentCollection"),
89
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
90
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
91
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/search/searchDocumentCollection"),
91
92
  method: "POST",
92
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: _headers,
93
94
  contentType: "application/json",
94
95
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
95
96
  requestType: "json",
@@ -81,10 +81,11 @@ class Users {
81
81
  __metadata(request, requestOptions) {
82
82
  return __awaiter(this, void 0, void 0, function* () {
83
83
  var _a, _b, _c, _d;
84
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
85
- url: core.url.join((_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/users/metadata"),
84
+ var _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
85
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
86
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/users/metadata"),
86
87
  method: "PATCH",
87
- headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
+ headers: _headers,
88
89
  contentType: "application/json",
89
90
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
90
91
  requestType: "json",
@@ -4,5 +4,5 @@
4
4
  export interface UserMetadataPatch {
5
5
  userEmail: string;
6
6
  /** Key-value object of metadata for user. Keys will be merged with any existing values but can also be set to `null` to effectively remove */
7
- metadata?: unknown;
7
+ metadata: Record<string, unknown>;
8
8
  }
@@ -0,0 +1,4 @@
1
+ import { AuthRequest } from "./AuthRequest.js";
2
+ export interface AuthProvider {
3
+ getAuthRequest(): Promise<AuthRequest>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });