@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.
Files changed (326) hide show
  1. package/.openapi-generator/FILES +36 -4
  2. package/README.md +33 -11
  3. package/dist/apis/AgentApi.d.ts +114 -0
  4. package/dist/apis/AgentApi.js +156 -0
  5. package/dist/apis/ChunksApi.d.ts +19 -16
  6. package/dist/apis/ChunksApi.js +9 -6
  7. package/dist/apis/DocumentsApi.d.ts +4 -4
  8. package/dist/apis/DocumentsApi.js +2 -2
  9. package/dist/apis/FoldersApi.d.ts +4 -4
  10. package/dist/apis/FoldersApi.js +2 -2
  11. package/dist/apis/InvitesApi.d.ts +54 -7
  12. package/dist/apis/InvitesApi.js +51 -2
  13. package/dist/apis/PublicApi.d.ts +59 -0
  14. package/dist/apis/PublicApi.js +103 -0
  15. package/dist/apis/SubscriptionsApi.d.ts +120 -0
  16. package/dist/apis/SubscriptionsApi.js +162 -0
  17. package/dist/apis/TenantsApi.d.ts +45 -1
  18. package/dist/apis/TenantsApi.js +44 -0
  19. package/dist/apis/ThreadsApi.d.ts +4 -4
  20. package/dist/apis/ThreadsApi.js +2 -2
  21. package/dist/apis/index.d.ts +3 -0
  22. package/dist/apis/index.js +3 -0
  23. package/dist/esm/apis/AgentApi.d.ts +114 -0
  24. package/dist/esm/apis/AgentApi.js +119 -0
  25. package/dist/esm/apis/ChunksApi.d.ts +19 -16
  26. package/dist/esm/apis/ChunksApi.js +9 -6
  27. package/dist/esm/apis/DocumentsApi.d.ts +4 -4
  28. package/dist/esm/apis/DocumentsApi.js +2 -2
  29. package/dist/esm/apis/FoldersApi.d.ts +4 -4
  30. package/dist/esm/apis/FoldersApi.js +2 -2
  31. package/dist/esm/apis/InvitesApi.d.ts +54 -7
  32. package/dist/esm/apis/InvitesApi.js +52 -3
  33. package/dist/esm/apis/PublicApi.d.ts +59 -0
  34. package/dist/esm/apis/PublicApi.js +66 -0
  35. package/dist/esm/apis/SubscriptionsApi.d.ts +120 -0
  36. package/dist/esm/apis/SubscriptionsApi.js +125 -0
  37. package/dist/esm/apis/TenantsApi.d.ts +45 -1
  38. package/dist/esm/apis/TenantsApi.js +45 -1
  39. package/dist/esm/apis/ThreadsApi.d.ts +4 -4
  40. package/dist/esm/apis/ThreadsApi.js +2 -2
  41. package/dist/esm/apis/index.d.ts +3 -0
  42. package/dist/esm/apis/index.js +3 -0
  43. package/dist/esm/models/AcceptInviteResponse.d.ts +6 -0
  44. package/dist/esm/models/AcceptInviteResponse.js +2 -0
  45. package/dist/esm/models/AskRequest.d.ts +47 -0
  46. package/dist/esm/models/AskRequest.js +44 -0
  47. package/dist/esm/models/AskResponse.d.ts +47 -0
  48. package/dist/esm/models/AskResponse.js +44 -0
  49. package/dist/esm/models/ChangeSubscriptionRequest.d.ts +53 -0
  50. package/dist/esm/models/ChangeSubscriptionRequest.js +53 -0
  51. package/dist/esm/models/CheckpointDetails.d.ts +96 -0
  52. package/dist/esm/models/CheckpointDetails.js +91 -0
  53. package/dist/esm/models/ChunkBulkResponse.d.ts +3 -3
  54. package/dist/esm/models/ChunkBulkResponse.js +3 -3
  55. package/dist/esm/models/ChunkContentItem.d.ts +3 -3
  56. package/dist/esm/models/ChunkContentItem.js +3 -3
  57. package/dist/esm/models/{ChunkMetadataInput.d.ts → ChunkMetadata.d.ts} +23 -23
  58. package/dist/esm/models/{ChunkMetadataInput.js → ChunkMetadata.js} +9 -9
  59. package/dist/esm/models/ChunkNeighborsResponse.d.ts +18 -0
  60. package/dist/esm/models/ChunkNeighborsResponse.js +10 -0
  61. package/dist/esm/models/ChunkResponse.d.ts +3 -3
  62. package/dist/esm/models/ChunkResponse.js +3 -3
  63. package/dist/esm/models/CreateChunkRequest.d.ts +3 -3
  64. package/dist/esm/models/CreateChunkRequest.js +3 -3
  65. package/dist/esm/models/DocumentResponse.d.ts +6 -0
  66. package/dist/esm/models/DocumentResponse.js +4 -0
  67. package/dist/esm/models/DocumentVersionMetadata.d.ts +24 -0
  68. package/dist/esm/models/DocumentVersionMetadata.js +8 -0
  69. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +24 -0
  70. package/dist/esm/models/DocumentVersionMetadataUpdate.js +8 -0
  71. package/dist/esm/models/ExtractRequest.d.ts +61 -0
  72. package/dist/esm/models/ExtractRequest.js +48 -0
  73. package/dist/esm/models/ExtractResponse.d.ts +49 -0
  74. package/dist/esm/models/ExtractResponse.js +44 -0
  75. package/dist/esm/models/FeaturesResponse.d.ts +12 -0
  76. package/dist/esm/models/FeaturesResponse.js +8 -0
  77. package/dist/esm/models/FolderResponse.d.ts +6 -0
  78. package/dist/esm/models/FolderResponse.js +4 -0
  79. package/dist/esm/models/IdpType.d.ts +2 -0
  80. package/dist/esm/models/IdpType.js +2 -0
  81. package/dist/esm/models/InviteLinkSettingsRequest.d.ts +70 -0
  82. package/dist/esm/models/InviteLinkSettingsRequest.js +58 -0
  83. package/dist/esm/models/InviteLinkSettingsResponse.d.ts +67 -0
  84. package/dist/esm/models/InviteLinkSettingsResponse.js +57 -0
  85. package/dist/esm/models/InviteResponse.d.ts +6 -0
  86. package/dist/esm/models/InviteResponse.js +2 -0
  87. package/dist/esm/models/InviteUserRequest.d.ts +6 -0
  88. package/dist/esm/models/InviteUserRequest.js +8 -1
  89. package/dist/esm/models/LineageNodeResponse.d.ts +3 -3
  90. package/dist/esm/models/LineageNodeResponse.js +3 -3
  91. package/dist/esm/models/MeteredQuotaStatus.d.ts +72 -0
  92. package/dist/esm/models/MeteredQuotaStatus.js +61 -0
  93. package/dist/esm/models/PathPartAncestorItem.d.ts +6 -0
  94. package/dist/esm/models/PathPartAncestorItem.js +4 -0
  95. package/dist/esm/models/PathPartResponse.d.ts +6 -0
  96. package/dist/esm/models/PathPartResponse.js +4 -0
  97. package/dist/esm/models/PipelineStatus.d.ts +1 -0
  98. package/dist/esm/models/PipelineStatus.js +2 -1
  99. package/dist/esm/models/ScoredChunkResponse.d.ts +3 -3
  100. package/dist/esm/models/ScoredChunkResponse.js +3 -3
  101. package/dist/esm/models/SeatQuotaStatus.d.ts +55 -0
  102. package/dist/esm/models/SeatQuotaStatus.js +48 -0
  103. package/dist/esm/models/SubscriptionPlanResponse.d.ts +101 -0
  104. package/dist/esm/models/SubscriptionPlanResponse.js +76 -0
  105. package/dist/esm/models/TenantQuotaStateResponse.d.ts +55 -0
  106. package/dist/esm/models/TenantQuotaStateResponse.js +50 -0
  107. package/dist/esm/models/TenantResponse.d.ts +12 -0
  108. package/dist/esm/models/TenantResponse.js +14 -1
  109. package/dist/esm/models/TenantSettingsResponse.d.ts +7 -0
  110. package/dist/esm/models/TenantSettingsResponse.js +5 -0
  111. package/dist/esm/models/TenantSettingsUpdate.d.ts +7 -0
  112. package/dist/esm/models/TenantSettingsUpdate.js +3 -0
  113. package/dist/esm/models/ThreadMessageDetailsInput.d.ts +7 -0
  114. package/dist/esm/models/ThreadMessageDetailsInput.js +3 -0
  115. package/dist/esm/models/ThreadMessageDetailsOutput.d.ts +7 -0
  116. package/dist/esm/models/ThreadMessageDetailsOutput.js +3 -0
  117. package/dist/esm/models/UpdateChunkMetadataRequest.d.ts +3 -3
  118. package/dist/esm/models/UpdateChunkMetadataRequest.js +3 -3
  119. package/dist/esm/models/UpdateDocumentRequest.d.ts +7 -1
  120. package/dist/esm/models/UpdateDocumentRequest.js +2 -0
  121. package/dist/esm/models/UpdateFolderRequest.d.ts +7 -1
  122. package/dist/esm/models/UpdateFolderRequest.js +2 -0
  123. package/dist/esm/models/UpdateInviteRequest.d.ts +53 -0
  124. package/dist/esm/models/UpdateInviteRequest.js +49 -0
  125. package/dist/esm/models/UsageMetric.d.ts +26 -0
  126. package/dist/esm/models/UsageMetric.js +44 -0
  127. package/dist/esm/models/index.d.ts +15 -2
  128. package/dist/esm/models/index.js +15 -2
  129. package/dist/models/AcceptInviteResponse.d.ts +6 -0
  130. package/dist/models/AcceptInviteResponse.js +2 -0
  131. package/dist/models/AskRequest.d.ts +47 -0
  132. package/dist/models/AskRequest.js +52 -0
  133. package/dist/models/AskResponse.d.ts +47 -0
  134. package/dist/models/AskResponse.js +52 -0
  135. package/dist/models/ChangeSubscriptionRequest.d.ts +53 -0
  136. package/dist/models/ChangeSubscriptionRequest.js +61 -0
  137. package/dist/models/CheckpointDetails.d.ts +96 -0
  138. package/dist/models/CheckpointDetails.js +99 -0
  139. package/dist/models/ChunkBulkResponse.d.ts +3 -3
  140. package/dist/models/ChunkBulkResponse.js +3 -3
  141. package/dist/models/ChunkContentItem.d.ts +3 -3
  142. package/dist/models/ChunkContentItem.js +3 -3
  143. package/dist/models/{ChunkMetadataInput.d.ts → ChunkMetadata.d.ts} +23 -23
  144. package/dist/models/{ChunkMetadataInput.js → ChunkMetadata.js} +15 -15
  145. package/dist/models/ChunkNeighborsResponse.d.ts +18 -0
  146. package/dist/models/ChunkNeighborsResponse.js +10 -0
  147. package/dist/models/ChunkResponse.d.ts +3 -3
  148. package/dist/models/ChunkResponse.js +3 -3
  149. package/dist/models/CreateChunkRequest.d.ts +3 -3
  150. package/dist/models/CreateChunkRequest.js +3 -3
  151. package/dist/models/DocumentResponse.d.ts +6 -0
  152. package/dist/models/DocumentResponse.js +4 -0
  153. package/dist/models/DocumentVersionMetadata.d.ts +24 -0
  154. package/dist/models/DocumentVersionMetadata.js +8 -0
  155. package/dist/models/DocumentVersionMetadataUpdate.d.ts +24 -0
  156. package/dist/models/DocumentVersionMetadataUpdate.js +8 -0
  157. package/dist/models/ExtractRequest.d.ts +61 -0
  158. package/dist/models/ExtractRequest.js +56 -0
  159. package/dist/models/ExtractResponse.d.ts +49 -0
  160. package/dist/models/ExtractResponse.js +52 -0
  161. package/dist/models/FeaturesResponse.d.ts +12 -0
  162. package/dist/models/FeaturesResponse.js +8 -0
  163. package/dist/models/FolderResponse.d.ts +6 -0
  164. package/dist/models/FolderResponse.js +4 -0
  165. package/dist/models/IdpType.d.ts +2 -0
  166. package/dist/models/IdpType.js +2 -0
  167. package/dist/models/InviteLinkSettingsRequest.d.ts +70 -0
  168. package/dist/models/InviteLinkSettingsRequest.js +66 -0
  169. package/dist/models/InviteLinkSettingsResponse.d.ts +67 -0
  170. package/dist/models/InviteLinkSettingsResponse.js +65 -0
  171. package/dist/models/InviteResponse.d.ts +6 -0
  172. package/dist/models/InviteResponse.js +2 -0
  173. package/dist/models/InviteUserRequest.d.ts +6 -0
  174. package/dist/models/InviteUserRequest.js +8 -1
  175. package/dist/models/LineageNodeResponse.d.ts +3 -3
  176. package/dist/models/LineageNodeResponse.js +3 -3
  177. package/dist/models/MeteredQuotaStatus.d.ts +72 -0
  178. package/dist/models/MeteredQuotaStatus.js +69 -0
  179. package/dist/models/PathPartAncestorItem.d.ts +6 -0
  180. package/dist/models/PathPartAncestorItem.js +4 -0
  181. package/dist/models/PathPartResponse.d.ts +6 -0
  182. package/dist/models/PathPartResponse.js +4 -0
  183. package/dist/models/PipelineStatus.d.ts +1 -0
  184. package/dist/models/PipelineStatus.js +2 -1
  185. package/dist/models/ScoredChunkResponse.d.ts +3 -3
  186. package/dist/models/ScoredChunkResponse.js +3 -3
  187. package/dist/models/SeatQuotaStatus.d.ts +55 -0
  188. package/dist/models/SeatQuotaStatus.js +56 -0
  189. package/dist/models/SubscriptionPlanResponse.d.ts +101 -0
  190. package/dist/models/SubscriptionPlanResponse.js +84 -0
  191. package/dist/models/TenantQuotaStateResponse.d.ts +55 -0
  192. package/dist/models/TenantQuotaStateResponse.js +58 -0
  193. package/dist/models/TenantResponse.d.ts +12 -0
  194. package/dist/models/TenantResponse.js +14 -1
  195. package/dist/models/TenantSettingsResponse.d.ts +7 -0
  196. package/dist/models/TenantSettingsResponse.js +5 -0
  197. package/dist/models/TenantSettingsUpdate.d.ts +7 -0
  198. package/dist/models/TenantSettingsUpdate.js +3 -0
  199. package/dist/models/ThreadMessageDetailsInput.d.ts +7 -0
  200. package/dist/models/ThreadMessageDetailsInput.js +3 -0
  201. package/dist/models/ThreadMessageDetailsOutput.d.ts +7 -0
  202. package/dist/models/ThreadMessageDetailsOutput.js +3 -0
  203. package/dist/models/UpdateChunkMetadataRequest.d.ts +3 -3
  204. package/dist/models/UpdateChunkMetadataRequest.js +3 -3
  205. package/dist/models/UpdateDocumentRequest.d.ts +7 -1
  206. package/dist/models/UpdateDocumentRequest.js +2 -0
  207. package/dist/models/UpdateFolderRequest.d.ts +7 -1
  208. package/dist/models/UpdateFolderRequest.js +2 -0
  209. package/dist/models/UpdateInviteRequest.d.ts +53 -0
  210. package/dist/models/UpdateInviteRequest.js +57 -0
  211. package/dist/models/UsageMetric.d.ts +26 -0
  212. package/dist/models/UsageMetric.js +52 -0
  213. package/dist/models/index.d.ts +15 -2
  214. package/dist/models/index.js +15 -2
  215. package/docs/AcceptInviteResponse.md +2 -0
  216. package/docs/AgentApi.md +158 -0
  217. package/docs/AskRequest.md +35 -0
  218. package/docs/AskResponse.md +35 -0
  219. package/docs/AuthApi.md +2 -2
  220. package/docs/ChangeSubscriptionRequest.md +37 -0
  221. package/docs/CheckpointDetails.md +49 -0
  222. package/docs/ChunkBulkResponse.md +1 -1
  223. package/docs/ChunkContentItem.md +1 -1
  224. package/docs/{ChunkMetadataInput.md → ChunkMetadata.md} +4 -4
  225. package/docs/ChunkNeighborsResponse.md +6 -0
  226. package/docs/ChunkResponse.md +1 -1
  227. package/docs/ChunksApi.md +13 -10
  228. package/docs/CreateChunkRequest.md +1 -1
  229. package/docs/DocumentResponse.md +2 -0
  230. package/docs/DocumentVersionMetadata.md +8 -0
  231. package/docs/DocumentVersionMetadataUpdate.md +8 -0
  232. package/docs/DocumentsApi.md +1 -1
  233. package/docs/ExtractRequest.md +39 -0
  234. package/docs/ExtractResponse.md +35 -0
  235. package/docs/FeaturesResponse.md +4 -0
  236. package/docs/FolderResponse.md +2 -0
  237. package/docs/FolderResponseOrDocumentResponse.md +2 -0
  238. package/docs/FoldersApi.md +1 -1
  239. package/docs/InviteLinkSettingsRequest.md +39 -0
  240. package/docs/InviteLinkSettingsResponse.md +39 -0
  241. package/docs/InviteResponse.md +2 -0
  242. package/docs/InviteUserRequest.md +2 -0
  243. package/docs/InvitesApi.md +81 -3
  244. package/docs/LineageNodeResponse.md +1 -1
  245. package/docs/MeteredQuotaStatus.md +43 -0
  246. package/docs/PathPartAncestorItem.md +2 -0
  247. package/docs/PathPartResponse.md +2 -0
  248. package/docs/PublicApi.md +68 -0
  249. package/docs/ScoredChunkResponse.md +1 -1
  250. package/docs/SeatQuotaStatus.md +37 -0
  251. package/docs/SectionContentItemOrChunkContentItem.md +1 -1
  252. package/docs/SubscriptionPlanResponse.md +51 -0
  253. package/docs/SubscriptionsApi.md +164 -0
  254. package/docs/TenantQuotaStateResponse.md +37 -0
  255. package/docs/TenantResponse.md +4 -0
  256. package/docs/TenantSettingsResponse.md +2 -0
  257. package/docs/TenantSettingsUpdate.md +2 -0
  258. package/docs/TenantsApi.md +75 -0
  259. package/docs/ThreadMessageDetailsInput.md +2 -0
  260. package/docs/ThreadMessageDetailsOutput.md +2 -0
  261. package/docs/ThreadsApi.md +1 -1
  262. package/docs/UpdateChunkMetadataRequest.md +1 -1
  263. package/docs/UpdateDocumentRequest.md +3 -1
  264. package/docs/UpdateFolderRequest.md +3 -1
  265. package/docs/UpdateInviteRequest.md +37 -0
  266. package/docs/UsageMetric.md +32 -0
  267. package/package.json +1 -1
  268. package/src/apis/AgentApi.ts +225 -0
  269. package/src/apis/ChunksApi.ts +27 -17
  270. package/src/apis/DocumentsApi.ts +4 -4
  271. package/src/apis/FoldersApi.ts +4 -4
  272. package/src/apis/InvitesApi.ts +107 -6
  273. package/src/apis/PublicApi.ts +100 -0
  274. package/src/apis/SubscriptionsApi.ts +238 -0
  275. package/src/apis/TenantsApi.ts +88 -0
  276. package/src/apis/ThreadsApi.ts +4 -4
  277. package/src/apis/index.ts +3 -0
  278. package/src/models/AcceptInviteResponse.ts +8 -0
  279. package/src/models/AskRequest.ts +83 -0
  280. package/src/models/AskResponse.ts +83 -0
  281. package/src/models/ChangeSubscriptionRequest.ts +96 -0
  282. package/src/models/CheckpointDetails.ts +169 -0
  283. package/src/models/ChunkBulkResponse.ts +11 -11
  284. package/src/models/ChunkContentItem.ts +10 -10
  285. package/src/models/{ChunkMetadataInput.ts → ChunkMetadata.ts} +25 -25
  286. package/src/models/ChunkNeighborsResponse.ts +26 -0
  287. package/src/models/ChunkResponse.ts +11 -11
  288. package/src/models/CreateChunkRequest.ts +10 -10
  289. package/src/models/DocumentResponse.ts +9 -0
  290. package/src/models/DocumentVersionMetadata.ts +32 -0
  291. package/src/models/DocumentVersionMetadataUpdate.ts +32 -0
  292. package/src/models/ExtractRequest.ts +99 -0
  293. package/src/models/ExtractResponse.ts +83 -0
  294. package/src/models/FeaturesResponse.ts +18 -0
  295. package/src/models/FolderResponse.ts +9 -0
  296. package/src/models/IdpType.ts +2 -0
  297. package/src/models/InviteLinkSettingsRequest.ts +116 -0
  298. package/src/models/InviteLinkSettingsResponse.ts +111 -0
  299. package/src/models/InviteResponse.ts +8 -0
  300. package/src/models/InviteUserRequest.ts +12 -0
  301. package/src/models/LineageNodeResponse.ts +10 -10
  302. package/src/models/MeteredQuotaStatus.ts +129 -0
  303. package/src/models/PathPartAncestorItem.ts +9 -0
  304. package/src/models/PathPartResponse.ts +9 -0
  305. package/src/models/PipelineStatus.ts +2 -1
  306. package/src/models/ScoredChunkResponse.ts +11 -11
  307. package/src/models/SeatQuotaStatus.ts +94 -0
  308. package/src/models/SubscriptionPlanResponse.ts +161 -0
  309. package/src/models/TenantQuotaStateResponse.ts +107 -0
  310. package/src/models/TenantResponse.ts +22 -0
  311. package/src/models/TenantSettingsResponse.ts +16 -0
  312. package/src/models/TenantSettingsUpdate.ts +15 -0
  313. package/src/models/ThreadMessageDetailsInput.ts +15 -0
  314. package/src/models/ThreadMessageDetailsOutput.ts +15 -0
  315. package/src/models/UpdateChunkMetadataRequest.ts +10 -10
  316. package/src/models/UpdateDocumentRequest.ts +9 -1
  317. package/src/models/UpdateFolderRequest.ts +9 -1
  318. package/src/models/UpdateInviteRequest.ts +94 -0
  319. package/src/models/UsageMetric.ts +54 -0
  320. package/src/models/index.ts +15 -2
  321. package/dist/esm/models/ChunkMetadataOutput.d.ts +0 -135
  322. package/dist/esm/models/ChunkMetadataOutput.js +0 -70
  323. package/dist/models/ChunkMetadataOutput.d.ts +0 -135
  324. package/dist/models/ChunkMetadataOutput.js +0 -78
  325. package/docs/ChunkMetadataOutput.md +0 -61
  326. package/src/models/ChunkMetadataOutput.ts +0 -203
@@ -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
- * Update an invite to accepted status and create tenant user.
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 &#x60;&#x60;invite_link.enabled&#x60;&#x60;). 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
- * Update an invite to accepted status and create tenant user.
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
- * Update an invite to accepted status and create tenant user.
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
- * Update an invite to accepted status and create tenant user.
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
+ }
@@ -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
  */