@knowledge-stack/ksapi 1.163.0 → 2.4.2

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 (153) hide show
  1. package/.openapi-generator/FILES +20 -2
  2. package/README.md +13 -3
  3. package/dist/apis/BillingApi.d.ts +70 -0
  4. package/dist/apis/BillingApi.js +120 -0
  5. package/dist/apis/DocumentVersionsApi.d.ts +8 -8
  6. package/dist/apis/DocumentVersionsApi.js +4 -4
  7. package/dist/apis/DocumentsApi.d.ts +4 -4
  8. package/dist/apis/DocumentsApi.js +2 -2
  9. package/dist/apis/SubscriptionsApi.d.ts +17 -20
  10. package/dist/apis/SubscriptionsApi.js +6 -9
  11. package/dist/apis/TenantsApi.d.ts +4 -4
  12. package/dist/apis/TenantsApi.js +2 -2
  13. package/dist/apis/TrashApi.d.ts +39 -1
  14. package/dist/apis/TrashApi.js +48 -0
  15. package/dist/apis/WorkflowRunsApi.d.ts +4 -4
  16. package/dist/apis/WorkflowRunsApi.js +2 -2
  17. package/dist/apis/index.d.ts +1 -0
  18. package/dist/apis/index.js +1 -0
  19. package/dist/esm/apis/BillingApi.d.ts +70 -0
  20. package/dist/esm/apis/BillingApi.js +83 -0
  21. package/dist/esm/apis/DocumentVersionsApi.d.ts +8 -8
  22. package/dist/esm/apis/DocumentVersionsApi.js +4 -4
  23. package/dist/esm/apis/DocumentsApi.d.ts +4 -4
  24. package/dist/esm/apis/DocumentsApi.js +2 -2
  25. package/dist/esm/apis/SubscriptionsApi.d.ts +17 -20
  26. package/dist/esm/apis/SubscriptionsApi.js +7 -10
  27. package/dist/esm/apis/TenantsApi.d.ts +4 -4
  28. package/dist/esm/apis/TenantsApi.js +2 -2
  29. package/dist/esm/apis/TrashApi.d.ts +39 -1
  30. package/dist/esm/apis/TrashApi.js +49 -1
  31. package/dist/esm/apis/WorkflowRunsApi.d.ts +4 -4
  32. package/dist/esm/apis/WorkflowRunsApi.js +2 -2
  33. package/dist/esm/apis/index.d.ts +1 -0
  34. package/dist/esm/apis/index.js +1 -0
  35. package/dist/esm/models/BillingInterval.d.ts +25 -0
  36. package/dist/esm/models/BillingInterval.js +43 -0
  37. package/dist/esm/models/BillingPaymentResponse.d.ts +100 -0
  38. package/dist/esm/models/BillingPaymentResponse.js +75 -0
  39. package/dist/esm/models/BillingSystem.d.ts +30 -0
  40. package/dist/esm/models/BillingSystem.js +48 -0
  41. package/dist/esm/models/ChangeSubscriptionRequest.d.ts +34 -0
  42. package/dist/esm/models/ChangeSubscriptionRequest.js +10 -0
  43. package/dist/esm/models/CheckoutAction.d.ts +27 -0
  44. package/dist/esm/models/CheckoutAction.js +45 -0
  45. package/dist/esm/models/CheckoutResponse.d.ts +76 -0
  46. package/dist/esm/models/{SubmitSubscriptionResponse.js → CheckoutResponse.js} +20 -20
  47. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +19 -0
  48. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +10 -0
  49. package/dist/esm/models/IdpConfig.d.ts +6 -0
  50. package/dist/esm/models/IdpConfig.js +10 -1
  51. package/dist/esm/models/PaginatedResponseBillingPaymentResponse.d.ts +66 -0
  52. package/dist/esm/models/PaginatedResponseBillingPaymentResponse.js +70 -0
  53. package/dist/esm/models/ScheduleCadence.d.ts +32 -0
  54. package/dist/esm/models/ScheduleCadence.js +50 -0
  55. package/dist/esm/models/SubscriptionPlanResponse.d.ts +24 -0
  56. package/dist/esm/models/SubscriptionPlanResponse.js +8 -0
  57. package/dist/esm/models/{SubmitSubscriptionResponse.d.ts → TenantSubscriptionResponse.d.ts} +49 -38
  58. package/dist/esm/models/TenantSubscriptionResponse.js +67 -0
  59. package/dist/esm/models/TrashItemDetailResponse.d.ts +110 -0
  60. package/dist/esm/models/TrashItemDetailResponse.js +81 -0
  61. package/dist/esm/models/TrashItemResponse.d.ts +7 -0
  62. package/dist/esm/models/TrashItemResponse.js +3 -0
  63. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +19 -0
  64. package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +10 -0
  65. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +19 -0
  66. package/dist/esm/models/WorkflowDefinitionResponse.js +7 -0
  67. package/dist/esm/models/index.d.ts +9 -1
  68. package/dist/esm/models/index.js +9 -1
  69. package/dist/models/BillingInterval.d.ts +25 -0
  70. package/dist/models/BillingInterval.js +51 -0
  71. package/dist/models/BillingPaymentResponse.d.ts +100 -0
  72. package/dist/models/BillingPaymentResponse.js +83 -0
  73. package/dist/models/BillingSystem.d.ts +30 -0
  74. package/dist/models/BillingSystem.js +56 -0
  75. package/dist/models/ChangeSubscriptionRequest.d.ts +34 -0
  76. package/dist/models/ChangeSubscriptionRequest.js +10 -0
  77. package/dist/models/CheckoutAction.d.ts +27 -0
  78. package/dist/models/CheckoutAction.js +53 -0
  79. package/dist/models/CheckoutResponse.d.ts +76 -0
  80. package/dist/models/{SubmitSubscriptionResponse.js → CheckoutResponse.js} +26 -26
  81. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +19 -0
  82. package/dist/models/CreateWorkflowDefinitionRequest.js +10 -0
  83. package/dist/models/IdpConfig.d.ts +6 -0
  84. package/dist/models/IdpConfig.js +10 -1
  85. package/dist/models/PaginatedResponseBillingPaymentResponse.d.ts +66 -0
  86. package/dist/models/PaginatedResponseBillingPaymentResponse.js +78 -0
  87. package/dist/models/ScheduleCadence.d.ts +32 -0
  88. package/dist/models/ScheduleCadence.js +58 -0
  89. package/dist/models/SubscriptionPlanResponse.d.ts +24 -0
  90. package/dist/models/SubscriptionPlanResponse.js +8 -0
  91. package/dist/models/{SubmitSubscriptionResponse.d.ts → TenantSubscriptionResponse.d.ts} +49 -38
  92. package/dist/models/TenantSubscriptionResponse.js +75 -0
  93. package/dist/models/TrashItemDetailResponse.d.ts +110 -0
  94. package/dist/models/TrashItemDetailResponse.js +89 -0
  95. package/dist/models/TrashItemResponse.d.ts +7 -0
  96. package/dist/models/TrashItemResponse.js +3 -0
  97. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +19 -0
  98. package/dist/models/UpdateWorkflowDefinitionRequest.js +10 -0
  99. package/dist/models/WorkflowDefinitionResponse.d.ts +19 -0
  100. package/dist/models/WorkflowDefinitionResponse.js +7 -0
  101. package/dist/models/index.d.ts +9 -1
  102. package/dist/models/index.js +9 -1
  103. package/docs/BillingApi.md +90 -0
  104. package/docs/BillingInterval.md +33 -0
  105. package/docs/BillingPaymentResponse.md +51 -0
  106. package/docs/BillingSystem.md +33 -0
  107. package/docs/ChangeSubscriptionRequest.md +9 -1
  108. package/docs/CheckoutAction.md +33 -0
  109. package/docs/CheckoutResponse.md +41 -0
  110. package/docs/CreateWorkflowDefinitionRequest.md +6 -0
  111. package/docs/DocumentVersionsApi.md +2 -2
  112. package/docs/DocumentsApi.md +1 -1
  113. package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +6 -0
  114. package/docs/IdpConfig.md +2 -0
  115. package/docs/PaginatedResponseBillingPaymentResponse.md +40 -0
  116. package/docs/ScheduleCadence.md +33 -0
  117. package/docs/SubscriptionPlanResponse.md +8 -0
  118. package/docs/SubscriptionsApi.md +7 -10
  119. package/docs/TenantSubscriptionResponse.md +47 -0
  120. package/docs/TenantsApi.md +1 -1
  121. package/docs/TrashApi.md +76 -0
  122. package/docs/TrashItemDetailResponse.md +55 -0
  123. package/docs/TrashItemResponse.md +2 -0
  124. package/docs/UpdateWorkflowDefinitionRequest.md +6 -0
  125. package/docs/WorkflowDefinitionResponse.md +6 -0
  126. package/docs/WorkflowRunsApi.md +1 -1
  127. package/package.json +1 -1
  128. package/src/apis/BillingApi.ts +142 -0
  129. package/src/apis/DocumentVersionsApi.ts +8 -8
  130. package/src/apis/DocumentsApi.ts +4 -4
  131. package/src/apis/SubscriptionsApi.ts +24 -31
  132. package/src/apis/TenantsApi.ts +4 -4
  133. package/src/apis/TrashApi.ts +86 -0
  134. package/src/apis/WorkflowRunsApi.ts +4 -4
  135. package/src/apis/index.ts +1 -0
  136. package/src/models/BillingInterval.ts +53 -0
  137. package/src/models/BillingPaymentResponse.ts +168 -0
  138. package/src/models/BillingSystem.ts +58 -0
  139. package/src/models/ChangeSubscriptionRequest.ts +55 -0
  140. package/src/models/CheckoutAction.ts +55 -0
  141. package/src/models/{SubmitSubscriptionResponse.ts → CheckoutResponse.ts} +61 -47
  142. package/src/models/CreateWorkflowDefinitionRequest.ts +37 -0
  143. package/src/models/IdpConfig.ts +14 -0
  144. package/src/models/PaginatedResponseBillingPaymentResponse.ts +130 -0
  145. package/src/models/ScheduleCadence.ts +60 -0
  146. package/src/models/SubscriptionPlanResponse.ts +32 -0
  147. package/src/models/TenantSubscriptionResponse.ts +159 -0
  148. package/src/models/TrashItemDetailResponse.ts +194 -0
  149. package/src/models/TrashItemResponse.ts +15 -0
  150. package/src/models/UpdateWorkflowDefinitionRequest.ts +37 -0
  151. package/src/models/WorkflowDefinitionResponse.ts +31 -0
  152. package/src/models/index.ts +9 -1
  153. package/docs/SubmitSubscriptionResponse.md +0 -39
