@knowledge-stack/ksapi 3.2.1 → 3.3.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 (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,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,44 @@
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
+ export const YidingCursorPropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the YidingCursor interface.
17
+ */
18
+ export function instanceOfYidingCursor(value) {
19
+ return true;
20
+ }
21
+ export function YidingCursorFromJSON(json) {
22
+ return YidingCursorFromJSONTyped(json, false);
23
+ }
24
+ export function YidingCursorFromJSONTyped(json, ignoreDiscriminator) {
25
+ if (json == null) {
26
+ return json;
27
+ }
28
+ return {
29
+ 'lastSyncedOrderTs': json['last_synced_order_ts'] == null ? undefined : (new Date(json['last_synced_order_ts'])),
30
+ 'lastSyncedUserTs': json['last_synced_user_ts'] == null ? undefined : (new Date(json['last_synced_user_ts'])),
31
+ };
32
+ }
33
+ export function YidingCursorToJSON(json) {
34
+ return YidingCursorToJSONTyped(json, false);
35
+ }
36
+ export function YidingCursorToJSONTyped(value, ignoreDiscriminator = false) {
37
+ if (value == null) {
38
+ return value;
39
+ }
40
+ return {
41
+ 'last_synced_order_ts': value['lastSyncedOrderTs'] == null ? value['lastSyncedOrderTs'] : value['lastSyncedOrderTs'].toISOString(),
42
+ 'last_synced_user_ts': value['lastSyncedUserTs'] == null ? value['lastSyncedUserTs'] : value['lastSyncedUserTs'].toISOString(),
43
+ };
44
+ }
@@ -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';
@@ -68,6 +68,7 @@ export * from './ColumnReference';
68
68
  export * from './CommonFileExclusionReason';
69
69
  export * from './CompleteUploadRequest';
70
70
  export * from './ConnectionConfig';
71
+ export * from './ConnectionSummary';
71
72
  export * from './ContentsSortOrder';
72
73
  export * from './CreateApiConnectionRequest';
73
74
  export * from './CreateApiKeyRequest';
@@ -291,6 +292,8 @@ export * from './SkillResponse';
291
292
  export * from './SkillSearchResult';
292
293
  export * from './SkillVersionResponse';
293
294
  export * from './SortDirection';
295
+ export * from './SourceConfigSummary';
296
+ export * from './SourceType';
294
297
  export * from './StartWorkflowRunRequest';
295
298
  export * from './Step';
296
299
  export * from './StepKind';
@@ -393,6 +396,8 @@ export * from './XlsxCellAnchorInput';
393
396
  export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
394
397
  export * from './XlsxCellAnchorOutput';
395
398
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
399
+ export * from './YidingConfig';
400
+ export * from './YidingCursor';
396
401
  export * from './ZipFileResult';
397
402
  export * from './ZipIngestionStatusResponse';
398
403
  export * from './ZipMemberStatusResponse';
@@ -0,0 +1,65 @@
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
+ * Where a connector points, with the password left out.
14
+ * @export
15
+ * @interface ConnectionSummary
16
+ */
17
+ export interface ConnectionSummary {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ConnectionSummary
22
+ */
23
+ host: string;
24
+ /**
25
+ *
26
+ * @type {number}
27
+ * @memberof ConnectionSummary
28
+ */
29
+ port?: number | null;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ConnectionSummary
34
+ */
35
+ database: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ConnectionSummary
40
+ */
41
+ username: string;
42
+ }
43
+ export declare const ConnectionSummaryPropertyValidationAttributesMap: {
44
+ [property: string]: {
45
+ maxLength?: number;
46
+ minLength?: number;
47
+ pattern?: string;
48
+ maximum?: number;
49
+ exclusiveMaximum?: boolean;
50
+ minimum?: number;
51
+ exclusiveMinimum?: boolean;
52
+ multipleOf?: number;
53
+ maxItems?: number;
54
+ minItems?: number;
55
+ uniqueItems?: boolean;
56
+ };
57
+ };
58
+ /**
59
+ * Check if a given object implements the ConnectionSummary interface.
60
+ */
61
+ export declare function instanceOfConnectionSummary(value: object): value is ConnectionSummary;
62
+ export declare function ConnectionSummaryFromJSON(json: any): ConnectionSummary;
63
+ export declare function ConnectionSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionSummary;
64
+ export declare function ConnectionSummaryToJSON(json: any): ConnectionSummary;
65
+ export declare function ConnectionSummaryToJSONTyped(value?: ConnectionSummary | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
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.ConnectionSummaryPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfConnectionSummary = instanceOfConnectionSummary;
18
+ exports.ConnectionSummaryFromJSON = ConnectionSummaryFromJSON;
19
+ exports.ConnectionSummaryFromJSONTyped = ConnectionSummaryFromJSONTyped;
20
+ exports.ConnectionSummaryToJSON = ConnectionSummaryToJSON;
21
+ exports.ConnectionSummaryToJSONTyped = ConnectionSummaryToJSONTyped;
22
+ exports.ConnectionSummaryPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the ConnectionSummary interface.
25
+ */
26
+ function instanceOfConnectionSummary(value) {
27
+ if (!('host' in value) || value['host'] === undefined)
28
+ return false;
29
+ if (!('database' in value) || value['database'] === undefined)
30
+ return false;
31
+ if (!('username' in value) || value['username'] === undefined)
32
+ return false;
33
+ return true;
34
+ }
35
+ function ConnectionSummaryFromJSON(json) {
36
+ return ConnectionSummaryFromJSONTyped(json, false);
37
+ }
38
+ function ConnectionSummaryFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'host': json['host'],
44
+ 'port': json['port'] == null ? undefined : json['port'],
45
+ 'database': json['database'],
46
+ 'username': json['username'],
47
+ };
48
+ }
49
+ function ConnectionSummaryToJSON(json) {
50
+ return ConnectionSummaryToJSONTyped(json, false);
51
+ }
52
+ function ConnectionSummaryToJSONTyped(value, ignoreDiscriminator = false) {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+ 'host': value['host'],
58
+ 'port': value['port'],
59
+ 'database': value['database'],
60
+ 'username': value['username'],
61
+ };
62
+ }
@@ -9,6 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { SourceType } from './SourceType';
13
+ import type { YidingConfig } from './YidingConfig';
12
14
  import type { ConnectionConfig } from './ConnectionConfig';
