@usecortex_ai/node 0.1.1 → 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 (43) 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/sources/client/Client.d.ts +32 -0
  5. package/dist/api/resources/sources/client/Client.js +91 -0
  6. package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.d.ts +12 -0
  7. package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.js +5 -0
  8. package/dist/api/resources/sources/client/requests/index.d.ts +1 -0
  9. package/dist/api/resources/upload/client/Client.d.ts +13 -16
  10. package/dist/api/resources/upload/client/Client.js +13 -16
  11. package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +2 -6
  12. package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +20 -0
  13. package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.js +5 -0
  14. package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.d.ts +20 -0
  15. package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.js +5 -0
  16. package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.d.ts +18 -0
  17. package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.js +5 -0
  18. package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +18 -0
  19. package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.js +5 -0
  20. package/dist/api/resources/upload/client/requests/index.d.ts +4 -4
  21. package/dist/api/types/AppSourcesUploadData.d.ts +1 -1
  22. package/dist/api/types/BatchUploadData.d.ts +1 -1
  23. package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +2 -2
  24. package/dist/api/types/EmbeddingsDeleteData.d.ts +2 -2
  25. package/dist/api/types/EmbeddingsGetData.d.ts +2 -2
  26. package/dist/api/types/EmbeddingsSearchData.d.ts +2 -2
  27. package/dist/api/types/FetchContentData.d.ts +2 -2
  28. package/dist/api/types/ListSourcesResponse.d.ts +1 -1
  29. package/dist/api/types/MarkdownUploadRequest.d.ts +2 -0
  30. package/dist/api/types/ProcessingStatus.d.ts +2 -2
  31. package/dist/api/types/Relations.d.ts +0 -2
  32. package/dist/api/types/SearchChunk.d.ts +5 -4
  33. package/dist/api/types/SingleUploadData.d.ts +1 -1
  34. package/dist/api/types/Source.d.ts +4 -3
  35. package/dist/api/types/SourceContent.d.ts +2 -2
  36. package/dist/api/types/SourceModel.d.ts +2 -0
  37. package/dist/api/types/SubTenantIdsData.d.ts +10 -0
  38. package/dist/api/types/SubTenantIdsData.js +5 -0
  39. package/dist/api/types/TenantCreateData.d.ts +2 -2
  40. package/dist/api/types/TenantStats.d.ts +3 -3
  41. package/dist/api/types/index.d.ts +1 -0
  42. package/dist/api/types/index.js +1 -0
  43. package/package.json +1 -1