@@ -10,11 +10,10 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ChangeSubscriptionRequest, SubmitSubscriptionResponse, SubscriptionPlanResponse } from '../models/index';
13
+ import type { ChangeSubscriptionRequest, CheckoutResponse, TenantSubscriptionResponse } from '../models/index';
14
14
  export interface ChangeTenantSubscriptionRequest {
15
15
  tenantId: string;
16
16
  changeSubscriptionRequest: ChangeSubscriptionRequest;
17
- idempotencyKey?: string | null;
18
17
  }
19
18
  export interface GetTenantSubscriptionRequest {
20
19
  tenantId: string;
@@ -30,27 +29,25 @@ export interface SubscriptionsApiInterface {
30
29
  * Creates request options for changeTenantSubscription without sending the request
31
30
  * @param {string} tenantId
32
31
  * @param {ChangeSubscriptionRequest} changeSubscriptionRequest
33
- * @param {string} [idempotencyKey]
34
32
  * @throws {RequiredError}
35
33
  * @memberof SubscriptionsApiInterface
36
34
  */
37
35
  changeTenantSubscriptionRequestOpts(requestParameters: ChangeTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
38
36
  /**
39
- * Submit a subscription change (mock-Stripe). OWNER-only on the target tenant. Validates the request (tenant + plan exist, ``num_seats`` within bounds), submits the (mock-)Stripe subscription update, and returns 202. The plan/seat write is NOT applied here — that happens in ``POST /webhooks/stripe/subscription`` after Stripe confirms the change. Async two-hop workflow per ``docs/billing_additional_limits.md`` §\"Async payment workflow\": the dev environment exercises the same submit/webhook split as production will when the real Stripe SDK replaces the log-line stub in ``notify_billing``. 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 — but only when a Stripe call is actually about to fire (i.e. the validation passed AND the change is not a no-op). Warning before validation would false-positive on every 4xx and on every redundant submit. **Header value lands in structured logs.** The header value is forwarded into the ``stripe.update_subscription`` log event\'s ``idempotency_key`` field (and into the eventual real Stripe call). Use opaque random IDs (e.g. ``uuid4()``); do NOT pass user identifiers, tokens, or other sensitive material as the ``Idempotency-Key`` header.
37
+ * Start a subscription change (OWNER only). Priced plan validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it nothing is written until the provider\'s webhook confirms payment. Free plan applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional local-first).
40
38
  * @summary Change Tenant Subscription Handler
41
39
  * @param {string} tenantId
42
40
  * @param {ChangeSubscriptionRequest} changeSubscriptionRequest
43
- * @param {string} [idempotencyKey]
44
41
  * @param {*} [options] Override http request option.
45
42
  * @throws {RequiredError}
46
43
  * @memberof SubscriptionsApiInterface
47
44
  */
48
- changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubmitSubscriptionResponse>>;
45
+ changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckoutResponse>>;
49
46
  /**
50
- * Submit a subscription change (mock-Stripe). OWNER-only on the target tenant. Validates the request (tenant + plan exist, ``num_seats`` within bounds), submits the (mock-)Stripe subscription update, and returns 202. The plan/seat write is NOT applied here — that happens in ``POST /webhooks/stripe/subscription`` after Stripe confirms the change. Async two-hop workflow per ``docs/billing_additional_limits.md`` §\"Async payment workflow\": the dev environment exercises the same submit/webhook split as production will when the real Stripe SDK replaces the log-line stub in ``notify_billing``. 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 — but only when a Stripe call is actually about to fire (i.e. the validation passed AND the change is not a no-op). Warning before validation would false-positive on every 4xx and on every redundant submit. **Header value lands in structured logs.** The header value is forwarded into the ``stripe.update_subscription`` log event\'s ``idempotency_key`` field (and into the eventual real Stripe call). Use opaque random IDs (e.g. ``uuid4()``); do NOT pass user identifiers, tokens, or other sensitive material as the ``Idempotency-Key`` header.
47
+ * Start a subscription change (OWNER only). Priced plan validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it nothing is written until the provider\'s webhook confirms payment. Free plan applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional local-first).
51
48
  * Change Tenant Subscription Handler
52
49
  */
53
- changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubmitSubscriptionResponse>;
50
+ changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckoutResponse>;
54
51
  /**
55
52
  * Creates request options for getTenantSubscription without sending the request
56
53
  * @param {string} tenantId
@@ -59,19 +56,19 @@ export interface SubscriptionsApiInterface {
59
56
  */
60
57
  getTenantSubscriptionRequestOpts(requestParameters: GetTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
61
58
  /**
62
- * 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.
59
+ * Read the tenant\'s current subscription: plan body + period state. 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. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). 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.
63
60
  * @summary Get Tenant Subscription Handler
64
61
  * @param {string} tenantId
65
62
  * @param {*} [options] Override http request option.
66
63
  * @throws {RequiredError}
67
64
  * @memberof SubscriptionsApiInterface
68
65
  */
69
- getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPlanResponse>>;
66
+ getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantSubscriptionResponse>>;
70
67
  /**
71
- * 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.
68
+ * Read the tenant\'s current subscription: plan body + period state. 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. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). 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.
72
69
  * Get Tenant Subscription Handler
73
70
  */
74
- getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPlanResponse>;
71
+ getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantSubscriptionResponse>;
75
72
  }
76
73
  /**
77
74
  *
@@ -82,27 +79,27 @@ export declare class SubscriptionsApi extends runtime.BaseAPI implements Subscri
82
79
  */
83
80
  changeTenantSubscriptionRequestOpts(requestParameters: ChangeTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
84
81
  /**
85
- * Submit a subscription change (mock-Stripe). OWNER-only on the target tenant. Validates the request (tenant + plan exist, ``num_seats`` within bounds), submits the (mock-)Stripe subscription update, and returns 202. The plan/seat write is NOT applied here — that happens in ``POST /webhooks/stripe/subscription`` after Stripe confirms the change. Async two-hop workflow per ``docs/billing_additional_limits.md`` §\"Async payment workflow\": the dev environment exercises the same submit/webhook split as production will when the real Stripe SDK replaces the log-line stub in ``notify_billing``. 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 — but only when a Stripe call is actually about to fire (i.e. the validation passed AND the change is not a no-op). Warning before validation would false-positive on every 4xx and on every redundant submit. **Header value lands in structured logs.** The header value is forwarded into the ``stripe.update_subscription`` log event\'s ``idempotency_key`` field (and into the eventual real Stripe call). Use opaque random IDs (e.g. ``uuid4()``); do NOT pass user identifiers, tokens, or other sensitive material as the ``Idempotency-Key`` header.
82
+ * Start a subscription change (OWNER only). Priced plan validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it nothing is written until the provider\'s webhook confirms payment. Free plan applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional local-first).
86
83
  * Change Tenant Subscription Handler
87
84
  */
88
- changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubmitSubscriptionResponse>>;
85
+ changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckoutResponse>>;
89
86
  /**
90
- * Submit a subscription change (mock-Stripe). OWNER-only on the target tenant. Validates the request (tenant + plan exist, ``num_seats`` within bounds), submits the (mock-)Stripe subscription update, and returns 202. The plan/seat write is NOT applied here — that happens in ``POST /webhooks/stripe/subscription`` after Stripe confirms the change. Async two-hop workflow per ``docs/billing_additional_limits.md`` §\"Async payment workflow\": the dev environment exercises the same submit/webhook split as production will when the real Stripe SDK replaces the log-line stub in ``notify_billing``. 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 — but only when a Stripe call is actually about to fire (i.e. the validation passed AND the change is not a no-op). Warning before validation would false-positive on every 4xx and on every redundant submit. **Header value lands in structured logs.** The header value is forwarded into the ``stripe.update_subscription`` log event\'s ``idempotency_key`` field (and into the eventual real Stripe call). Use opaque random IDs (e.g. ``uuid4()``); do NOT pass user identifiers, tokens, or other sensitive material as the ``Idempotency-Key`` header.
87
+ * Start a subscription change (OWNER only). Priced plan validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it nothing is written until the provider\'s webhook confirms payment. Free plan applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional local-first).
91
88
  * Change Tenant Subscription Handler
92
89
  */
93
- changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubmitSubscriptionResponse>;
90
+ changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckoutResponse>;
94
91
  /**
95
92
  * Creates request options for getTenantSubscription without sending the request
96
93
  */
97
94
  getTenantSubscriptionRequestOpts(requestParameters: GetTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
98
95
  /**
99
- * 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.
96
+ * Read the tenant\'s current subscription: plan body + period state. 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. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). 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.
100
97
  * Get Tenant Subscription Handler
101
98
  */
102
- getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPlanResponse>>;
99
+ getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantSubscriptionResponse>>;
103
100
  /**
104
- * 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.
101
+ * Read the tenant\'s current subscription: plan body + period state. 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. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). 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.
105
102
  * Get Tenant Subscription Handler
106
103
  */
107
- getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPlanResponse>;
104
+ getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantSubscriptionResponse>;
108
105
  }
@@ -76,9 +76,6 @@ class SubscriptionsApi extends runtime.BaseAPI {
76
76
  const queryParameters = {};
77
77
  const headerParameters = {};
78
78
  headerParameters['Content-Type'] = 'application/json';
79
- if (requestParameters['idempotencyKey'] != null) {
80
- headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
81
- }
82
79
  if (this.configuration && this.configuration.accessToken) {
83
80
  const token = this.configuration.accessToken;
84
81
  const tokenString = yield token("bearerAuth", []);
@@ -98,18 +95,18 @@ class SubscriptionsApi extends runtime.BaseAPI {
98
95
  });
99
96
  }
100
97
  /**
101
- * Submit a subscription change (mock-Stripe). OWNER-only on the target tenant. Validates the request (tenant + plan exist, ``num_seats`` within bounds), submits the (mock-)Stripe subscription update, and returns 202. The plan/seat write is NOT applied here — that happens in ``POST /webhooks/stripe/subscription`` after Stripe confirms the change. Async two-hop workflow per ``docs/billing_additional_limits.md`` §\"Async payment workflow\": the dev environment exercises the same submit/webhook split as production will when the real Stripe SDK replaces the log-line stub in ``notify_billing``. 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 — but only when a Stripe call is actually about to fire (i.e. the validation passed AND the change is not a no-op). Warning before validation would false-positive on every 4xx and on every redundant submit. **Header value lands in structured logs.** The header value is forwarded into the ``stripe.update_subscription`` log event\'s ``idempotency_key`` field (and into the eventual real Stripe call). Use opaque random IDs (e.g. ``uuid4()``); do NOT pass user identifiers, tokens, or other sensitive material as the ``Idempotency-Key`` header.
98
+ * Start a subscription change (OWNER only). Priced plan validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it nothing is written until the provider\'s webhook confirms payment. Free plan applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional local-first).
102
99
  * Change Tenant Subscription Handler
103
100
  */
104
101
  changeTenantSubscriptionRaw(requestParameters, initOverrides) {
105
102
  return __awaiter(this, void 0, void 0, function* () {
106
103
  const requestOptions = yield this.changeTenantSubscriptionRequestOpts(requestParameters);
107
104
  const response = yield this.request(requestOptions, initOverrides);
108
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubmitSubscriptionResponseFromJSON)(jsonValue));
105
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CheckoutResponseFromJSON)(jsonValue));
109
106
  });
110
107
  }
