@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,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.SourceType = void 0;
17
+ exports.instanceOfSourceType = instanceOfSourceType;
18
+ exports.SourceTypeFromJSON = SourceTypeFromJSON;
19
+ exports.SourceTypeFromJSONTyped = SourceTypeFromJSONTyped;
20
+ exports.SourceTypeToJSON = SourceTypeToJSON;
21
+ exports.SourceTypeToJSONTyped = SourceTypeToJSONTyped;
22
+ /**
23
+ * Extra connector config for data sync model direct connect or automatic login/copy method.
24
+ * @export
25
+ */
26
+ exports.SourceType = {
27
+ Direct: 'DIRECT',
28
+ Yidingsync: 'YIDINGSYNC'
29
+ };
30
+ function instanceOfSourceType(value) {
31
+ for (const key in exports.SourceType) {
32
+ if (Object.prototype.hasOwnProperty.call(exports.SourceType, key)) {
33
+ if (exports.SourceType[key] === value) {
34
+ return true;
35
+ }
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ function SourceTypeFromJSON(json) {
41
+ return SourceTypeFromJSONTyped(json, false);
42
+ }
43
+ function SourceTypeFromJSONTyped(json, ignoreDiscriminator) {
44
+ return json;
45
+ }
46
+ function SourceTypeToJSON(value) {
47
+ return value;
48
+ }
49
+ function SourceTypeToJSONTyped(value, ignoreDiscriminator) {
50
+ return value;
51
+ }
@@ -9,6 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { YidingConfig } from './YidingConfig';
13
+ import type { YidingCursor } from './YidingCursor';
12
14
  import type { ConnectionConfig } from './ConnectionConfig';
13
15
  /**
14
16
  * Rename, move, and/or re-credential a connector (PATCH). All optional.
@@ -42,6 +44,18 @@ export interface UpdateDataSourceRequest {
42
44
  * @memberof UpdateDataSourceRequest
43
45
  */
44
46
  connectionConfig?: ConnectionConfig | null;
47
+ /**
48
+ * Fresh YIDINGSYNC crawler config to replace the stored one (login, shop, start date, recurrence); rejected on a DIRECT connector. Changing ``cron`` re-arms the schedule. connection_config stays server-managed for YIDINGSYNC.
49
+ * @type {YidingConfig}
50
+ * @memberof UpdateDataSourceRequest
51
+ */
52
+ sourceConfig?: YidingConfig | null;
53
+ /**
54
+ * The crawl cursor, replaced whole. Written by the sync itself (the worker acts as the connector's owner) after each batch, so it records what has already been read. Moving it forward by hand makes the next run skip those days for good — the increment only re-scans what the cursor points at.
55
+ * @type {YidingCursor}
56
+ * @memberof UpdateDataSourceRequest
57
+ */
58
+ syncState?: YidingCursor | null;
45
59
  }
46
60
  export declare const UpdateDataSourceRequestPropertyValidationAttributesMap: {
47
61
  [property: string]: {
@@ -19,6 +19,8 @@ exports.UpdateDataSourceRequestFromJSON = UpdateDataSourceRequestFromJSON;
19
19
  exports.UpdateDataSourceRequestFromJSONTyped = UpdateDataSourceRequestFromJSONTyped;
20
20
  exports.UpdateDataSourceRequestToJSON = UpdateDataSourceRequestToJSON;
21
21
  exports.UpdateDataSourceRequestToJSONTyped = UpdateDataSourceRequestToJSONTyped;
22
+ const YidingConfig_1 = require("./YidingConfig");
23
+ const YidingCursor_1 = require("./YidingCursor");
22
24
  const ConnectionConfig_1 = require("./ConnectionConfig");
23
25
  exports.UpdateDataSourceRequestPropertyValidationAttributesMap = {
24
26
  name: {
@@ -43,6 +45,8 @@ function UpdateDataSourceRequestFromJSONTyped(json, ignoreDiscriminator) {
43
45
  'name': json['name'] == null ? undefined : json['name'],
44
46
  'parentPathPartId': json['parent_path_part_id'] == null ? undefined : json['parent_path_part_id'],
45
47
  'connectionConfig': json['connection_config'] == null ? undefined : (0, ConnectionConfig_1.ConnectionConfigFromJSON)(json['connection_config']),
48
+ 'sourceConfig': json['source_config'] == null ? undefined : (0, YidingConfig_1.YidingConfigFromJSON)(json['source_config']),
49
+ 'syncState': json['sync_state'] == null ? undefined : (0, YidingCursor_1.YidingCursorFromJSON)(json['sync_state']),
46
50
  };
47
51
  }
48
52
  function UpdateDataSourceRequestToJSON(json) {
@@ -56,5 +60,7 @@ function UpdateDataSourceRequestToJSONTyped(value, ignoreDiscriminator = false)
56
60
  'name': value['name'],
57
61
  'parent_path_part_id': value['parentPathPartId'],
58
62
  'connection_config': (0, ConnectionConfig_1.ConnectionConfigToJSON)(value['connectionConfig']),
63
+ 'source_config': (0, YidingConfig_1.YidingConfigToJSON)(value['sourceConfig']),
64
+ 'sync_state': (0, YidingCursor_1.YidingCursorToJSON)(value['syncState']),
59
65
  };
60
66
  }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * What a customer supplies for a YiDing sync: the summary plus the secret.
14
+ * @export
15
+ * @interface YidingConfig
16
+ */
17
+ export interface YidingConfig {
18
+ /**
19
+ * The account the crawler signs in to the panel as
20
+ * @type {string}
21
+ * @memberof YidingConfig
22
+ */
23
+ username: string;
24
+ /**
25
+ * The panel's own id for the shop. Only the customer list is scoped by it — orders follow the logged-in account — but it answers a wrong one with a 500, so an empty value fails the crawl, not just that page.
26
+ * @type {string}
27
+ * @memberof YidingConfig
28
+ */
29
+ businessId: string;
30
+ /**
31
+ * First dining day to sync; earlier orders are not fetched
32
+ * @type {Date}
33
+ * @memberof YidingConfig
34
+ */
35
+ startDate: Date;
36
+ /**
37
+ * Crawl recurrence, in the tenant's timezone
38
+ * @type {string}
39
+ * @memberof YidingConfig
40
+ */
41
+ cron: string;
42
+ /**
43
+ * Root of the YiDing admin panel the crawler signs in to
44
+ * @type {string}
45
+ * @memberof YidingConfig
46
+ */
47
+ baseUrl?: string;
48
+ /**
49
+ * Write-only: the settings panel never reads it back
50
+ * @type {string}
51
+ * @memberof YidingConfig
52
+ */
53
+ password: string;
54
+ }
55
+ export declare const YidingConfigPropertyValidationAttributesMap: {
56
+ [property: string]: {
57
+ maxLength?: number;
58
+ minLength?: number;
59
+ pattern?: string;
60
+ maximum?: number;
61
+ exclusiveMaximum?: boolean;
62
+ minimum?: number;
63
+ exclusiveMinimum?: boolean;
64
+ multipleOf?: number;
65
+ maxItems?: number;
66
+ minItems?: number;
67
+ uniqueItems?: boolean;
68
+ };
69
+ };
70
+ /**
71
+ * Check if a given object implements the YidingConfig interface.
72
+ */
73
+ export declare function instanceOfYidingConfig(value: object): value is YidingConfig;
74
+ export declare function YidingConfigFromJSON(json: any): YidingConfig;
75
+ export declare function YidingConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): YidingConfig;
76
+ export declare function YidingConfigToJSON(json: any): YidingConfig;
77
+ export declare function YidingConfigToJSONTyped(value?: YidingConfig | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.YidingConfigPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfYidingConfig = instanceOfYidingConfig;
18
+ exports.YidingConfigFromJSON = YidingConfigFromJSON;
19
+ exports.YidingConfigFromJSONTyped = YidingConfigFromJSONTyped;
20
+ exports.YidingConfigToJSON = YidingConfigToJSON;
21
+ exports.YidingConfigToJSONTyped = YidingConfigToJSONTyped;
22
+ exports.YidingConfigPropertyValidationAttributesMap = {
23
+ username: {
24
+ minLength: 1,
25
+ },
26
+ businessId: {
27
+ minLength: 1,
28
+ },
29
+ cron: {
30
+ minLength: 1,
31
+ },
32
+ baseUrl: {
33
+ maxLength: 2048,
34
+ },
35
+ password: {
36
+ minLength: 1,
37
+ },
38
+ };
39
+ /**
40
+ * Check if a given object implements the YidingConfig interface.
41
+ */
42
+ function instanceOfYidingConfig(value) {
43
+ if (!('username' in value) || value['username'] === undefined)
44
+ return false;
45
+ if (!('businessId' in value) || value['businessId'] === undefined)
46
+ return false;
47
+ if (!('startDate' in value) || value['startDate'] === undefined)
48
+ return false;
49
+ if (!('cron' in value) || value['cron'] === undefined)
50
+ return false;
51
+ if (!('password' in value) || value['password'] === undefined)
52
+ return false;
53
+ return true;
54
+ }
55
+ function YidingConfigFromJSON(json) {
56
+ return YidingConfigFromJSONTyped(json, false);
57
+ }
58
+ function YidingConfigFromJSONTyped(json, ignoreDiscriminator) {
59
+ if (json == null) {
60
+ return json;
61
+ }
62
+ return {
63
+ 'username': json['username'],
64
+ 'businessId': json['business_id'],
65
+ 'startDate': (new Date(json['start_date'])),
66
+ 'cron': json['cron'],
67
+ 'baseUrl': json['base_url'] == null ? undefined : json['base_url'],
68
+ 'password': json['password'],
69
+ };
70
+ }
71
+ function YidingConfigToJSON(json) {
72
+ return YidingConfigToJSONTyped(json, false);
73
+ }
74
+ function YidingConfigToJSONTyped(value, ignoreDiscriminator = false) {
75
+ if (value == null) {
76
+ return value;
77
+ }
78
+ return {
79
+ 'username': value['username'],
80
+ 'business_id': value['businessId'],
81
+ 'start_date': value['startDate'].toISOString().substring(0, 10),
82
+ 'cron': value['cron'],
83
+ 'base_url': value['baseUrl'],
84
+ 'password': value['password'],
85
+ };
86
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * How far a crawl has read; a missing mark means "never", not "day zero".
14
+ * @export
15
+ * @interface YidingCursor
16
+ */
17
+ export interface YidingCursor {
18
+ /**
19
+ * Seating time of the last order read
20
+ * @type {Date}
21
+ * @memberof YidingCursor
22
+ */
23
+ lastSyncedOrderTs?: Date | null;
24
+ /**
25
+ * When the customer list was last refreshed
26
+ * @type {Date}
27
+ * @memberof YidingCursor
28
+ */
29
+ lastSyncedUserTs?: Date | null;
30
+ }
31
+ export declare const YidingCursorPropertyValidationAttributesMap: {
32
+ [property: string]: {
33
+ maxLength?: number;
34
+ minLength?: number;
35
+ pattern?: string;
36
+ maximum?: number;
37
+ exclusiveMaximum?: boolean;
38
+ minimum?: number;
39
+ exclusiveMinimum?: boolean;
40
+ multipleOf?: number;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ };
45
+ };
46
+ /**
47
+ * Check if a given object implements the YidingCursor interface.
48
+ */
49
+ export declare function instanceOfYidingCursor(value: object): value is YidingCursor;
50
+ export declare function YidingCursorFromJSON(json: any): YidingCursor;
51
+ export declare function YidingCursorFromJSONTyped(json: any, ignoreDiscriminator: boolean): YidingCursor;
52
+ export declare function YidingCursorToJSON(json: any): YidingCursor;
53
+ export declare function YidingCursorToJSONTyped(value?: YidingCursor | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.YidingCursorPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfYidingCursor = instanceOfYidingCursor;
18
+ exports.YidingCursorFromJSON = YidingCursorFromJSON;
19
+ exports.YidingCursorFromJSONTyped = YidingCursorFromJSONTyped;
20
+ exports.YidingCursorToJSON = YidingCursorToJSON;
21
+ exports.YidingCursorToJSONTyped = YidingCursorToJSONTyped;
22
+ exports.YidingCursorPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the YidingCursor interface.
25
+ */
26
+ function instanceOfYidingCursor(value) {
27
+ return true;
28
+ }
29
+ function YidingCursorFromJSON(json) {
30
+ return YidingCursorFromJSONTyped(json, false);
31
+ }
32
+ function YidingCursorFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'lastSyncedOrderTs': json['last_synced_order_ts'] == null ? undefined : (new Date(json['last_synced_order_ts'])),
38
+ 'lastSyncedUserTs': json['last_synced_user_ts'] == null ? undefined : (new Date(json['last_synced_user_ts'])),
39
+ };
40
+ }
41
+ function YidingCursorToJSON(json) {
42
+ return YidingCursorToJSONTyped(json, false);
43
+ }
44
+ function YidingCursorToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'last_synced_order_ts': value['lastSyncedOrderTs'] == null ? value['lastSyncedOrderTs'] : value['lastSyncedOrderTs'].toISOString(),
50
+ 'last_synced_user_ts': value['lastSyncedUserTs'] == null ? value['lastSyncedUserTs'] : value['lastSyncedUserTs'].toISOString(),
51
+ };
52
+ }
@@ -66,6 +66,7 @@ export * from './ColumnReference';
66
66
  export * from './CommonFileExclusionReason';
67
67
  export * from './CompleteUploadRequest';
68
68
  export * from './ConnectionConfig';
69
+ export * from './ConnectionSummary';
69
70
  export * from './ContentsSortOrder';
70
71
  export * from './CreateApiConnectionRequest';
71
72
  export * from './CreateApiKeyRequest';
@@ -289,6 +290,8 @@ export * from './SkillResponse';
289
290
  export * from './SkillSearchResult';
290
291
  export * from './SkillVersionResponse';
291
292
  export * from './SortDirection';
293
+ export * from './SourceConfigSummary';
294
+ export * from './SourceType';
292
295
  export * from './StartWorkflowRunRequest';
293
296
  export * from './Step';
294
297
  export * from './StepKind';
@@ -391,6 +394,8 @@ export * from './XlsxCellAnchorInput';
391
394
  export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
392
395
  export * from './XlsxCellAnchorOutput';
393
396
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
397
+ export * from './YidingConfig';
398
+ export * from './YidingCursor';
394
399
  export * from './ZipFileResult';
395
400
  export * from './ZipIngestionStatusResponse';
396
401
  export * from './ZipMemberStatusResponse';
@@ -84,6 +84,7 @@ __exportStar(require("./ColumnReference"), exports);
84
84
  __exportStar(require("./CommonFileExclusionReason"), exports);
85
85
  __exportStar(require("./CompleteUploadRequest"), exports);
86
86
  __exportStar(require("./ConnectionConfig"), exports);
87
+ __exportStar(require("./ConnectionSummary"), exports);
87
88
  __exportStar(require("./ContentsSortOrder"), exports);
88
89
  __exportStar(require("./CreateApiConnectionRequest"), exports);
89
90
  __exportStar(require("./CreateApiKeyRequest"), exports);
@@ -307,6 +308,8 @@ __exportStar(require("./SkillResponse"), exports);
307
308
  __exportStar(require("./SkillSearchResult"), exports);
308
309
  __exportStar(require("./SkillVersionResponse"), exports);
309
310
  __exportStar(require("./SortDirection"), exports);
311
+ __exportStar(require("./SourceConfigSummary"), exports);
312
+ __exportStar(require("./SourceType"), exports);
310
313
  __exportStar(require("./StartWorkflowRunRequest"), exports);
311
314
  __exportStar(require("./Step"), exports);
312
315
  __exportStar(require("./StepKind"), exports);
@@ -409,6 +412,8 @@ __exportStar(require("./XlsxCellAnchorInput"), exports);
409
412
  __exportStar(require("./XlsxCellAnchorInputOrDocxParagraphAnchorInput"), exports);
410
413
  __exportStar(require("./XlsxCellAnchorOutput"), exports);
411
414
  __exportStar(require("./XlsxCellAnchorOutputOrDocxParagraphAnchorOutput"), exports);
415
+ __exportStar(require("./YidingConfig"), exports);
416
+ __exportStar(require("./YidingCursor"), exports);
412
417
  __exportStar(require("./ZipFileResult"), exports);
413
418
  __exportStar(require("./ZipIngestionStatusResponse"), exports);
414
419
  __exportStar(require("./ZipMemberStatusResponse"), exports);
@@ -0,0 +1,41 @@
1
+
2
+ # ConnectionSummary
3
+
4
+ Where a connector points, with the password left out.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `host` | string
11
+ `port` | number
12
+ `database` | string
13
+ `username` | string
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { ConnectionSummary } from '@knowledge-stack/ksapi'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "host": null,
23
+ "port": null,
24
+ "database": null,
25
+ "username": null,
26
+ } satisfies ConnectionSummary
27
+
28
+ console.log(example)
29
+
30
+ // Convert the instance to a JSON string
31
+ const exampleJSON: string = JSON.stringify(example)
32
+ console.log(exampleJSON)
33
+
34
+ // Parse the JSON string back to an object
35
+ const exampleParsed = JSON.parse(exampleJSON) as ConnectionSummary
36
+ console.log(exampleParsed)
37
+ ```
38
+
39
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
40
+
41
+
@@ -9,8 +9,10 @@ Name | Type
9
9
  ------------ | -------------
10
10
  `name` | string
11
11
  `parentPathPartId` | string
12
+ `sourceType` | [SourceType](SourceType.md)
12
13
  `engine` | [DataSourceEngine](DataSourceEngine.md)
13
14
  `connectionConfig` | [ConnectionConfig](ConnectionConfig.md)
15
+ `sourceConfig` | [YidingConfig](YidingConfig.md)
14
16
 
15
17
  ## Example
16
18
 
@@ -21,8 +23,10 @@ import type { CreateDataSourceRequest } from '@knowledge-stack/ksapi'
21
23
  const example = {
22
24
  "name": null,
23
25
  "parentPathPartId": null,
26
+ "sourceType": null,
24
27
  "engine": null,
25
28
  "connectionConfig": null,
29
+ "sourceConfig": null,
26
30
  } satisfies CreateDataSourceRequest
27
31
 
28
32
  console.log(example)
@@ -1,7 +1,7 @@
1
1
 
2
2
  # DataSourceResponse
3
3
 
4
- Connector response; a discriminated-union variant for folder listings. The ``connection_config`` (host/port/credentials) is intentionally omitted — the password is write-only and never serialized back.
4
+ Connector response; a discriminated-union variant for folder listings. The stored ``connection_config`` is never returned whole: the password is write-only and never serialized back. What it points at travels in ``connection_summary`` instead, which a YIDINGSYNC connector needs — the server generated those credentials, so this is the only place its owner ever sees which database the sync built.
5
5
 
6
6
  ## Properties
7
7
 
@@ -15,6 +15,9 @@ Name | Type
15
15
  `tenantId` | string
16
16
  `name` | string
17
17
  `engine` | [DataSourceEngine](DataSourceEngine.md)
18
+ `sourceType` | [SourceType](SourceType.md)
19
+ `connectionSummary` | [ConnectionSummary](ConnectionSummary.md)
20
+ `sourceConfig` | [SourceConfigSummary](SourceConfigSummary.md)
18
21
  `approvalState` | [PathPartApprovalState](PathPartApprovalState.md)
19
22
  `owner` | [UserInfo](UserInfo.md)
20
23
  `permissions` | [ItemPermissions](ItemPermissions.md)
@@ -36,6 +39,9 @@ const example = {
36
39
  "tenantId": null,
37
40
  "name": null,
38
41
  "engine": null,
42
+ "sourceType": null,
43
+ "connectionSummary": null,
44
+ "sourceConfig": null,
39
45
  "approvalState": null,
40
46
  "owner": null,
41
47
  "permissions": null,
@@ -105,7 +105,7 @@ example().catch(console.error);
105
105
 
106
106
  Delete Data Source Handler
107
107
 
108
- 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\&#39;s summary Qdrant point carries that table\&#39;s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\&#39;s table search (best-effort, mirrors the document delete path).
108
+ 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\&#39;s summary Qdrant point carries that table\&#39;s path_part, so the set-trashed workflow flips it to trashed too — keeping trashed tables out of the agent\&#39;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, &#x60;&#x60;delete_connector_schedule&#x60;&#x60; 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.
109
109
 
110
110
  ### Example
111
111
 
@@ -948,7 +948,7 @@ example().catch(console.error);
948
948
 
949
949
  Sync Data Source Handler
950
950
 
951
- Reconcile modeled tables against the live external catalog. Requires &#x60;&#x60;can_write&#x60;&#x60;. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes &#x60;&#x60;column_config&#x60;&#x60; (preserving the admin\&#39;s &#x60;&#x60;exposed&#x60;&#x60;/&#x60;&#x60;comment&#x60;&#x60; 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 \&quot;was modeled, now gone\&quot; record) and its embedding purged. It never models tables that were not imported.
951
+ Reconcile modeled tables against the live external catalog. Requires &#x60;&#x60;can_write&#x60;&#x60;. Re-introspects each modeled schema and, per table: a schema change (columns added/removed/retyped) refreshes &#x60;&#x60;column_config&#x60;&#x60; (preserving the admin\&#39;s &#x60;&#x60;exposed&#x60;&#x60;/&#x60;&#x60;comment&#x60;&#x60; 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 \&quot;was modeled, now gone\&quot; 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.
952
952
 
953
953
  ### Example
954
954
 
@@ -1011,6 +1011,7 @@ example().catch(console.error);
1011
1011
  | Status code | Description | Response headers |
1012
1012
  |-------------|-------------|------------------|
1013
1013
  | **200** | Successful Response | - |
1014
+ | **202** | Crawl accepted; it runs in the background | - |
1014
1015
  | **422** | Validation Error | - |
1015
1016
  | **0** | Error response. | - |
1016
1017
 
@@ -1173,7 +1174,7 @@ example().catch(console.error);
1173
1174
 
1174
1175
  Update Data Source Handler
1175
1176
 
1176
- Rename, move, and/or re-credential a connector. Requires &#x60;&#x60;can_write&#x60;&#x60; on the connector (and on the destination folder for a move); supplying &#x60;&#x60;connection_config&#x60;&#x60; additionally requires OWNER/ADMIN. Fresh &#x60;&#x60;connection_config&#x60;&#x60; is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. &#x60;&#x60;engine&#x60;&#x60; is immutable.
1177
+ Rename, move, and/or re-credential a connector. Requires &#x60;&#x60;can_write&#x60;&#x60; on the connector (and on the destination folder for a move); supplying &#x60;&#x60;connection_config&#x60;&#x60; additionally requires OWNER/ADMIN. Fresh &#x60;&#x60;connection_config&#x60;&#x60; is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. &#x60;&#x60;engine&#x60;&#x60; is immutable. A fresh &#x60;&#x60;source_config&#x60;&#x60; re-arms the crawl schedule, so changing &#x60;&#x60;cron&#x60;&#x60; takes effect immediately rather than at the next provisioning.
1177
1178
 
1178
1179
  ### Example
1179
1180
 
@@ -56,6 +56,9 @@ Name | Type
56
56
  `excludedCommonFiles` | [Array&lt;ExcludedCommonFile&gt;](ExcludedCommonFile.md)
57
57
  `runThreadId` | string
58
58
  `engine` | [DataSourceEngine](DataSourceEngine.md)
59
+ `sourceType` | [SourceType](SourceType.md)
60
+ `connectionSummary` | [ConnectionSummary](ConnectionSummary.md)
61
+ `sourceConfig` | [SourceConfigSummary](SourceConfigSummary.md)
59
62
  `dataSourceId` | string
60
63
  `schemaName` | string
61
64
  `isDefault` | boolean
@@ -131,6 +134,9 @@ const example = {
131
134
  "excludedCommonFiles": null,
132
135
  "runThreadId": null,
133
136
  "engine": null,
137
+ "sourceType": null,
138
+ "connectionSummary": null,
139
+ "sourceConfig": null,
134
140
  "dataSourceId": null,
135
141
  "schemaName": null,
136
142
  "isDefault": null,
@@ -0,0 +1,43 @@
1
+
2
+ # SourceConfigSummary
3
+
4
+ A YIDINGSYNC connector\'s stored config, with the password left out.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `username` | string
11
+ `businessId` | string
12
+ `startDate` | Date
13
+ `cron` | string
14
+ `baseUrl` | string
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { SourceConfigSummary } from '@knowledge-stack/ksapi'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "username": null,
24
+ "businessId": null,
25
+ "startDate": null,
26
+ "cron": null,
27
+ "baseUrl": null,
28
+ } satisfies SourceConfigSummary
29
+
30
+ console.log(example)
31
+
32
+ // Convert the instance to a JSON string
33
+ const exampleJSON: string = JSON.stringify(example)
34
+ console.log(exampleJSON)
35
+
36
+ // Parse the JSON string back to an object
37
+ const exampleParsed = JSON.parse(exampleJSON) as SourceConfigSummary
38
+ console.log(exampleParsed)
39
+ ```
40
+
41
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
42
+
43
+