@usecortex_ai/node 0.1.0 → 0.1.2

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 (58) hide show
  1. package/dist/api/resources/embeddings/client/Client.d.ts +0 -1
  2. package/dist/api/resources/embeddings/client/Client.js +0 -1
  3. package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +1 -3
  4. package/dist/api/resources/search/client/Client.d.ts +2 -2
  5. package/dist/api/resources/sources/client/Client.d.ts +32 -0
  6. package/dist/api/resources/sources/client/Client.js +91 -0
  7. package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.d.ts +12 -0
  8. package/dist/api/resources/sources/client/requests/index.d.ts +1 -0
  9. package/dist/api/resources/upload/client/Client.d.ts +5 -6
  10. package/dist/api/resources/upload/client/Client.js +25 -8
  11. package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +1 -0
  12. package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +1 -0
  13. package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +1 -0
  14. package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateMarkdownPatch.d.ts +21 -0
  15. package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateTextPatch.d.ts +21 -0
  16. package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateTextPatch.js +5 -0
  17. package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +1 -0
  18. package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadMarkdownPost.d.ts +19 -0
  19. package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadMarkdownPost.js +5 -0
  20. package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadTextPost.d.ts +19 -0
  21. package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadTextPost.js +5 -0
  22. package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +2 -6
  23. package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +4 -1
  24. package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +4 -1
  25. package/dist/api/types/AppSourcesUploadData.d.ts +2 -2
  26. package/dist/api/types/BatchUploadData.d.ts +2 -2
  27. package/dist/api/types/BodyScrapeWebpageUploadScrapeWebpagePost.d.ts +6 -0
  28. package/dist/api/types/BodyScrapeWebpageUploadScrapeWebpagePost.js +5 -0
  29. package/dist/api/types/BodyUpdateScrapeJobUploadUpdateWebpagePatch.d.ts +6 -0
  30. package/dist/api/types/BodyUpdateScrapeJobUploadUpdateWebpagePatch.js +5 -0
  31. package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +2 -2
  32. package/dist/api/types/EmbeddingsDeleteData.d.ts +2 -2
  33. package/dist/api/types/EmbeddingsGetData.d.ts +2 -2
  34. package/dist/api/types/EmbeddingsSearchData.d.ts +2 -2
  35. package/dist/api/types/ErrorResponse.d.ts +1 -1
  36. package/dist/api/types/ExtendedContext.d.ts +1 -1
  37. package/dist/api/types/FetchContentData.d.ts +2 -2
  38. package/dist/api/types/ListSourcesResponse.d.ts +2 -2
  39. package/dist/api/types/MarkdownUploadRequest.d.ts +2 -0
  40. package/dist/api/types/ProcessingStatus.d.ts +2 -2
  41. package/dist/api/types/Relations.d.ts +7 -0
  42. package/dist/api/types/Relations.js +5 -0
  43. package/dist/api/types/SearchChunk.d.ts +5 -4
  44. package/dist/api/types/SingleUploadData.d.ts +2 -2
  45. package/dist/api/types/Source.d.ts +4 -3
  46. package/dist/api/types/SourceContent.d.ts +2 -2
  47. package/dist/api/types/SourceModel.d.ts +2 -0
  48. package/dist/api/types/SubTenantIdsData.d.ts +10 -0
  49. package/dist/api/types/SubTenantIdsData.js +5 -0
  50. package/dist/api/types/TenantCreateData.d.ts +2 -2
  51. package/dist/api/types/TenantStats.d.ts +3 -3
  52. package/dist/api/types/index.d.ts +4 -2
  53. package/dist/api/types/index.js +4 -2
  54. package/package.json +1 -1
  55. package/dist/api/types/FullTextSearchData.d.ts +0 -9
  56. package/dist/api/types/SearchData.d.ts +0 -9
  57. /package/dist/api/{types/FullTextSearchData.js → resources/sources/client/requests/SourcesGetSubTenantIdsRequest.js} +0 -0
  58. /package/dist/api/{types/SearchData.js → resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateMarkdownPatch.js} +0 -0
