@credal/sdk 0.1.2 → 0.1.5

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 (121) hide show
  1. package/dist/cjs/Client.d.ts +0 -3
  2. package/dist/cjs/Client.js +6 -11
  3. package/dist/cjs/api/resources/{permissionsService/types/Group.d.ts → common/types/CustomMetadataValue.d.ts} +1 -4
  4. package/dist/cjs/api/resources/common/types/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/common/types/index.js +1 -0
  6. package/dist/cjs/api/resources/copilots/client/Client.js +36 -27
  7. package/dist/cjs/api/resources/documentCatalog/client/Client.js +12 -9
  8. package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +5 -2
  9. package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatch.d.ts +1 -1
  10. package/dist/cjs/api/resources/documentCollections/client/Client.js +28 -21
  11. package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.ts +1 -3
  12. package/dist/cjs/api/resources/index.d.ts +0 -3
  13. package/dist/cjs/api/resources/index.js +1 -4
  14. package/dist/cjs/api/resources/search/client/Client.js +4 -3
  15. package/dist/cjs/api/resources/users/client/Client.js +4 -3
  16. package/dist/cjs/api/resources/users/types/UserMetadataPatch.d.ts +1 -1
  17. package/dist/cjs/core/auth/AuthProvider.d.ts +4 -0
  18. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  19. package/dist/cjs/{api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js → core/auth/AuthRequest.js} +0 -3
  20. package/dist/cjs/core/auth/index.d.ts +2 -0
  21. package/dist/cjs/core/fetcher/Fetcher.js +2 -2
  22. package/dist/cjs/core/fetcher/index.d.ts +5 -5
  23. package/dist/cjs/core/fetcher/index.js +5 -5
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/Client.d.mts +0 -3
  27. package/dist/esm/Client.mjs +2 -7
  28. package/dist/esm/api/resources/{permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.mjs → common/types/CustomMetadataValue.d.mts} +1 -1
  29. package/dist/esm/api/resources/common/types/index.d.mts +1 -0
  30. package/dist/esm/api/resources/common/types/index.mjs +1 -0
  31. package/dist/esm/api/resources/copilots/client/Client.mjs +36 -27
  32. package/dist/esm/api/resources/documentCatalog/client/Client.mjs +12 -9
  33. package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +5 -2
  34. package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatch.d.mts +1 -1
  35. package/dist/esm/api/resources/documentCollections/client/Client.mjs +28 -21
  36. package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.mts +1 -3
  37. package/dist/esm/api/resources/index.d.mts +0 -3
  38. package/dist/esm/api/resources/index.mjs +0 -3
  39. package/dist/esm/api/resources/search/client/Client.mjs +4 -3
  40. package/dist/esm/api/resources/users/client/Client.mjs +4 -3
  41. package/dist/esm/api/resources/users/types/UserMetadataPatch.d.mts +1 -1
  42. package/dist/esm/core/auth/AuthProvider.d.mts +4 -0
  43. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  44. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  45. package/dist/esm/core/auth/index.d.mts +2 -0
  46. package/dist/esm/core/fetcher/Fetcher.mjs +2 -2
  47. package/dist/esm/core/fetcher/index.d.mts +5 -5
  48. package/dist/esm/core/fetcher/index.mjs +2 -2
  49. package/dist/esm/version.d.mts +1 -1
  50. package/dist/esm/version.mjs +1 -1
  51. package/package.json +1 -1
  52. package/reference.md +0 -213
  53. package/dist/cjs/api/resources/permissionsService/client/Client.d.ts +0 -86
  54. package/dist/cjs/api/resources/permissionsService/client/Client.js +0 -257
  55. package/dist/cjs/api/resources/permissionsService/client/index.d.ts +0 -2
  56. package/dist/cjs/api/resources/permissionsService/client/index.js +0 -17
  57. package/dist/cjs/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +0 -26
  58. package/dist/cjs/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +0 -23
  59. package/dist/cjs/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +0 -20
  60. package/dist/cjs/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +0 -5
  61. package/dist/cjs/api/resources/permissionsService/client/requests/index.d.ts +0 -3
  62. package/dist/cjs/api/resources/permissionsService/index.d.ts +0 -2
  63. package/dist/cjs/api/resources/permissionsService/index.js +0 -18
  64. package/dist/cjs/api/resources/permissionsService/types/Action.d.ts +0 -7
  65. package/dist/cjs/api/resources/permissionsService/types/Action.js +0 -9
  66. package/dist/cjs/api/resources/permissionsService/types/AuthorizedResource.d.ts +0 -8
  67. package/dist/cjs/api/resources/permissionsService/types/AuthorizedResource.js +0 -5
  68. package/dist/cjs/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +0 -5
  69. package/dist/cjs/api/resources/permissionsService/types/AuthorizedResourceListPage.js +0 -5
  70. package/dist/cjs/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +0 -5
  71. package/dist/cjs/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +0 -5
  72. package/dist/cjs/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.d.ts +0 -6
  73. package/dist/cjs/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +0 -5
  74. package/dist/cjs/api/resources/permissionsService/types/Group.js +0 -5
  75. package/dist/cjs/api/resources/permissionsService/types/Principal.d.ts +0 -13
  76. package/dist/cjs/api/resources/permissionsService/types/Principal.js +0 -5
  77. package/dist/cjs/api/resources/permissionsService/types/PrincipalListPage.d.ts +0 -8
  78. package/dist/cjs/api/resources/permissionsService/types/PrincipalListPage.js +0 -5
  79. package/dist/cjs/api/resources/permissionsService/types/ResourceAuthorizationResult.d.ts +0 -9
  80. package/dist/cjs/api/resources/permissionsService/types/ResourceAuthorizationResult.js +0 -5
  81. package/dist/cjs/api/resources/permissionsService/types/User.d.ts +0 -8
  82. package/dist/cjs/api/resources/permissionsService/types/User.js +0 -5
  83. package/dist/cjs/api/resources/permissionsService/types/index.d.ts +0 -10
  84. package/dist/cjs/api/resources/permissionsService/types/index.js +0 -26
  85. package/dist/esm/api/resources/permissionsService/client/Client.d.mts +0 -86
  86. package/dist/esm/api/resources/permissionsService/client/Client.mjs +0 -220
  87. package/dist/esm/api/resources/permissionsService/client/index.d.mts +0 -2
  88. package/dist/esm/api/resources/permissionsService/client/index.mjs +0 -1
  89. package/dist/esm/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.mts +0 -26
  90. package/dist/esm/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.mts +0 -23
  91. package/dist/esm/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.mts +0 -20
  92. package/dist/esm/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.mjs +0 -4
  93. package/dist/esm/api/resources/permissionsService/client/requests/index.d.mts +0 -3
  94. package/dist/esm/api/resources/permissionsService/index.d.mts +0 -2
  95. package/dist/esm/api/resources/permissionsService/index.mjs +0 -2
  96. package/dist/esm/api/resources/permissionsService/types/Action.d.mts +0 -7
  97. package/dist/esm/api/resources/permissionsService/types/Action.mjs +0 -6
  98. package/dist/esm/api/resources/permissionsService/types/AuthorizedResource.d.mts +0 -8
  99. package/dist/esm/api/resources/permissionsService/types/AuthorizedResource.mjs +0 -4
  100. package/dist/esm/api/resources/permissionsService/types/AuthorizedResourceListPage.d.mts +0 -5
  101. package/dist/esm/api/resources/permissionsService/types/AuthorizedResourceListPage.mjs +0 -4
  102. package/dist/esm/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.mts +0 -5
  103. package/dist/esm/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.mjs +0 -4
  104. package/dist/esm/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.d.mts +0 -6
  105. package/dist/esm/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.mjs +0 -4
  106. package/dist/esm/api/resources/permissionsService/types/Group.d.mts +0 -7
  107. package/dist/esm/api/resources/permissionsService/types/Group.mjs +0 -4
  108. package/dist/esm/api/resources/permissionsService/types/Principal.d.mts +0 -13
  109. package/dist/esm/api/resources/permissionsService/types/Principal.mjs +0 -4
  110. package/dist/esm/api/resources/permissionsService/types/PrincipalListPage.d.mts +0 -8
  111. package/dist/esm/api/resources/permissionsService/types/PrincipalListPage.mjs +0 -4
  112. package/dist/esm/api/resources/permissionsService/types/ResourceAuthorizationResult.d.mts +0 -9
  113. package/dist/esm/api/resources/permissionsService/types/ResourceAuthorizationResult.mjs +0 -4
  114. package/dist/esm/api/resources/permissionsService/types/User.d.mts +0 -8
  115. package/dist/esm/api/resources/permissionsService/types/User.mjs +0 -4
  116. package/dist/esm/api/resources/permissionsService/types/index.d.mts +0 -10
  117. package/dist/esm/api/resources/permissionsService/types/index.mjs +0 -10
  118. /package/dist/cjs/api/resources/{permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js → common/types/CustomMetadataValue.js} +0 -0
  119. /package/dist/cjs/{api/resources/permissionsService/client/requests/index.js → core/auth/AuthProvider.js} +0 -0
  120. /package/dist/esm/api/resources/{permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.mjs → common/types/CustomMetadataValue.mjs} +0 -0
  121. /package/dist/esm/{api/resources/permissionsService/client/requests/index.mjs → core/auth/AuthProvider.mjs} +0 -0
