@knowledge-stack/ksapi 3.2.1 → 3.3.1

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 (63) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +7 -2
  3. package/dist/apis/DataSourcesApi.d.ts +14 -14
  4. package/dist/apis/DataSourcesApi.js +14 -7
  5. package/dist/esm/apis/DataSourcesApi.d.ts +14 -14
  6. package/dist/esm/apis/DataSourcesApi.js +14 -7
  7. package/dist/esm/models/ConnectionSummary.d.ts +65 -0
  8. package/dist/esm/models/ConnectionSummary.js +54 -0
  9. package/dist/esm/models/CreateDataSourceRequest.d.ts +16 -2
  10. package/dist/esm/models/CreateDataSourceRequest.js +8 -6
  11. package/dist/esm/models/DataSourceResponse.d.ts +26 -2
  12. package/dist/esm/models/DataSourceResponse.js +11 -0
  13. package/dist/esm/models/SourceConfigSummary.d.ts +71 -0
  14. package/dist/esm/models/SourceConfigSummary.js +71 -0
  15. package/dist/esm/models/SourceType.d.ts +25 -0
  16. package/dist/esm/models/SourceType.js +43 -0
  17. package/dist/esm/models/UpdateDataSourceRequest.d.ts +14 -0
  18. package/dist/esm/models/UpdateDataSourceRequest.js +6 -0
  19. package/dist/esm/models/YidingConfig.d.ts +77 -0
  20. package/dist/esm/models/YidingConfig.js +78 -0
  21. package/dist/esm/models/YidingCursor.d.ts +53 -0
  22. package/dist/esm/models/YidingCursor.js +44 -0
  23. package/dist/esm/models/index.d.ts +5 -0
  24. package/dist/esm/models/index.js +5 -0
  25. package/dist/models/ConnectionSummary.d.ts +65 -0
  26. package/dist/models/ConnectionSummary.js +62 -0
  27. package/dist/models/CreateDataSourceRequest.d.ts +16 -2
  28. package/dist/models/CreateDataSourceRequest.js +8 -6
  29. package/dist/models/DataSourceResponse.d.ts +26 -2
  30. package/dist/models/DataSourceResponse.js +11 -0
  31. package/dist/models/SourceConfigSummary.d.ts +71 -0
  32. package/dist/models/SourceConfigSummary.js +79 -0
  33. package/dist/models/SourceType.d.ts +25 -0
  34. package/dist/models/SourceType.js +51 -0
  35. package/dist/models/UpdateDataSourceRequest.d.ts +14 -0
  36. package/dist/models/UpdateDataSourceRequest.js +6 -0
  37. package/dist/models/YidingConfig.d.ts +77 -0
  38. package/dist/models/YidingConfig.js +86 -0
  39. package/dist/models/YidingCursor.d.ts +53 -0
  40. package/dist/models/YidingCursor.js +52 -0
  41. package/dist/models/index.d.ts +5 -0
  42. package/dist/models/index.js +5 -0
  43. package/docs/ConnectionSummary.md +41 -0
  44. package/docs/CreateDataSourceRequest.md +4 -0
  45. package/docs/DataSourceResponse.md +7 -1
  46. package/docs/DataSourcesApi.md +4 -3
  47. package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +6 -0
  48. package/docs/SourceConfigSummary.md +43 -0
  49. package/docs/SourceType.md +33 -0
  50. package/docs/UpdateDataSourceRequest.md +4 -0
  51. package/docs/YidingConfig.md +45 -0
  52. package/docs/YidingCursor.md +37 -0
  53. package/package.json +1 -1
  54. package/src/apis/DataSourcesApi.ts +22 -15
  55. package/src/models/ConnectionSummary.ts +109 -0
  56. package/src/models/CreateDataSourceRequest.ts +34 -6
  57. package/src/models/DataSourceResponse.ts +51 -2
  58. package/src/models/SourceConfigSummary.ts +130 -0
  59. package/src/models/SourceType.ts +53 -0
  60. package/src/models/UpdateDataSourceRequest.ts +30 -0
  61. package/src/models/YidingConfig.ts +142 -0
  62. package/src/models/YidingCursor.ts +90 -0
  63. package/src/models/index.ts +5 -0
