@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
@@ -7,6 +7,8 @@ docs/AcceptInviteResponse.md
7
7
  docs/AccessCheckResponse.md
8
8
  docs/ActivateSkillVersionRequest.md
9
9
  docs/AddMemberRequest.md
10
+ docs/AdminKbApi.md
11
+ docs/AdminWorkflowsApi.md
10
12
  docs/AgentApi.md
11
13
  docs/AncestryResponse.md
12
14
  docs/ApiAuthConfig.md
@@ -94,6 +96,7 @@ docs/DataSourceSyncResponse.md
94
96
  docs/DataSourceTableResponse.md
95
97
  docs/DataSourcesApi.md
96
98
  docs/DefaultApi.md
99
+ docs/DefinitionOutputStat.md
97
100
  docs/DiffFormat.md
98
101
  docs/DiffRow.md
99
102
  docs/DiffRowType.md
@@ -151,6 +154,7 @@ docs/GroupPermissionResponse.md
151
154
  docs/GroupResponse.md
152
155
  docs/HTTPValidationError.md
153
156
  docs/HealthCheckResponse.md
157
+ docs/HourHistogramResponse.md
154
158
  docs/HybridSearchProfile.md
155
159
  docs/IdpConfig.md
156
160
  docs/IdpType.md
@@ -171,6 +175,11 @@ docs/InviteStatus.md
171
175
  docs/InviteUserRequest.md
172
176
  docs/InvitesApi.md
173
177
  docs/ItemPermissions.md
178
+ docs/KbMetric.md
179
+ docs/KbSummaryResponse.md
180
+ docs/KbTimeseriesResponse.md
181
+ docs/LabeledSeries.md
182
+ docs/LeaderboardEntry.md
174
183
  docs/LineageEdgeResponse.md
175
184
  docs/LineageGraphResponse.md
176
185
  docs/LineageNodeResponse.md
@@ -251,6 +260,7 @@ docs/RevisionEdit.md
251
260
  docs/RootResponse.md
252
261
  docs/RunFolder.md
253
262
  docs/RunFolderRef.md
263
+ docs/RunTimeseriesResponse.md
254
264
  docs/SSOInitiateResponse.md
255
265
  docs/ScoredChunkResponse.md
256
266
  docs/SearchSkillsRequest.md
@@ -323,6 +333,8 @@ docs/ThreadMessagesApi.md
323
333
  docs/ThreadOrder.md
324
334
  docs/ThreadResponse.md
325
335
  docs/ThreadsApi.md
336
+ docs/TimeBucket.md
337
+ docs/TimeseriesPoint.md
326
338
  docs/ToolDisplayType.md
327
339
  docs/ToolPart.md
328
340
  docs/ToolStatus.md
@@ -370,7 +382,9 @@ docs/WorkflowDefinitionResponse.md
370
382
  docs/WorkflowDefinitionsApi.md
371
383
  docs/WorkflowDetailResponse.md
372
384
  docs/WorkflowExecutionState.md
385
+ docs/WorkflowLeaderboardResponse.md
373
386
  docs/WorkflowMemoryApi.md
387
+ docs/WorkflowOutputStatsResponse.md
374
388
  docs/WorkflowRunAsset.md
375
389
  docs/WorkflowRunCallbackRequest.md
376
390
  docs/WorkflowRunOrder.md
@@ -384,6 +398,8 @@ docs/XlsxCellAnchorInputOrDocxParagraphAnchorInput.md
384
398
  docs/XlsxCellAnchorOutput.md
385
399
  docs/XlsxCellAnchorOutputOrDocxParagraphAnchorOutput.md
386
400
  package.json
401
+ src/apis/AdminKbApi.ts
402
+ src/apis/AdminWorkflowsApi.ts
387
403
  src/apis/AgentApi.ts
388
404
  src/apis/ApiConnectionsApi.ts
389
405
  src/apis/ApiKeysApi.ts
@@ -504,6 +520,7 @@ src/models/DataSourceSchemaListResponse.ts
504
520
  src/models/DataSourceSchemaResponse.ts
505
521
  src/models/DataSourceSyncResponse.ts
506
522
  src/models/DataSourceTableResponse.ts