13
15
  import type { DataSourceEngine } from './DataSourceEngine';
14
16
  /**
@@ -29,18 +31,30 @@ export interface CreateDataSourceRequest {
29
31
  * @memberof CreateDataSourceRequest
30
32
  */
31
33
  parentPathPartId: string;
34
+ /**
35
+ *
36
+ * @type {SourceType}
37
+ * @memberof CreateDataSourceRequest
38
+ */
39
+ sourceType?: SourceType;
32
40
  /**
33
41
  *
34
42
  * @type {DataSourceEngine}
35
43
  * @memberof CreateDataSourceRequest
36
44
  */
37
- engine: DataSourceEngine;
45
+ engine?: DataSourceEngine;
38
46
  /**
39
47
  *
40
48
  * @type {ConnectionConfig}
41
49
  * @memberof CreateDataSourceRequest
42
50
  */
43
- connectionConfig: ConnectionConfig;
51
+ connectionConfig?: ConnectionConfig | null;
52
+ /**
53
+ *
54
+ * @type {YidingConfig}
55
+ * @memberof CreateDataSourceRequest
56
+ */
57
+ sourceConfig?: YidingConfig | null;
44
58
  }
45
59
  export declare const CreateDataSourceRequestPropertyValidationAttributesMap: {
46
60
  [property: string]: {
@@ -19,6 +19,8 @@ exports.CreateDataSourceRequestFromJSON = CreateDataSourceRequestFromJSON;
19
19
  exports.CreateDataSourceRequestFromJSONTyped = CreateDataSourceRequestFromJSONTyped;
20
20
  exports.CreateDataSourceRequestToJSON = CreateDataSourceRequestToJSON;
21
21
  exports.CreateDataSourceRequestToJSONTyped = CreateDataSourceRequestToJSONTyped;
22
+ const SourceType_1 = require("./SourceType");
23
+ const YidingConfig_1 = require("./YidingConfig");
22
24
  const ConnectionConfig_1 = require("./ConnectionConfig");
23
25
  const DataSourceEngine_1 = require("./DataSourceEngine");
24
26
  exports.CreateDataSourceRequestPropertyValidationAttributesMap = {
@@ -34,10 +36,6 @@ function instanceOfCreateDataSourceRequest(value) {
34
36
  return false;
35
37
  if (!('parentPathPartId' in value) || value['parentPathPartId'] === undefined)
36
38
  return false;
37
- if (!('engine' in value) || value['engine'] === undefined)
38
- return false;
39
- if (!('connectionConfig' in value) || value['connectionConfig'] === undefined)
40
- return false;
41
39
  return true;
42
40
  }
43
41
  function CreateDataSourceRequestFromJSON(json) {
@@ -50,8 +48,10 @@ function CreateDataSourceRequestFromJSONTyped(json, ignoreDiscriminator) {
50
48
  return {
51
49
  'name': json['name'],
52
50
  'parentPathPartId': json['parent_path_part_id'],
53
- 'engine': (0, DataSourceEngine_1.DataSourceEngineFromJSON)(json['engine']),
54
- 'connectionConfig': (0, ConnectionConfig_1.ConnectionConfigFromJSON)(json['connection_config']),
51
+ 'sourceType': json['source_type'] == null ? undefined : (0, SourceType_1.SourceTypeFromJSON)(json['source_type']),
52
+ 'engine': json['engine'] == null ? undefined : (0, DataSourceEngine_1.DataSourceEngineFromJSON)(json['engine']),
53
+ 'connectionConfig': json['connection_config'] == null ? undefined : (0, ConnectionConfig_1.ConnectionConfigFromJSON)(json['connection_config']),
54
+ 'sourceConfig': json['source_config'] == null ? undefined : (0, YidingConfig_1.YidingConfigFromJSON)(json['source_config']),
55
55
  };
56
56
  }
57
57
  function CreateDataSourceRequestToJSON(json) {
@@ -64,7 +64,9 @@ function CreateDataSourceRequestToJSONTyped(value, ignoreDiscriminator = false)
64
64
  return {
65
65
  'name': value['name'],
66
66
  'parent_path_part_id': value['parentPathPartId'],
67
+ 'source_type': (0, SourceType_1.SourceTypeToJSON)(value['sourceType']),
67
68
  'engine': (0, DataSourceEngine_1.DataSourceEngineToJSON)(value['engine']),
68
69
  'connection_config': (0, ConnectionConfig_1.ConnectionConfigToJSON)(value['connectionConfig']),
70
+ 'source_config': (0, YidingConfig_1.YidingConfigToJSON)(value['sourceConfig']),
69
71
  };
70
72
  }
@@ -9,15 +9,21 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { ConnectionSummary } from './ConnectionSummary';
12
13
  import type { ItemPermissions } from './ItemPermissions';
14
+ import type { SourceType } from './SourceType';
13
15
  import type { PathPartApprovalState } from './PathPartApprovalState';
16
+ import type { SourceConfigSummary } from './SourceConfigSummary';
14
17
  import type { UserInfo } from './UserInfo';
15
18
  import type { DataSourceEngine } from './DataSourceEngine';
16
19
  /**
17
20
  * Connector response; a discriminated-union variant for folder listings.
18
21
  *
19
- * The ``connection_config`` (host/port/credentials) is intentionally
20
- * omitted — the password is write-only and never serialized back.
22
+ * The stored ``connection_config`` is never returned whole: the password is
23
+ * write-only and never serialized back. What it points at travels in
24
+ * ``connection_summary`` instead, which a YIDINGSYNC connector needs — the
25
+ * server generated those credentials, so this is the only place its owner ever
26
+ * sees which database the sync built.
21
27
  * @export
22
28
  * @interface DataSourceResponse
23
29
  */
@@ -70,6 +76,24 @@ export interface DataSourceResponse {
70
76
  * @memberof DataSourceResponse
71
77
  */
72
78
  engine: DataSourceEngine;
79
+ /**
80
+ *
81
+ * @type {SourceType}
82
+ * @memberof DataSourceResponse
83
+ */
84
+ sourceType: SourceType;
85
+ /**
86
+ * 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.
87
+ * @type {ConnectionSummary}
88
+ * @memberof DataSourceResponse
89
+ */
90
+ connectionSummary?: ConnectionSummary | null;
91
+ /**
92
+ * A YIDINGSYNC connector's crawler config without the password: which shop, from when, and the crawl recurrence. Null on DIRECT.
93
+ * @type {SourceConfigSummary}
94
+ * @memberof DataSourceResponse
95
+ */
96
+ sourceConfig?: SourceConfigSummary | null;
73
97
  /**
74
98
  *
75
99
  * @type {PathPartApprovalState}
@@ -19,8 +19,11 @@ exports.DataSourceResponseFromJSON = DataSourceResponseFromJSON;
19
19
  exports.DataSourceResponseFromJSONTyped = DataSourceResponseFromJSONTyped;
20
20
  exports.DataSourceResponseToJSON = DataSourceResponseToJSON;
21
21
  exports.DataSourceResponseToJSONTyped = DataSourceResponseToJSONTyped;
22
+ const ConnectionSummary_1 = require("./ConnectionSummary");
22
23
  const ItemPermissions_1 = require("./ItemPermissions");
24
+ const SourceType_1 = require("./SourceType");
23
25
  const PathPartApprovalState_1 = require("./PathPartApprovalState");
26
+ const SourceConfigSummary_1 = require("./SourceConfigSummary");
24
27
  const UserInfo_1 = require("./UserInfo");
25
28
  const DataSourceEngine_1 = require("./DataSourceEngine");
26
29
  /**
@@ -48,6 +51,8 @@ function instanceOfDataSourceResponse(value) {
48
51
  return false;
49
52
  if (!('engine' in value) || value['engine'] === undefined)
50
53
  return false;
54
+ if (!('sourceType' in value) || value['sourceType'] === undefined)
55
+ return false;
51
56
  if (!('approvalState' in value) || value['approvalState'] === undefined)
52
57
  return false;
53
58
  if (!('permissions' in value) || value['permissions'] === undefined)
@@ -74,6 +79,9 @@ function DataSourceResponseFromJSONTyped(json, ignoreDiscriminator) {
74
79
  'tenantId': json['tenant_id'],
75
80
  'name': json['name'],
76
81
  'engine': (0, DataSourceEngine_1.DataSourceEngineFromJSON)(json['engine']),
82
+ 'sourceType': (0, SourceType_1.SourceTypeFromJSON)(json['source_type']),
83
+ 'connectionSummary': json['connection_summary'] == null ? undefined : (0, ConnectionSummary_1.ConnectionSummaryFromJSON)(json['connection_summary']),
84
+ 'sourceConfig': json['source_config'] == null ? undefined : (0, SourceConfigSummary_1.SourceConfigSummaryFromJSON)(json['source_config']),
77
85
  'approvalState': (0, PathPartApprovalState_1.PathPartApprovalStateFromJSON)(json['approval_state']),
78
86
  'owner': json['owner'] == null ? undefined : (0, UserInfo_1.UserInfoFromJSON)(json['owner']),
79
87
  'permissions': (0, ItemPermissions_1.ItemPermissionsFromJSON)(json['permissions']),
@@ -97,6 +105,9 @@ function DataSourceResponseToJSONTyped(value, ignoreDiscriminator = false) {
97
105
  'tenant_id': value['tenantId'],
98
106
  'name': value['name'],
99
107
  'engine': (0, DataSourceEngine_1.DataSourceEngineToJSON)(value['engine']),
108
+ 'source_type': (0, SourceType_1.SourceTypeToJSON)(value['sourceType']),
109
+ 'connection_summary': (0, ConnectionSummary_1.ConnectionSummaryToJSON)(value['connectionSummary']),
110
+ 'source_config': (0, SourceConfigSummary_1.SourceConfigSummaryToJSON)(value['sourceConfig']),
100
111
  'approval_state': (0, PathPartApprovalState_1.PathPartApprovalStateToJSON)(value['approvalState']),
101
112
  'owner': (0, UserInfo_1.UserInfoToJSON)(value['owner']),
102
113
  'permissions': (0, ItemPermissions_1.ItemPermissionsToJSON)(value['permissions']),
@@ -0,0 +1,71 @@
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
+ * A YIDINGSYNC connector's stored config, with the password left out.
14
+ * @export
15
+ * @interface SourceConfigSummary
16
+ */
17
+ export interface SourceConfigSummary {
18
+ /**
19
+ * The account the crawler signs in to the panel as
20
+ * @type {string}
21
+ * @memberof SourceConfigSummary
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 SourceConfigSummary
28
+ */
29
+ businessId: string;
30
+ /**
31
+ * First dining day to sync; earlier orders are not fetched
32
+ * @type {Date}
33
+ * @memberof SourceConfigSummary
34
+ */
35
+ startDate: Date;
36
+ /**
37
+ * Crawl recurrence, in the tenant's timezone
38
+ * @type {string}
39
+ * @memberof SourceConfigSummary
40
+ */
41
+ cron: string;
42
+ /**
43
+ * Root of the YiDing admin panel the crawler signs in to
44
+ * @type {string}
45
+ * @memberof SourceConfigSummary
46
+ */
47
+ baseUrl?: string;
48
+ }
49
+ export declare const SourceConfigSummaryPropertyValidationAttributesMap: {
50
+ [property: string]: {
51
+ maxLength?: number;
52
+ minLength?: number;
53
+ pattern?: string;
54
+ maximum?: number;
55
+ exclusiveMaximum?: boolean;
56
+ minimum?: number;
57
+ exclusiveMinimum?: boolean;
58
+ multipleOf?: number;
59
+ maxItems?: number;
60
+ minItems?: number;
61
+ uniqueItems?: boolean;
62
+ };
63
+ };
64
+ /**
65
+ * Check if a given object implements the SourceConfigSummary interface.
66
+ */
67
+ export declare function instanceOfSourceConfigSummary(value: object): value is SourceConfigSummary;
68
+ export declare function SourceConfigSummaryFromJSON(json: any): SourceConfigSummary;
69
+ export declare function SourceConfigSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceConfigSummary;
70
+ export declare function SourceConfigSummaryToJSON(json: any): SourceConfigSummary;
71
+ export declare function SourceConfigSummaryToJSONTyped(value?: SourceConfigSummary | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,79 @@
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.SourceConfigSummaryPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfSourceConfigSummary = instanceOfSourceConfigSummary;
18
+ exports.SourceConfigSummaryFromJSON = SourceConfigSummaryFromJSON;
19
+ exports.SourceConfigSummaryFromJSONTyped = SourceConfigSummaryFromJSONTyped;
20
+ exports.SourceConfigSummaryToJSON = SourceConfigSummaryToJSON;
21
+ exports.SourceConfigSummaryToJSONTyped = SourceConfigSummaryToJSONTyped;
22
+ exports.SourceConfigSummaryPropertyValidationAttributesMap = {
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
+ };
36
+ /**
37
+ * Check if a given object implements the SourceConfigSummary interface.
38
+ */
39
+ function instanceOfSourceConfigSummary(value) {
40
+ if (!('username' in value) || value['username'] === undefined)
41
+ return false;
42
+ if (!('businessId' in value) || value['businessId'] === undefined)
43
+ return false;
44
+ if (!('startDate' in value) || value['startDate'] === undefined)
45
+ return false;
46
+ if (!('cron' in value) || value['cron'] === undefined)
47
+ return false;
48
+ return true;
49
+ }
50
+ function SourceConfigSummaryFromJSON(json) {
51
+ return SourceConfigSummaryFromJSONTyped(json, false);
52
+ }
53
+ function SourceConfigSummaryFromJSONTyped(json, ignoreDiscriminator) {
54
+ if (json == null) {
55
+ return json;
56
+ }
57
+ return {
58
+ 'username': json['username'],
59
+ 'businessId': json['business_id'],
60
+ 'startDate': (new Date(json['start_date'])),
61
+ 'cron': json['cron'],
62
+ 'baseUrl': json['base_url'] == null ? undefined : json['base_url'],
63
+ };
64
+ }
65
+ function SourceConfigSummaryToJSON(json) {
66
+ return SourceConfigSummaryToJSONTyped(json, false);
67
+ }
68
+ function SourceConfigSummaryToJSONTyped(value, ignoreDiscriminator = false) {
69
+ if (value == null) {
70
+ return value;
71
+ }
72
+ return {
73
+ 'username': value['username'],
74
+ 'business_id': value['businessId'],
75
+ 'start_date': value['startDate'].toISOString().substring(0, 10),
76
+ 'cron': value['cron'],
77
+ 'base_url': value['baseUrl'],
78
+ };
79
+ }
@@ -0,0 +1,25 @@
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
+ * Extra connector config for data sync model direct connect or automatic login/copy method.
14
+ * @export
15
+ */
16
+ export declare const SourceType: {
17
+ readonly Direct: 'DIRECT';
18
+ readonly Yidingsync: 'YIDINGSYNC';
19
+ };
20
+ export type SourceType = typeof SourceType[keyof typeof SourceType];
21
+ export declare function instanceOfSourceType(value: any): boolean;
22
+ export declare function SourceTypeFromJSON(json: any): SourceType;
23
+ export declare function SourceTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceType;
24
+ export declare function SourceTypeToJSON(value?: SourceType | null): any;
25
+ export declare function SourceTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SourceType;