@knowledge-stack/ksapi 1.139.0 → 1.140.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 (110) hide show
  1. package/.openapi-generator/FILES +28 -0
  2. package/README.md +25 -11
  3. package/dist/apis/AdminKbApi.d.ts +109 -0
  4. package/dist/apis/AdminKbApi.js +172 -0
  5. package/dist/apis/AdminWorkflowsApi.d.ts +252 -0
  6. package/dist/apis/AdminWorkflowsApi.js +337 -0
  7. package/dist/apis/SkillsApi.d.ts +4 -4
  8. package/dist/apis/SkillsApi.js +2 -2
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +2 -0
  11. package/dist/esm/apis/AdminKbApi.d.ts +109 -0
  12. package/dist/esm/apis/AdminKbApi.js +135 -0
  13. package/dist/esm/apis/AdminWorkflowsApi.d.ts +252 -0
  14. package/dist/esm/apis/AdminWorkflowsApi.js +300 -0
  15. package/dist/esm/apis/SkillsApi.d.ts +4 -4
  16. package/dist/esm/apis/SkillsApi.js +2 -2
  17. package/dist/esm/apis/index.d.ts +2 -0
  18. package/dist/esm/apis/index.js +2 -0
  19. package/dist/esm/models/DefinitionOutputStat.d.ts +65 -0
  20. package/dist/esm/models/DefinitionOutputStat.js +56 -0
  21. package/dist/esm/models/HourHistogramResponse.d.ts +53 -0
  22. package/dist/esm/models/HourHistogramResponse.js +54 -0
  23. package/dist/esm/models/KbMetric.d.ts +26 -0
  24. package/dist/esm/models/KbMetric.js +44 -0
  25. package/dist/esm/models/KbSummaryResponse.d.ts +152 -0
  26. package/dist/esm/models/KbSummaryResponse.js +109 -0
  27. package/dist/esm/models/KbTimeseriesResponse.d.ts +71 -0
  28. package/dist/esm/models/KbTimeseriesResponse.js +57 -0
  29. package/dist/esm/models/LabeledSeries.d.ts +54 -0
  30. package/dist/esm/models/LabeledSeries.js +47 -0
  31. package/dist/esm/models/LeaderboardEntry.d.ts +59 -0
  32. package/dist/esm/models/LeaderboardEntry.js +52 -0
  33. package/dist/esm/models/RunTimeseriesResponse.d.ts +61 -0
  34. package/dist/esm/models/RunTimeseriesResponse.js +52 -0
  35. package/dist/esm/models/SkillResponse.d.ts +7 -0
  36. package/dist/esm/models/SkillResponse.js +3 -0
  37. package/dist/esm/models/TimeBucket.d.ts +27 -0
  38. package/dist/esm/models/TimeBucket.js +45 -0
  39. package/dist/esm/models/TimeseriesPoint.d.ts +53 -0
  40. package/dist/esm/models/TimeseriesPoint.js +48 -0
  41. package/dist/esm/models/WorkflowLeaderboardResponse.d.ts +54 -0
  42. package/dist/esm/models/WorkflowLeaderboardResponse.js +45 -0
  43. package/dist/esm/models/WorkflowOutputStatsResponse.d.ts +54 -0
  44. package/dist/esm/models/WorkflowOutputStatsResponse.js +47 -0
  45. package/dist/esm/models/index.d.ts +12 -0
  46. package/dist/esm/models/index.js +12 -0
  47. package/dist/models/DefinitionOutputStat.d.ts +65 -0
  48. package/dist/models/DefinitionOutputStat.js +64 -0
  49. package/dist/models/HourHistogramResponse.d.ts +53 -0
  50. package/dist/models/HourHistogramResponse.js +62 -0
  51. package/dist/models/KbMetric.d.ts +26 -0
  52. package/dist/models/KbMetric.js +52 -0
  53. package/dist/models/KbSummaryResponse.d.ts +152 -0
  54. package/dist/models/KbSummaryResponse.js +117 -0
  55. package/dist/models/KbTimeseriesResponse.d.ts +71 -0
  56. package/dist/models/KbTimeseriesResponse.js +65 -0
  57. package/dist/models/LabeledSeries.d.ts +54 -0
  58. package/dist/models/LabeledSeries.js +55 -0
  59. package/dist/models/LeaderboardEntry.d.ts +59 -0
  60. package/dist/models/LeaderboardEntry.js +60 -0
  61. package/dist/models/RunTimeseriesResponse.d.ts +61 -0
  62. package/dist/models/RunTimeseriesResponse.js +60 -0
  63. package/dist/models/SkillResponse.d.ts +7 -0
  64. package/dist/models/SkillResponse.js +3 -0
  65. package/dist/models/TimeBucket.d.ts +27 -0
  66. package/dist/models/TimeBucket.js +53 -0
  67. package/dist/models/TimeseriesPoint.d.ts +53 -0
  68. package/dist/models/TimeseriesPoint.js +56 -0
  69. package/dist/models/WorkflowLeaderboardResponse.d.ts +54 -0
  70. package/dist/models/WorkflowLeaderboardResponse.js +53 -0
  71. package/dist/models/WorkflowOutputStatsResponse.d.ts +54 -0
  72. package/dist/models/WorkflowOutputStatsResponse.js +55 -0
  73. package/dist/models/index.d.ts +12 -0
  74. package/dist/models/index.js +12 -0
  75. package/docs/AdminKbApi.md +163 -0
  76. package/docs/AdminWorkflowsApi.md +424 -0
  77. package/docs/DefinitionOutputStat.md +41 -0
  78. package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +2 -0
  79. package/docs/HourHistogramResponse.md +37 -0
  80. package/docs/KbMetric.md +33 -0
  81. package/docs/KbSummaryResponse.md +67 -0
  82. package/docs/KbTimeseriesResponse.md +41 -0
  83. package/docs/LabeledSeries.md +37 -0
  84. package/docs/LeaderboardEntry.md +39 -0
  85. package/docs/RunTimeseriesResponse.md +39 -0
  86. package/docs/SkillResponse.md +2 -0
  87. package/docs/SkillsApi.md +1 -1
  88. package/docs/TimeBucket.md +33 -0
  89. package/docs/TimeseriesPoint.md +37 -0
  90. package/docs/WorkflowLeaderboardResponse.md +37 -0
  91. package/docs/WorkflowOutputStatsResponse.md +37 -0
  92. package/package.json +1 -1
  93. package/src/apis/AdminKbApi.ts +237 -0
  94. package/src/apis/AdminWorkflowsApi.ts +539 -0
  95. package/src/apis/SkillsApi.ts +4 -4
  96. package/src/apis/index.ts +2 -0
  97. package/src/models/DefinitionOutputStat.ts +110 -0
  98. package/src/models/HourHistogramResponse.ts +97 -0
  99. package/src/models/KbMetric.ts +54 -0
  100. package/src/models/KbSummaryResponse.ts +235 -0
  101. package/src/models/KbTimeseriesResponse.ts +136 -0
  102. package/src/models/LabeledSeries.ts +99 -0
  103. package/src/models/LeaderboardEntry.ts +101 -0
  104. package/src/models/RunTimeseriesResponse.ts +117 -0
  105. package/src/models/SkillResponse.ts +15 -0
  106. package/src/models/TimeBucket.ts +55 -0
  107. package/src/models/TimeseriesPoint.ts +92 -0
  108. package/src/models/WorkflowLeaderboardResponse.ts +98 -0
  109. package/src/models/WorkflowOutputStatsResponse.ts +99 -0
  110. package/src/models/index.ts +12 -0
