@knowledge-stack/ksapi 1.103.3 → 1.104.0

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 (37) hide show
  1. package/README.md +4 -2
  2. package/dist/apis/ApiConnectionsApi.d.ts +38 -0
  3. package/dist/apis/ApiConnectionsApi.js +47 -0
  4. package/dist/apis/DataSourcesApi.d.ts +38 -0
  5. package/dist/apis/DataSourcesApi.js +47 -0
  6. package/dist/apis/FoldersApi.d.ts +6 -6
  7. package/dist/apis/FoldersApi.js +2 -2
  8. package/dist/esm/apis/ApiConnectionsApi.d.ts +38 -0
  9. package/dist/esm/apis/ApiConnectionsApi.js +47 -0
  10. package/dist/esm/apis/DataSourcesApi.d.ts +38 -0
  11. package/dist/esm/apis/DataSourcesApi.js +47 -0
  12. package/dist/esm/apis/FoldersApi.d.ts +6 -6
  13. package/dist/esm/apis/FoldersApi.js +2 -2
  14. package/dist/esm/models/DataSourceResponse.d.ts +7 -0
  15. package/dist/esm/models/DataSourceResponse.js +5 -0
  16. package/dist/esm/models/DataSourceTableResponse.d.ts +7 -0
  17. package/dist/esm/models/DataSourceTableResponse.js +5 -0
  18. package/dist/esm/models/SearchablePartType.d.ts +1 -0
  19. package/dist/esm/models/SearchablePartType.js +2 -1
  20. package/dist/models/DataSourceResponse.d.ts +7 -0
  21. package/dist/models/DataSourceResponse.js +5 -0
  22. package/dist/models/DataSourceTableResponse.d.ts +7 -0
  23. package/dist/models/DataSourceTableResponse.js +5 -0
  24. package/dist/models/SearchablePartType.d.ts +1 -0
  25. package/dist/models/SearchablePartType.js +2 -1
  26. package/docs/ApiConnectionsApi.md +76 -0
  27. package/docs/DataSourceResponse.md +2 -0
  28. package/docs/DataSourceTableResponse.md +2 -0
  29. package/docs/DataSourcesApi.md +76 -0
  30. package/docs/FoldersApi.md +3 -3
  31. package/package.json +1 -1
  32. package/src/apis/ApiConnectionsApi.ts +82 -0
  33. package/src/apis/DataSourcesApi.ts +82 -0
  34. package/src/apis/FoldersApi.ts +6 -6
  35. package/src/models/DataSourceResponse.ts +16 -0
  36. package/src/models/DataSourceTableResponse.ts +16 -0
  37. package/src/models/SearchablePartType.ts +2 -1
@@ -56,6 +56,10 @@ export interface CreateDataSourceOperationRequest {
56
56
  createDataSourceRequest: CreateDataSourceRequest;
57
57
  }
58
58
 
59
+ export interface DeleteDataSourceRequest {
60
+ dataSourceId: string;
61
+ }
62
+
59
63
  export interface GetDataSourceRequest {
60
64
  dataSourceId: string;
61
65
  }