523
+ src/models/DefinitionOutputStat.ts
507
524
  src/models/DiffFormat.ts
508
525
  src/models/DiffRow.ts
509
526
  src/models/DiffRowType.ts
@@ -555,6 +572,7 @@ src/models/GroupPermissionResponse.ts
555
572
  src/models/GroupResponse.ts
556
573
  src/models/HTTPValidationError.ts
557
574
  src/models/HealthCheckResponse.ts
575
+ src/models/HourHistogramResponse.ts
558
576
  src/models/HybridSearchProfile.ts
559
577
  src/models/IdpConfig.ts
560
578
  src/models/IdpType.ts
@@ -574,6 +592,11 @@ src/models/InviteResponse.ts
574
592
  src/models/InviteStatus.ts
575
593
  src/models/InviteUserRequest.ts
576
594
  src/models/ItemPermissions.ts
595
+ src/models/KbMetric.ts
596
+ src/models/KbSummaryResponse.ts
597
+ src/models/KbTimeseriesResponse.ts
598
+ src/models/LabeledSeries.ts
599
+ src/models/LeaderboardEntry.ts
577
600
  src/models/LineageEdgeResponse.ts
578
601
  src/models/LineageGraphResponse.ts
579
602
  src/models/LineageNodeResponse.ts
@@ -650,6 +673,7 @@ src/models/RevisionEdit.ts
650
673
  src/models/RootResponse.ts
651
674
  src/models/RunFolder.ts
652
675
  src/models/RunFolderRef.ts
676
+ src/models/RunTimeseriesResponse.ts
653
677
  src/models/SSOInitiateResponse.ts
654
678
  src/models/ScoredChunkResponse.ts
655
679
  src/models/SearchSkillsRequest.ts
@@ -713,6 +737,8 @@ src/models/ThreadMessageDetails.ts
713
737
  src/models/ThreadMessageResponse.ts
714
738
  src/models/ThreadOrder.ts
715
739
  src/models/ThreadResponse.ts
740
+ src/models/TimeBucket.ts
741
+ src/models/TimeseriesPoint.ts
716
742
  src/models/ToolDisplayType.ts
717
743
  src/models/ToolPart.ts
718
744
  src/models/ToolStatus.ts
@@ -756,6 +782,8 @@ src/models/WorkflowDefinitionOrder.ts
756
782
  src/models/WorkflowDefinitionResponse.ts
757
783
  src/models/WorkflowDetailResponse.ts
758
784
  src/models/WorkflowExecutionState.ts
785
+ src/models/WorkflowLeaderboardResponse.ts
786
+ src/models/WorkflowOutputStatsResponse.ts
759
787
  src/models/WorkflowRunAsset.ts
760
788
  src/models/WorkflowRunCallbackRequest.ts
761
789
  src/models/WorkflowRunOrder.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @knowledge-stack/ksapi@1.139.0
1
+ # @knowledge-stack/ksapi@1.140.0
2
2
 
3
3
  A TypeScript SDK client for the localhost API.
4
4
 