@@ -0,0 +1,33 @@
1
+
2
+ # KbMetric
3
+
4
+ A knowledge-base time series the dashboard can request.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { KbMetric } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies KbMetric
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 KbMetric
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
+
@@ -0,0 +1,67 @@
1
+
2
+ # KbSummaryResponse
3
+
4
+ Point-in-time knowledge-base totals for a tenant.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `documentsTotal` | number
11
+ `documentsByOrigin` | { [key: string]: number; }
12
+ `documentsByType` | { [key: string]: number; }
13
+ `documentVersionsTotal` | number
14
+ `chunksTotal` | number
15
+ `chunksByType` | { [key: string]: number; }
16
+ `tokensTotal` | number
17
+ `sectionsTotal` | number
18
+ `threadsTotal` | number
19
+ `messagesTotal` | number
20
+ `messagesByRole` | { [key: string]: number; }
21
+ `dataSourcesTotal` | number
22
+ `dataSourceTablesTotal` | number
23
+ `documentsCheckedOut` | number
24
+ `quota` | [Array<MeteredQuotaStatus>](MeteredQuotaStatus.md)
25
+ `feedbackUp` | number
26
+ `feedbackDown` | number
27
+
28
+ ## Example
29
+
30
+ ```typescript
31
+ import type { KbSummaryResponse } from '@knowledge-stack/ksapi'
32
+
33
+ // TODO: Update the object below with actual values
34
+ const example = {
35
+ "documentsTotal": null,
36
+ "documentsByOrigin": null,
37
+ "documentsByType": null,
38
+ "documentVersionsTotal": null,
39
+ "chunksTotal": null,
40
+ "chunksByType": null,
41
+ "tokensTotal": null,
42
+ "sectionsTotal": null,
43
+ "threadsTotal": null,
44
+ "messagesTotal": null,
45
+ "messagesByRole": null,
46
+ "dataSourcesTotal": null,
47
+ "dataSourceTablesTotal": null,
48
+ "documentsCheckedOut": null,
49
+ "quota": null,
50
+ "feedbackUp": null,
51
+ "feedbackDown": null,
52
+ } satisfies KbSummaryResponse
53
+
54
+ console.log(example)
55
+
56
+ // Convert the instance to a JSON string
57
+ const exampleJSON: string = JSON.stringify(example)
58
+ console.log(exampleJSON)
59
+
60
+ // Parse the JSON string back to an object
61
+ const exampleParsed = JSON.parse(exampleJSON) as KbSummaryResponse
62
+ console.log(exampleParsed)
63
+ ```
64
+
65
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
66
+
67
+
@@ -0,0 +1,41 @@
1
+
2
+ # KbTimeseriesResponse
3
+
4
+ A knowledge-base metric bucketed over time. ``series`` carries one entry per split — two (SOURCE / GENERATED) for ``document_uploads``, one for the ingestion metrics.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `metric` | [KbMetric](KbMetric.md)
11
+ `timezone` | string
12
+ `bucket` | [TimeBucket](TimeBucket.md)
13
+ `series` | [Array<LabeledSeries>](LabeledSeries.md)
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { KbTimeseriesResponse } from '@knowledge-stack/ksapi'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "metric": null,
23
+ "timezone": null,
24
+ "bucket": null,
25
+ "series": null,
26
+ } satisfies KbTimeseriesResponse
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 KbTimeseriesResponse
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
+
@@ -0,0 +1,37 @@
1
+
2
+ # LabeledSeries
3
+
4
+ A named series (e.g. one per document origin or ingestion outcome).
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `label` | string
11
+ `points` | [Array<TimeseriesPoint>](TimeseriesPoint.md)
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { LabeledSeries } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "label": null,
21
+ "points": null,
22
+ } satisfies LabeledSeries
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 LabeledSeries
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
+
@@ -0,0 +1,39 @@
1
+
2
+ # LeaderboardEntry
3
+
4
+ One ranked entry (a workflow definition or a user).
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `id` | string
11
+ `name` | string
12
+ `count` | number
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { LeaderboardEntry } from '@knowledge-stack/ksapi'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "id": null,
22
+ "name": null,
23
+ "count": null,
24
+ } satisfies LeaderboardEntry
25
+
26
+ console.log(example)
27
+
28
+ // Convert the instance to a JSON string
29
+ const exampleJSON: string = JSON.stringify(example)
30
+ console.log(exampleJSON)
31
+
32
+ // Parse the JSON string back to an object
33
+ const exampleParsed = JSON.parse(exampleJSON) as LeaderboardEntry
34
+ console.log(exampleParsed)
35
+ ```
36
+
37
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
38
+
39
+
@@ -0,0 +1,39 @@
1
+
2
+ # RunTimeseriesResponse
3
+
4
+ Workflow runs bucketed over time.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `timezone` | string
11
+ `bucket` | [TimeBucket](TimeBucket.md)
12
+ `points` | [Array<TimeseriesPoint>](TimeseriesPoint.md)
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { RunTimeseriesResponse } from '@knowledge-stack/ksapi'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "timezone": null,
22
+ "bucket": null,
23
+ "points": null,
24
+ } satisfies RunTimeseriesResponse
25
+
26
+ console.log(example)
27
+
28
+ // Convert the instance to a JSON string
29
+ const exampleJSON: string = JSON.stringify(example)
30
+ console.log(exampleJSON)
31
+
32
+ // Parse the JSON string back to an object
33
+ const exampleParsed = JSON.parse(exampleJSON) as RunTimeseriesResponse
34
+ console.log(exampleParsed)
35
+ ```
36
+
37
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
38
+
39
+
@@ -17,6 +17,7 @@ Name | Type
17
17
  `description` | string