111
108
  /**
112
- * Submit a subscription change (mock-Stripe). OWNER-only on the target tenant. Validates the request (tenant + plan exist, ``num_seats`` within bounds), submits the (mock-)Stripe subscription update, and returns 202. The plan/seat write is NOT applied here — that happens in ``POST /webhooks/stripe/subscription`` after Stripe confirms the change. Async two-hop workflow per ``docs/billing_additional_limits.md`` §\"Async payment workflow\": the dev environment exercises the same submit/webhook split as production will when the real Stripe SDK replaces the log-line stub in ``notify_billing``. 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 — but only when a Stripe call is actually about to fire (i.e. the validation passed AND the change is not a no-op). Warning before validation would false-positive on every 4xx and on every redundant submit. **Header value lands in structured logs.** The header value is forwarded into the ``stripe.update_subscription`` log event\'s ``idempotency_key`` field (and into the eventual real Stripe call). Use opaque random IDs (e.g. ``uuid4()``); do NOT pass user identifiers, tokens, or other sensitive material as the ``Idempotency-Key`` header.
109
+ * Start a subscription change (OWNER only). Priced plan validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it nothing is written until the provider\'s webhook confirms payment. Free plan applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional local-first).
113
110
  * Change Tenant Subscription Handler
114
111
  */