@@ -0,0 +1,33 @@
1
+
2
+ # SourceType
3
+
4
+ Extra connector config for data sync model direct connect or automatic login/copy method.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { SourceType } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies SourceType
19
+
20
+ console.log(example)
21
+
22
+ // Convert the instance to a JSON string
23
+ const exampleJSON: string = JSON.stringify(example)
24
+ console.log(exampleJSON)
25
+
26
+ // Parse the JSON string back to an object
27
+ const exampleParsed = JSON.parse(exampleJSON) as SourceType
28
+ console.log(exampleParsed)
29
+ ```
30
+
31
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
32
+
33
+
@@ -10,6 +10,8 @@ Name | Type
10
10
  `name` | string
11
11
  `parentPathPartId` | string
12
12
  `connectionConfig` | [ConnectionConfig](ConnectionConfig.md)
13
+ `sourceConfig` | [YidingConfig](YidingConfig.md)
14
+ `syncState` | [YidingCursor](YidingCursor.md)
13
15
 
14
16
  ## Example
15
17
 
@@ -21,6 +23,8 @@ const example = {
21
23
  "name": null,
22
24
  "parentPathPartId": null,
23
25
  "connectionConfig": null,
26
+ "sourceConfig": null,
27
+ "syncState": null,
24
28
  } satisfies UpdateDataSourceRequest
25
29
 
26
30
  console.log(example)
@@ -0,0 +1,45 @@
1
+
2
+ # YidingConfig
3
+
4
+ What a customer supplies for a YiDing sync: the summary plus the secret.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `username` | string
11
+ `businessId` | string
12
+ `startDate` | Date
13
+ `cron` | string
14
+ `baseUrl` | string
15
+ `password` | string
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { YidingConfig } from '@knowledge-stack/ksapi'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "username": null,
25
+ "businessId": null,
26
+ "startDate": null,
27
+ "cron": null,
28
+ "baseUrl": null,
29
+ "password": null,
30
+ } satisfies YidingConfig
31
+
32
+ console.log(example)
33
+
34
+ // Convert the instance to a JSON string
35
+ const exampleJSON: string = JSON.stringify(example)
36
+ console.log(exampleJSON)
37
+
38
+ // Parse the JSON string back to an object
39
+ const exampleParsed = JSON.parse(exampleJSON) as YidingConfig
40
+ console.log(exampleParsed)
41
+ ```
42
+
43
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
44
+
45
+
@@ -0,0 +1,37 @@
1
+
2
+ # YidingCursor
3
+
4
+ How far a crawl has read; a missing mark means \"never\", not \"day zero\".
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `lastSyncedOrderTs` | Date
11
+ `lastSyncedUserTs` | Date
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { YidingCursor } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "lastSyncedOrderTs": null,
21
+ "lastSyncedUserTs": null,
22
+ } satisfies YidingCursor
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as YidingCursor
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -199,7 +199,7 @@ export interface DataSourcesApiInterface {
199
199
  deleteDataSourceRequestOpts(requestParameters: DeleteDataSourceRequest): Promise<runtime.RequestOpts>;
200
200
 
201
201
  /**
202
- * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path).
202
+ * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path). A YIDINGSYNC connector also owns a daily crawl schedule, which is removed here: left behind, it would fire every night at a connector that is gone. The check is not redundant — unlike the best-effort trash sync above, ``delete_connector_schedule`` re-raises anything that is not NOT_FOUND, so calling it for a DIRECT connector would put a Temporal outage in the way of a delete that never needed Temporal at all.
203
203
  * @summary Delete Data Source Handler
204
204
  * @param {string} dataSourceId
205
205
  * @param {*} [options] Override http request option.
@@ -209,7 +209,7 @@ export interface DataSourcesApiInterface {
209
209
  deleteDataSourceRaw(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
210
210
 
211
211
  /**
212
- * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path).
212
+ * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path). A YIDINGSYNC connector also owns a daily crawl schedule, which is removed here: left behind, it would fire every night at a connector that is gone. The check is not redundant — unlike the best-effort trash sync above, ``delete_connector_schedule`` re-raises anything that is not NOT_FOUND, so calling it for a DIRECT connector would put a Temporal outage in the way of a delete that never needed Temporal at all.
213
213
  * Delete Data Source Handler
214
214
  */
215
215
  deleteDataSource(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -475,7 +475,7 @@ export interface DataSourcesApiInterface {
475
475
  syncDataSourceRequestOpts(requestParameters: SyncDataSourceRequest): Promise<runtime.RequestOpts>;
476
476
 
477
477
  /**
478
- * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported.
478
+ * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported. A crawler-fed connector has no catalog to reconcile against, so it starts a crawl instead and returns 202.
479
479
  * @summary Sync Data Source Handler
480
480
  * @param {string} dataSourceId
481
481
  * @param {*} [options] Override http request option.
@@ -485,10 +485,10 @@ export interface DataSourcesApiInterface {
485
485
  syncDataSourceRaw(requestParameters: SyncDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataSourceSyncResponse>>;
486
486
 
487
487
  /**
488
- * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported.
488
+ * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported. A crawler-fed connector has no catalog to reconcile against, so it starts a crawl instead and returns 202.
489
489
  * Sync Data Source Handler
490
490
  */
491
- syncDataSource(requestParameters: SyncDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceSyncResponse>;
491
+ syncDataSource(requestParameters: SyncDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceSyncResponse | null | undefined >;
492
492
 
493
493
  /**
494
494
  * Creates request options for testDataSourceConnection without sending the request
@@ -548,7 +548,7 @@ export interface DataSourcesApiInterface {
548
548
  updateDataSourceRequestOpts(requestParameters: UpdateDataSourceOperationRequest): Promise<runtime.RequestOpts>;
549
549
 
550
550
  /**
551
- * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
551
+ * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable. A fresh ``source_config`` re-arms the crawl schedule, so changing ``cron`` takes effect immediately rather than at the next provisioning.
552
552
  * @summary Update Data Source Handler
553
553
  * @param {string} dataSourceId
554
554
  * @param {UpdateDataSourceRequest} updateDataSourceRequest
@@ -559,7 +559,7 @@ export interface DataSourcesApiInterface {
559
559
  updateDataSourceRaw(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataSourceResponse>>;
560
560
 
561
561
  /**
562
- * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
562
+ * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable. A fresh ``source_config`` re-arms the crawl schedule, so changing ``cron`` takes effect immediately rather than at the next provisioning.
563
563
  * Update Data Source Handler
564
564
  */
565
565
  updateDataSource(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceResponse>;
@@ -692,7 +692,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
692
692
  }
693
693
 
694
694
  /**
695
- * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path).
695
+ * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path). A YIDINGSYNC connector also owns a daily crawl schedule, which is removed here: left behind, it would fire every night at a connector that is gone. The check is not redundant — unlike the best-effort trash sync above, ``delete_connector_schedule`` re-raises anything that is not NOT_FOUND, so calling it for a DIRECT connector would put a Temporal outage in the way of a delete that never needed Temporal at all.
696
696
  * Delete Data Source Handler
697
697
  */
698
698
  async deleteDataSourceRaw(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
@@ -703,7 +703,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
703
703
  }
704
704
 
705
705
  /**
706
- * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path).
706
+ * Move a connector and its schemas/tables to trash. Soft-delete via the path_part subtree (schemas + tables are children, so they trash with it). Each modeled table\'s summary Qdrant point carries that table\'s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\'s table search (best-effort, mirrors the document delete path). A YIDINGSYNC connector also owns a daily crawl schedule, which is removed here: left behind, it would fire every night at a connector that is gone. The check is not redundant — unlike the best-effort trash sync above, ``delete_connector_schedule`` re-raises anything that is not NOT_FOUND, so calling it for a DIRECT connector would put a Temporal outage in the way of a delete that never needed Temporal at all.
707
707
  * Delete Data Source Handler
708
708
  */
709
709
  async deleteDataSource(requestParameters: DeleteDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
@@ -1346,7 +1346,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
1346
1346
  }
1347
1347
 
1348
1348
  /**
1349
- * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported.
1349
+ * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported. A crawler-fed connector has no catalog to reconcile against, so it starts a crawl instead and returns 202.
1350
1350
  * Sync Data Source Handler
1351
1351
  */
1352
1352
  async syncDataSourceRaw(requestParameters: SyncDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataSourceSyncResponse>> {
@@ -1357,12 +1357,19 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
1357
1357
  }
1358
1358
 
1359
1359
  /**
1360
- * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported.
1360
+ * Reconcile modeled tables against the live external catalog. Requires ``can_write``. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes ``column_config`` (preserving the admin\'s ``exposed``/``comment`` field-modeling) and re-summarizes + re-embeds; an unchanged table is a no-op; a table dropped from the source is soft-deleted (keeping the \"was modeled, now gone\" record) and its embedding purged. It never models tables that were not imported. A crawler-fed connector has no catalog to reconcile against, so it starts a crawl instead and returns 202.
1361
1361
  * Sync Data Source Handler
1362
1362
  */
1363
- async syncDataSource(requestParameters: SyncDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceSyncResponse> {
1363
+ async syncDataSource(requestParameters: SyncDataSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceSyncResponse | null | undefined > {
1364
1364
  const response = await this.syncDataSourceRaw(requestParameters, initOverrides);
1365
- return await response.value();
1365
+ switch (response.raw.status) {
1366
+ case 200:
1367
+ return await response.value();
1368
+ case 202:
1369
+ return null;
1370
+ default:
1371
+ return await response.value();
1372
+ }
1366
1373
  }
1367
1374
 
1368
1375
  /**
@@ -1522,7 +1529,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
1522
1529
  }
1523
1530
 
1524
1531
  /**
1525
- * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
1532
+ * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable. A fresh ``source_config`` re-arms the crawl schedule, so changing ``cron`` takes effect immediately rather than at the next provisioning.
1526
1533
  * Update Data Source Handler
1527
1534
  */
1528
1535
  async updateDataSourceRaw(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataSourceResponse>> {
@@ -1533,7 +1540,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
1533
1540
  }
1534
1541
 
1535
1542
  /**
1536
- * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
1543
+ * Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable. A fresh ``source_config`` re-arms the crawl schedule, so changing ``cron`` takes effect immediately rather than at the next provisioning.
1537
1544
  * Update Data Source Handler
1538
1545
  */
1539
1546
  async updateDataSource(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceResponse> {
@@ -0,0 +1,109 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Where a connector points, with the password left out.
18
+ * @export
19
+ * @interface ConnectionSummary
20
+ */
21
+ export interface ConnectionSummary {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ConnectionSummary
26
+ */
27
+ host: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ConnectionSummary
32
+ */
33
+ port?: number | null;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ConnectionSummary
38
+ */
39
+ database: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ConnectionSummary
44
+ */
45
+ username: string;
46
+ }
47
+ export const ConnectionSummaryPropertyValidationAttributesMap: {
48
+ [property: string]: {
49
+ maxLength?: number,
50
+ minLength?: number,
51
+ pattern?: string,
52
+ maximum?: number,
53
+ exclusiveMaximum?: boolean,
54
+ minimum?: number,
55
+ exclusiveMinimum?: boolean,
56
+ multipleOf?: number,
57
+ maxItems?: number,
58
+ minItems?: number,
59
+ uniqueItems?: boolean
60
+ }
61
+ } = {
62
+ }
63
+
64
+
65
+ /**
66
+ * Check if a given object implements the ConnectionSummary interface.
67
+ */
68
+ export function instanceOfConnectionSummary(value: object): value is ConnectionSummary {
69
+ if (!('host' in value) || value['host'] === undefined) return false;
70
+ if (!('database' in value) || value['database'] === undefined) return false;
71
+ if (!('username' in value) || value['username'] === undefined) return false;
72
+ return true;
73
+ }
74
+
75
+ export function ConnectionSummaryFromJSON(json: any): ConnectionSummary {
76
+ return ConnectionSummaryFromJSONTyped(json, false);
77
+ }
78
+
79
+ export function ConnectionSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionSummary {
80
+ if (json == null) {
81
+ return json;
82
+ }
83
+ return {
84
+
85
+ 'host': json['host'],
86
+ 'port': json['port'] == null ? undefined : json['port'],
87
+ 'database': json['database'],
88
+ 'username': json['username'],
89
+ };
90
+ }
91
+
92
+ export function ConnectionSummaryToJSON(json: any): ConnectionSummary {
93
+ return ConnectionSummaryToJSONTyped(json, false);
94
+ }
95
+
96
+ export function ConnectionSummaryToJSONTyped(value?: ConnectionSummary | null, ignoreDiscriminator: boolean = false): any {
97
+ if (value == null) {
98
+ return value;
99
+ }
100
+
101
+ return {
102
+
103
+ 'host': value['host'],
104
+ 'port': value['port'],
105
+ 'database': value['database'],
106
+ 'username': value['username'],
107
+ };
108
+ }
109
+
@@ -13,6 +13,20 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { SourceType } from './SourceType';
17
+ import {
18
+ SourceTypeFromJSON,
19
+ SourceTypeFromJSONTyped,
20
+ SourceTypeToJSON,
21
+ SourceTypeToJSONTyped,
22
+ } from './SourceType';
23
+ import type { YidingConfig } from './YidingConfig';
24
+ import {
25
+ YidingConfigFromJSON,
26
+ YidingConfigFromJSONTyped,
27
+ YidingConfigToJSON,
28
+ YidingConfigToJSONTyped,
29
+ } from './YidingConfig';
16
30
  import type { ConnectionConfig } from './ConnectionConfig';
17
31
  import {
18
32
  ConnectionConfigFromJSON,
@@ -46,18 +60,30 @@ export interface CreateDataSourceRequest {
46
60
  * @memberof CreateDataSourceRequest
47
61
  */
48
62
  parentPathPartId: string;
63
+ /**
64
+ *
65
+ * @type {SourceType}
66
+ * @memberof CreateDataSourceRequest
67
+ */
68
+ sourceType?: SourceType;
49
69
  /**
50
70
  *
51
71
  * @type {DataSourceEngine}
52
72
  * @memberof CreateDataSourceRequest
53
73
  */
54
- engine: DataSourceEngine;
74
+ engine?: DataSourceEngine;
55
75
  /**
56
76
  *
57
77
  * @type {ConnectionConfig}
58
78
  * @memberof CreateDataSourceRequest
59
79
  */
60
- connectionConfig: ConnectionConfig;
80
+ connectionConfig?: ConnectionConfig | null;
81
+ /**
82
+ *
83
+ * @type {YidingConfig}
84
+ * @memberof CreateDataSourceRequest
85
+ */
86
+ sourceConfig?: YidingConfig | null;
61
87
  }
62
88
 
63
89
 
@@ -88,8 +114,6 @@ export const CreateDataSourceRequestPropertyValidationAttributesMap: {
88
114
  export function instanceOfCreateDataSourceRequest(value: object): value is CreateDataSourceRequest {
89
115
  if (!('name' in value) || value['name'] === undefined) return false;
90
116
  if (!('parentPathPartId' in value) || value['parentPathPartId'] === undefined) return false;
91
- if (!('engine' in value) || value['engine'] === undefined) return false;
92
- if (!('connectionConfig' in value) || value['connectionConfig'] === undefined) return false;
93
117
  return true;
94
118
  }
95
119
 
@@ -105,8 +129,10 @@ export function CreateDataSourceRequestFromJSONTyped(json: any, ignoreDiscrimina
105
129
 
106
130
  'name': json['name'],
107
131
  'parentPathPartId': json['parent_path_part_id'],
108
- 'engine': DataSourceEngineFromJSON(json['engine']),
109
- 'connectionConfig': ConnectionConfigFromJSON(json['connection_config']),
132
+ 'sourceType': json['source_type'] == null ? undefined : SourceTypeFromJSON(json['source_type']),
133
+ 'engine': json['engine'] == null ? undefined : DataSourceEngineFromJSON(json['engine']),
134
+ 'connectionConfig': json['connection_config'] == null ? undefined : ConnectionConfigFromJSON(json['connection_config']),
135
+ 'sourceConfig': json['source_config'] == null ? undefined : YidingConfigFromJSON(json['source_config']),
110
136
  };
111
137
  }
112
138
 
@@ -123,8 +149,10 @@ export function CreateDataSourceRequestToJSONTyped(value?: CreateDataSourceReque
123
149
 
124
150
  'name': value['name'],
125
151
  'parent_path_part_id': value['parentPathPartId'],
152
+ 'source_type': SourceTypeToJSON(value['sourceType']),
126
153
  'engine': DataSourceEngineToJSON(value['engine']),
127
154
  'connection_config': ConnectionConfigToJSON(value['connectionConfig']),
155
+ 'source_config': YidingConfigToJSON(value['sourceConfig']),
128
156
  };
129
157
  }
130
158
 
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ConnectionSummary } from './ConnectionSummary';
17
+ import {
18
+ ConnectionSummaryFromJSON,
19
+ ConnectionSummaryFromJSONTyped,
20
+ ConnectionSummaryToJSON,
21
+ ConnectionSummaryToJSONTyped,
22
+ } from './ConnectionSummary';
16
23
  import type { ItemPermissions } from './ItemPermissions';
17
24
  import {
18
25
  ItemPermissionsFromJSON,
@@ -20,6 +27,13 @@ import {
20
27
  ItemPermissionsToJSON,
21
28
  ItemPermissionsToJSONTyped,
22
29
  } from './ItemPermissions';
30
+ import type { SourceType } from './SourceType';
31
+ import {
32
+ SourceTypeFromJSON,
33
+ SourceTypeFromJSONTyped,
34
+ SourceTypeToJSON,
35
+ SourceTypeToJSONTyped,
36
+ } from './SourceType';
23
37
  import type { PathPartApprovalState } from './PathPartApprovalState';
24
38
  import {
25
39
  PathPartApprovalStateFromJSON,
@@ -27,6 +41,13 @@ import {
27
41
  PathPartApprovalStateToJSON,
28
42
  PathPartApprovalStateToJSONTyped,
29
43
  } from './PathPartApprovalState';
44
+ import type { SourceConfigSummary } from './SourceConfigSummary';
45
+ import {
46
+ SourceConfigSummaryFromJSON,
47
+ SourceConfigSummaryFromJSONTyped,
48
+ SourceConfigSummaryToJSON,
49
+ SourceConfigSummaryToJSONTyped,
50
+ } from './SourceConfigSummary';
30
51
  import type { UserInfo } from './UserInfo';
31
52
  import {
32
53
  UserInfoFromJSON,
@@ -45,8 +66,11 @@ import {
45
66
  /**
46
67
  * Connector response; a discriminated-union variant for folder listings.
47
68
  *
48
- * The ``connection_config`` (host/port/credentials) is intentionally
49
- * omitted — the password is write-only and never serialized back.
69
+ * The stored ``connection_config`` is never returned whole: the password is
70
+ * write-only and never serialized back. What it points at travels in
71
+ * ``connection_summary`` instead, which a YIDINGSYNC connector needs — the
72
+ * server generated those credentials, so this is the only place its owner ever
73
+ * sees which database the sync built.
50
74
  * @export
51
75
  * @interface DataSourceResponse
52
76
  */
@@ -99,6 +123,24 @@ export interface DataSourceResponse {
99
123
  * @memberof DataSourceResponse
100
124
  */
101
125
  engine: DataSourceEngine;
126
+ /**
127
+ *
128
+ * @type {SourceType}
129
+ * @memberof DataSourceResponse
130
+ */
131
+ sourceType: SourceType;
132
+ /**
133
+ * Where the connector points, without the password. Null on a YIDINGSYNC connector until provisioning has built its database, so polling this is how the UI learns the sync is ready.
134
+ * @type {ConnectionSummary}
135
+ * @memberof DataSourceResponse
136
+ */
137
+ connectionSummary?: ConnectionSummary | null;
138
+ /**
139
+ * A YIDINGSYNC connector's crawler config without the password: which shop, from when, and the crawl recurrence. Null on DIRECT.
140
+ * @type {SourceConfigSummary}
141
+ * @memberof DataSourceResponse
142
+ */
143
+ sourceConfig?: SourceConfigSummary | null;
102
144
  /**
103
145
  *
104
146
  * @type {PathPartApprovalState}
@@ -169,6 +211,7 @@ export function instanceOfDataSourceResponse(value: object): value is DataSource
169
211
  if (!('tenantId' in value) || value['tenantId'] === undefined) return false;
170
212
  if (!('name' in value) || value['name'] === undefined) return false;
171
213
  if (!('engine' in value) || value['engine'] === undefined) return false;
214
+ if (!('sourceType' in value) || value['sourceType'] === undefined) return false;
172
215
  if (!('approvalState' in value) || value['approvalState'] === undefined) return false;
173
216
  if (!('permissions' in value) || value['permissions'] === undefined) return false;
174
217
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
@@ -194,6 +237,9 @@ export function DataSourceResponseFromJSONTyped(json: any, ignoreDiscriminator:
194
237
  'tenantId': json['tenant_id'],
195
238
  'name': json['name'],
196
239
  'engine': DataSourceEngineFromJSON(json['engine']),
240
+ 'sourceType': SourceTypeFromJSON(json['source_type']),
241
+ 'connectionSummary': json['connection_summary'] == null ? undefined : ConnectionSummaryFromJSON(json['connection_summary']),
242
+ 'sourceConfig': json['source_config'] == null ? undefined : SourceConfigSummaryFromJSON(json['source_config']),
197
243
  'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
198
244
  'owner': json['owner'] == null ? undefined : UserInfoFromJSON(json['owner']),
199
245
  'permissions': ItemPermissionsFromJSON(json['permissions']),
@@ -221,6 +267,9 @@ export function DataSourceResponseToJSONTyped(value?: DataSourceResponse | null,
221
267
  'tenant_id': value['tenantId'],
222
268
  'name': value['name'],
223
269
  'engine': DataSourceEngineToJSON(value['engine']),
270
+ 'source_type': SourceTypeToJSON(value['sourceType']),
271
+ 'connection_summary': ConnectionSummaryToJSON(value['connectionSummary']),
272
+ 'source_config': SourceConfigSummaryToJSON(value['sourceConfig']),
224
273
  'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
225
274
  'owner': UserInfoToJSON(value['owner']),
226
275
  'permissions': ItemPermissionsToJSON(value['permissions']),