18
18
  `skillMd` | string
19
19
  `scriptNames` | Array<string>
20
+ `scripts` | [Array<SkillScriptFile>](SkillScriptFile.md)
20
21
  `hasUnpublishedChanges` | boolean
21
22
  `approvalState` | [PathPartApprovalState](PathPartApprovalState.md)
22
23
  `owner` | [UserInfo](UserInfo.md)
@@ -41,6 +42,7 @@ const example = {
41
42
  "description": null,
42
43
  "skillMd": null,
43
44
  "scriptNames": null,
45
+ "scripts": null,
44
46
  "hasUnpublishedChanges": null,
45
47
  "approvalState": null,
46
48
  "owner": null,
package/docs/SkillsApi.md CHANGED
@@ -558,7 +558,7 @@ example().catch(console.error);
558
558
 
559
559
  Get Skill Handler
560
560
 
561
- Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
561
+ Skill detail: SKILL.md, script contents, has_unpublished_changes, perms.
562
562
 
563
563
  ### Example
564
564
 
@@ -0,0 +1,33 @@
1
+
2
+ # TimeBucket
3
+
4
+ Granularity for a bucketed time series.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { TimeBucket } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies TimeBucket
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 TimeBucket
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
+
@@ -0,0 +1,37 @@
1
+
2
+ # TimeseriesPoint
3
+
4
+ One bucket of a time series.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `bucketStart` | Date
11
+ `count` | number
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { TimeseriesPoint } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "bucketStart": null,
21
+ "count": null,
22
+ } satisfies TimeseriesPoint
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 TimeseriesPoint
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
+
@@ -0,0 +1,37 @@
1
+
2
+ # WorkflowLeaderboardResponse
3
+
4
+ Top workflows and top users by run count over a window.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `topWorkflows` | [Array<LeaderboardEntry>](LeaderboardEntry.md)
11
+ `topUsers` | [Array<LeaderboardEntry>](LeaderboardEntry.md)
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { WorkflowLeaderboardResponse } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "topWorkflows": null,
21
+ "topUsers": null,
22
+ } satisfies WorkflowLeaderboardResponse
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 WorkflowLeaderboardResponse
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
+
@@ -0,0 +1,37 @@
1
+
2
+ # WorkflowOutputStatsResponse
3
+
4
+ Avg documents generated per workflow definition (completed runs).
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `perDefinition` | [Array<DefinitionOutputStat>](DefinitionOutputStat.md)
11
+ `overallAvg` | number
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { WorkflowOutputStatsResponse } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "perDefinition": null,
21
+ "overallAvg": null,
22
+ } satisfies WorkflowOutputStatsResponse
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 WorkflowOutputStatsResponse
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": "1.139.0",
3
+ "version": "1.140.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -0,0 +1,237 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ErrorResponse,
19
+ HTTPValidationError,
20
+ KbMetric,
21
+ KbSummaryResponse,
22
+ KbTimeseriesResponse,
23
+ TimeBucket,
24
+ } from '../models/index';
25
+ import {
26
+ ErrorResponseFromJSON,
27
+ ErrorResponseToJSON,
28
+ HTTPValidationErrorFromJSON,
29
+ HTTPValidationErrorToJSON,
30
+ KbMetricFromJSON,
31
+ KbMetricToJSON,
32
+ KbSummaryResponseFromJSON,
33
+ KbSummaryResponseToJSON,
34
+ KbTimeseriesResponseFromJSON,
35
+ KbTimeseriesResponseToJSON,
36
+ TimeBucketFromJSON,
37
+ TimeBucketToJSON,
38
+ } from '../models/index';
39
+
40
+ export interface GetAdminKbTimeseriesRequest {
41
+ metric: KbMetric;
42
+ since?: Date | null;
43
+ until?: Date | null;
44
+ bucket?: TimeBucket;
45
+ timezone?: string | null;
46
+ }
47
+
48
+ /**
49
+ * AdminKbApi - interface
50
+ *
51
+ * @export
52
+ * @interface AdminKbApiInterface
53
+ */
54
+ export interface AdminKbApiInterface {
55
+ /**
56
+ * Creates request options for getAdminKbSummary without sending the request
57
+ * @throws {RequiredError}
58
+ * @memberof AdminKbApiInterface
59
+ */
60
+ getAdminKbSummaryRequestOpts(): Promise<runtime.RequestOpts>;
61
+
62
+ /**
63
+ * Point-in-time knowledge-base totals for the tenant.
64
+ * @summary Get Admin Kb Summary Handler
65
+ * @param {*} [options] Override http request option.
66
+ * @throws {RequiredError}
67
+ * @memberof AdminKbApiInterface
68
+ */
69
+ getAdminKbSummaryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbSummaryResponse>>;
70
+
71
+ /**
72
+ * Point-in-time knowledge-base totals for the tenant.
73
+ * Get Admin Kb Summary Handler
74
+ */
75
+ getAdminKbSummary(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbSummaryResponse>;
76
+
77
+ /**
78
+ * Creates request options for getAdminKbTimeseries without sending the request
79
+ * @param {KbMetric} metric Which KB metric to bucket.
80
+ * @param {Date} [since] Window start.
81
+ * @param {Date} [until] Window end.
82
+ * @param {TimeBucket} [bucket] Bucket size.
83
+ * @param {string} [timezone] IANA tz override; defaults to tenant setting.
84
+ * @throws {RequiredError}
85
+ * @memberof AdminKbApiInterface
86
+ */
87
+ getAdminKbTimeseriesRequestOpts(requestParameters: GetAdminKbTimeseriesRequest): Promise<runtime.RequestOpts>;
88
+
89
+ /**
90
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
91
+ * @summary Get Admin Kb Timeseries Handler
92
+ * @param {KbMetric} metric Which KB metric to bucket.
93
+ * @param {Date} [since] Window start.
94
+ * @param {Date} [until] Window end.
95
+ * @param {TimeBucket} [bucket] Bucket size.
96
+ * @param {string} [timezone] IANA tz override; defaults to tenant setting.
97
+ * @param {*} [options] Override http request option.
98
+ * @throws {RequiredError}
99
+ * @memberof AdminKbApiInterface
100
+ */
101
+ getAdminKbTimeseriesRaw(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbTimeseriesResponse>>;
102
+
103
+ /**
104
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
105
+ * Get Admin Kb Timeseries Handler
106
+ */
107
+ getAdminKbTimeseries(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbTimeseriesResponse>;
108
+
109
+ }
110
+
111
+ /**
112
+ *
113
+ */
114
+ export class AdminKbApi extends runtime.BaseAPI implements AdminKbApiInterface {
115
+
116
+ /**
117
+ * Creates request options for getAdminKbSummary without sending the request
118
+ */
119
+ async getAdminKbSummaryRequestOpts(): Promise<runtime.RequestOpts> {
120
+ const queryParameters: any = {};
121
+
122
+ const headerParameters: runtime.HTTPHeaders = {};
123
+
124
+ if (this.configuration && this.configuration.accessToken) {
125
+ const token = this.configuration.accessToken;
126
+ const tokenString = await token("bearerAuth", []);
127
+
128
+ if (tokenString) {
129
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
130
+ }
131
+ }
132
+
133
+ let urlPath = `/v1/admin/kb/summary`;
134
+
135
+ return {
136
+ path: urlPath,
137
+ method: 'GET',
138
+ headers: headerParameters,
139
+ query: queryParameters,
140
+ };
141
+ }
142
+
143
+ /**
144
+ * Point-in-time knowledge-base totals for the tenant.
145
+ * Get Admin Kb Summary Handler
146
+ */
147
+ async getAdminKbSummaryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbSummaryResponse>> {
148
+ const requestOptions = await this.getAdminKbSummaryRequestOpts();
149
+ const response = await this.request(requestOptions, initOverrides);
150
+
151
+ return new runtime.JSONApiResponse(response, (jsonValue) => KbSummaryResponseFromJSON(jsonValue));
152
+ }
153
+
154
+ /**
155
+ * Point-in-time knowledge-base totals for the tenant.
156
+ * Get Admin Kb Summary Handler
157
+ */
158
+ async getAdminKbSummary(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbSummaryResponse> {
159
+ const response = await this.getAdminKbSummaryRaw(initOverrides);
160
+ return await response.value();
161
+ }
162
+
163
+ /**
164
+ * Creates request options for getAdminKbTimeseries without sending the request
165
+ */
166
+ async getAdminKbTimeseriesRequestOpts(requestParameters: GetAdminKbTimeseriesRequest): Promise<runtime.RequestOpts> {
167
+ if (requestParameters['metric'] == null) {
168
+ throw new runtime.RequiredError(
169
+ 'metric',
170
+ 'Required parameter "metric" was null or undefined when calling getAdminKbTimeseries().'
171
+ );
172
+ }
173
+
174
+ const queryParameters: any = {};
175
+
176
+ if (requestParameters['metric'] != null) {
177
+ queryParameters['metric'] = requestParameters['metric'];
178
+ }
179
+
180
+ if (requestParameters['since'] != null) {
181
+ queryParameters['since'] = (requestParameters['since'] as any).toISOString();
182
+ }
183
+
184
+ if (requestParameters['until'] != null) {
185
+ queryParameters['until'] = (requestParameters['until'] as any).toISOString();
186
+ }
187
+
188
+ if (requestParameters['bucket'] != null) {
189
+ queryParameters['bucket'] = requestParameters['bucket'];
190
+ }
191
+
192
+ if (requestParameters['timezone'] != null) {
193
+ queryParameters['timezone'] = requestParameters['timezone'];
194
+ }
195
+
196
+ const headerParameters: runtime.HTTPHeaders = {};
197
+
198
+ if (this.configuration && this.configuration.accessToken) {
199
+ const token = this.configuration.accessToken;
200
+ const tokenString = await token("bearerAuth", []);
201
+
202
+ if (tokenString) {
203
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
204
+ }
205
+ }
206
+
207
+ let urlPath = `/v1/admin/kb/timeseries`;
208
+
209
+ return {
210
+ path: urlPath,
211
+ method: 'GET',
212
+ headers: headerParameters,
213
+ query: queryParameters,
214
+ };
215
+ }
216
+
217
+ /**
218
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
219
+ * Get Admin Kb Timeseries Handler
220
+ */
221
+ async getAdminKbTimeseriesRaw(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbTimeseriesResponse>> {
222
+ const requestOptions = await this.getAdminKbTimeseriesRequestOpts(requestParameters);
223
+ const response = await this.request(requestOptions, initOverrides);
224
+
225
+ return new runtime.JSONApiResponse(response, (jsonValue) => KbTimeseriesResponseFromJSON(jsonValue));
226
+ }
227
+
228
+ /**
229
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
230
+ * Get Admin Kb Timeseries Handler
231
+ */
232
+ async getAdminKbTimeseries(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbTimeseriesResponse> {
233
+ const response = await this.getAdminKbTimeseriesRaw(requestParameters, initOverrides);
234
+ return await response.value();
235
+ }
236
+
237
+ }