@@ -6,7 +6,6 @@ import * as core from "./core/index.js";
6
6
  import { Copilots } from "./api/resources/copilots/client/Client.js";
7
7
  import { DocumentCatalog } from "./api/resources/documentCatalog/client/Client.js";
8
8
  import { DocumentCollections } from "./api/resources/documentCollections/client/Client.js";
9
- import { PermissionsService } from "./api/resources/permissionsService/client/Client.js";
10
9
  import { Search } from "./api/resources/search/client/Client.js";
11
10
  import { Users } from "./api/resources/users/client/Client.js";
12
11
  export declare namespace CredalClient {
@@ -37,14 +36,12 @@ export declare class CredalClient {
37
36
  protected _copilots: Copilots | undefined;
38
37
  protected _documentCatalog: DocumentCatalog | undefined;
39
38
  protected _documentCollections: DocumentCollections | undefined;
40
- protected _permissionsService: PermissionsService | undefined;
41
39
  protected _search: Search | undefined;
42
40
  protected _users: Users | undefined;
43
41
  constructor(_options?: CredalClient.Options);
44
42
  get copilots(): Copilots;
45
43
  get documentCatalog(): DocumentCatalog;
46
44
  get documentCollections(): DocumentCollections;
47
- get permissionsService(): PermissionsService;
48
45
  get search(): Search;
49
46
  get users(): Users;
50
47
  }
@@ -42,16 +42,15 @@ const headers_js_1 = require("./core/headers.js");
42
42
  const Client_js_1 = require("./api/resources/copilots/client/Client.js");
43
43
  const Client_js_2 = require("./api/resources/documentCatalog/client/Client.js");
44
44
  const Client_js_3 = require("./api/resources/documentCollections/client/Client.js");
45
- const Client_js_4 = require("./api/resources/permissionsService/client/Client.js");
46
- const Client_js_5 = require("./api/resources/search/client/Client.js");
47
- const Client_js_6 = require("./api/resources/users/client/Client.js");
45
+ const Client_js_4 = require("./api/resources/search/client/Client.js");
46
+ const Client_js_5 = require("./api/resources/users/client/Client.js");
48
47
  class CredalClient {
49
48
  constructor(_options = {}) {
50
49
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
51
50
  "X-Fern-Language": "JavaScript",
52
51
  "X-Fern-SDK-Name": "@credal/sdk",
53
- "X-Fern-SDK-Version": "0.1.2",
54
- "User-Agent": "@credal/sdk/0.1.2",
52
+ "X-Fern-SDK-Version": "0.1.5",
53
+ "User-Agent": "@credal/sdk/0.1.5",
55
54
  "X-Fern-Runtime": core.RUNTIME.type,
56
55
  "X-Fern-Runtime-Version": core.RUNTIME.version,
57
56
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -68,17 +67,13 @@ class CredalClient {
68
67
  var _a;
69
68
  return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new Client_js_3.DocumentCollections(this._options)));
70
69
  }
71
- get permissionsService() {
72
- var _a;
73
- return ((_a = this._permissionsService) !== null && _a !== void 0 ? _a : (this._permissionsService = new Client_js_4.PermissionsService(this._options)));
74
- }
75
70
  get search() {
76
71
  var _a;
77
- return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_js_5.Search(this._options)));
72
+ return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_js_4.Search(this._options)));
78
73
  }