115
112
  changeTenantSubscription(requestParameters, initOverrides) {
@@ -146,18 +143,18 @@ class SubscriptionsApi extends runtime.BaseAPI {
146
143
  });
147
144
  }
148
145
  /**
149
- * 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.
146
+ * Read the tenant\'s current subscription: plan body + period state. 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. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). 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.
150
147
  * Get Tenant Subscription Handler
151
148
  */
152
149
  getTenantSubscriptionRaw(requestParameters, initOverrides) {
153
150
  return __awaiter(this, void 0, void 0, function* () {
154
151
  const requestOptions = yield this.getTenantSubscriptionRequestOpts(requestParameters);
155
152
  const response = yield this.request(requestOptions, initOverrides);
156
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionPlanResponseFromJSON)(jsonValue));
153
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TenantSubscriptionResponseFromJSON)(jsonValue));
157
154
  });
158
155
  }
159
156
  /**
160
- * 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.
157
+ * Read the tenant\'s current subscription: plan body + period state. 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. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). 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.
161
158
  * Get Tenant Subscription Handler
162
159
  */
163
160
  getTenantSubscription(requestParameters, initOverrides) {
@@ -125,7 +125,7 @@ export interface TenantsApiInterface {
125
125
  */
126
126
  deleteTenantRequestOpts(requestParameters: DeleteTenantRequest): Promise<runtime.RequestOpts>;
127
127
  /**
128
- * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
128
+ * Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
129
129
  * @summary Delete Tenant
130
130
  * @param {string} tenantId
131
131
  * @param {*} [options] Override http request option.
@@ -134,7 +134,7 @@ export interface TenantsApiInterface {
134
134
  */
135
135
  deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
136
136
  /**
137
- * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
137
+ * Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
138
138
  * Delete Tenant
139
139
  */
140
140
  deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -395,12 +395,12 @@ export declare class TenantsApi extends runtime.BaseAPI implements TenantsApiInt
395
395
  */
396
396
  deleteTenantRequestOpts(requestParameters: DeleteTenantRequest): Promise<runtime.RequestOpts>;
397
397
  /**
398
- * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
398
+ * Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
399
399
  * Delete Tenant
400
400
  */
401
401
  deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
402
402
  /**
403
- * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
403
+ * Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
404
404
  * Delete Tenant
405
405
  */
406
406
  deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -194,7 +194,7 @@ class TenantsApi extends runtime.BaseAPI {
194
194
  });
195
195
  }