@@ -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
  }
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,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";
@@ -138,7 +138,7 @@ export declare class Upload {
138
138
  * Upload markdown content. If request.document_metadata contains a 'file_id' key (non-empty), it will be used as the file ID;
139
139
  * otherwise, a new file_id will be generated for that file. This allows file-specific IDs to be set directly in the metadata.
140
140
  *
141
- * @param {CortexAI.BodyUploadMarkdownUploadUploadMarkdownPost} request
141
+ * @param {CortexAI.UploadUploadMarkdownRequest} request
142
142
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
143
143
  *
144
144
  * @throws {@link CortexAI.BadRequestError}
@@ -152,18 +152,18 @@ export declare class Upload {
152
152
  * @example
153
153
  * await client.upload.uploadMarkdown({
154
154
  * tenant_id: "tenant_id",
155
- * request: {
155
+ * body: {
156
156
  * content: "content"
157
157
  * }
158
158
  * })
159
159
  */
160
- uploadMarkdown(request: CortexAI.BodyUploadMarkdownUploadUploadMarkdownPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
160
+ uploadMarkdown(request: CortexAI.UploadUploadMarkdownRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
161
161
  private __uploadMarkdown;
162
162
  /**
163
163
  * Upload markdown content. If request.document_metadata contains a 'file_id' key (non-empty), it will be used as the file ID;
164
164
  * otherwise, a new file_id will be generated for that file. This allows file-specific IDs to be set directly in the metadata.
165
165
  *
166
- * @param {CortexAI.BodyUploadMarkdownUploadUploadTextPost} request
166
+ * @param {CortexAI.UploadUploadTextRequest} request
167
167
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
168
168
  *
169
169
  * @throws {@link CortexAI.BadRequestError}
@@ -177,15 +177,15 @@ export declare class Upload {
177
177
  * @example
178
178
  * await client.upload.uploadText({
179
179
  * tenant_id: "tenant_id",
180
- * request: {
180
+ * body: {
181
181
  * content: "content"
182
182
  * }
183
183
  * })
184
184
  */
185
- uploadText(request: CortexAI.BodyUploadMarkdownUploadUploadTextPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
185
+ uploadText(request: CortexAI.UploadUploadTextRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
186
186
  private __uploadText;
187
187
  /**
188
- * @param {CortexAI.BodyUpdateMarkdownUploadUpdateMarkdownPatch} request
188
+ * @param {CortexAI.UploadUpdateMarkdownRequest} request
189
189
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
190
190
  *
191
191
  * @throws {@link CortexAI.BadRequestError}
@@ -200,15 +200,15 @@ export declare class Upload {
200
200
  * await client.upload.updateMarkdown({
201
201
  * source_id: "source_id",
202
202
  * tenant_id: "tenant_id",
203
- * request: {
203
+ * body: {
204
204
  * content: "content"
205
205
  * }
206
206
  * })
207
207
  */
208
- updateMarkdown(request: CortexAI.BodyUpdateMarkdownUploadUpdateMarkdownPatch, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
208
+ updateMarkdown(request: CortexAI.UploadUpdateMarkdownRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
209
209
  private __updateMarkdown;
210
210
  /**
211
- * @param {CortexAI.BodyUpdateMarkdownUploadUpdateTextPatch} request
211
+ * @param {CortexAI.UploadUpdateTextRequest} request
212
212
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
213
213
  *
214
214
  * @throws {@link CortexAI.BadRequestError}
@@ -223,12 +223,12 @@ export declare class Upload {
223
223
  * await client.upload.updateText({
224
224
  * source_id: "source_id",
225
225
  * tenant_id: "tenant_id",
226
- * request: {
226
+ * body: {
227
227
  * content: "content"
228
228
  * }
229
229
  * })
230
230
  */
231
- updateText(request: CortexAI.BodyUpdateMarkdownUploadUpdateTextPatch, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
231
+ updateText(request: CortexAI.UploadUpdateTextRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
232
232
  private __updateText;
233
233
  /**
234
234
  * @param {CortexAI.EmbeddingsUploadRequest} request
@@ -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>;
@@ -535,7 +535,7 @@ class Upload {
535
535
  * Upload markdown content. If request.document_metadata contains a 'file_id' key (non-empty), it will be used as the file ID;
536
536
  * otherwise, a new file_id will be generated for that file. This allows file-specific IDs to be set directly in the metadata.
537
537
  *
538
- * @param {CortexAI.BodyUploadMarkdownUploadUploadMarkdownPost} request
538
+ * @param {CortexAI.UploadUploadMarkdownRequest} request
539
539
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
540
540
  *
541
541
  * @throws {@link CortexAI.BadRequestError}
@@ -549,7 +549,7 @@ class Upload {
549
549
  * @example
550
550
  * await client.upload.uploadMarkdown({
551
551
  * tenant_id: "tenant_id",
552
- * request: {
552
+ * body: {
553
553
  * content: "content"
554
554
  * }
555
555
  * })
@@ -559,7 +559,7 @@ class Upload {
559
559
  }
560
560
  async __uploadMarkdown(request, requestOptions) {
561
561
  var _a, _b, _c;
562
- const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request, _body = __rest(request, ["tenant_id", "sub_tenant_id"]);
562
+ const { tenant_id: tenantId, sub_tenant_id: subTenantId, body: _body } = request;
563
563
  const _queryParams = {};
564
564
  _queryParams["tenant_id"] = tenantId;
565
565
  if (subTenantId != null) {
@@ -625,7 +625,7 @@ class Upload {
625
625
  * Upload markdown content. If request.document_metadata contains a 'file_id' key (non-empty), it will be used as the file ID;
626
626
  * otherwise, a new file_id will be generated for that file. This allows file-specific IDs to be set directly in the metadata.
627
627
  *
628
- * @param {CortexAI.BodyUploadMarkdownUploadUploadTextPost} request
628
+ * @param {CortexAI.UploadUploadTextRequest} request
629
629
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
630
630
  *
631
631
  * @throws {@link CortexAI.BadRequestError}
@@ -639,7 +639,7 @@ class Upload {
639
639
  * @example
640
640
  * await client.upload.uploadText({
641
641
  * tenant_id: "tenant_id",
642
- * request: {
642
+ * body: {
643
643
  * content: "content"
644
644
  * }
645
645
  * })
@@ -649,7 +649,7 @@ class Upload {
649
649
  }
650
650
  async __uploadText(request, requestOptions) {
651
651
  var _a, _b, _c;
652
- const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request, _body = __rest(request, ["tenant_id", "sub_tenant_id"]);
652
+ const { tenant_id: tenantId, sub_tenant_id: subTenantId, body: _body } = request;
653
653
  const _queryParams = {};
654
654
  _queryParams["tenant_id"] = tenantId;
655
655
  if (subTenantId != null) {
@@ -712,7 +712,7 @@ class Upload {
712
712
  }
713
713
  }
714
714
  /**
715
- * @param {CortexAI.BodyUpdateMarkdownUploadUpdateMarkdownPatch} request
715
+ * @param {CortexAI.UploadUpdateMarkdownRequest} request
716
716
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
717
717
  *
718
718
  * @throws {@link CortexAI.BadRequestError}
@@ -727,7 +727,7 @@ class Upload {
727
727
  * await client.upload.updateMarkdown({
728
728
  * source_id: "source_id",
729
729
  * tenant_id: "tenant_id",
730
- * request: {
730
+ * body: {
731
731
  * content: "content"
732
732
  * }
733
733
  * })
@@ -737,7 +737,7 @@ class Upload {
737
737
  }
738
738
  async __updateMarkdown(request, requestOptions) {
739
739
  var _a, _b, _c;
740
- const { source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId } = request, _body = __rest(request, ["source_id", "tenant_id", "sub_tenant_id"]);
740
+ const { source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId, body: _body } = request;
741
741
  const _queryParams = {};
742
742
  _queryParams["source_id"] = sourceId;
743
743
  _queryParams["tenant_id"] = tenantId;
@@ -801,7 +801,7 @@ class Upload {
801
801
  }
802
802
  }
803
803
  /**
804
- * @param {CortexAI.BodyUpdateMarkdownUploadUpdateTextPatch} request
804
+ * @param {CortexAI.UploadUpdateTextRequest} request
805
805
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
806
806
  *
807
807
  * @throws {@link CortexAI.BadRequestError}
@@ -816,7 +816,7 @@ class Upload {
816
816
  * await client.upload.updateText({
817
817
  * source_id: "source_id",
818
818
  * tenant_id: "tenant_id",
819
- * request: {
819
+ * body: {
820
820
  * content: "content"
821
821
  * }
822
822
  * })
@@ -826,7 +826,7 @@ class Upload {
826
826
  }
827
827
  async __updateText(request, requestOptions) {
828
828
  var _a, _b, _c;
829
- const { source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId } = request, _body = __rest(request, ["source_id", "tenant_id", "sub_tenant_id"]);
829
+ const { source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId, body: _body } = request;
830
830
  const _queryParams = {};
831
831
  _queryParams["source_id"] = sourceId;
832
832
  _queryParams["tenant_id"] = tenantId;
@@ -988,10 +988,7 @@ class Upload {
988
988
  *
989
989
  * @example
990
990
  * await client.upload.updateEmbeddings({
991
- * tenant_id: "tenant_id",
992
- * embeddings: {
993
- * "key": [1.1]
994
- * }
991
+ * tenant_id: "tenant_id"
995
992
  * })
996
993
  */
997
994
  updateEmbeddings(request, requestOptions) {
@@ -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
  }
@@ -0,0 +1,20 @@
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
+ * body: {
11
+ * content: "content"
12
+ * }
13
+ * }
14
+ */
15
+ export interface UploadUpdateMarkdownRequest {
16
+ source_id: string;
17
+ tenant_id: string;
18
+ sub_tenant_id?: string;
19
+ body: CortexAI.MarkdownUploadRequest;
20
+ }
@@ -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,20 @@
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
+ * body: {
11
+ * content: "content"
12
+ * }
13
+ * }
14
+ */
15
+ export interface UploadUpdateTextRequest {
16
+ source_id: string;
17
+ tenant_id: string;
18
+ sub_tenant_id?: string;
19
+ body: CortexAI.MarkdownUploadRequest;
20
+ }
@@ -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,18 @@
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
+ * body: {
10
+ * content: "content"
11
+ * }
12
+ * }
13
+ */
14
+ export interface UploadUploadMarkdownRequest {
15
+ tenant_id: string;
16
+ sub_tenant_id?: string;
17
+ body: CortexAI.MarkdownUploadRequest;
18
+ }
@@ -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,18 @@
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
+ * body: {
10
+ * content: "content"
11
+ * }
12
+ * }
13
+ */
14
+ export interface UploadUploadTextRequest {
15
+ tenant_id: string;
16
+ sub_tenant_id?: string;
17
+ body: CortexAI.MarkdownUploadRequest;
18
+ }
@@ -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 });
@@ -3,10 +3,10 @@ export { type BodyBatchUpdateUploadBatchUpdatePatch } from "./BodyBatchUpdateUpl
3
3
  export { type BodyUploadFilesUploadUploadDocumentPost } from "./BodyUploadFilesUploadUploadDocumentPost.js";
4
4
  export { type BodyUpdateFileUploadUpdateDocumentPatch } from "./BodyUpdateFileUploadUpdateDocumentPatch.js";
5
5
  export { type UploadUploadAppSourcesRequest } from "./UploadUploadAppSourcesRequest.js";
6
- export { type BodyUploadMarkdownUploadUploadMarkdownPost } from "./BodyUploadMarkdownUploadUploadMarkdownPost.js";
7
- export { type BodyUploadMarkdownUploadUploadTextPost } from "./BodyUploadMarkdownUploadUploadTextPost.js";
8
- export { type BodyUpdateMarkdownUploadUpdateMarkdownPatch } from "./BodyUpdateMarkdownUploadUpdateMarkdownPatch.js";
9
- export { type BodyUpdateMarkdownUploadUpdateTextPatch } from "./BodyUpdateMarkdownUploadUpdateTextPatch.js";
6
+ export { type UploadUploadMarkdownRequest } from "./UploadUploadMarkdownRequest.js";
7
+ export { type UploadUploadTextRequest } from "./UploadUploadTextRequest.js";
8
+ export { type UploadUpdateMarkdownRequest } from "./UploadUpdateMarkdownRequest.js";
9
+ export { type UploadUpdateTextRequest } from "./UploadUpdateTextRequest.js";
10
10
  export { type EmbeddingsUploadRequest } from "./EmbeddingsUploadRequest.js";
11
11
  export { type EmbeddingsUpdateRequest } from "./EmbeddingsUpdateRequest.js";
12
12
  export { type UploadScrapeWebpageRequest } from "./UploadScrapeWebpageRequest.js";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface AppSourcesUploadData {
6
+ uploaded: CortexAI.FileUploadResult[];
6
7
  success?: boolean;
7
8
  message?: string;
8
- uploaded: CortexAI.FileUploadResult[];
9
9
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as CortexAI from "../index.js";
5
5
  export interface BatchUploadData {
6
+ uploaded: CortexAI.FileUploadResult[];
6
7
  success?: boolean;
7
8
  message?: string;
8
- uploaded: CortexAI.FileUploadResult[];
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 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
  }
@@ -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
+ sources: (CortexAI.Source | undefined)[];
6
7
  success?: boolean;
7
8
  message?: string;
8
- sources: (CortexAI.Source | undefined)[];
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
  }
@@ -2,8 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface Relations {
5
- /** List of cortex source IDs for relations */
6
5
  cortex_source_ids?: string[];
7
- /** Additional metadata for relations */
8
6
  auto_discovery?: Record<string, unknown>;
9
7
  }
@@ -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
+ file_id: string;
5
6
  success?: boolean;
6
7
  message?: string;
7
- file_id: 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
  }
@@ -26,6 +26,7 @@ export * from "./SingleUploadData.js";
26
26
  export * from "./Source.js";
27
27
  export * from "./SourceContent.js";
28
28
  export * from "./SourceModel.js";
29
+ export * from "./SubTenantIdsData.js";
29
30
  export * from "./TenantCreateData.js";
30
31
  export * from "./TenantStats.js";
31
32
  export * from "./ValidationError.js";
@@ -42,6 +42,7 @@ __exportStar(require("./SingleUploadData.js"), exports);
42
42
  __exportStar(require("./Source.js"), exports);
43
43
  __exportStar(require("./SourceContent.js"), exports);
44
44
  __exportStar(require("./SourceModel.js"), exports);
45
+ __exportStar(require("./SubTenantIdsData.js"), exports);
45
46
  __exportStar(require("./TenantCreateData.js"), exports);
46
47
  __exportStar(require("./TenantStats.js"), exports);
47
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.1",
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",