79
74
  get users() {
80
75
  var _a;
81
- return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_6.Users(this._options)));
76
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_5.Users(this._options)));
82
77
  }
83
78
  }
84
79
  exports.CredalClient = CredalClient;
@@ -1,7 +1,4 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export interface Group {
5
- name: string;
6
- id?: string;
7
- }
4
+ export type CustomMetadataValue = string | number | boolean | string;
@@ -5,3 +5,4 @@ export * from "./ResourceType.js";
5
5
  export * from "./Collaborator.js";
6
6
  export * from "./Role.js";
7
7
  export * from "./Operator.js";
8
+ export * from "./CustomMetadataValue.js";
@@ -21,3 +21,4 @@ __exportStar(require("./ResourceType.js"), exports);
21
21
  __exportStar(require("./Collaborator.js"), exports);
22
22
  __exportStar(require("./Role.js"), exports);
23
23
  __exportStar(require("./Operator.js"), exports);
24
+ __exportStar(require("./CustomMetadataValue.js"), exports);
@@ -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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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
+ let _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",
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Credal from "../../../../index.js";
4
5
  /**
5
6
  * @example
6
7
  * {
@@ -25,11 +26,13 @@ export interface UploadDocumentContentsRequest {
25
26
  /** The external URL of the document you want to upload. If provided Credal will link to this URL. */