@@ -94,7 +94,6 @@ export declare class Embeddings {
94
94
  *
95
95
  * @example
96
96
  * await client.embeddings.search({
97
- * embeddings: [1.1],
98
97
  * tenant_id: "tenant_id"
99
98
  * })
100
99
  */
@@ -160,7 +160,6 @@ class Embeddings {
160
160
  *
161
161
  * @example
162
162
  * await client.embeddings.search({
163
- * embeddings: [1.1],
164
163
  * tenant_id: "tenant_id"
165
164
  * })
166
165
  */
@@ -4,14 +4,12 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * embeddings: [1.1],
8
7
  * tenant_id: "tenant_id"
9
8
  * }
10
9
  */
11
10
  export interface EmbeddingsSearchRequest {
12
- /** Single embedding vector for search */
13
- embeddings: number[];
14
11
  tenant_id: string;
12
+ embeddings?: number[];
15
13
  sub_tenant_id?: string;
16
14
  max_chunks?: number;
17
15
  }
@@ -88,7 +88,7 @@ export declare class Search {
88
88
  * tenant_id: "tenant_id"
89
89
  * })
90
90
  */
91
- retrieve(request: CortexAI.SearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchData>;
91
+ retrieve(request: CortexAI.SearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchChunk[]>;
92
92
  private __retrieve;
93
93
  /**
94
94
  * Full text search endpoint for Cortex customers.
@@ -127,7 +127,7 @@ export declare class Search {
127
127
  * tenant_id: "tenant_id"
128
128
  * })
129
129
  */
130
- fullTextSearch(request: CortexAI.FullTextSearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.FullTextSearchData>;
130
+ fullTextSearch(request: CortexAI.FullTextSearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchChunk[]>;
131
131
  private __fullTextSearch;
132
132
  protected _getAuthorizationHeader(): Promise<string | undefined>;
133
133
  }
@@ -68,5 +68,37 @@ export declare class Sources {
68
68
  */
69
69
  getByIds(request: CortexAI.SourceBodyParams, requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<CortexAI.ListSourcesResponse>;
70
70
  private __getByIds;
71
+ /**
72
+ * Get all sub-tenant IDs (tenant IDs) contained within a specific Weaviate collection.
73
+ * Fetches the tenant IDs directly from Weaviate using default cluster credentials.
74
+ *
75
+ * Args:
76
+ * tenant_id: The tenant ID to fetch sub-tenant IDs for
77
+ * api_details: Authentication dependency
78
+ *
79
+ * Returns:
80
+ * SubTenantIdsData: Contains collection_name, sub_tenant_ids list, count, and success message
81
+ *
82
+ * Example:
83
+ * GET /list/sub_tenant_ids?tenant_id=my_tenant_123
84
+ *
85
+ * @param {CortexAI.SourcesGetSubTenantIdsRequest} request
86
+ * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
87
+ *
88
+ * @throws {@link CortexAI.BadRequestError}
89
+ * @throws {@link CortexAI.UnauthorizedError}
90
+ * @throws {@link CortexAI.ForbiddenError}
91
+ * @throws {@link CortexAI.NotFoundError}
92
+ * @throws {@link CortexAI.UnprocessableEntityError}
93
+ * @throws {@link CortexAI.InternalServerError}
94
+ * @throws {@link CortexAI.ServiceUnavailableError}
95
+ *
96
+ * @example
97
+ * await client.sources.getSubTenantIds({
98
+ * tenant_id: "tenant_id"
99
+ * })
100
+ */
101
+ getSubTenantIds(request: CortexAI.SourcesGetSubTenantIdsRequest, requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<CortexAI.SubTenantIdsData>;
102
+ private __getSubTenantIds;
71
103
  protected _getAuthorizationHeader(): Promise<string | undefined>;
72
104
  }
@@ -196,6 +196,97 @@ class Sources {
196
196
  });
197
197
  }
198
198
  }
199
+ /**
200
+ * Get all sub-tenant IDs (tenant IDs) contained within a specific Weaviate collection.
201
+ * Fetches the tenant IDs directly from Weaviate using default cluster credentials.
202
+ *
203
+ * Args:
204
+ * tenant_id: The tenant ID to fetch sub-tenant IDs for
205
+ * api_details: Authentication dependency
206
+ *
207
+ * Returns:
208
+ * SubTenantIdsData: Contains collection_name, sub_tenant_ids list, count, and success message
209
+ *
210
+ * Example:
211
+ * GET /list/sub_tenant_ids?tenant_id=my_tenant_123
212
+ *
213
+ * @param {CortexAI.SourcesGetSubTenantIdsRequest} request
214
+ * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
215
+ *
216
+ * @throws {@link CortexAI.BadRequestError}
217
+ * @throws {@link CortexAI.UnauthorizedError}
218
+ * @throws {@link CortexAI.ForbiddenError}
219
+ * @throws {@link CortexAI.NotFoundError}
220
+ * @throws {@link CortexAI.UnprocessableEntityError}
221
+ * @throws {@link CortexAI.InternalServerError}
222
+ * @throws {@link CortexAI.ServiceUnavailableError}
223
+ *
224
+ * @example
225
+ * await client.sources.getSubTenantIds({
226
+ * tenant_id: "tenant_id"
227
+ * })
228
+ */
229
+ getSubTenantIds(request, requestOptions) {
230
+ return core.HttpResponsePromise.fromPromise(this.__getSubTenantIds(request, requestOptions));
231
+ }
232
+ async __getSubTenantIds(request, requestOptions) {
233
+ var _a, _b, _c;
234
+ const { tenant_id: tenantId } = request;
235
+ const _queryParams = {};
236
+ _queryParams["tenant_id"] = tenantId;
237
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
238
+ const _response = await core.fetcher({
239
+ url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "list/sub_tenant_ids"),
240
+ method: "GET",
241
+ headers: _headers,
242
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
243
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
244
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
245
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
246
+ });
247
+ if (_response.ok) {
248
+ return { data: _response.body, rawResponse: _response.rawResponse };
249
+ }
250
+ if (_response.error.reason === "status-code") {
251
+ switch (_response.error.statusCode) {
252
+ case 400:
253
+ throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
254
+ case 401:
255
+ throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
256
+ case 403:
257
+ throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
258
+ case 404:
259
+ throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
260
+ case 422:
261
+ throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
262
+ case 500:
263
+ throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
264
+ case 503:
265
+ throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
266
+ default:
267
+ throw new errors.CortexAIError({
268
+ statusCode: _response.error.statusCode,
269
+ body: _response.error.body,
270
+ rawResponse: _response.rawResponse,
271
+ });
272
+ }
273
+ }
274
+ switch (_response.error.reason) {
275
+ case "non-json":
276
+ throw new errors.CortexAIError({
277
+ statusCode: _response.error.statusCode,
278
+ body: _response.error.rawBody,
279
+ rawResponse: _response.rawResponse,
280
+ });
281
+ case "timeout":
282
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/sub_tenant_ids.");
283
+ case "unknown":
284
+ throw new errors.CortexAIError({
285
+ message: _response.error.errorMessage,
286
+ rawResponse: _response.rawResponse,
287
+ });
288
+ }
289
+ }
199
290
  async _getAuthorizationHeader() {
200
291
  const bearer = await core.Supplier.get(this._options.token);
201
292
  if (bearer != null) {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "tenant_id"
8
+ * }
9
+ */
10
+ export interface SourcesGetSubTenantIdsRequest {
11
+ tenant_id: string;
12
+ }
@@ -1,2 +1,3 @@
1
1
  export { type SourcesGetAllRequest } from "./SourcesGetAllRequest.js";
2
2
  export { type SourceBodyParams } from "./SourceBodyParams.js";
3
+ export { type SourcesGetSubTenantIdsRequest } from "./SourcesGetSubTenantIdsRequest.js";
@@ -264,10 +264,7 @@ export declare class Upload {
264
264
  *
265
265
  * @example
266
266
  * await client.upload.updateEmbeddings({
267
- * tenant_id: "tenant_id",
268
- * embeddings: {
269
- * "key": [1.1]
270
- * }
267
+ * tenant_id: "tenant_id"
271
268
  * })
272
269
  */
273
270
  updateEmbeddings(request: CortexAI.EmbeddingsUpdateRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
@@ -287,7 +284,8 @@ export declare class Upload {
287
284
  * @example
288
285
  * await client.upload.scrapeWebpage({
289
286
  * web_url: "web_url",
290
- * tenant_id: "tenant_id"
287
+ * tenant_id: "tenant_id",
288
+ * body: {}
291
289
  * })
292
290
  */
293
291
  scrapeWebpage(request: CortexAI.UploadScrapeWebpageRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
@@ -308,7 +306,8 @@ export declare class Upload {
308
306
  * await client.upload.updateWebpage({
309
307
  * web_url: "web_url",
310
308
  * source_id: "source_id",
311
- * tenant_id: "tenant_id"
309
+ * tenant_id: "tenant_id",
310
+ * body: {}
312
311
  * })
313
312
  */
314
313
  updateWebpage(request: CortexAI.UploadUpdateWebpageRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
@@ -86,6 +86,9 @@ class Upload {
86
86
  if (request.document_metadata != null) {
87
87
  _request.append("document_metadata", request.document_metadata);
88
88
  }
89
+ if (request.relations != null) {
90
+ _request.append("relations", request.relations);
91
+ }
89
92
  const _maybeEncodedRequest = await _request.getRequest();
90
93
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
91
94
  const _response = await core.fetcher({
@@ -187,6 +190,9 @@ class Upload {
187
190
  if (request.document_metadata != null) {
188
191
  _request.append("document_metadata", request.document_metadata);
189
192
  }
193
+ if (request.relations != null) {
194
+ _request.append("relations", request.relations);
195
+ }
190
196
  const _maybeEncodedRequest = await _request.getRequest();
191
197
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
192
198
  const _response = await core.fetcher({
@@ -281,6 +287,9 @@ class Upload {
281
287
  if (request.document_metadata != null) {
282
288
  _request.append("document_metadata", request.document_metadata);
283
289
  }
290
+ if (request.relations != null) {
291
+ _request.append("relations", request.relations);
292
+ }
284
293
  const _maybeEncodedRequest = await _request.getRequest();
285
294
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
286
295
  const _response = await core.fetcher({
@@ -377,6 +386,9 @@ class Upload {
377
386
  if (request.document_metadata != null) {
378
387
  _request.append("document_metadata", request.document_metadata);
379
388
  }
389
+ if (request.relations != null) {
390
+ _request.append("relations", request.relations);
391
+ }
380
392
  const _maybeEncodedRequest = await _request.getRequest();
381
393
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
382
394
  const _response = await core.fetcher({
@@ -976,10 +988,7 @@ class Upload {
976
988
  *
977
989
  * @example
978
990
  * await client.upload.updateEmbeddings({
979
- * tenant_id: "tenant_id",
980
- * embeddings: {
981
- * "key": [1.1]
982
- * }
991
+ * tenant_id: "tenant_id"
983
992
  * })
984
993
  */
985
994
  updateEmbeddings(request, requestOptions) {
@@ -1064,7 +1073,8 @@ class Upload {
1064
1073
  * @example
1065
1074
  * await client.upload.scrapeWebpage({
1066
1075
  * web_url: "web_url",
1067
- * tenant_id: "tenant_id"
1076
+ * tenant_id: "tenant_id",
1077
+ * body: {}
1068
1078
  * })
1069
1079
  */
1070
1080
  scrapeWebpage(request, requestOptions) {
@@ -1072,7 +1082,7 @@ class Upload {
1072
1082
  }
1073
1083
  async __scrapeWebpage(request, requestOptions) {
1074
1084
  var _a, _b, _c;
1075
- const { web_url: webUrl, tenant_id: tenantId, sub_tenant_id: subTenantId, file_id: fileId } = request;
1085
+ const { web_url: webUrl, tenant_id: tenantId, sub_tenant_id: subTenantId, file_id: fileId, body: _body, } = request;
1076
1086
  const _queryParams = {};
1077
1087
  _queryParams["web_url"] = webUrl;
1078
1088
  _queryParams["tenant_id"] = tenantId;
@@ -1087,7 +1097,10 @@ class Upload {
1087
1097
  url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "upload/scrape_webpage"),
1088
1098
  method: "POST",
1089
1099
  headers: _headers,
1100
+ contentType: "application/x-www-form-urlencoded",
1090
1101
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1102
+ requestType: "json",
1103
+ body: _body,
1091
1104
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1092
1105
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1093
1106
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -1151,7 +1164,8 @@ class Upload {
1151
1164
  * await client.upload.updateWebpage({
1152
1165
  * web_url: "web_url",
1153
1166
  * source_id: "source_id",
1154
- * tenant_id: "tenant_id"
1167
+ * tenant_id: "tenant_id",
1168
+ * body: {}
1155
1169
  * })
1156
1170
  */
1157
1171
  updateWebpage(request, requestOptions) {
@@ -1159,7 +1173,7 @@ class Upload {
1159
1173
  }
1160
1174
  async __updateWebpage(request, requestOptions) {
1161
1175
  var _a, _b, _c;
1162
- const { web_url: webUrl, source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
1176
+ const { web_url: webUrl, source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId, body: _body, } = request;
1163
1177
  const _queryParams = {};
1164
1178
  _queryParams["web_url"] = webUrl;
1165
1179
  _queryParams["source_id"] = sourceId;
@@ -1172,7 +1186,10 @@ class Upload {
1172
1186
  url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "upload/update_webpage"),
1173
1187
  method: "PATCH",
1174
1188
  headers: _headers,
1189
+ contentType: "application/x-www-form-urlencoded",
1175
1190
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1191
+ requestType: "json",
1192
+ body: _body,
1176
1193
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1177
1194
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1178
1195
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -16,4 +16,5 @@ export interface BodyBatchUpdateUploadBatchUpdatePatch {
16
16
  source_ids?: string[];
17
17
  tenant_metadata?: string;
18
18
  document_metadata?: string;
19
+ relations?: string;
19
20
  }
@@ -15,4 +15,5 @@ export interface BodyBatchUploadUploadBatchUploadPost {
15
15
  files: core.file.Uploadable.FileLike[];
16
16
  tenant_metadata?: string;
17
17
  document_metadata?: string;
18
+ relations?: string;
18
19
  }
@@ -17,4 +17,5 @@ export interface BodyUpdateFileUploadUpdateDocumentPatch {
17
17
  file: core.file.Uploadable.FileLike;
18
18
  tenant_metadata?: string;
19
19
  document_metadata?: string;
20
+ relations?: string;
20
21
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as CortexAI from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * source_id: "source_id",
9
+ * tenant_id: "tenant_id",
10
+ * request: {
11
+ * content: "content"
12
+ * }
13
+ * }
14
+ */
15
+ export interface BodyUpdateMarkdownUploadUpdateMarkdownPatch {
16
+ source_id: string;
17
+ tenant_id: string;
18
+ sub_tenant_id?: string;
19
+ request: CortexAI.MarkdownUploadRequest;
20
+ relations?: CortexAI.Relations;
21
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as CortexAI from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * source_id: "source_id",
9
+ * tenant_id: "tenant_id",
10
+ * request: {
11
+ * content: "content"
12
+ * }
13
+ * }
14
+ */
15
+ export interface BodyUpdateMarkdownUploadUpdateTextPatch {
16
+ source_id: string;
17
+ tenant_id: string;
18
+ sub_tenant_id?: string;
19
+ request: CortexAI.MarkdownUploadRequest;
20
+ relations?: CortexAI.Relations;
21
+ }
@@ -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 });
@@ -15,4 +15,5 @@ export interface BodyUploadFilesUploadUploadDocumentPost {
15
15
  file: core.file.Uploadable.FileLike;
16
16
  tenant_metadata?: string;
17
17
  document_metadata?: string;
18
+ relations?: string;
18
19
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as CortexAI from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * tenant_id: "tenant_id",
9
+ * request: {
10
+ * content: "content"
11
+ * }
12
+ * }
13
+ */
14
+ export interface BodyUploadMarkdownUploadUploadMarkdownPost {
15
+ tenant_id: string;
16
+ sub_tenant_id?: string;
17
+ request: CortexAI.MarkdownUploadRequest;
18
+ relations?: CortexAI.Relations;
19
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as CortexAI from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * tenant_id: "tenant_id",
9
+ * request: {
10
+ * content: "content"
11
+ * }
12
+ * }
13
+ */
14
+ export interface BodyUploadMarkdownUploadUploadTextPost {
15
+ tenant_id: string;
16
+ sub_tenant_id?: string;
17
+ request: CortexAI.MarkdownUploadRequest;
18
+ relations?: CortexAI.Relations;
19
+ }
@@ -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 });
@@ -4,15 +4,11 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * tenant_id: "tenant_id",
8
- * embeddings: {
9
- * "key": [1.1]
10
- * }
7
+ * tenant_id: "tenant_id"
11
8
  * }
12
9
  */
13
10
  export interface EmbeddingsUpdateRequest {
14
11
  tenant_id: string;
15
12
  sub_tenant_id?: string;
16
- /** Dictionary with chunk_id as key and embedding array as value */
17
- embeddings: Record<string, number[]>;
13
+ embeddings?: Record<string, number[]>;
18
14
  }
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as CortexAI from "../../../../index.js";
4
5
  /**
5
6
  * @example
6
7
  * {
7
8
  * web_url: "web_url",
8
- * tenant_id: "tenant_id"
9
+ * tenant_id: "tenant_id",
10
+ * body: {}
9
11
  * }
10
12
  */
11
13
  export interface UploadScrapeWebpageRequest {
@@ -13,4 +15,5 @@ export interface UploadScrapeWebpageRequest {
13
15
  tenant_id: string;
14
16
  sub_tenant_id?: string;
15
17
  file_id?: string;
18
+ body: CortexAI.BodyScrapeWebpageUploadScrapeWebpagePost;
16
19
  }
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as CortexAI from "../../../../index.js";
4
5
  /**
5
6
  * @example
6
7
  * {
7
8
  * web_url: "web_url",
8
9
  * source_id: "source_id",
9
- * tenant_id: "tenant_id"
10
+ * tenant_id: "tenant_id",
11
+ * body: {}
10
12
  * }
11
13
  */
12
14
  export interface UploadUpdateWebpageRequest {
@@ -14,4 +16,5 @@ export interface UploadUpdateWebpageRequest {
14
16
  source_id: string;
15
17
  tenant_id: string;
16
18
  sub_tenant_id?: string;
19
+ body: CortexAI.BodyUpdateScrapeJobUploadUpdateWebpagePatch;
17
20
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface AppSourcesUploadData {
6
- success?: boolean;
7
- message: string;
8
6
  uploaded: CortexAI.FileUploadResult[];
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface BatchUploadData {
6
- success?: boolean;
7
- message: string;
8
6
  uploaded: CortexAI.FileUploadResult[];
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface BodyScrapeWebpageUploadScrapeWebpagePost {
5
+ relations?: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface BodyUpdateScrapeJobUploadUpdateWebpagePatch {
5
+ relations?: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface EmbeddingsCreateCollectionData {
5
- success?: boolean;
6
- message: string;
7
5
  tenant_id: string;
8
6
  sub_tenant_id: string;
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface EmbeddingsDeleteData {
5
- success?: boolean;
6
- message: string;
7
5
  total_deleted: number;
8
6
  status: Record<string, boolean>;
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface EmbeddingsGetData {
5
- success?: boolean;
6
- message: string;
7
5
  embeddings: Record<string, number[]>;
8
6
  not_found_chunk_ids: string[];
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface EmbeddingsSearchData {
5
- success?: boolean;
6
- message: string;
7
5
  chunk_ids: string[];
8
6
  scores: number[];
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export interface ErrorResponse {
5
5
  success?: boolean;
6
- message: string;
6
+ message?: string;
7
7
  error_code?: string;
8
8
  data?: Record<string, unknown>;
9
9
  }
@@ -3,5 +3,5 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface ExtendedContext {
6
- related_chunks?: CortexAI.RelatedChunk[];
6
+ relations?: CortexAI.RelatedChunk[];
7
7
  }
@@ -2,9 +2,9 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface FetchContentData {
5
- success?: boolean;
6
- message: string;
7
5
  file_id: string;
8
6
  url: string;
9
7
  file_content?: string;
8
+ success?: boolean;
9
+ message?: string;
10
10
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface ListSourcesResponse {
6
- success?: boolean;
7
- message: string;
8
6
  sources: (CortexAI.Source | undefined)[];
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as CortexAI from "../index.js";
4
5
  export interface MarkdownUploadRequest {
5
6
  content: string;
6
7
  tenant_metadata?: Record<string, unknown>;
7
8
  document_metadata?: Record<string, unknown>;
9
+ relations?: CortexAI.Relations;
8
10
  }
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface ProcessingStatus {
5
- success?: boolean;
6
- message: string;
7
5
  file_id: string;
8
6
  indexing_status: string;
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface Relations {
5
+ cortex_source_ids?: string[];
6
+ auto_discovery?: Record<string, unknown>;
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 });
@@ -6,16 +6,17 @@ export interface SearchChunk {
6
6
  chunk_uuid: string;
7
7
  source_id: string;
8
8
  chunk_content: string;
9
- source_collection?: string[];
10
- layout?: string;
11
- source_url?: string;
12
- version: string;
13
9
  source_type?: string;
14
10
  source_upload_time?: string;
15
11
  source_title?: string;
16
12
  source_last_updated_time?: string;
13
+ source_collection?: string[];
14
+ layout?: string;
15
+ source_url?: string;
16
+ version?: string;
17
17
  relevancy_score?: number;
18
18
  cortex_metadata?: Record<string, unknown>;
19
19
  document_metadata?: Record<string, unknown>;
20
+ tenant_metadata?: Record<string, unknown>;
20
21
  extra_context?: CortexAI.ExtendedContext;
21
22
  }
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface SingleUploadData {
5
- success?: boolean;
6
- message: string;
7
5
  file_id: string;
6
+ success?: boolean;
7
+ message?: string;
8
8
  }
@@ -3,17 +3,18 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface Source {
6
- collections?: string[];
7
6
  id: string;
8
7
  title: string;
9
8
  type: string;
9
+ timestamp: string;
10
+ content: CortexAI.SourceContent;
11
+ collections?: string[];
10
12
  description?: string;
11
13
  note?: string;
12
14
  url?: string;
13
- timestamp: string;
14
- content: CortexAI.SourceContent;
15
15
  cortex_metadata?: Record<string, unknown>;
16
16
  document_metadata?: Record<string, unknown>;
17
+ tenant_metadata?: Record<string, unknown>;
17
18
  meta?: Record<string, unknown>;
18
19
  attachments?: unknown[];
19
20
  }
@@ -6,6 +6,6 @@ export interface SourceContent {
6
6
  html_base64?: string;
7
7
  csv_base64?: string;
8
8
  markdown?: string;
9
- files?: string[];
10
- layout?: unknown[];
9
+ files?: Record<string, unknown>[];
10
+ layout?: Record<string, unknown>[];
11
11
  }
@@ -13,6 +13,8 @@ export interface SourceModel {
13
13
  timestamp?: string;
14
14
  content?: CortexAI.ContentModel;
15
15
  cortex_metadata?: Record<string, unknown>;
16
+ tenant_metadata?: Record<string, unknown>;
17
+ document_metadata?: Record<string, unknown>;
16
18
  meta?: Record<string, unknown>;
17
19
  attachments?: CortexAI.AttachmentModel[];
18
20
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SubTenantIdsData {
5
+ collection_name: string;
6
+ sub_tenant_ids: string[];
7
+ count: number;
8
+ success?: boolean;
9
+ message?: string;
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,8 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface TenantCreateData {
5
- success?: boolean;
6
- message: string;
7
5
  status: string;
8
6
  tenant_id: string;
7
+ success?: boolean;
8
+ message?: string;
9
9
  }
@@ -2,9 +2,9 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface TenantStats {
5
- success?: boolean;
6
- message: string;
7
5
  object_count: number;
8
- vector_dimension?: number;
9
6
  tenant_name: string;
7
+ vector_dimension?: number;
8
+ success?: boolean;
9
+ message?: string;
10
10
  }
@@ -3,6 +3,8 @@ export * from "./AppSourcesUploadData.js";
3
3
  export * from "./AttachmentModel.js";
4
4
  export * from "./Bm25OperatorType.js";
5
5
  export * from "./BatchUploadData.js";
6
+ export * from "./BodyScrapeWebpageUploadScrapeWebpagePost.js";
7
+ export * from "./BodyUpdateScrapeJobUploadUpdateWebpagePatch.js";
6
8
  export * from "./ContentModel.js";
7
9
  export * from "./DeleteMemoryRequest.js";
8
10
  export * from "./EmbeddingsCreateCollectionData.js";
@@ -13,18 +15,18 @@ export * from "./ErrorResponse.js";
13
15
  export * from "./ExtendedContext.js";
14
16
  export * from "./FetchContentData.js";
15
17
  export * from "./FileUploadResult.js";
16
- export * from "./FullTextSearchData.js";
17
18
  export * from "./HttpValidationError.js";
18
19
  export * from "./ListSourcesResponse.js";
19
20
  export * from "./MarkdownUploadRequest.js";
20
21
  export * from "./ProcessingStatus.js";
21
22
  export * from "./RelatedChunk.js";
23
+ export * from "./Relations.js";
22
24
  export * from "./SearchChunk.js";
23
- export * from "./SearchData.js";
24
25
  export * from "./SingleUploadData.js";
25
26
  export * from "./Source.js";
26
27
  export * from "./SourceContent.js";
27
28
  export * from "./SourceModel.js";
29
+ export * from "./SubTenantIdsData.js";
28
30
  export * from "./TenantCreateData.js";
29
31
  export * from "./TenantStats.js";
30
32
  export * from "./ValidationError.js";
@@ -19,6 +19,8 @@ __exportStar(require("./AppSourcesUploadData.js"), exports);
19
19
  __exportStar(require("./AttachmentModel.js"), exports);
20
20
  __exportStar(require("./Bm25OperatorType.js"), exports);
21
21
  __exportStar(require("./BatchUploadData.js"), exports);
22
+ __exportStar(require("./BodyScrapeWebpageUploadScrapeWebpagePost.js"), exports);
23
+ __exportStar(require("./BodyUpdateScrapeJobUploadUpdateWebpagePatch.js"), exports);
22
24
  __exportStar(require("./ContentModel.js"), exports);
23
25
  __exportStar(require("./DeleteMemoryRequest.js"), exports);
24
26
  __exportStar(require("./EmbeddingsCreateCollectionData.js"), exports);
@@ -29,18 +31,18 @@ __exportStar(require("./ErrorResponse.js"), exports);
29
31
  __exportStar(require("./ExtendedContext.js"), exports);
30
32
  __exportStar(require("./FetchContentData.js"), exports);
31
33
  __exportStar(require("./FileUploadResult.js"), exports);
32
- __exportStar(require("./FullTextSearchData.js"), exports);
33
34
  __exportStar(require("./HttpValidationError.js"), exports);
34
35
  __exportStar(require("./ListSourcesResponse.js"), exports);
35
36
  __exportStar(require("./MarkdownUploadRequest.js"), exports);
36
37
  __exportStar(require("./ProcessingStatus.js"), exports);
37
38
  __exportStar(require("./RelatedChunk.js"), exports);
39
+ __exportStar(require("./Relations.js"), exports);
38
40
  __exportStar(require("./SearchChunk.js"), exports);
39
- __exportStar(require("./SearchData.js"), exports);
40
41
  __exportStar(require("./SingleUploadData.js"), exports);
41
42
  __exportStar(require("./Source.js"), exports);
42
43
  __exportStar(require("./SourceContent.js"), exports);
43
44
  __exportStar(require("./SourceModel.js"), exports);
45
+ __exportStar(require("./SubTenantIdsData.js"), exports);
44
46
  __exportStar(require("./TenantCreateData.js"), exports);
45
47
  __exportStar(require("./TenantStats.js"), exports);
46
48
  __exportStar(require("./ValidationError.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usecortex_ai/node",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "The official TypeScript SDK for the Cortex AI platform.",
5
5
  "author": "Nishkarsh Shrivastava <nishkarsh@usecortex.ai>",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as CortexAI from "../index.js";
5
- export interface FullTextSearchData {
6
- success?: boolean;
7
- message: string;
8
- chunks: CortexAI.SearchChunk[];
9
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as CortexAI from "../index.js";
5
- export interface SearchData {
6
- success?: boolean;
7
- message: string;
8
- chunks: CortexAI.SearchChunk[];
9
- }