196
196
  /**
197
- * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
197
+ * Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
198
198
  * Delete Tenant
199
199
  */
200
200
  deleteTenantRaw(requestParameters, initOverrides) {
@@ -205,7 +205,7 @@ class TenantsApi extends runtime.BaseAPI {
205
205
  });
206
206
  }
207
207
  /**
208
- * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
208
+ * Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
209
209
  * Delete Tenant
210
210
  */
211
211
  deleteTenant(requestParameters, initOverrides) {
@@ -10,13 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { BulkOperationResponse, BulkTrashRequest, PaginatedResponseTrashItemResponse, PartType, PathOrder, SortDirection } from '../models/index';
13
+ import type { BulkOperationResponse, BulkTrashRequest, PaginatedResponseTrashItemResponse, PartType, PathOrder, SortDirection, TrashItemDetailResponse } from '../models/index';
14
14
  export interface BulkPermanentlyDeleteTrashRequest {
15
15
  bulkTrashRequest: BulkTrashRequest;
16
16
  }
17
17
  export interface BulkRestoreTrashRequest {
18
18
  bulkTrashRequest: BulkTrashRequest;
19
19
  }
20
+ export interface GetTrashItemRequest {
21
+ pathPartId: string;
22
+ }
20
23
  export interface ListTrashRequest {
21
24
  sortOrder?: PathOrder;
22
25
  sortDir?: SortDirection;
@@ -85,6 +88,27 @@ export interface TrashApiInterface {
85
88
  * Bulk Restore Trash Handler
86
89
  */
87
90
  bulkRestoreTrash(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
91
+ /**
92
+ * Creates request options for getTrashItem without sending the request
93
+ * @param {string} pathPartId Trashed PathPart ID
94
+ * @throws {RequiredError}
95
+ * @memberof TrashApiInterface
96
+ */
97
+ getTrashItemRequestOpts(requestParameters: GetTrashItemRequest): Promise<runtime.RequestOpts>;
98
+ /**
99
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
100
+ * @summary Get Trash Item Handler
101
+ * @param {string} pathPartId Trashed PathPart ID
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ * @memberof TrashApiInterface
105
+ */
106
+ getTrashItemRaw(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TrashItemDetailResponse>>;
107
+ /**
108
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
109
+ * Get Trash Item Handler
110
+ */
111
+ getTrashItem(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TrashItemDetailResponse>;
88
112
  /**
89
113
  * Creates request options for listTrash without sending the request
90
114
  * @param {PathOrder} [sortOrder] Sort order (default: LOGICAL &#x3D; deletion recency)
@@ -201,6 +225,20 @@ export declare class TrashApi extends runtime.BaseAPI implements TrashApiInterfa
201
225
  * Bulk Restore Trash Handler
202
226
  */
203
227
  bulkRestoreTrash(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
228
+ /**
229
+ * Creates request options for getTrashItem without sending the request
230
+ */
231
+ getTrashItemRequestOpts(requestParameters: GetTrashItemRequest): Promise<runtime.RequestOpts>;
232
+ /**
233
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
234
+ * Get Trash Item Handler
235
+ */
236
+ getTrashItemRaw(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TrashItemDetailResponse>>;
237
+ /**
238
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
239
+ * Get Trash Item Handler
240
+ */
241
+ getTrashItem(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TrashItemDetailResponse>;
204
242
  /**
205
243
  * Creates request options for listTrash without sending the request
206
244
  */
@@ -160,6 +160,54 @@ class TrashApi extends runtime.BaseAPI {
160
160
  return yield response.value();
161
161
  });
162
162
  }
163
+ /**
164
+ * Creates request options for getTrashItem without sending the request
165
+ */
166
+ getTrashItemRequestOpts(requestParameters) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ if (requestParameters['pathPartId'] == null) {
169
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling getTrashItem().');
170
+ }
171
+ const queryParameters = {};
172
+ const headerParameters = {};
173
+ if (this.configuration && this.configuration.accessToken) {
174
+ const token = this.configuration.accessToken;
175
+ const tokenString = yield token("bearerAuth", []);
176
+ if (tokenString) {
177
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
178
+ }
179
+ }
180
+ let urlPath = `/v1/trash/{path_part_id}`;
181
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
182
+ return {
183
+ path: urlPath,
184
+ method: 'GET',
185
+ headers: headerParameters,
186
+ query: queryParameters,
187
+ };
188
+ });
189
+ }
190
+ /**
191
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
192
+ * Get Trash Item Handler
193
+ */
194
+ getTrashItemRaw(requestParameters, initOverrides) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ const requestOptions = yield this.getTrashItemRequestOpts(requestParameters);
197
+ const response = yield this.request(requestOptions, initOverrides);
198
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TrashItemDetailResponseFromJSON)(jsonValue));
199
+ });
200
+ }
201
+ /**
202
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
203
+ * Get Trash Item Handler
204
+ */
205
+ getTrashItem(requestParameters, initOverrides) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ const response = yield this.getTrashItemRaw(requestParameters, initOverrides);
208
+ return yield response.value();
209
+ });
210
+ }
163
211
  /**
164
212
  * Creates request options for listTrash without sending the request
165
213
  */