@@ -16,9 +16,9 @@ Next, try it out.
16
16
  ```ts
17
17
  import {
18
18
  Configuration,
19
- AgentApi,
19
+ AdminKbApi,
20
20
  } from '@knowledge-stack/ksapi';
21
- import type { AgentAskRequest } from '@knowledge-stack/ksapi';
21
+ import type { GetAdminKbSummaryRequest } from '@knowledge-stack/ksapi';
22
22
 
23
23
  async function example() {
24
24
  console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
@@ -28,15 +28,10 @@ async function example() {
28
28
  // Configure HTTP bearer authorization: bearerAuth
29
29
  accessToken: "YOUR BEARER TOKEN",
30
30
  });
31
- const api = new AgentApi(config);
32
-
33
- const body = {
34
- // AskRequest
35
- askRequest: ...,
36
- } satisfies AgentAskRequest;
31
+ const api = new AdminKbApi(config);
37
32
 
38
33
  try {
39
- const data = await api.agentAsk(body);
34
+ const data = await api.getAdminKbSummary();
40
35
  console.log(data);
41
36
  } catch (error) {
42
37
  console.error(error);
@@ -56,6 +51,13 @@ All URIs are relative to *http://localhost:8000*
56
51
 
57
52
  | Class | Method | HTTP request | Description
58
53
  | ----- | ------ | ------------ | -------------
54
+ *AdminKbApi* | [**getAdminKbSummary**](docs/AdminKbApi.md#getadminkbsummary) | **GET** /v1/admin/kb/summary | Get Admin Kb Summary Handler
55
+ *AdminKbApi* | [**getAdminKbTimeseries**](docs/AdminKbApi.md#getadminkbtimeseries) | **GET** /v1/admin/kb/timeseries | Get Admin Kb Timeseries Handler
56
+ *AdminWorkflowsApi* | [**getAdminWorkflowByHour**](docs/AdminWorkflowsApi.md#getadminworkflowbyhour) | **GET** /v1/admin/workflows/by-hour | Get Admin Workflow By Hour Handler
57
+ *AdminWorkflowsApi* | [**getAdminWorkflowLeaderboard**](docs/AdminWorkflowsApi.md#getadminworkflowleaderboard) | **GET** /v1/admin/workflows/leaderboard | Get Admin Workflow Leaderboard Handler
58
+ *AdminWorkflowsApi* | [**getAdminWorkflowOutputStats**](docs/AdminWorkflowsApi.md#getadminworkflowoutputstats) | **GET** /v1/admin/workflows/output-stats | Get Admin Workflow Output Stats Handler
59
+ *AdminWorkflowsApi* | [**getAdminWorkflowSummary**](docs/AdminWorkflowsApi.md#getadminworkflowsummary) | **GET** /v1/admin/workflows/summary | Get Admin Workflow Summary Handler
60
+ *AdminWorkflowsApi* | [**getAdminWorkflowTimeseries**](docs/AdminWorkflowsApi.md#getadminworkflowtimeseries) | **GET** /v1/admin/workflows/timeseries | Get Admin Workflow Timeseries Handler
59
61
  *AgentApi* | [**agentAsk**](docs/AgentApi.md#agentask) | **POST** /v1/agent/ask | Agent Ask Handler
60
62
  *AgentApi* | [**agentExtract**](docs/AgentApi.md#agentextract) | **POST** /v1/agent/extract | Agent Extract Handler
61
63
  *ApiConnectionsApi* | [**acceptApiConnectionDisclaimer**](docs/ApiConnectionsApi.md#acceptapiconnectiondisclaimer) | **POST** /v1/api-connections/{connection_id}/disclaimer | Accept Api Connection Disclaimer Handler
@@ -366,6 +368,7 @@ All URIs are relative to *http://localhost:8000*
366
368
  - [DataSourceSchemaResponse](docs/DataSourceSchemaResponse.md)
367
369
  - [DataSourceSyncResponse](docs/DataSourceSyncResponse.md)
368
370
  - [DataSourceTableResponse](docs/DataSourceTableResponse.md)
371
+ - [DefinitionOutputStat](docs/DefinitionOutputStat.md)
369
372
  - [DiffFormat](docs/DiffFormat.md)
370
373
  - [DiffRow](docs/DiffRow.md)
371
374
  - [DiffRowType](docs/DiffRowType.md)
@@ -417,6 +420,7 @@ All URIs are relative to *http://localhost:8000*
417
420
  - [GroupResponse](docs/GroupResponse.md)
418
421
  - [HTTPValidationError](docs/HTTPValidationError.md)
419
422
  - [HealthCheckResponse](docs/HealthCheckResponse.md)
423
+ - [HourHistogramResponse](docs/HourHistogramResponse.md)
420
424
  - [HybridSearchProfile](docs/HybridSearchProfile.md)
421
425
  - [IdpConfig](docs/IdpConfig.md)
422
426
  - [IdpType](docs/IdpType.md)
@@ -436,6 +440,11 @@ All URIs are relative to *http://localhost:8000*
436
440
  - [InviteStatus](docs/InviteStatus.md)
437
441
  - [InviteUserRequest](docs/InviteUserRequest.md)
438
442
  - [ItemPermissions](docs/ItemPermissions.md)
443
+ - [KbMetric](docs/KbMetric.md)
444
+ - [KbSummaryResponse](docs/KbSummaryResponse.md)
445
+ - [KbTimeseriesResponse](docs/KbTimeseriesResponse.md)
446
+ - [LabeledSeries](docs/LabeledSeries.md)
447
+ - [LeaderboardEntry](docs/LeaderboardEntry.md)
439
448
  - [LineageEdgeResponse](docs/LineageEdgeResponse.md)
440
449
  - [LineageGraphResponse](docs/LineageGraphResponse.md)
441
450
  - [LineageNodeResponse](docs/LineageNodeResponse.md)
@@ -512,6 +521,7 @@ All URIs are relative to *http://localhost:8000*
512
521
  - [RootResponse](docs/RootResponse.md)
513
522
  - [RunFolder](docs/RunFolder.md)
514
523
  - [RunFolderRef](docs/RunFolderRef.md)
524
+ - [RunTimeseriesResponse](docs/RunTimeseriesResponse.md)
515
525
  - [SSOInitiateResponse](docs/SSOInitiateResponse.md)
516
526
  - [ScoredChunkResponse](docs/ScoredChunkResponse.md)
517
527
  - [SearchSkillsRequest](docs/SearchSkillsRequest.md)
@@ -575,6 +585,8 @@ All URIs are relative to *http://localhost:8000*
575
585
  - [ThreadMessageResponse](docs/ThreadMessageResponse.md)
576
586
  - [ThreadOrder](docs/ThreadOrder.md)
577
587
  - [ThreadResponse](docs/ThreadResponse.md)
588
+ - [TimeBucket](docs/TimeBucket.md)
589
+ - [TimeseriesPoint](docs/TimeseriesPoint.md)
578
590
  - [ToolDisplayType](docs/ToolDisplayType.md)
579
591
  - [ToolPart](docs/ToolPart.md)
580
592
  - [ToolStatus](docs/ToolStatus.md)
@@ -618,6 +630,8 @@ All URIs are relative to *http://localhost:8000*
618
630
  - [WorkflowDefinitionResponse](docs/WorkflowDefinitionResponse.md)
619
631
  - [WorkflowDetailResponse](docs/WorkflowDetailResponse.md)
620
632
  - [WorkflowExecutionState](docs/WorkflowExecutionState.md)
633
+ - [WorkflowLeaderboardResponse](docs/WorkflowLeaderboardResponse.md)
634
+ - [WorkflowOutputStatsResponse](docs/WorkflowOutputStatsResponse.md)
621
635
  - [WorkflowRunAsset](docs/WorkflowRunAsset.md)
622
636
  - [WorkflowRunCallbackRequest](docs/WorkflowRunCallbackRequest.md)
623
637
  - [WorkflowRunOrder](docs/WorkflowRunOrder.md)
@@ -654,7 +668,7 @@ and is automatically generated by the
654
668
  [OpenAPI Generator](https://openapi-generator.tech) project:
655
669
 
656
670
  - API version: `0.1.0`
657
- - Package version: `1.139.0`
671
+ - Package version: `1.140.0`
658
672
  - Generator version: `7.21.0`
659
673
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
660
674
 
@@ -0,0 +1,109 @@
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
+ import * as runtime from '../runtime';
13
+ import type { KbMetric, KbSummaryResponse, KbTimeseriesResponse, TimeBucket } from '../models/index';
14
+ export interface GetAdminKbTimeseriesRequest {
15
+ metric: KbMetric;
16
+ since?: Date | null;
17
+ until?: Date | null;
18
+ bucket?: TimeBucket;
19
+ timezone?: string | null;
20
+ }
21
+ /**
22
+ * AdminKbApi - interface
23
+ *
24
+ * @export
25
+ * @interface AdminKbApiInterface
26
+ */
27
+ export interface AdminKbApiInterface {
28
+ /**
29
+ * Creates request options for getAdminKbSummary without sending the request
30
+ * @throws {RequiredError}
31
+ * @memberof AdminKbApiInterface
32
+ */
33
+ getAdminKbSummaryRequestOpts(): Promise<runtime.RequestOpts>;
34
+ /**
35
+ * Point-in-time knowledge-base totals for the tenant.
36
+ * @summary Get Admin Kb Summary Handler
37
+ * @param {*} [options] Override http request option.
38
+ * @throws {RequiredError}
39
+ * @memberof AdminKbApiInterface
40
+ */
41
+ getAdminKbSummaryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbSummaryResponse>>;
42
+ /**
43
+ * Point-in-time knowledge-base totals for the tenant.
44
+ * Get Admin Kb Summary Handler
45
+ */
46
+ getAdminKbSummary(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbSummaryResponse>;
47
+ /**
48
+ * Creates request options for getAdminKbTimeseries without sending the request
49
+ * @param {KbMetric} metric Which KB metric to bucket.
50
+ * @param {Date} [since] Window start.
51
+ * @param {Date} [until] Window end.
52
+ * @param {TimeBucket} [bucket] Bucket size.
53
+ * @param {string} [timezone] IANA tz override; defaults to tenant setting.
54
+ * @throws {RequiredError}
55
+ * @memberof AdminKbApiInterface
56
+ */
57
+ getAdminKbTimeseriesRequestOpts(requestParameters: GetAdminKbTimeseriesRequest): Promise<runtime.RequestOpts>;
58
+ /**
59
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
60
+ * @summary Get Admin Kb Timeseries Handler
61
+ * @param {KbMetric} metric Which KB metric to bucket.
62
+ * @param {Date} [since] Window start.
63
+ * @param {Date} [until] Window end.
64
+ * @param {TimeBucket} [bucket] Bucket size.
65
+ * @param {string} [timezone] IANA tz override; defaults to tenant setting.
66
+ * @param {*} [options] Override http request option.
67
+ * @throws {RequiredError}
68
+ * @memberof AdminKbApiInterface
69
+ */
70
+ getAdminKbTimeseriesRaw(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbTimeseriesResponse>>;
71
+ /**
72
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
73
+ * Get Admin Kb Timeseries Handler
74
+ */
75
+ getAdminKbTimeseries(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbTimeseriesResponse>;
76
+ }
77
+ /**
78
+ *
79
+ */
80
+ export declare class AdminKbApi extends runtime.BaseAPI implements AdminKbApiInterface {
81
+ /**
82
+ * Creates request options for getAdminKbSummary without sending the request
83
+ */
84
+ getAdminKbSummaryRequestOpts(): Promise<runtime.RequestOpts>;
85
+ /**
86
+ * Point-in-time knowledge-base totals for the tenant.
87
+ * Get Admin Kb Summary Handler
88
+ */
89
+ getAdminKbSummaryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbSummaryResponse>>;
90
+ /**
91
+ * Point-in-time knowledge-base totals for the tenant.
92
+ * Get Admin Kb Summary Handler
93
+ */
94
+ getAdminKbSummary(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbSummaryResponse>;
95
+ /**
96
+ * Creates request options for getAdminKbTimeseries without sending the request
97
+ */
98
+ getAdminKbTimeseriesRequestOpts(requestParameters: GetAdminKbTimeseriesRequest): Promise<runtime.RequestOpts>;
99
+ /**
100
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
101
+ * Get Admin Kb Timeseries Handler
102
+ */
103
+ getAdminKbTimeseriesRaw(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KbTimeseriesResponse>>;
104
+ /**
105
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
106
+ * Get Admin Kb Timeseries Handler
107
+ */
108
+ getAdminKbTimeseries(requestParameters: GetAdminKbTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KbTimeseriesResponse>;
109
+ }
@@ -0,0 +1,172 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || (function () {
32
+ var ownKeys = function(o) {
33
+ ownKeys = Object.getOwnPropertyNames || function (o) {
34
+ var ar = [];
35
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
+ return ar;
37
+ };
38
+ return ownKeys(o);
39
+ };
40
+ return function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ })();
48
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
49
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
+ return new (P || (P = Promise))(function (resolve, reject) {
51
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
52
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
53
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
55
+ });
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.AdminKbApi = void 0;
59
+ const runtime = __importStar(require("../runtime"));
60
+ const index_1 = require("../models/index");
61
+ /**
62
+ *
63
+ */
64
+ class AdminKbApi extends runtime.BaseAPI {
65
+ /**
66
+ * Creates request options for getAdminKbSummary without sending the request
67
+ */
68
+ getAdminKbSummaryRequestOpts() {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const queryParameters = {};
71
+ const headerParameters = {};
72
+ if (this.configuration && this.configuration.accessToken) {
73
+ const token = this.configuration.accessToken;
74
+ const tokenString = yield token("bearerAuth", []);
75
+ if (tokenString) {
76
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
77
+ }
78
+ }
79
+ let urlPath = `/v1/admin/kb/summary`;
80
+ return {
81
+ path: urlPath,
82
+ method: 'GET',
83
+ headers: headerParameters,
84
+ query: queryParameters,
85
+ };
86
+ });
87
+ }
88
+ /**
89
+ * Point-in-time knowledge-base totals for the tenant.
90
+ * Get Admin Kb Summary Handler
91
+ */
92
+ getAdminKbSummaryRaw(initOverrides) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ const requestOptions = yield this.getAdminKbSummaryRequestOpts();
95
+ const response = yield this.request(requestOptions, initOverrides);
96
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.KbSummaryResponseFromJSON)(jsonValue));
97
+ });
98
+ }
99
+ /**
100
+ * Point-in-time knowledge-base totals for the tenant.
101
+ * Get Admin Kb Summary Handler
102
+ */
103
+ getAdminKbSummary(initOverrides) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ const response = yield this.getAdminKbSummaryRaw(initOverrides);
106
+ return yield response.value();
107
+ });
108
+ }
109
+ /**
110
+ * Creates request options for getAdminKbTimeseries without sending the request
111
+ */
112
+ getAdminKbTimeseriesRequestOpts(requestParameters) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ if (requestParameters['metric'] == null) {
115
+ throw new runtime.RequiredError('metric', 'Required parameter "metric" was null or undefined when calling getAdminKbTimeseries().');
116
+ }
117
+ const queryParameters = {};
118
+ if (requestParameters['metric'] != null) {
119
+ queryParameters['metric'] = requestParameters['metric'];
120
+ }
121
+ if (requestParameters['since'] != null) {
122
+ queryParameters['since'] = requestParameters['since'].toISOString();
123
+ }
124
+ if (requestParameters['until'] != null) {
125
+ queryParameters['until'] = requestParameters['until'].toISOString();
126
+ }
127
+ if (requestParameters['bucket'] != null) {
128
+ queryParameters['bucket'] = requestParameters['bucket'];
129
+ }
130
+ if (requestParameters['timezone'] != null) {
131
+ queryParameters['timezone'] = requestParameters['timezone'];
132
+ }
133
+ const headerParameters = {};
134
+ if (this.configuration && this.configuration.accessToken) {
135
+ const token = this.configuration.accessToken;
136
+ const tokenString = yield token("bearerAuth", []);
137
+ if (tokenString) {
138
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
139
+ }
140
+ }
141
+ let urlPath = `/v1/admin/kb/timeseries`;
142
+ return {
143
+ path: urlPath,
144
+ method: 'GET',
145
+ headers: headerParameters,
146
+ query: queryParameters,
147
+ };
148
+ });
149
+ }
150
+ /**
151
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
152
+ * Get Admin Kb Timeseries Handler
153
+ */
154
+ getAdminKbTimeseriesRaw(requestParameters, initOverrides) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ const requestOptions = yield this.getAdminKbTimeseriesRequestOpts(requestParameters);
157
+ const response = yield this.request(requestOptions, initOverrides);
158
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.KbTimeseriesResponseFromJSON)(jsonValue));
159
+ });
160
+ }
161
+ /**
162
+ * A knowledge-base metric bucketed over time, in the resolved timezone.
163
+ * Get Admin Kb Timeseries Handler
164
+ */
165
+ getAdminKbTimeseries(requestParameters, initOverrides) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const response = yield this.getAdminKbTimeseriesRaw(requestParameters, initOverrides);
168
+ return yield response.value();
169
+ });
170
+ }
171
+ }
172
+ exports.AdminKbApi = AdminKbApi;