@@ -115,6 +119,30 @@ export interface DataSourcesApiInterface {
115
119
  */
116
120
  createDataSource(requestParameters: CreateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceResponse>;
117
121
 
122
+ /**
123
+ * Creates request options for deleteDataSource without sending the request
124
+ * @param {string} dataSourceId
125
+ * @throws {RequiredError}
126
+ * @memberof DataSourcesApiInterface
127
+ */
128
+ deleteDataSourceRequestOpts(requestParameters: DeleteDataSourceRequest): Promise<runtime.RequestOpts>;
129
+
130
+ /**
131
+ * Move a connector and its modeled tables to trash. Soft-delete via the path_part subtree (the tables are children, so they trash with it). Connectors carry no Qdrant vectors, so there is no trash-sync workflow.
132
+ * @summary Delete Data Source Handler
133
+ * @param {string} dataSourceId
134
+ * @param {*} [options] Override http request option.
135
+ * @throws {RequiredError}
136
+ * @memberof DataSourcesApiInterface
137
+ */
138
+ deleteDataSourceRaw(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
139
+
140
+ /**
141
+ * Move a connector and its modeled tables to trash. Soft-delete via the path_part subtree (the tables are children, so they trash with it). Connectors carry no Qdrant vectors, so there is no trash-sync workflow.
142
+ * Delete Data Source Handler
143
+ */
144
+ deleteDataSource(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
145
+
118
146
  /**
119
147
  * Creates request options for getDataSource without sending the request
120
148
  * @param {string} dataSourceId
@@ -331,6 +359,60 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
331
359
  return await response.value();
332
360
  }
333
361
 
362
+ /**
363
+ * Creates request options for deleteDataSource without sending the request
364
+ */
365
+ async deleteDataSourceRequestOpts(requestParameters: DeleteDataSourceRequest): Promise<runtime.RequestOpts> {
366
+ if (requestParameters['dataSourceId'] == null) {
367
+ throw new runtime.RequiredError(
368
+ 'dataSourceId',
369
+ 'Required parameter "dataSourceId" was null or undefined when calling deleteDataSource().'
370
+ );
371
+ }
372
+
373
+ const queryParameters: any = {};
374
+
375
+ const headerParameters: runtime.HTTPHeaders = {};
376
+
377
+ if (this.configuration && this.configuration.accessToken) {
378
+ const token = this.configuration.accessToken;
379
+ const tokenString = await token("bearerAuth", []);
380
+
381
+ if (tokenString) {
382
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
383
+ }
384
+ }
385
+
386
+ let urlPath = `/v1/data-sources/{data_source_id}`;
387
+ urlPath = urlPath.replace(`{${"data_source_id"}}`, encodeURIComponent(String(requestParameters['dataSourceId'])));
388
+
389
+ return {
390
+ path: urlPath,
391
+ method: 'DELETE',
392
+ headers: headerParameters,
393
+ query: queryParameters,
394
+ };
395
+ }
396
+
397
+ /**
398
+ * Move a connector and its modeled tables to trash. Soft-delete via the path_part subtree (the tables are children, so they trash with it). Connectors carry no Qdrant vectors, so there is no trash-sync workflow.
399
+ * Delete Data Source Handler
400
+ */
401
+ async deleteDataSourceRaw(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
402
+ const requestOptions = await this.deleteDataSourceRequestOpts(requestParameters);
403
+ const response = await this.request(requestOptions, initOverrides);
404
+
405
+ return new runtime.VoidApiResponse(response);
406
+ }
407
+
408
+ /**
409
+ * Move a connector and its modeled tables to trash. Soft-delete via the path_part subtree (the tables are children, so they trash with it). Connectors carry no Qdrant vectors, so there is no trash-sync workflow.
410
+ * Delete Data Source Handler
411
+ */
412
+ async deleteDataSource(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
413
+ await this.deleteDataSourceRaw(requestParameters, initOverrides);
414
+ }
415
+
334
416
  /**
335
417
  * Creates request options for getDataSource without sending the request
336
418
  */
@@ -302,7 +302,7 @@ export interface FoldersApiInterface {
302
302
  * Creates request options for searchItems without sending the request
303
303
  * @param {string} nameLike Case-insensitive partial name search
304
304
  * @param {SearchSortOrder} [sortOrder] Sort order for results (default: NAME)
305
- * @param {SearchablePartType} [partType] Filter by item type (default: both folders and documents)
305
+ * @param {SearchablePartType} [partType] Filter by item type (default: all searchable types)
306
306
  * @param {boolean} [withTags] Include tags in the response (default: false)
307
307
  * @param {string} [parentPathPartId] Scope search to descendants of this folder\&#39;s path part
308
308
  * @param {number} [limit] Number of items per page
@@ -313,11 +313,11 @@ export interface FoldersApiInterface {
313
313
  searchItemsRequestOpts(requestParameters: SearchItemsRequest): Promise<runtime.RequestOpts>;
314
314
 
315
315
  /**
316
- * Search for folders, documents, and data-source connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
316
+ * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
317
317
  * @summary Search Items Handler
318
318
  * @param {string} nameLike Case-insensitive partial name search
319
319
  * @param {SearchSortOrder} [sortOrder] Sort order for results (default: NAME)
320
- * @param {SearchablePartType} [partType] Filter by item type (default: both folders and documents)
320
+ * @param {SearchablePartType} [partType] Filter by item type (default: all searchable types)
321
321
  * @param {boolean} [withTags] Include tags in the response (default: false)
322
322
  * @param {string} [parentPathPartId] Scope search to descendants of this folder\&#39;s path part
323
323
  * @param {number} [limit] Number of items per page
@@ -329,7 +329,7 @@ export interface FoldersApiInterface {
329
329
  searchItemsRaw(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceTableResponseApiConnectionResponseDiscriminator>>;
330
330
 
331
331
  /**
332
- * Search for folders, documents, and data-source connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
332
+ * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
333
333
  * Search Items Handler
334
334
  */
335
335
  searchItems(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceTableResponseApiConnectionResponseDiscriminator>;
@@ -830,7 +830,7 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
830
830
  }
831
831
 
832
832
  /**
833
- * Search for folders, documents, and data-source connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
833
+ * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
834
834
  * Search Items Handler
835
835
  */
836
836
  async searchItemsRaw(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceTableResponseApiConnectionResponseDiscriminator>> {
@@ -841,7 +841,7 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
841
841
  }
842
842
 
843
843
  /**
844
- * Search for folders, documents, and data-source connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
844
+ * Search for folders, documents, and connectors by name. Performs a case-insensitive partial name match using trigram indexing. Results are filtered by the current user\'s path permissions. When parent_path_part_id is provided, only items under that folder are searched. Otherwise, all accessible items across the tenant are searched.
845
845
  * Search Items Handler
846
846
  */
847
847
  async searchItems(requestParameters: SearchItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceTableResponseApiConnectionResponseDiscriminator> {
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ItemPermissions } from './ItemPermissions';
17
+ import {
18
+ ItemPermissionsFromJSON,
19
+ ItemPermissionsFromJSONTyped,
20
+ ItemPermissionsToJSON,
21
+ ItemPermissionsToJSONTyped,
22
+ } from './ItemPermissions';
16
23
  import type { PathPartApprovalState } from './PathPartApprovalState';
17
24
  import {
18
25
  PathPartApprovalStateFromJSON,
@@ -104,6 +111,12 @@ export interface DataSourceResponse {
104
111
  * @memberof DataSourceResponse
105
112
  */
106
113
  owner?: UserInfo | null;
114
+ /**
115
+ *
116
+ * @type {ItemPermissions}
117
+ * @memberof DataSourceResponse
118
+ */
119
+ permissions: ItemPermissions;
107
120
  /**
108
121
  *
109
122
  * @type {Date}
@@ -157,6 +170,7 @@ export function instanceOfDataSourceResponse(value: object): value is DataSource
157
170
  if (!('name' in value) || value['name'] === undefined) return false;
158
171
  if (!('engine' in value) || value['engine'] === undefined) return false;
159
172
  if (!('approvalState' in value) || value['approvalState'] === undefined) return false;
173
+ if (!('permissions' in value) || value['permissions'] === undefined) return false;
160
174
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
161
175
  if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
162
176
  return true;
@@ -182,6 +196,7 @@ export function DataSourceResponseFromJSONTyped(json: any, ignoreDiscriminator:
182
196
  'engine': DataSourceEngineFromJSON(json['engine']),
183
197
  'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
184
198
  'owner': json['owner'] == null ? undefined : UserInfoFromJSON(json['owner']),
199
+ 'permissions': ItemPermissionsFromJSON(json['permissions']),
185
200
  'createdAt': (new Date(json['created_at'])),
186
201
  'updatedAt': (new Date(json['updated_at'])),
187
202
  };
@@ -208,6 +223,7 @@ export function DataSourceResponseToJSONTyped(value?: DataSourceResponse | null,
208
223
  'engine': DataSourceEngineToJSON(value['engine']),
209
224
  'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
210
225
  'owner': UserInfoToJSON(value['owner']),
226
+ 'permissions': ItemPermissionsToJSON(value['permissions']),
211
227
  'created_at': value['createdAt'].toISOString(),
212
228
  'updated_at': value['updatedAt'].toISOString(),
213
229
  };
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ItemPermissions } from './ItemPermissions';
17
+ import {
18
+ ItemPermissionsFromJSON,
19
+ ItemPermissionsFromJSONTyped,
20
+ ItemPermissionsToJSON,
21
+ ItemPermissionsToJSONTyped,
22
+ } from './ItemPermissions';
16
23
  import type { PathPartApprovalState } from './PathPartApprovalState';
17
24
  import {
18
25
  PathPartApprovalStateFromJSON,
@@ -99,6 +106,12 @@ export interface DataSourceTableResponse {
99
106
  * @memberof DataSourceTableResponse
100
107
  */
101
108
  approvalState: PathPartApprovalState;
109
+ /**
110
+ *
111
+ * @type {ItemPermissions}
112
+ * @memberof DataSourceTableResponse
113
+ */
114
+ permissions: ItemPermissions;
102
115
  /**
103
116
  *
104
117
  * @type {Date}
@@ -155,6 +168,7 @@ export function instanceOfDataSourceTableResponse(value: object): value is DataS
155
168
  if (!('description' in value) || value['description'] === undefined) return false;
156
169
  if (!('columnConfig' in value) || value['columnConfig'] === undefined) return false;
157
170
  if (!('approvalState' in value) || value['approvalState'] === undefined) return false;
171
+ if (!('permissions' in value) || value['permissions'] === undefined) return false;
158
172
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
159
173
  if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
160
174
  return true;
@@ -182,6 +196,7 @@ export function DataSourceTableResponseFromJSONTyped(json: any, ignoreDiscrimina
182
196
  'description': json['description'],
183
197
  'columnConfig': json['column_config'],
184
198
  'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
199
+ 'permissions': ItemPermissionsFromJSON(json['permissions']),
185
200
  'createdAt': (new Date(json['created_at'])),
186
201
  'updatedAt': (new Date(json['updated_at'])),
187
202
  };
@@ -210,6 +225,7 @@ export function DataSourceTableResponseToJSONTyped(value?: DataSourceTableRespon
210
225
  'description': value['description'],
211
226
  'column_config': value['columnConfig'],
212
227
  'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
228
+ 'permissions': ItemPermissionsToJSON(value['permissions']),
213
229
  'created_at': value['createdAt'].toISOString(),
214
230
  'updated_at': value['updatedAt'].toISOString(),
215
231
  };
@@ -20,7 +20,8 @@
20
20
  export const SearchablePartType = {
21
21
  Folder: 'FOLDER',
22
22
  Document: 'DOCUMENT',
23
- DataSource: 'DATA_SOURCE'
23
+ DataSource: 'DATA_SOURCE',
24
+ ApiConnection: 'API_CONNECTION'
24
25
  } as const;
25
26
  export type SearchablePartType = typeof SearchablePartType[keyof typeof SearchablePartType];
26
27