@@ -356,7 +356,7 @@ export interface WorkflowRunsApiInterface {
356
356
  */
357
357
  workflowRunCallbackRequestOpts(requestParameters: WorkflowRunCallbackOperationRequest): Promise<runtime.RequestOpts>;
358
358
  /**
359
- * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op.
359
+ * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op. On the first terminal transition it emails the run\'s triggering user (``run.user_id``) a completion or failure notification. Only already-loaded columns are captured in-session; recipient/language lookups and the send run post-commit and best-effort, so a rolled-back transaction never notifies and a notification failure never fails the callback.
360
360
  * @summary Workflow Run Callback Handler
361
361
  * @param {string} runId
362
362
  * @param {WorkflowRunCallbackRequest} workflowRunCallbackRequest
@@ -366,7 +366,7 @@ export interface WorkflowRunsApiInterface {
366
366
  */
367
367
  workflowRunCallbackRaw(requestParameters: WorkflowRunCallbackOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowCallbackResponse>>;
368
368
  /**
369
- * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op.
369
+ * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op. On the first terminal transition it emails the run\'s triggering user (``run.user_id``) a completion or failure notification. Only already-loaded columns are captured in-session; recipient/language lookups and the send run post-commit and best-effort, so a rolled-back transaction never notifies and a notification failure never fails the callback.
370
370
  * Workflow Run Callback Handler
371
371
  */
372
372
  workflowRunCallback(requestParameters: WorkflowRunCallbackOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowCallbackResponse>;
@@ -530,12 +530,12 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
530
530
  */
531
531
  workflowRunCallbackRequestOpts(requestParameters: WorkflowRunCallbackOperationRequest): Promise<runtime.RequestOpts>;
532
532
  /**
533
- * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op.
533
+ * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op. On the first terminal transition it emails the run\'s triggering user (``run.user_id``) a completion or failure notification. Only already-loaded columns are captured in-session; recipient/language lookups and the send run post-commit and best-effort, so a rolled-back transaction never notifies and a notification failure never fails the callback.
534
534
  * Workflow Run Callback Handler
535
535
  */
536
536
  workflowRunCallbackRaw(requestParameters: WorkflowRunCallbackOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowCallbackResponse>>;
537
537
  /**
538
- * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op.
538
+ * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op. On the first terminal transition it emails the run\'s triggering user (``run.user_id``) a completion or failure notification. Only already-loaded columns are captured in-session; recipient/language lookups and the send run post-commit and best-effort, so a rolled-back transaction never notifies and a notification failure never fails the callback.
539
539
  * Workflow Run Callback Handler
540
540
  */
541
541
  workflowRunCallback(requestParameters: WorkflowRunCallbackOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowCallbackResponse>;
@@ -684,7 +684,7 @@ class WorkflowRunsApi extends runtime.BaseAPI {
684
684
  });
685
685
  }
686
686
  /**
687
- * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op.
687
+ * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op. On the first terminal transition it emails the run\'s triggering user (``run.user_id``) a completion or failure notification. Only already-loaded columns are captured in-session; recipient/language lookups and the send run post-commit and best-effort, so a rolled-back transaction never notifies and a notification failure never fails the callback.
688
688
  * Workflow Run Callback Handler
689
689
  */
690
690
  workflowRunCallbackRaw(requestParameters, initOverrides) {
@@ -695,7 +695,7 @@ class WorkflowRunsApi extends runtime.BaseAPI {
695
695
  });
696
696
  }
697
697
  /**
698
- * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op.
698
+ * Terminal-state write seam for the in-process agent runner. The gating Temporal activities ``mark_run_completed_activity`` and ``mark_run_failed_activity`` authenticate as the triggering user (via ``assume_user``) and POST here. Only the user who triggered the run (or OWNER/ADMIN) may write its terminal state. The handler is idempotent: a callback against an already-terminal row returns ``already_terminal`` and the activity-level retry treats it as a no-op. On the first terminal transition it emails the run\'s triggering user (``run.user_id``) a completion or failure notification. Only already-loaded columns are captured in-session; recipient/language lookups and the send run post-commit and best-effort, so a rolled-back transaction never notifies and a notification failure never fails the callback.
699
699
  * Workflow Run Callback Handler
700
700
  */
701
701
  workflowRunCallback(requestParameters, initOverrides) {
@@ -5,6 +5,7 @@ export * from './ApiConnectionsApi';
5
5
  export * from './ApiKeysApi';
6
6
  export * from './AuditEventsApi';
7
7
  export * from './AuthApi';
8
+ export * from './BillingApi';
8
9
  export * from './BulkDeleteApi';
9
10
  export * from './BulkDownloadApi';
10
11
  export * from './BulkMoveApi';
@@ -23,6 +23,7 @@ __exportStar(require("./ApiConnectionsApi"), exports);
23
23
  __exportStar(require("./ApiKeysApi"), exports);
24
24
  __exportStar(require("./AuditEventsApi"), exports);
25
25
  __exportStar(require("./AuthApi"), exports);
26
+ __exportStar(require("./BillingApi"), exports);
26
27
  __exportStar(require("./BulkDeleteApi"), exports);
27
28
  __exportStar(require("./BulkDownloadApi"), exports);
28
29
  __exportStar(require("./BulkMoveApi"), exports);
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { PaginatedResponseBillingPaymentResponse } from '../models/index';
14
+ export interface ListBillingPaymentsRequest {
15
+ tenantId: string;
16
+ limit?: number;
17
+ offset?: number;
18
+ }
19
+ /**
20
+ * BillingApi - interface
21
+ *
22
+ * @export
23
+ * @interface BillingApiInterface
24
+ */
25
+ export interface BillingApiInterface {
26
+ /**
27
+ * Creates request options for listBillingPayments without sending the request
28
+ * @param {string} tenantId
29
+ * @param {number} [limit] Number of items per page
30
+ * @param {number} [offset] Number of items to skip
31
+ * @throws {RequiredError}
32
+ * @memberof BillingApiInterface
33
+ */
34
+ listBillingPaymentsRequestOpts(requestParameters: ListBillingPaymentsRequest): Promise<runtime.RequestOpts>;
35
+ /**
36
+ * Newest-first payment history for the tenant (OWNER/ADMIN only). Backs the billing page\'s receipts list. ``invoice_url`` links the Stripe-hosted invoice when the payment ran through Stripe; CN (Ping++) payments render an in-app receipt from the row itself.
37
+ * @summary List Billing Payments Handler
38
+ * @param {string} tenantId
39
+ * @param {number} [limit] Number of items per page
40
+ * @param {number} [offset] Number of items to skip
41
+ * @param {*} [options] Override http request option.
42
+ * @throws {RequiredError}
43
+ * @memberof BillingApiInterface
44
+ */
45
+ listBillingPaymentsRaw(requestParameters: ListBillingPaymentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseBillingPaymentResponse>>;
46
+ /**
47
+ * Newest-first payment history for the tenant (OWNER/ADMIN only). Backs the billing page\'s receipts list. ``invoice_url`` links the Stripe-hosted invoice when the payment ran through Stripe; CN (Ping++) payments render an in-app receipt from the row itself.
48
+ * List Billing Payments Handler
49
+ */
50
+ listBillingPayments(requestParameters: ListBillingPaymentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseBillingPaymentResponse>;
51
+ }
52
+ /**
53
+ *
54
+ */
55
+ export declare class BillingApi extends runtime.BaseAPI implements BillingApiInterface {
56
+ /**
57
+ * Creates request options for listBillingPayments without sending the request
58
+ */
59
+ listBillingPaymentsRequestOpts(requestParameters: ListBillingPaymentsRequest): Promise<runtime.RequestOpts>;
60
+ /**
61
+ * Newest-first payment history for the tenant (OWNER/ADMIN only). Backs the billing page\'s receipts list. ``invoice_url`` links the Stripe-hosted invoice when the payment ran through Stripe; CN (Ping++) payments render an in-app receipt from the row itself.
62
+ * List Billing Payments Handler
63
+ */
64
+ listBillingPaymentsRaw(requestParameters: ListBillingPaymentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseBillingPaymentResponse>>;
65
+ /**
66
+ * Newest-first payment history for the tenant (OWNER/ADMIN only). Backs the billing page\'s receipts list. ``invoice_url`` links the Stripe-hosted invoice when the payment ran through Stripe; CN (Ping++) payments render an in-app receipt from the row itself.
67
+ * List Billing Payments Handler
68
+ */
69
+ listBillingPayments(requestParameters: ListBillingPaymentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseBillingPaymentResponse>;
70
+ }