@knowledge-stack/ksapi 1.72.3 → 1.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +36 -4
- package/README.md +33 -11
- package/dist/apis/AgentApi.d.ts +114 -0
- package/dist/apis/AgentApi.js +156 -0
- package/dist/apis/ChunksApi.d.ts +19 -16
- package/dist/apis/ChunksApi.js +9 -6
- package/dist/apis/DocumentsApi.d.ts +4 -4
- package/dist/apis/DocumentsApi.js +2 -2
- package/dist/apis/FoldersApi.d.ts +4 -4
- package/dist/apis/FoldersApi.js +2 -2
- package/dist/apis/InvitesApi.d.ts +54 -7
- package/dist/apis/InvitesApi.js +51 -2
- package/dist/apis/PublicApi.d.ts +59 -0
- package/dist/apis/PublicApi.js +103 -0
- package/dist/apis/SubscriptionsApi.d.ts +120 -0
- package/dist/apis/SubscriptionsApi.js +162 -0
- package/dist/apis/TenantsApi.d.ts +45 -1
- package/dist/apis/TenantsApi.js +44 -0
- package/dist/apis/ThreadsApi.d.ts +4 -4
- package/dist/apis/ThreadsApi.js +2 -2
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/AgentApi.d.ts +114 -0
- package/dist/esm/apis/AgentApi.js +119 -0
- package/dist/esm/apis/ChunksApi.d.ts +19 -16
- package/dist/esm/apis/ChunksApi.js +9 -6
- package/dist/esm/apis/DocumentsApi.d.ts +4 -4
- package/dist/esm/apis/DocumentsApi.js +2 -2
- package/dist/esm/apis/FoldersApi.d.ts +4 -4
- package/dist/esm/apis/FoldersApi.js +2 -2
- package/dist/esm/apis/InvitesApi.d.ts +54 -7
- package/dist/esm/apis/InvitesApi.js +52 -3
- package/dist/esm/apis/PublicApi.d.ts +59 -0
- package/dist/esm/apis/PublicApi.js +66 -0
- package/dist/esm/apis/SubscriptionsApi.d.ts +120 -0
- package/dist/esm/apis/SubscriptionsApi.js +125 -0
- package/dist/esm/apis/TenantsApi.d.ts +45 -1
- package/dist/esm/apis/TenantsApi.js +45 -1
- package/dist/esm/apis/ThreadsApi.d.ts +4 -4
- package/dist/esm/apis/ThreadsApi.js +2 -2
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/AcceptInviteResponse.d.ts +6 -0
- package/dist/esm/models/AcceptInviteResponse.js +2 -0
- package/dist/esm/models/AskRequest.d.ts +47 -0
- package/dist/esm/models/AskRequest.js +44 -0
- package/dist/esm/models/AskResponse.d.ts +47 -0
- package/dist/esm/models/AskResponse.js +44 -0
- package/dist/esm/models/ChangeSubscriptionRequest.d.ts +53 -0
- package/dist/esm/models/ChangeSubscriptionRequest.js +53 -0
- package/dist/esm/models/CheckpointDetails.d.ts +96 -0
- package/dist/esm/models/CheckpointDetails.js +91 -0
- package/dist/esm/models/ChunkBulkResponse.d.ts +3 -3
- package/dist/esm/models/ChunkBulkResponse.js +3 -3
- package/dist/esm/models/ChunkContentItem.d.ts +3 -3
- package/dist/esm/models/ChunkContentItem.js +3 -3
- package/dist/esm/models/{ChunkMetadataInput.d.ts → ChunkMetadata.d.ts} +23 -23
- package/dist/esm/models/{ChunkMetadataInput.js → ChunkMetadata.js} +9 -9
- package/dist/esm/models/ChunkNeighborsResponse.d.ts +18 -0
- package/dist/esm/models/ChunkNeighborsResponse.js +10 -0
- package/dist/esm/models/ChunkResponse.d.ts +3 -3
- package/dist/esm/models/ChunkResponse.js +3 -3
- package/dist/esm/models/CreateChunkRequest.d.ts +3 -3
- package/dist/esm/models/CreateChunkRequest.js +3 -3
- package/dist/esm/models/DocumentResponse.d.ts +6 -0
- package/dist/esm/models/DocumentResponse.js +4 -0
- package/dist/esm/models/DocumentVersionMetadata.d.ts +24 -0
- package/dist/esm/models/DocumentVersionMetadata.js +8 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +24 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.js +8 -0
- package/dist/esm/models/ExtractRequest.d.ts +61 -0
- package/dist/esm/models/ExtractRequest.js +48 -0
- package/dist/esm/models/ExtractResponse.d.ts +49 -0
- package/dist/esm/models/ExtractResponse.js +44 -0
- package/dist/esm/models/FolderResponse.d.ts +6 -0
- package/dist/esm/models/FolderResponse.js +4 -0
- package/dist/esm/models/InviteLinkSettingsRequest.d.ts +70 -0
- package/dist/esm/models/InviteLinkSettingsRequest.js +58 -0
- package/dist/esm/models/InviteLinkSettingsResponse.d.ts +67 -0
- package/dist/esm/models/InviteLinkSettingsResponse.js +57 -0
- package/dist/esm/models/InviteResponse.d.ts +6 -0
- package/dist/esm/models/InviteResponse.js +2 -0
- package/dist/esm/models/InviteUserRequest.d.ts +6 -0
- package/dist/esm/models/InviteUserRequest.js +8 -1
- package/dist/esm/models/LineageNodeResponse.d.ts +3 -3
- package/dist/esm/models/LineageNodeResponse.js +3 -3
- package/dist/esm/models/MeteredQuotaStatus.d.ts +72 -0
- package/dist/esm/models/MeteredQuotaStatus.js +61 -0
- package/dist/esm/models/PathPartAncestorItem.d.ts +6 -0
- package/dist/esm/models/PathPartAncestorItem.js +4 -0
- package/dist/esm/models/PathPartResponse.d.ts +6 -0
- package/dist/esm/models/PathPartResponse.js +4 -0
- package/dist/esm/models/PipelineStatus.d.ts +1 -0
- package/dist/esm/models/PipelineStatus.js +2 -1
- package/dist/esm/models/ScoredChunkResponse.d.ts +3 -3
- package/dist/esm/models/ScoredChunkResponse.js +3 -3
- package/dist/esm/models/SeatQuotaStatus.d.ts +55 -0
- package/dist/esm/models/SeatQuotaStatus.js +48 -0
- package/dist/esm/models/SubscriptionPlanResponse.d.ts +101 -0
- package/dist/esm/models/SubscriptionPlanResponse.js +76 -0
- package/dist/esm/models/TenantQuotaStateResponse.d.ts +55 -0
- package/dist/esm/models/TenantQuotaStateResponse.js +50 -0
- package/dist/esm/models/TenantResponse.d.ts +12 -0
- package/dist/esm/models/TenantResponse.js +14 -1
- package/dist/esm/models/TenantSettingsResponse.d.ts +7 -0
- package/dist/esm/models/TenantSettingsResponse.js +5 -0
- package/dist/esm/models/TenantSettingsUpdate.d.ts +7 -0
- package/dist/esm/models/TenantSettingsUpdate.js +3 -0
- package/dist/esm/models/ThreadMessageDetailsInput.d.ts +7 -0
- package/dist/esm/models/ThreadMessageDetailsInput.js +3 -0
- package/dist/esm/models/ThreadMessageDetailsOutput.d.ts +7 -0
- package/dist/esm/models/ThreadMessageDetailsOutput.js +3 -0
- package/dist/esm/models/UpdateChunkMetadataRequest.d.ts +3 -3
- package/dist/esm/models/UpdateChunkMetadataRequest.js +3 -3
- package/dist/esm/models/UpdateDocumentRequest.d.ts +7 -1
- package/dist/esm/models/UpdateDocumentRequest.js +2 -0
- package/dist/esm/models/UpdateFolderRequest.d.ts +7 -1
- package/dist/esm/models/UpdateFolderRequest.js +2 -0
- package/dist/esm/models/UpdateInviteRequest.d.ts +53 -0
- package/dist/esm/models/UpdateInviteRequest.js +49 -0
- package/dist/esm/models/UsageMetric.d.ts +26 -0
- package/dist/esm/models/UsageMetric.js +44 -0
- package/dist/esm/models/index.d.ts +15 -2
- package/dist/esm/models/index.js +15 -2
- package/dist/models/AcceptInviteResponse.d.ts +6 -0
- package/dist/models/AcceptInviteResponse.js +2 -0
- package/dist/models/AskRequest.d.ts +47 -0
- package/dist/models/AskRequest.js +52 -0
- package/dist/models/AskResponse.d.ts +47 -0
- package/dist/models/AskResponse.js +52 -0
- package/dist/models/ChangeSubscriptionRequest.d.ts +53 -0
- package/dist/models/ChangeSubscriptionRequest.js +61 -0
- package/dist/models/CheckpointDetails.d.ts +96 -0
- package/dist/models/CheckpointDetails.js +99 -0
- package/dist/models/ChunkBulkResponse.d.ts +3 -3
- package/dist/models/ChunkBulkResponse.js +3 -3
- package/dist/models/ChunkContentItem.d.ts +3 -3
- package/dist/models/ChunkContentItem.js +3 -3
- package/dist/models/{ChunkMetadataInput.d.ts → ChunkMetadata.d.ts} +23 -23
- package/dist/models/{ChunkMetadataInput.js → ChunkMetadata.js} +15 -15
- package/dist/models/ChunkNeighborsResponse.d.ts +18 -0
- package/dist/models/ChunkNeighborsResponse.js +10 -0
- package/dist/models/ChunkResponse.d.ts +3 -3
- package/dist/models/ChunkResponse.js +3 -3
- package/dist/models/CreateChunkRequest.d.ts +3 -3
- package/dist/models/CreateChunkRequest.js +3 -3
- package/dist/models/DocumentResponse.d.ts +6 -0
- package/dist/models/DocumentResponse.js +4 -0
- package/dist/models/DocumentVersionMetadata.d.ts +24 -0
- package/dist/models/DocumentVersionMetadata.js +8 -0
- package/dist/models/DocumentVersionMetadataUpdate.d.ts +24 -0
- package/dist/models/DocumentVersionMetadataUpdate.js +8 -0
- package/dist/models/ExtractRequest.d.ts +61 -0
- package/dist/models/ExtractRequest.js +56 -0
- package/dist/models/ExtractResponse.d.ts +49 -0
- package/dist/models/ExtractResponse.js +52 -0
- package/dist/models/FolderResponse.d.ts +6 -0
- package/dist/models/FolderResponse.js +4 -0
- package/dist/models/InviteLinkSettingsRequest.d.ts +70 -0
- package/dist/models/InviteLinkSettingsRequest.js +66 -0
- package/dist/models/InviteLinkSettingsResponse.d.ts +67 -0
- package/dist/models/InviteLinkSettingsResponse.js +65 -0
- package/dist/models/InviteResponse.d.ts +6 -0
- package/dist/models/InviteResponse.js +2 -0
- package/dist/models/InviteUserRequest.d.ts +6 -0
- package/dist/models/InviteUserRequest.js +8 -1
- package/dist/models/LineageNodeResponse.d.ts +3 -3
- package/dist/models/LineageNodeResponse.js +3 -3
- package/dist/models/MeteredQuotaStatus.d.ts +72 -0
- package/dist/models/MeteredQuotaStatus.js +69 -0
- package/dist/models/PathPartAncestorItem.d.ts +6 -0
- package/dist/models/PathPartAncestorItem.js +4 -0
- package/dist/models/PathPartResponse.d.ts +6 -0
- package/dist/models/PathPartResponse.js +4 -0
- package/dist/models/PipelineStatus.d.ts +1 -0
- package/dist/models/PipelineStatus.js +2 -1
- package/dist/models/ScoredChunkResponse.d.ts +3 -3
- package/dist/models/ScoredChunkResponse.js +3 -3
- package/dist/models/SeatQuotaStatus.d.ts +55 -0
- package/dist/models/SeatQuotaStatus.js +56 -0
- package/dist/models/SubscriptionPlanResponse.d.ts +101 -0
- package/dist/models/SubscriptionPlanResponse.js +84 -0
- package/dist/models/TenantQuotaStateResponse.d.ts +55 -0
- package/dist/models/TenantQuotaStateResponse.js +58 -0
- package/dist/models/TenantResponse.d.ts +12 -0
- package/dist/models/TenantResponse.js +14 -1
- package/dist/models/TenantSettingsResponse.d.ts +7 -0
- package/dist/models/TenantSettingsResponse.js +5 -0
- package/dist/models/TenantSettingsUpdate.d.ts +7 -0
- package/dist/models/TenantSettingsUpdate.js +3 -0
- package/dist/models/ThreadMessageDetailsInput.d.ts +7 -0
- package/dist/models/ThreadMessageDetailsInput.js +3 -0
- package/dist/models/ThreadMessageDetailsOutput.d.ts +7 -0
- package/dist/models/ThreadMessageDetailsOutput.js +3 -0
- package/dist/models/UpdateChunkMetadataRequest.d.ts +3 -3
- package/dist/models/UpdateChunkMetadataRequest.js +3 -3
- package/dist/models/UpdateDocumentRequest.d.ts +7 -1
- package/dist/models/UpdateDocumentRequest.js +2 -0
- package/dist/models/UpdateFolderRequest.d.ts +7 -1
- package/dist/models/UpdateFolderRequest.js +2 -0
- package/dist/models/UpdateInviteRequest.d.ts +53 -0
- package/dist/models/UpdateInviteRequest.js +57 -0
- package/dist/models/UsageMetric.d.ts +26 -0
- package/dist/models/UsageMetric.js +52 -0
- package/dist/models/index.d.ts +15 -2
- package/dist/models/index.js +15 -2
- package/docs/AcceptInviteResponse.md +2 -0
- package/docs/AgentApi.md +158 -0
- package/docs/AskRequest.md +35 -0
- package/docs/AskResponse.md +35 -0
- package/docs/ChangeSubscriptionRequest.md +37 -0
- package/docs/CheckpointDetails.md +49 -0
- package/docs/ChunkBulkResponse.md +1 -1
- package/docs/ChunkContentItem.md +1 -1
- package/docs/{ChunkMetadataInput.md → ChunkMetadata.md} +4 -4
- package/docs/ChunkNeighborsResponse.md +6 -0
- package/docs/ChunkResponse.md +1 -1
- package/docs/ChunksApi.md +13 -10
- package/docs/CreateChunkRequest.md +1 -1
- package/docs/DocumentResponse.md +2 -0
- package/docs/DocumentVersionMetadata.md +8 -0
- package/docs/DocumentVersionMetadataUpdate.md +8 -0
- package/docs/DocumentsApi.md +1 -1
- package/docs/ExtractRequest.md +39 -0
- package/docs/ExtractResponse.md +35 -0
- package/docs/FolderResponse.md +2 -0
- package/docs/FolderResponseOrDocumentResponse.md +2 -0
- package/docs/FoldersApi.md +1 -1
- package/docs/InviteLinkSettingsRequest.md +39 -0
- package/docs/InviteLinkSettingsResponse.md +39 -0
- package/docs/InviteResponse.md +2 -0
- package/docs/InviteUserRequest.md +2 -0
- package/docs/InvitesApi.md +81 -3
- package/docs/LineageNodeResponse.md +1 -1
- package/docs/MeteredQuotaStatus.md +43 -0
- package/docs/PathPartAncestorItem.md +2 -0
- package/docs/PathPartResponse.md +2 -0
- package/docs/PublicApi.md +68 -0
- package/docs/ScoredChunkResponse.md +1 -1
- package/docs/SeatQuotaStatus.md +37 -0
- package/docs/SectionContentItemOrChunkContentItem.md +1 -1
- package/docs/SubscriptionPlanResponse.md +51 -0
- package/docs/SubscriptionsApi.md +164 -0
- package/docs/TenantQuotaStateResponse.md +37 -0
- package/docs/TenantResponse.md +4 -0
- package/docs/TenantSettingsResponse.md +2 -0
- package/docs/TenantSettingsUpdate.md +2 -0
- package/docs/TenantsApi.md +75 -0
- package/docs/ThreadMessageDetailsInput.md +2 -0
- package/docs/ThreadMessageDetailsOutput.md +2 -0
- package/docs/ThreadsApi.md +1 -1
- package/docs/UpdateChunkMetadataRequest.md +1 -1
- package/docs/UpdateDocumentRequest.md +3 -1
- package/docs/UpdateFolderRequest.md +3 -1
- package/docs/UpdateInviteRequest.md +37 -0
- package/docs/UsageMetric.md +32 -0
- package/package.json +1 -1
- package/src/apis/AgentApi.ts +225 -0
- package/src/apis/ChunksApi.ts +27 -17
- package/src/apis/DocumentsApi.ts +4 -4
- package/src/apis/FoldersApi.ts +4 -4
- package/src/apis/InvitesApi.ts +107 -6
- package/src/apis/PublicApi.ts +100 -0
- package/src/apis/SubscriptionsApi.ts +238 -0
- package/src/apis/TenantsApi.ts +88 -0
- package/src/apis/ThreadsApi.ts +4 -4
- package/src/apis/index.ts +3 -0
- package/src/models/AcceptInviteResponse.ts +8 -0
- package/src/models/AskRequest.ts +83 -0
- package/src/models/AskResponse.ts +83 -0
- package/src/models/ChangeSubscriptionRequest.ts +96 -0
- package/src/models/CheckpointDetails.ts +169 -0
- package/src/models/ChunkBulkResponse.ts +11 -11
- package/src/models/ChunkContentItem.ts +10 -10
- package/src/models/{ChunkMetadataInput.ts → ChunkMetadata.ts} +25 -25
- package/src/models/ChunkNeighborsResponse.ts +26 -0
- package/src/models/ChunkResponse.ts +11 -11
- package/src/models/CreateChunkRequest.ts +10 -10
- package/src/models/DocumentResponse.ts +9 -0
- package/src/models/DocumentVersionMetadata.ts +32 -0
- package/src/models/DocumentVersionMetadataUpdate.ts +32 -0
- package/src/models/ExtractRequest.ts +99 -0
- package/src/models/ExtractResponse.ts +83 -0
- package/src/models/FolderResponse.ts +9 -0
- package/src/models/InviteLinkSettingsRequest.ts +116 -0
- package/src/models/InviteLinkSettingsResponse.ts +111 -0
- package/src/models/InviteResponse.ts +8 -0
- package/src/models/InviteUserRequest.ts +12 -0
- package/src/models/LineageNodeResponse.ts +10 -10
- package/src/models/MeteredQuotaStatus.ts +129 -0
- package/src/models/PathPartAncestorItem.ts +9 -0
- package/src/models/PathPartResponse.ts +9 -0
- package/src/models/PipelineStatus.ts +2 -1
- package/src/models/ScoredChunkResponse.ts +11 -11
- package/src/models/SeatQuotaStatus.ts +94 -0
- package/src/models/SubscriptionPlanResponse.ts +161 -0
- package/src/models/TenantQuotaStateResponse.ts +107 -0
- package/src/models/TenantResponse.ts +22 -0
- package/src/models/TenantSettingsResponse.ts +16 -0
- package/src/models/TenantSettingsUpdate.ts +15 -0
- package/src/models/ThreadMessageDetailsInput.ts +15 -0
- package/src/models/ThreadMessageDetailsOutput.ts +15 -0
- package/src/models/UpdateChunkMetadataRequest.ts +10 -10
- package/src/models/UpdateDocumentRequest.ts +9 -1
- package/src/models/UpdateFolderRequest.ts +9 -1
- package/src/models/UpdateInviteRequest.ts +94 -0
- package/src/models/UsageMetric.ts +54 -0
- package/src/models/index.ts +15 -2
- package/dist/esm/models/ChunkMetadataOutput.d.ts +0 -135
- package/dist/esm/models/ChunkMetadataOutput.js +0 -70
- package/dist/models/ChunkMetadataOutput.d.ts +0 -135
- package/dist/models/ChunkMetadataOutput.js +0 -78
- package/docs/ChunkMetadataOutput.md +0 -61
- package/src/models/ChunkMetadataOutput.ts +0 -203
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
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
|
+
SubscriptionPlanResponse,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
SubscriptionPlanResponseFromJSON,
|
|
22
|
+
SubscriptionPlanResponseToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* PublicApi - interface
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
* @interface PublicApiInterface
|
|
30
|
+
*/
|
|
31
|
+
export interface PublicApiInterface {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for listPublicSubscriptions without sending the request
|
|
34
|
+
* @throws {RequiredError}
|
|
35
|
+
* @memberof PublicApiInterface
|
|
36
|
+
*/
|
|
37
|
+
listPublicSubscriptionsRequestOpts(): Promise<runtime.RequestOpts>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* List publicly-visible subscription plans (no authentication required). Filters to ``subscription_plan.public = true`` — custom enterprise tiers (created with ``public=False`` via ``POST /system/subscriptions``) are excluded. Tenants on a private plan can still read it via ``GET /v1/tenants/{tenant_id}/subscriptions``.
|
|
41
|
+
* @summary List Public Subscriptions Handler
|
|
42
|
+
* @param {*} [options] Override http request option.
|
|
43
|
+
* @throws {RequiredError}
|
|
44
|
+
* @memberof PublicApiInterface
|
|
45
|
+
*/
|
|
46
|
+
listPublicSubscriptionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SubscriptionPlanResponse>>>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* List publicly-visible subscription plans (no authentication required). Filters to ``subscription_plan.public = true`` — custom enterprise tiers (created with ``public=False`` via ``POST /system/subscriptions``) are excluded. Tenants on a private plan can still read it via ``GET /v1/tenants/{tenant_id}/subscriptions``.
|
|
50
|
+
* List Public Subscriptions Handler
|
|
51
|
+
*/
|
|
52
|
+
listPublicSubscriptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SubscriptionPlanResponse>>;
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export class PublicApi extends runtime.BaseAPI implements PublicApiInterface {
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Creates request options for listPublicSubscriptions without sending the request
|
|
63
|
+
*/
|
|
64
|
+
async listPublicSubscriptionsRequestOpts(): Promise<runtime.RequestOpts> {
|
|
65
|
+
const queryParameters: any = {};
|
|
66
|
+
|
|
67
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
let urlPath = `/public/subscriptions`;
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
path: urlPath,
|
|
74
|
+
method: 'GET',
|
|
75
|
+
headers: headerParameters,
|
|
76
|
+
query: queryParameters,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* List publicly-visible subscription plans (no authentication required). Filters to ``subscription_plan.public = true`` — custom enterprise tiers (created with ``public=False`` via ``POST /system/subscriptions``) are excluded. Tenants on a private plan can still read it via ``GET /v1/tenants/{tenant_id}/subscriptions``.
|
|
82
|
+
* List Public Subscriptions Handler
|
|
83
|
+
*/
|
|
84
|
+
async listPublicSubscriptionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SubscriptionPlanResponse>>> {
|
|
85
|
+
const requestOptions = await this.listPublicSubscriptionsRequestOpts();
|
|
86
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
87
|
+
|
|
88
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SubscriptionPlanResponseFromJSON));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* List publicly-visible subscription plans (no authentication required). Filters to ``subscription_plan.public = true`` — custom enterprise tiers (created with ``public=False`` via ``POST /system/subscriptions``) are excluded. Tenants on a private plan can still read it via ``GET /v1/tenants/{tenant_id}/subscriptions``.
|
|
93
|
+
* List Public Subscriptions Handler
|
|
94
|
+
*/
|
|
95
|
+
async listPublicSubscriptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SubscriptionPlanResponse>> {
|
|
96
|
+
const response = await this.listPublicSubscriptionsRaw(initOverrides);
|
|
97
|
+
return await response.value();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
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
|
+
ChangeSubscriptionRequest,
|
|
19
|
+
HTTPValidationError,
|
|
20
|
+
SubscriptionPlanResponse,
|
|
21
|
+
TenantResponse,
|
|
22
|
+
} from '../models/index';
|
|
23
|
+
import {
|
|
24
|
+
ChangeSubscriptionRequestFromJSON,
|
|
25
|
+
ChangeSubscriptionRequestToJSON,
|
|
26
|
+
HTTPValidationErrorFromJSON,
|
|
27
|
+
HTTPValidationErrorToJSON,
|
|
28
|
+
SubscriptionPlanResponseFromJSON,
|
|
29
|
+
SubscriptionPlanResponseToJSON,
|
|
30
|
+
TenantResponseFromJSON,
|
|
31
|
+
TenantResponseToJSON,
|
|
32
|
+
} from '../models/index';
|
|
33
|
+
|
|
34
|
+
export interface ChangeTenantSubscriptionRequest {
|
|
35
|
+
tenantId: string;
|
|
36
|
+
changeSubscriptionRequest: ChangeSubscriptionRequest;
|
|
37
|
+
idempotencyKey?: string | null;
|
|
38
|
+
authorization?: string | null;
|
|
39
|
+
ksUat?: string | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface GetTenantSubscriptionRequest {
|
|
43
|
+
tenantId: string;
|
|
44
|
+
authorization?: string | null;
|
|
45
|
+
ksUat?: string | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* SubscriptionsApi - interface
|
|
50
|
+
*
|
|
51
|
+
* @export
|
|
52
|
+
* @interface SubscriptionsApiInterface
|
|
53
|
+
*/
|
|
54
|
+
export interface SubscriptionsApiInterface {
|
|
55
|
+
/**
|
|
56
|
+
* Creates request options for changeTenantSubscription without sending the request
|
|
57
|
+
* @param {string} tenantId
|
|
58
|
+
* @param {ChangeSubscriptionRequest} changeSubscriptionRequest
|
|
59
|
+
* @param {string} [idempotencyKey]
|
|
60
|
+
* @param {string} [authorization]
|
|
61
|
+
* @param {string} [ksUat]
|
|
62
|
+
* @throws {RequiredError}
|
|
63
|
+
* @memberof SubscriptionsApiInterface
|
|
64
|
+
*/
|
|
65
|
+
changeTenantSubscriptionRequestOpts(requestParameters: ChangeTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Change the tenant\'s subscription plan and/or seat count. OWNER-only on the target tenant. Covers three scenarios with one shape: - Plan change (with optional seat-count change). - Pure seat-count change (same plan, different ``num_seats``). - No-op (same plan, same seats) — returns 200, performs no DB or Stripe writes. Optional ``Idempotency-Key`` request header is forwarded to Stripe verbatim (clients that retry the same logical operation MUST send the same value across attempts; Stripe collapses duplicates server- side). Absent the header, the server generates a fresh ``uuid4()`` per call and emits a warning — retries in that case are NOT deduplicated. v1 mock-Stripe doesn\'t care, but the contract is in place for the real integration.
|
|
69
|
+
* @summary Change Tenant Subscription Handler
|
|
70
|
+
* @param {string} tenantId
|
|
71
|
+
* @param {ChangeSubscriptionRequest} changeSubscriptionRequest
|
|
72
|
+
* @param {string} [idempotencyKey]
|
|
73
|
+
* @param {string} [authorization]
|
|
74
|
+
* @param {string} [ksUat]
|
|
75
|
+
* @param {*} [options] Override http request option.
|
|
76
|
+
* @throws {RequiredError}
|
|
77
|
+
* @memberof SubscriptionsApiInterface
|
|
78
|
+
*/
|
|
79
|
+
changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantResponse>>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Change the tenant\'s subscription plan and/or seat count. OWNER-only on the target tenant. Covers three scenarios with one shape: - Plan change (with optional seat-count change). - Pure seat-count change (same plan, different ``num_seats``). - No-op (same plan, same seats) — returns 200, performs no DB or Stripe writes. Optional ``Idempotency-Key`` request header is forwarded to Stripe verbatim (clients that retry the same logical operation MUST send the same value across attempts; Stripe collapses duplicates server- side). Absent the header, the server generates a fresh ``uuid4()`` per call and emits a warning — retries in that case are NOT deduplicated. v1 mock-Stripe doesn\'t care, but the contract is in place for the real integration.
|
|
83
|
+
* Change Tenant Subscription Handler
|
|
84
|
+
*/
|
|
85
|
+
changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantResponse>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates request options for getTenantSubscription without sending the request
|
|
89
|
+
* @param {string} tenantId
|
|
90
|
+
* @param {string} [authorization]
|
|
91
|
+
* @param {string} [ksUat]
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
* @memberof SubscriptionsApiInterface
|
|
94
|
+
*/
|
|
95
|
+
getTenantSubscriptionRequestOpts(requestParameters: GetTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Read the tenant\'s current subscription plan, including private tiers. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. Returns the full plan body (id, name, caps, max_seats, public flag, timestamps). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
99
|
+
* @summary Get Tenant Subscription Handler
|
|
100
|
+
* @param {string} tenantId
|
|
101
|
+
* @param {string} [authorization]
|
|
102
|
+
* @param {string} [ksUat]
|
|
103
|
+
* @param {*} [options] Override http request option.
|
|
104
|
+
* @throws {RequiredError}
|
|
105
|
+
* @memberof SubscriptionsApiInterface
|
|
106
|
+
*/
|
|
107
|
+
getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPlanResponse>>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Read the tenant\'s current subscription plan, including private tiers. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. Returns the full plan body (id, name, caps, max_seats, public flag, timestamps). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
111
|
+
* Get Tenant Subscription Handler
|
|
112
|
+
*/
|
|
113
|
+
getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPlanResponse>;
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
export class SubscriptionsApi extends runtime.BaseAPI implements SubscriptionsApiInterface {
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Creates request options for changeTenantSubscription without sending the request
|
|
124
|
+
*/
|
|
125
|
+
async changeTenantSubscriptionRequestOpts(requestParameters: ChangeTenantSubscriptionRequest): Promise<runtime.RequestOpts> {
|
|
126
|
+
if (requestParameters['tenantId'] == null) {
|
|
127
|
+
throw new runtime.RequiredError(
|
|
128
|
+
'tenantId',
|
|
129
|
+
'Required parameter "tenantId" was null or undefined when calling changeTenantSubscription().'
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (requestParameters['changeSubscriptionRequest'] == null) {
|
|
134
|
+
throw new runtime.RequiredError(
|
|
135
|
+
'changeSubscriptionRequest',
|
|
136
|
+
'Required parameter "changeSubscriptionRequest" was null or undefined when calling changeTenantSubscription().'
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const queryParameters: any = {};
|
|
141
|
+
|
|
142
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
143
|
+
|
|
144
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
145
|
+
|
|
146
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
147
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (requestParameters['authorization'] != null) {
|
|
151
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
let urlPath = `/v1/tenants/{tenant_id}/subscriptions`;
|
|
156
|
+
urlPath = urlPath.replace(`{${"tenant_id"}}`, encodeURIComponent(String(requestParameters['tenantId'])));
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
path: urlPath,
|
|
160
|
+
method: 'POST',
|
|
161
|
+
headers: headerParameters,
|
|
162
|
+
query: queryParameters,
|
|
163
|
+
body: ChangeSubscriptionRequestToJSON(requestParameters['changeSubscriptionRequest']),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Change the tenant\'s subscription plan and/or seat count. OWNER-only on the target tenant. Covers three scenarios with one shape: - Plan change (with optional seat-count change). - Pure seat-count change (same plan, different ``num_seats``). - No-op (same plan, same seats) — returns 200, performs no DB or Stripe writes. Optional ``Idempotency-Key`` request header is forwarded to Stripe verbatim (clients that retry the same logical operation MUST send the same value across attempts; Stripe collapses duplicates server- side). Absent the header, the server generates a fresh ``uuid4()`` per call and emits a warning — retries in that case are NOT deduplicated. v1 mock-Stripe doesn\'t care, but the contract is in place for the real integration.
|
|
169
|
+
* Change Tenant Subscription Handler
|
|
170
|
+
*/
|
|
171
|
+
async changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantResponse>> {
|
|
172
|
+
const requestOptions = await this.changeTenantSubscriptionRequestOpts(requestParameters);
|
|
173
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
174
|
+
|
|
175
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TenantResponseFromJSON(jsonValue));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Change the tenant\'s subscription plan and/or seat count. OWNER-only on the target tenant. Covers three scenarios with one shape: - Plan change (with optional seat-count change). - Pure seat-count change (same plan, different ``num_seats``). - No-op (same plan, same seats) — returns 200, performs no DB or Stripe writes. Optional ``Idempotency-Key`` request header is forwarded to Stripe verbatim (clients that retry the same logical operation MUST send the same value across attempts; Stripe collapses duplicates server- side). Absent the header, the server generates a fresh ``uuid4()`` per call and emits a warning — retries in that case are NOT deduplicated. v1 mock-Stripe doesn\'t care, but the contract is in place for the real integration.
|
|
180
|
+
* Change Tenant Subscription Handler
|
|
181
|
+
*/
|
|
182
|
+
async changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantResponse> {
|
|
183
|
+
const response = await this.changeTenantSubscriptionRaw(requestParameters, initOverrides);
|
|
184
|
+
return await response.value();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Creates request options for getTenantSubscription without sending the request
|
|
189
|
+
*/
|
|
190
|
+
async getTenantSubscriptionRequestOpts(requestParameters: GetTenantSubscriptionRequest): Promise<runtime.RequestOpts> {
|
|
191
|
+
if (requestParameters['tenantId'] == null) {
|
|
192
|
+
throw new runtime.RequiredError(
|
|
193
|
+
'tenantId',
|
|
194
|
+
'Required parameter "tenantId" was null or undefined when calling getTenantSubscription().'
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const queryParameters: any = {};
|
|
199
|
+
|
|
200
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
201
|
+
|
|
202
|
+
if (requestParameters['authorization'] != null) {
|
|
203
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
let urlPath = `/v1/tenants/{tenant_id}/subscriptions`;
|
|
208
|
+
urlPath = urlPath.replace(`{${"tenant_id"}}`, encodeURIComponent(String(requestParameters['tenantId'])));
|
|
209
|
+
|
|
210
|
+
return {
|
|
211
|
+
path: urlPath,
|
|
212
|
+
method: 'GET',
|
|
213
|
+
headers: headerParameters,
|
|
214
|
+
query: queryParameters,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Read the tenant\'s current subscription plan, including private tiers. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. Returns the full plan body (id, name, caps, max_seats, public flag, timestamps). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
220
|
+
* Get Tenant Subscription Handler
|
|
221
|
+
*/
|
|
222
|
+
async getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPlanResponse>> {
|
|
223
|
+
const requestOptions = await this.getTenantSubscriptionRequestOpts(requestParameters);
|
|
224
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
225
|
+
|
|
226
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SubscriptionPlanResponseFromJSON(jsonValue));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Read the tenant\'s current subscription plan, including private tiers. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. Returns the full plan body (id, name, caps, max_seats, public flag, timestamps). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
231
|
+
* Get Tenant Subscription Handler
|
|
232
|
+
*/
|
|
233
|
+
async getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPlanResponse> {
|
|
234
|
+
const response = await this.getTenantSubscriptionRaw(requestParameters, initOverrides);
|
|
235
|
+
return await response.value();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
}
|
package/src/apis/TenantsApi.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
HTTPValidationError,
|
|
20
20
|
PaginatedResponseTenantResponse,
|
|
21
21
|
PaginatedResponseTenantUserResponse,
|
|
22
|
+
TenantQuotaStateResponse,
|
|
22
23
|
TenantResponse,
|
|
23
24
|
TenantUserEditRequest,
|
|
24
25
|
TenantUserResponse,
|
|
@@ -33,6 +34,8 @@ import {
|
|
|
33
34
|
PaginatedResponseTenantResponseToJSON,
|
|
34
35
|
PaginatedResponseTenantUserResponseFromJSON,
|
|
35
36
|
PaginatedResponseTenantUserResponseToJSON,
|
|
37
|
+
TenantQuotaStateResponseFromJSON,
|
|
38
|
+
TenantQuotaStateResponseToJSON,
|
|
36
39
|
TenantResponseFromJSON,
|
|
37
40
|
TenantResponseToJSON,
|
|
38
41
|
TenantUserEditRequestFromJSON,
|
|
@@ -83,6 +86,12 @@ export interface GetTenantRequest {
|
|
|
83
86
|
ksUat?: string | null;
|
|
84
87
|
}
|
|
85
88
|
|
|
89
|
+
export interface GetTenantQuotaStateRequest {
|
|
90
|
+
tenantId: string;
|
|
91
|
+
authorization?: string | null;
|
|
92
|
+
ksUat?: string | null;
|
|
93
|
+
}
|
|
94
|
+
|
|
86
95
|
export interface ListTenantUsersRequest {
|
|
87
96
|
tenantId: string;
|
|
88
97
|
limit?: number;
|
|
@@ -304,6 +313,34 @@ export interface TenantsApiInterface {
|
|
|
304
313
|
*/
|
|
305
314
|
getTenant(requestParameters: GetTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantResponse>;
|
|
306
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Creates request options for getTenantQuotaState without sending the request
|
|
318
|
+
* @param {string} tenantId
|
|
319
|
+
* @param {string} [authorization]
|
|
320
|
+
* @param {string} [ksUat]
|
|
321
|
+
* @throws {RequiredError}
|
|
322
|
+
* @memberof TenantsApiInterface
|
|
323
|
+
*/
|
|
324
|
+
getTenantQuotaStateRequestOpts(requestParameters: GetTenantQuotaStateRequest): Promise<runtime.RequestOpts>;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Read the tenant\'s current quota state across all metered caps + seats. Any active member of the tenant can read. Read-only — does not mutate quota state.
|
|
328
|
+
* @summary Get Tenant Quota State Handler
|
|
329
|
+
* @param {string} tenantId
|
|
330
|
+
* @param {string} [authorization]
|
|
331
|
+
* @param {string} [ksUat]
|
|
332
|
+
* @param {*} [options] Override http request option.
|
|
333
|
+
* @throws {RequiredError}
|
|
334
|
+
* @memberof TenantsApiInterface
|
|
335
|
+
*/
|
|
336
|
+
getTenantQuotaStateRaw(requestParameters: GetTenantQuotaStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantQuotaStateResponse>>;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Read the tenant\'s current quota state across all metered caps + seats. Any active member of the tenant can read. Read-only — does not mutate quota state.
|
|
340
|
+
* Get Tenant Quota State Handler
|
|
341
|
+
*/
|
|
342
|
+
getTenantQuotaState(requestParameters: GetTenantQuotaStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantQuotaStateResponse>;
|
|
343
|
+
|
|
307
344
|
/**
|
|
308
345
|
* Creates request options for listTenantUsers without sending the request
|
|
309
346
|
* @param {string} tenantId
|
|
@@ -799,6 +836,57 @@ export class TenantsApi extends runtime.BaseAPI implements TenantsApiInterface {
|
|
|
799
836
|
return await response.value();
|
|
800
837
|
}
|
|
801
838
|
|
|
839
|
+
/**
|
|
840
|
+
* Creates request options for getTenantQuotaState without sending the request
|
|
841
|
+
*/
|
|
842
|
+
async getTenantQuotaStateRequestOpts(requestParameters: GetTenantQuotaStateRequest): Promise<runtime.RequestOpts> {
|
|
843
|
+
if (requestParameters['tenantId'] == null) {
|
|
844
|
+
throw new runtime.RequiredError(
|
|
845
|
+
'tenantId',
|
|
846
|
+
'Required parameter "tenantId" was null or undefined when calling getTenantQuotaState().'
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const queryParameters: any = {};
|
|
851
|
+
|
|
852
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
853
|
+
|
|
854
|
+
if (requestParameters['authorization'] != null) {
|
|
855
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
let urlPath = `/v1/tenants/{tenant_id}/quota`;
|
|
860
|
+
urlPath = urlPath.replace(`{${"tenant_id"}}`, encodeURIComponent(String(requestParameters['tenantId'])));
|
|
861
|
+
|
|
862
|
+
return {
|
|
863
|
+
path: urlPath,
|
|
864
|
+
method: 'GET',
|
|
865
|
+
headers: headerParameters,
|
|
866
|
+
query: queryParameters,
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Read the tenant\'s current quota state across all metered caps + seats. Any active member of the tenant can read. Read-only — does not mutate quota state.
|
|
872
|
+
* Get Tenant Quota State Handler
|
|
873
|
+
*/
|
|
874
|
+
async getTenantQuotaStateRaw(requestParameters: GetTenantQuotaStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantQuotaStateResponse>> {
|
|
875
|
+
const requestOptions = await this.getTenantQuotaStateRequestOpts(requestParameters);
|
|
876
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
877
|
+
|
|
878
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TenantQuotaStateResponseFromJSON(jsonValue));
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Read the tenant\'s current quota state across all metered caps + seats. Any active member of the tenant can read. Read-only — does not mutate quota state.
|
|
883
|
+
* Get Tenant Quota State Handler
|
|
884
|
+
*/
|
|
885
|
+
async getTenantQuotaState(requestParameters: GetTenantQuotaStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantQuotaStateResponse> {
|
|
886
|
+
const response = await this.getTenantQuotaStateRaw(requestParameters, initOverrides);
|
|
887
|
+
return await response.value();
|
|
888
|
+
}
|
|
889
|
+
|
|
802
890
|
/**
|
|
803
891
|
* Creates request options for listTenantUsers without sending the request
|
|
804
892
|
*/
|
package/src/apis/ThreadsApi.ts
CHANGED
|
@@ -223,7 +223,7 @@ export interface ThreadsApiInterface {
|
|
|
223
223
|
sendUserMessageRequestOpts(requestParameters: SendUserMessageRequest): Promise<runtime.RequestOpts>;
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output.
|
|
226
|
+
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output. Quota: consumes one MESSAGE inside the same transaction that creates the user-message row and starts the workflow. Any failure on the consume, the workflow start, or anywhere in between rolls back the whole transaction via the session context manager — message insert, quota consume, and downstream side effects are all-or-nothing. No explicit refund path is needed because nothing commits until the workflow has been durably enqueued. Workflow failures observed asynchronously (after enqueue) do **not** refund — the consume stands, matching agent-ask\'s v1 simplification.
|
|
227
227
|
* @summary Send User Message Handler
|
|
228
228
|
* @param {string} threadId
|
|
229
229
|
* @param {UserMessageRequest} userMessageRequest
|
|
@@ -236,7 +236,7 @@ export interface ThreadsApiInterface {
|
|
|
236
236
|
sendUserMessageRaw(requestParameters: SendUserMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserMessageResponse>>;
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
|
-
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output.
|
|
239
|
+
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output. Quota: consumes one MESSAGE inside the same transaction that creates the user-message row and starts the workflow. Any failure on the consume, the workflow start, or anywhere in between rolls back the whole transaction via the session context manager — message insert, quota consume, and downstream side effects are all-or-nothing. No explicit refund path is needed because nothing commits until the workflow has been durably enqueued. Workflow failures observed asynchronously (after enqueue) do **not** refund — the consume stands, matching agent-ask\'s v1 simplification.
|
|
240
240
|
* Send User Message Handler
|
|
241
241
|
*/
|
|
242
242
|
sendUserMessage(requestParameters: SendUserMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserMessageResponse>;
|
|
@@ -561,7 +561,7 @@ export class ThreadsApi extends runtime.BaseAPI implements ThreadsApiInterface {
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
/**
|
|
564
|
-
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output.
|
|
564
|
+
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output. Quota: consumes one MESSAGE inside the same transaction that creates the user-message row and starts the workflow. Any failure on the consume, the workflow start, or anywhere in between rolls back the whole transaction via the session context manager — message insert, quota consume, and downstream side effects are all-or-nothing. No explicit refund path is needed because nothing commits until the workflow has been durably enqueued. Workflow failures observed asynchronously (after enqueue) do **not** refund — the consume stands, matching agent-ask\'s v1 simplification.
|
|
565
565
|
* Send User Message Handler
|
|
566
566
|
*/
|
|
567
567
|
async sendUserMessageRaw(requestParameters: SendUserMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserMessageResponse>> {
|
|
@@ -572,7 +572,7 @@ export class ThreadsApi extends runtime.BaseAPI implements ThreadsApiInterface {
|
|
|
572
572
|
}
|
|
573
573
|
|
|
574
574
|
/**
|
|
575
|
-
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output.
|
|
575
|
+
* Send a user message and trigger agent generation. Returns immediately with a workflow_id. Connect to GET /{thread_id}/stream (SSE) before or after calling this endpoint to receive the streamed output. Quota: consumes one MESSAGE inside the same transaction that creates the user-message row and starts the workflow. Any failure on the consume, the workflow start, or anywhere in between rolls back the whole transaction via the session context manager — message insert, quota consume, and downstream side effects are all-or-nothing. No explicit refund path is needed because nothing commits until the workflow has been durably enqueued. Workflow failures observed asynchronously (after enqueue) do **not** refund — the consume stands, matching agent-ask\'s v1 simplification.
|
|
576
576
|
* Send User Message Handler
|
|
577
577
|
*/
|
|
578
578
|
async sendUserMessage(requestParameters: SendUserMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserMessageResponse> {
|
package/src/apis/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export * from './AgentApi';
|
|
3
4
|
export * from './ApiKeysApi';
|
|
4
5
|
export * from './AuthApi';
|
|
5
6
|
export * from './ChunkLineagesApi';
|
|
@@ -12,7 +13,9 @@ export * from './FeedbackApi';
|
|
|
12
13
|
export * from './FoldersApi';
|
|
13
14
|
export * from './InvitesApi';
|
|
14
15
|
export * from './PathPartsApi';
|
|
16
|
+
export * from './PublicApi';
|
|
15
17
|
export * from './SectionsApi';
|
|
18
|
+
export * from './SubscriptionsApi';
|
|
16
19
|
export * from './TagsApi';
|
|
17
20
|
export * from './TenantGroupsApi';
|
|
18
21
|
export * from './TenantsApi';
|
|
@@ -39,6 +39,12 @@ export interface AcceptInviteResponse {
|
|
|
39
39
|
* @memberof AcceptInviteResponse
|
|
40
40
|
*/
|
|
41
41
|
role: TenantUserRole;
|
|
42
|
+
/**
|
|
43
|
+
* Groups configured on the invite/tenant link that no longer exist and were therefore skipped.
|
|
44
|
+
* @type {Array<string>}
|
|
45
|
+
* @memberof AcceptInviteResponse
|
|
46
|
+
*/
|
|
47
|
+
skippedGroups?: Array<string>;
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
|
|
@@ -81,6 +87,7 @@ export function AcceptInviteResponseFromJSONTyped(json: any, ignoreDiscriminator
|
|
|
81
87
|
|
|
82
88
|
'tenantId': json['tenant_id'],
|
|
83
89
|
'role': TenantUserRoleFromJSON(json['role']),
|
|
90
|
+
'skippedGroups': json['skipped_groups'] == null ? undefined : json['skipped_groups'],
|
|
84
91
|
};
|
|
85
92
|
}
|
|
86
93
|
|
|
@@ -97,6 +104,7 @@ export function AcceptInviteResponseToJSONTyped(value?: AcceptInviteResponse | n
|
|
|
97
104
|
|
|
98
105
|
'tenant_id': value['tenantId'],
|
|
99
106
|
'role': TenantUserRoleToJSON(value['role']),
|
|
107
|
+
'skipped_groups': value['skippedGroups'],
|
|
100
108
|
};
|
|
101
109
|
}
|
|
102
110
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* Request body for POST /v1/agent/ask.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AskRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface AskRequest {
|
|
22
|
+
/**
|
|
23
|
+
* User prompt passed directly to the agent
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AskRequest
|
|
26
|
+
*/
|
|
27
|
+
prompt: string;
|
|
28
|
+
}
|
|
29
|
+
export const AskRequestPropertyValidationAttributesMap: {
|
|
30
|
+
[property: string]: {
|
|
31
|
+
maxLength?: number,
|
|
32
|
+
minLength?: number,
|
|
33
|
+
pattern?: string,
|
|
34
|
+
maximum?: number,
|
|
35
|
+
exclusiveMaximum?: boolean,
|
|
36
|
+
minimum?: number,
|
|
37
|
+
exclusiveMinimum?: boolean,
|
|
38
|
+
multipleOf?: number,
|
|
39
|
+
maxItems?: number,
|
|
40
|
+
minItems?: number,
|
|
41
|
+
uniqueItems?: boolean
|
|
42
|
+
}
|
|
43
|
+
} = {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given object implements the AskRequest interface.
|
|
49
|
+
*/
|
|
50
|
+
export function instanceOfAskRequest(value: object): value is AskRequest {
|
|
51
|
+
if (!('prompt' in value) || value['prompt'] === undefined) return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function AskRequestFromJSON(json: any): AskRequest {
|
|
56
|
+
return AskRequestFromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function AskRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AskRequest {
|
|
60
|
+
if (json == null) {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'prompt': json['prompt'],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function AskRequestToJSON(json: any): AskRequest {
|
|
70
|
+
return AskRequestToJSONTyped(json, false);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function AskRequestToJSONTyped(value?: AskRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
74
|
+
if (value == null) {
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
|
|
80
|
+
'prompt': value['prompt'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|