@knowledge-stack/ksapi 1.72.4 → 1.78.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.
- 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/FeaturesResponse.d.ts +12 -0
- package/dist/esm/models/FeaturesResponse.js +8 -0
- package/dist/esm/models/FolderResponse.d.ts +6 -0
- package/dist/esm/models/FolderResponse.js +4 -0
- package/dist/esm/models/IdpType.d.ts +2 -0
- package/dist/esm/models/IdpType.js +2 -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/FeaturesResponse.d.ts +12 -0
- package/dist/models/FeaturesResponse.js +8 -0
- package/dist/models/FolderResponse.d.ts +6 -0
- package/dist/models/FolderResponse.js +4 -0
- package/dist/models/IdpType.d.ts +2 -0
- package/dist/models/IdpType.js +2 -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/AuthApi.md +2 -2
- 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/FeaturesResponse.md +4 -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/FeaturesResponse.ts +18 -0
- package/src/models/FolderResponse.ts +9 -0
- package/src/models/IdpType.ts +2 -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
package/src/apis/InvitesApi.ts
CHANGED
|
@@ -21,6 +21,7 @@ import type {
|
|
|
21
21
|
InviteStatus,
|
|
22
22
|
InviteUserRequest,
|
|
23
23
|
PaginatedResponseInviteResponse,
|
|
24
|
+
UpdateInviteRequest,
|
|
24
25
|
} from '../models/index';
|
|
25
26
|
import {
|
|
26
27
|
AcceptInviteResponseFromJSON,
|
|
@@ -35,6 +36,8 @@ import {
|
|
|
35
36
|
InviteUserRequestToJSON,
|
|
36
37
|
PaginatedResponseInviteResponseFromJSON,
|
|
37
38
|
PaginatedResponseInviteResponseToJSON,
|
|
39
|
+
UpdateInviteRequestFromJSON,
|
|
40
|
+
UpdateInviteRequestToJSON,
|
|
38
41
|
} from '../models/index';
|
|
39
42
|
|
|
40
43
|
export interface AcceptInviteRequest {
|
|
@@ -64,6 +67,13 @@ export interface ListInvitesRequest {
|
|
|
64
67
|
ksUat?: string | null;
|
|
65
68
|
}
|
|
66
69
|
|
|
70
|
+
export interface UpdateInviteOperationRequest {
|
|
71
|
+
inviteId: string;
|
|
72
|
+
updateInviteRequest: UpdateInviteRequest;
|
|
73
|
+
authorization?: string | null;
|
|
74
|
+
ksUat?: string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
/**
|
|
68
78
|
* InvitesApi - interface
|
|
69
79
|
*
|
|
@@ -73,7 +83,7 @@ export interface ListInvitesRequest {
|
|
|
73
83
|
export interface InvitesApiInterface {
|
|
74
84
|
/**
|
|
75
85
|
* Creates request options for acceptInvite without sending the request
|
|
76
|
-
* @param {string} inviteId
|
|
86
|
+
* @param {string} inviteId Either an Invite ID (traditional per-email invite) OR a Tenant ID (when the tenant has ``invite_link.enabled``). Tenant lookup is tried first.
|
|
77
87
|
* @param {string} [authorization]
|
|
78
88
|
* @param {string} [ksUat]
|
|
79
89
|
* @throws {RequiredError}
|
|
@@ -82,9 +92,9 @@ export interface InvitesApiInterface {
|
|
|
82
92
|
acceptInviteRequestOpts(requestParameters: AcceptInviteRequest): Promise<runtime.RequestOpts>;
|
|
83
93
|
|
|
84
94
|
/**
|
|
85
|
-
*
|
|
95
|
+
* Accept an invite OR a tenant invite-link. The path parameter ``invite_id`` may be either: * a Tenant ID (when an admin has enabled ``invite_link`` on the tenant), OR * an Invite ID (the traditional per-email invite flow). Tenant lookup is tried first. If the row is found, the request is treated as an invite-link request — both 400 paths below have *distinct* messages so the frontend can branch on copy: * \"does not have invite link enabled\" → admin hasn\'t turned it on * \"does not support inviting users\" → tenant kill-switch ``system_metadata.can_invite`` is honored on this path too — it\'s a hard kill switch for self-serve onboarding. Only when no tenant matches do we look up an Invite row.
|
|
86
96
|
* @summary Accept Invite
|
|
87
|
-
* @param {string} inviteId
|
|
97
|
+
* @param {string} inviteId Either an Invite ID (traditional per-email invite) OR a Tenant ID (when the tenant has ``invite_link.enabled``). Tenant lookup is tried first.
|
|
88
98
|
* @param {string} [authorization]
|
|
89
99
|
* @param {string} [ksUat]
|
|
90
100
|
* @param {*} [options] Override http request option.
|
|
@@ -94,7 +104,7 @@ export interface InvitesApiInterface {
|
|
|
94
104
|
acceptInviteRaw(requestParameters: AcceptInviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AcceptInviteResponse>>;
|
|
95
105
|
|
|
96
106
|
/**
|
|
97
|
-
*
|
|
107
|
+
* Accept an invite OR a tenant invite-link. The path parameter ``invite_id`` may be either: * a Tenant ID (when an admin has enabled ``invite_link`` on the tenant), OR * an Invite ID (the traditional per-email invite flow). Tenant lookup is tried first. If the row is found, the request is treated as an invite-link request — both 400 paths below have *distinct* messages so the frontend can branch on copy: * \"does not have invite link enabled\" → admin hasn\'t turned it on * \"does not support inviting users\" → tenant kill-switch ``system_metadata.can_invite`` is honored on this path too — it\'s a hard kill switch for self-serve onboarding. Only when no tenant matches do we look up an Invite row.
|
|
98
108
|
* Accept Invite
|
|
99
109
|
*/
|
|
100
110
|
acceptInvite(requestParameters: AcceptInviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AcceptInviteResponse>;
|
|
@@ -189,6 +199,36 @@ export interface InvitesApiInterface {
|
|
|
189
199
|
*/
|
|
190
200
|
listInvites(requestParameters: ListInvitesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseInviteResponse>;
|
|
191
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Creates request options for updateInvite without sending the request
|
|
204
|
+
* @param {string} inviteId
|
|
205
|
+
* @param {UpdateInviteRequest} updateInviteRequest
|
|
206
|
+
* @param {string} [authorization]
|
|
207
|
+
* @param {string} [ksUat]
|
|
208
|
+
* @throws {RequiredError}
|
|
209
|
+
* @memberof InvitesApiInterface
|
|
210
|
+
*/
|
|
211
|
+
updateInviteRequestOpts(requestParameters: UpdateInviteOperationRequest): Promise<runtime.RequestOpts>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Update an invite\'s expiry or groups (admin/owner only). The invite must belong to the caller\'s current tenant. Any provided groups are validated to belong to the same tenant.
|
|
215
|
+
* @summary Update Invite Handler
|
|
216
|
+
* @param {string} inviteId
|
|
217
|
+
* @param {UpdateInviteRequest} updateInviteRequest
|
|
218
|
+
* @param {string} [authorization]
|
|
219
|
+
* @param {string} [ksUat]
|
|
220
|
+
* @param {*} [options] Override http request option.
|
|
221
|
+
* @throws {RequiredError}
|
|
222
|
+
* @memberof InvitesApiInterface
|
|
223
|
+
*/
|
|
224
|
+
updateInviteRaw(requestParameters: UpdateInviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InviteResponse>>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Update an invite\'s expiry or groups (admin/owner only). The invite must belong to the caller\'s current tenant. Any provided groups are validated to belong to the same tenant.
|
|
228
|
+
* Update Invite Handler
|
|
229
|
+
*/
|
|
230
|
+
updateInvite(requestParameters: UpdateInviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InviteResponse>;
|
|
231
|
+
|
|
192
232
|
}
|
|
193
233
|
|
|
194
234
|
/**
|
|
@@ -228,7 +268,7 @@ export class InvitesApi extends runtime.BaseAPI implements InvitesApiInterface {
|
|
|
228
268
|
}
|
|
229
269
|
|
|
230
270
|
/**
|
|
231
|
-
*
|
|
271
|
+
* Accept an invite OR a tenant invite-link. The path parameter ``invite_id`` may be either: * a Tenant ID (when an admin has enabled ``invite_link`` on the tenant), OR * an Invite ID (the traditional per-email invite flow). Tenant lookup is tried first. If the row is found, the request is treated as an invite-link request — both 400 paths below have *distinct* messages so the frontend can branch on copy: * \"does not have invite link enabled\" → admin hasn\'t turned it on * \"does not support inviting users\" → tenant kill-switch ``system_metadata.can_invite`` is honored on this path too — it\'s a hard kill switch for self-serve onboarding. Only when no tenant matches do we look up an Invite row.
|
|
232
272
|
* Accept Invite
|
|
233
273
|
*/
|
|
234
274
|
async acceptInviteRaw(requestParameters: AcceptInviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AcceptInviteResponse>> {
|
|
@@ -239,7 +279,7 @@ export class InvitesApi extends runtime.BaseAPI implements InvitesApiInterface {
|
|
|
239
279
|
}
|
|
240
280
|
|
|
241
281
|
/**
|
|
242
|
-
*
|
|
282
|
+
* Accept an invite OR a tenant invite-link. The path parameter ``invite_id`` may be either: * a Tenant ID (when an admin has enabled ``invite_link`` on the tenant), OR * an Invite ID (the traditional per-email invite flow). Tenant lookup is tried first. If the row is found, the request is treated as an invite-link request — both 400 paths below have *distinct* messages so the frontend can branch on copy: * \"does not have invite link enabled\" → admin hasn\'t turned it on * \"does not support inviting users\" → tenant kill-switch ``system_metadata.can_invite`` is honored on this path too — it\'s a hard kill switch for self-serve onboarding. Only when no tenant matches do we look up an Invite row.
|
|
243
283
|
* Accept Invite
|
|
244
284
|
*/
|
|
245
285
|
async acceptInvite(requestParameters: AcceptInviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AcceptInviteResponse> {
|
|
@@ -409,4 +449,65 @@ export class InvitesApi extends runtime.BaseAPI implements InvitesApiInterface {
|
|
|
409
449
|
return await response.value();
|
|
410
450
|
}
|
|
411
451
|
|
|
452
|
+
/**
|
|
453
|
+
* Creates request options for updateInvite without sending the request
|
|
454
|
+
*/
|
|
455
|
+
async updateInviteRequestOpts(requestParameters: UpdateInviteOperationRequest): Promise<runtime.RequestOpts> {
|
|
456
|
+
if (requestParameters['inviteId'] == null) {
|
|
457
|
+
throw new runtime.RequiredError(
|
|
458
|
+
'inviteId',
|
|
459
|
+
'Required parameter "inviteId" was null or undefined when calling updateInvite().'
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (requestParameters['updateInviteRequest'] == null) {
|
|
464
|
+
throw new runtime.RequiredError(
|
|
465
|
+
'updateInviteRequest',
|
|
466
|
+
'Required parameter "updateInviteRequest" was null or undefined when calling updateInvite().'
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const queryParameters: any = {};
|
|
471
|
+
|
|
472
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
473
|
+
|
|
474
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
475
|
+
|
|
476
|
+
if (requestParameters['authorization'] != null) {
|
|
477
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
let urlPath = `/v1/invites/{invite_id}`;
|
|
482
|
+
urlPath = urlPath.replace(`{${"invite_id"}}`, encodeURIComponent(String(requestParameters['inviteId'])));
|
|
483
|
+
|
|
484
|
+
return {
|
|
485
|
+
path: urlPath,
|
|
486
|
+
method: 'PATCH',
|
|
487
|
+
headers: headerParameters,
|
|
488
|
+
query: queryParameters,
|
|
489
|
+
body: UpdateInviteRequestToJSON(requestParameters['updateInviteRequest']),
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Update an invite\'s expiry or groups (admin/owner only). The invite must belong to the caller\'s current tenant. Any provided groups are validated to belong to the same tenant.
|
|
495
|
+
* Update Invite Handler
|
|
496
|
+
*/
|
|
497
|
+
async updateInviteRaw(requestParameters: UpdateInviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InviteResponse>> {
|
|
498
|
+
const requestOptions = await this.updateInviteRequestOpts(requestParameters);
|
|
499
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
500
|
+
|
|
501
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => InviteResponseFromJSON(jsonValue));
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Update an invite\'s expiry or groups (admin/owner only). The invite must belong to the caller\'s current tenant. Any provided groups are validated to belong to the same tenant.
|
|
506
|
+
* Update Invite Handler
|
|
507
|
+
*/
|
|
508
|
+
async updateInvite(requestParameters: UpdateInviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InviteResponse> {
|
|
509
|
+
const response = await this.updateInviteRaw(requestParameters, initOverrides);
|
|
510
|
+
return await response.value();
|
|
511
|
+
}
|
|
512
|
+
|
|
412
513
|
}
|
|
@@ -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
|
*/
|