26
27
  documentExternalUrl?: string;
27
28
  /** Optional JSON representing any custom metadata for this document */
28
- customMetadata?: unknown;
29
- /** If specified, document will also be added to a particular document collection */
29
+ customMetadata?: Record<string, Credal.CustomMetadataValue>;
30
+ /** If specified, the document will also be added to the provided document collection. The document does not immediately start appearing in searches of that collection due to an asynchronous embedding process. To await this process and have this endpoint return only when that embedding process is complete, use the `awaitVectorStoreSync` parameter. */
30
31
  collectionId?: string;
31
32
  /** If specified, document contents will be re-uploaded and re-embedded even if the document already exists in Credal */
32
33
  forceUpdate?: boolean;
33
34
  /** If specified, document will be accessible to everyone within the organization of the uploader */
34
35
  internalPublic?: boolean;
36
+ /** If specified, the API will wait for the vector store to be updated before returning. This is useful if you want to ensure that the document is immediately searchable after this call returns. */
37
+ awaitVectorStoreSync?: boolean;
35
38
  }
@@ -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
  }
@@ -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
+ let _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
+ let _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",
@@ -204,10 +206,11 @@ class DocumentCollections {
204
206
  const { collectionId } = request;
205
207
  const _queryParams = {};
206
208
  _queryParams["collectionId"] = collectionId;
207
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
208
- 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/listDocumentsInCollection"),
209
+ let _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"),
209
212
  method: "GET",
210
- 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),
213
+ headers: _headers,
211
214
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
212
215
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
213
216
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -265,10 +268,11 @@ class DocumentCollections {
265
268
  __createCollection(request, requestOptions) {
266
269
  return __awaiter(this, void 0, void 0, function* () {
267
270
  var _a, _b, _c, _d;
268
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
269
- 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
+ let _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"),
270
274
  method: "POST",
271
- 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,
272
276
  contentType: "application/json",
273
277
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
274
278
  requestType: "json",
@@ -321,10 +325,11 @@ class DocumentCollections {
321
325
  __deleteCollection(request, requestOptions) {
322
326
  return __awaiter(this, void 0, void 0, function* () {
323
327
  var _a, _b, _c, _d;
324
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
325
- 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
+ let _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"),
326
331
  method: "DELETE",
327
- 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,
328
333
  contentType: "application/json",
329
334
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
330
335
  requestType: "json",
@@ -393,10 +398,11 @@ class DocumentCollections {
393
398
  __createMongoCollectionSync(request, requestOptions) {
394
399
  return __awaiter(this, void 0, void 0, function* () {
395
400
  var _a, _b, _c, _d;
396
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
397
- 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
+ let _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"),
398
404
  method: "POST",
399
- 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,
400
406
  contentType: "application/json",
401
407
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
402
408
  requestType: "json",
@@ -465,10 +471,11 @@ class DocumentCollections {
465
471
  __updateMongoCollectionSync(request, requestOptions) {
466
472
  return __awaiter(this, void 0, void 0, function* () {
467
473
  var _a, _b, _c, _d;
468
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
469
- 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
+ let _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"),
470
477
  method: "POST",
471
- 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,
472
479
  contentType: "application/json",
473
480
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
474
481
  requestType: "json",
@@ -8,8 +8,6 @@
8
8
  * }
9
9
  */
10
10
  export interface ListDocumentsInCollectionRequest {
11
- /**
12
- * The ID of the document collection to list documents from.
13
- */
11
+ /** The ID of the document collection to list documents from. */
14
12
  collectionId: string;
15
13
  }
@@ -6,8 +6,6 @@ export * as documentCatalog from "./documentCatalog/index.js";
6
6
  export * from "./documentCatalog/types/index.js";
7
7
  export * as documentCollections from "./documentCollections/index.js";
8
8
  export * from "./documentCollections/types/index.js";
9
- export * as permissionsService from "./permissionsService/index.js";
10
- export * from "./permissionsService/types/index.js";
11
9
  export * as search from "./search/index.js";
12
10
  export * from "./search/types/index.js";
13
11
  export * as users from "./users/index.js";
@@ -15,5 +13,4 @@ export * from "./users/types/index.js";
15
13
  export * from "./copilots/client/requests/index.js";
16
14
  export * from "./documentCatalog/client/requests/index.js";
17
15
  export * from "./documentCollections/client/requests/index.js";
18
- export * from "./permissionsService/client/requests/index.js";
19
16
  export * from "./search/client/requests/index.js";
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.users = exports.search = exports.permissionsService = exports.documentCollections = exports.documentCatalog = exports.copilots = exports.common = void 0;
39
+ exports.users = exports.search = exports.documentCollections = exports.documentCatalog = exports.copilots = exports.common = void 0;
40
40
  exports.common = __importStar(require("./common/index.js"));
41
41
  __exportStar(require("./common/types/index.js"), exports);
42
42
  exports.copilots = __importStar(require("./copilots/index.js"));
@@ -45,8 +45,6 @@ exports.documentCatalog = __importStar(require("./documentCatalog/index.js"));
45
45
  __exportStar(require("./documentCatalog/types/index.js"), exports);
46
46
  exports.documentCollections = __importStar(require("./documentCollections/index.js"));
47
47
  __exportStar(require("./documentCollections/types/index.js"), exports);
48
- exports.permissionsService = __importStar(require("./permissionsService/index.js"));
49
- __exportStar(require("./permissionsService/types/index.js"), exports);
50
48
  exports.search = __importStar(require("./search/index.js"));
51
49
  __exportStar(require("./search/types/index.js"), exports);
52
50
  exports.users = __importStar(require("./users/index.js"));
@@ -54,5 +52,4 @@ __exportStar(require("./users/types/index.js"), exports);
54
52
  __exportStar(require("./copilots/client/requests/index.js"), exports);
55
53
  __exportStar(require("./documentCatalog/client/requests/index.js"), exports);
56
54
  __exportStar(require("./documentCollections/client/requests/index.js"), exports);
57
- __exportStar(require("./permissionsService/client/requests/index.js"), exports);
58
55
  __exportStar(require("./search/client/requests/index.js"), exports);
@@ -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
+ let _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
+ let _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,9 @@
1
+ /**
2
+ * Request parameters for authentication requests.
3
+ */
4
+ export interface AuthRequest {
5
+ /**
6
+ * The headers to be included in the request.
7
+ */
8
+ headers: Record<string, string>;
9
+ }
@@ -1,5 +1,2 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,4 @@
1
+ export { AuthProvider } from "./AuthProvider.js";
2
+ export { type AuthRequest } from "./AuthRequest.js";
1
3
  export { BasicAuth } from "./BasicAuth.js";
2
4
  export { BearerToken } from "./BearerToken.js";
@@ -12,15 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.fetcher = void 0;
13
13
  exports.fetcherImpl = fetcherImpl;
14
14
  const json_js_1 = require("../json.js");
15
- const RawResponse_js_1 = require("./RawResponse.js");
16
- const Supplier_js_1 = require("./Supplier.js");
17
15
  const createRequestUrl_js_1 = require("./createRequestUrl.js");
18
16
  const getErrorResponseBody_js_1 = require("./getErrorResponseBody.js");
19
17
  const getFetchFn_js_1 = require("./getFetchFn.js");
20
18
  const getRequestBody_js_1 = require("./getRequestBody.js");
21
19
  const getResponseBody_js_1 = require("./getResponseBody.js");
22
20
  const makeRequest_js_1 = require("./makeRequest.js");
21
+ const RawResponse_js_1 = require("./RawResponse.js");
23
22
  const requestWithRetries_js_1 = require("./requestWithRetries.js");
23
+ const Supplier_js_1 = require("./Supplier.js");
24
24
  function getHeaders(args) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
26
  const newHeaders = {};