@knowledge-stack/ksapi 1.162.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
@@ -0,0 +1,33 @@
1
+
2
+ # BillingSystem
3
+
4
+ External payment platform a subscription or payment is linked to. ``STRIPE`` serves North America; ``PING_PP`` (Ping++, a mainland-China payment aggregator fronting Alipay + WeChat Pay) serves China. Rows with no external billing linkage (free / admin-issued / synthetic fall-back subscriptions) carry NULL instead of a value.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { BillingSystem } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies BillingSystem
19
+
20
+ console.log(example)
21
+
22
+ // Convert the instance to a JSON string
23
+ const exampleJSON: string = JSON.stringify(example)
24
+ console.log(exampleJSON)
25
+
26
+ // Parse the JSON string back to an object
27
+ const exampleParsed = JSON.parse(exampleJSON) as BillingSystem
28
+ console.log(exampleParsed)
29
+ ```
30
+
31
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
32
+
33
+
@@ -1,7 +1,7 @@
1
1
 
2
2
  # ChangeSubscriptionRequest
3
3
 
4
- Body for ``POST /v1/tenants/{tenant_id}/subscriptions``.
4
+ Body for ``POST /v1/tenants/{tenant_id}/subscriptions``. For a priced plan, ``interval`` and ``billing_system`` are required (``channel`` too for Ping++); the response carries the provider checkout to complete. For the free plan they are ignored — the downgrade is applied immediately (unbilled tenants) or scheduled for period end (billed tenants).
5
5
 
6
6
  ## Properties
7
7
 
@@ -9,6 +9,10 @@ Name | Type
9
9
  ------------ | -------------
10
10
  `subscriptionId` | string
11
11
  `numSeats` | number
12
+ `interval` | [BillingInterval](BillingInterval.md)
13
+ `billingSystem` | [BillingSystem](BillingSystem.md)
14
+ `channel` | string
15
+ `channelExtra` | { [key: string]: any; }
12
16
 
13
17
  ## Example
14
18
 
@@ -19,6 +23,10 @@ import type { ChangeSubscriptionRequest } from '@knowledge-stack/ksapi'
19
23
  const example = {
20
24
  "subscriptionId": null,
21
25
  "numSeats": null,
26
+ "interval": null,
27
+ "billingSystem": null,
28
+ "channel": null,
29
+ "channelExtra": null,
22
30
  } satisfies ChangeSubscriptionRequest
23
31
 
24
32
  console.log(example)
@@ -0,0 +1,33 @@
1
+
2
+ # CheckoutAction
3
+
4
+ What the client must do next after a subscription-change request.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { CheckoutAction } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies CheckoutAction
19
+
20
+ console.log(example)
21
+
22
+ // Convert the instance to a JSON string
23
+ const exampleJSON: string = JSON.stringify(example)
24
+ console.log(exampleJSON)
25
+
26
+ // Parse the JSON string back to an object
27
+ const exampleParsed = JSON.parse(exampleJSON) as CheckoutAction
28
+ console.log(exampleParsed)
29
+ ```
30
+
31
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
32
+
33
+
@@ -0,0 +1,41 @@
1
+
2
+ # CheckoutResponse
3
+
4
+ Result of ``POST /v1/tenants/{tenant_id}/subscriptions``. ``REDIRECT`` → send the browser to ``url`` (Stripe Checkout). ``CREDENTIAL`` → feed ``credential`` to the Ping++ JS SDK to invoke the chosen channel. ``SCHEDULED`` → nothing to pay; the current billed subscription will not renew and expires at period end. ``APPLIED`` → the change is already in effect (free-plan downgrade of an unbilled tenant, or a no-op request).
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `action` | [CheckoutAction](CheckoutAction.md)
11
+ `billingSystem` | [BillingSystem](BillingSystem.md)
12
+ `url` | string
13
+ `credential` | { [key: string]: any; }
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { CheckoutResponse } from '@knowledge-stack/ksapi'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "action": null,
23
+ "billingSystem": null,
24
+ "url": null,
25
+ "credential": null,
26
+ } satisfies CheckoutResponse
27
+
28
+ console.log(example)
29
+
30
+ // Convert the instance to a JSON string
31
+ const exampleJSON: string = JSON.stringify(example)
32
+ console.log(exampleJSON)
33
+
34
+ // Parse the JSON string back to an object
35
+ const exampleParsed = JSON.parse(exampleJSON) as CheckoutResponse
36
+ console.log(exampleParsed)
37
+ ```
38
+
39
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
40
+
41
+
@@ -7,6 +7,9 @@ Create a new workflow definition. Inputs are per-run (see ``POST /workflow-defi
7
7
 
8
8
  Name | Type
9
9
  ------------ | -------------
10
+ `scheduleCadence` | [ScheduleCadence](ScheduleCadence.md)
11
+ `scheduleStartAt` | Date
12
+ `scheduleTimezone` | string
10
13
  `name` | string
11
14
  `description` | string
12
15
  `maxRunDurationSeconds` | number
@@ -24,6 +27,9 @@ import type { CreateWorkflowDefinitionRequest } from '@knowledge-stack/ksapi'
24
27
 
25
28
  // TODO: Update the object below with actual values
26
29
  const example = {
30
+ "scheduleCadence": null,
31
+ "scheduleStartAt": null,
32
+ "scheduleTimezone": null,
27
33
  "name": null,
28
34
  "description": null,
29
35
  "maxRunDurationSeconds": null,
@@ -177,7 +177,7 @@ example().catch(console.error);
177
177
 
178
178
  Create Document Version Handler
179
179
 
180
- Create a new version for a document. The version number is automatically incremented from the highest existing version.
180
+ Create a new version for a document. Requires an active document checkout held by the caller. Acquire one via ``POST /v1/documents/{id}/checkout`` first and release it after; otherwise this returns 409 Conflict (\"A document checkout is required to edit this document.\"). The version number is automatically incremented from the highest existing version.
181
181
 
182
182
  ### Example
183
183
 
@@ -252,7 +252,7 @@ example().catch(console.error);
252
252
 
253
253
  Delete Document Version Handler
254
254
 
255
- Delete a document version by its ID. Cannot delete the active version of a document.
255
+ Delete a document version by its ID. Requires an active document checkout held by the caller on the **parent document** (the version itself carries no lock). Acquire one via ``POST /v1/documents/{id}/checkout`` first; otherwise this returns 409 Conflict (\"A document checkout is required to edit this document.\"). Cannot delete the active version of a document.
256
256
 
257
257
  ### Example
258
258
 
@@ -736,7 +736,7 @@ example().catch(console.error);
736
736
 
737
737
  Ingest Document Version Handler
738
738
 
739
- Upload a new file for an existing document, creating a new version and triggering ingestion. Creates a new document version (incrementing the highest version number), uploads the file to S3, and starts the ingestion workflow. Upon successful ingestion, the new version is automatically activated (set as the document\'s active_version) and the old version\'s Qdrant points are deactivated. Returns 201 immediately with the Temporal ``workflow_id``. Ingestion runs in the background — poll ``GET /v1/system-jobs/document_versions/{workflow_id}`` (also given in the ``Location`` header) until ``status`` is terminal.
739
+ Upload a new file for an existing document, creating a new version and triggering ingestion. Requires an active document checkout held by the caller. Acquire one via ``POST /v1/documents/{id}/checkout`` first and release it after; otherwise this returns 409 Conflict (\"A document checkout is required to edit this document.\"). Creates a new document version (incrementing the highest version number), uploads the file to S3, and starts the ingestion workflow. Upon successful ingestion, the new version is automatically activated (set as the document\'s active_version) and the old version\'s Qdrant points are deactivated. Returns 201 immediately with the Temporal ``workflow_id``. Ingestion runs in the background — poll ``GET /v1/system-jobs/document_versions/{workflow_id}`` (also given in the ``Location`` header) until ``status`` is terminal.
740
740
 
741
741
  ### Example
742
742
 
@@ -38,6 +38,9 @@ Name | Type
38
38
  `copyCount` | number
39
39
  `lastRun` | [LastRunSummary](LastRunSummary.md)
40
40
  `pendingApprovalCount` | number
41
+ `scheduleCadence` | [ScheduleCadence](ScheduleCadence.md)
42
+ `scheduleStartAt` | Date
43
+ `scheduleTimezone` | string
41
44
  `workflowDefinitionId` | string
42
45
  `triggeredBy` | [UserInfo](UserInfo.md)
43
46
  `executionState` | [WorkflowExecutionState](WorkflowExecutionState.md)
@@ -110,6 +113,9 @@ const example = {
110
113
  "copyCount": null,
111
114
  "lastRun": null,
112
115
  "pendingApprovalCount": null,
116
+ "scheduleCadence": null,
117
+ "scheduleStartAt": null,
118
+ "scheduleTimezone": null,
113
119
  "workflowDefinitionId": null,
114
120
  "triggeredBy": null,
115
121
  "executionState": null,
package/docs/IdpConfig.md CHANGED
@@ -9,6 +9,7 @@ Name | Type
9
9
  ------------ | -------------
10
10
  `provider` | [SupportedIdP](SupportedIdP.md)
11
11
  `_configuration` | { [key: string]: any; }
12
+ `syncCrontab` | string
12
13
 
13
14
  ## Example
14
15
 
@@ -19,6 +20,7 @@ import type { IdpConfig } from '@knowledge-stack/ksapi'
19
20
  const example = {
20
21
  "provider": null,
21
22
  "_configuration": null,
23
+ "syncCrontab": null,
22
24
  } satisfies IdpConfig
23
25
 
24
26
  console.log(example)
@@ -0,0 +1,40 @@
1
+
2
+ # PaginatedResponseBillingPaymentResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `items` | [Array<BillingPaymentResponse>](BillingPaymentResponse.md)
10
+ `total` | number
11
+ `limit` | number
12
+ `offset` | number
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { PaginatedResponseBillingPaymentResponse } from '@knowledge-stack/ksapi'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "items": null,
22
+ "total": null,
23
+ "limit": null,
24
+ "offset": null,
25
+ } satisfies PaginatedResponseBillingPaymentResponse
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as PaginatedResponseBillingPaymentResponse
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
39
+
40
+
@@ -0,0 +1,33 @@
1
+
2
+ # ScheduleCadence
3
+
4
+ How often a workflow definition runs itself. The cadence names the recurrence; the time of day, weekday and day of month all come from the definition\'s ``schedule_start_at``, so an illegal combination (a daily cadence carrying a weekday, say) cannot be expressed. ``None`` on the definition means manual-only — the state every definition is in today.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { ScheduleCadence } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies ScheduleCadence
19
+
20
+ console.log(example)
21
+
22
+ // Convert the instance to a JSON string
23
+ const exampleJSON: string = JSON.stringify(example)
24
+ console.log(exampleJSON)
25
+
26
+ // Parse the JSON string back to an object
27
+ const exampleParsed = JSON.parse(exampleJSON) as ScheduleCadence
28
+ console.log(exampleParsed)
29
+ ```
30
+
31
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
32
+
33
+
@@ -15,6 +15,10 @@ Name | Type
15
15
  `mediaMinutes` | number
16
16
  `maxSeats` | number
17
17
  `_public` | boolean
18
+ `priceMonthlyUsdCents` | number
19
+ `priceAnnualUsdCents` | number
20
+ `priceMonthlyCnyFen` | number
21
+ `priceAnnualCnyFen` | number
18
22
  `createdAt` | Date
19
23
  `updatedAt` | Date
20
24
 
@@ -33,6 +37,10 @@ const example = {
33
37
  "mediaMinutes": null,
34
38
  "maxSeats": null,
35
39
  "_public": null,
40
+ "priceMonthlyUsdCents": null,
41
+ "priceAnnualUsdCents": null,
42
+ "priceMonthlyCnyFen": null,
43
+ "priceAnnualCnyFen": null,
36
44
  "createdAt": null,
37
45
  "updatedAt": null,
38
46
  } satisfies SubscriptionPlanResponse
@@ -11,11 +11,11 @@ All URIs are relative to *http://localhost:8000*
11
11
 
12
12
  ## changeTenantSubscription
13
13
 
14
- > SubmitSubscriptionResponse changeTenantSubscription(tenantId, changeSubscriptionRequest, idempotencyKey)
14
+ > CheckoutResponse changeTenantSubscription(tenantId, changeSubscriptionRequest)
15
15
 
16
16
  Change Tenant Subscription Handler
17
17
 
18
- 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.
18
+ 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).
19
19
 
20
20
  ### Example
21
21
 
@@ -41,8 +41,6 @@ async function example() {
41
41
  tenantId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
42
42
  // ChangeSubscriptionRequest
43
43
  changeSubscriptionRequest: ...,
44
- // string (optional)
45
- idempotencyKey: idempotencyKey_example,
46
44
  } satisfies ChangeTenantSubscriptionRequest;
47
45
 
48
46
  try {
@@ -64,11 +62,10 @@ example().catch(console.error);
64
62
  |------------- | ------------- | ------------- | -------------|
65
63
  | **tenantId** | `string` | | [Defaults to `undefined`] |
66
64
  | **changeSubscriptionRequest** | [ChangeSubscriptionRequest](ChangeSubscriptionRequest.md) | | |
67
- | **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
68
65
 
69
66
  ### Return type
70
67
 
71
- [**SubmitSubscriptionResponse**](SubmitSubscriptionResponse.md)
68
+ [**CheckoutResponse**](CheckoutResponse.md)
72
69
 
73
70
  ### Authorization
74
71
 
@@ -83,7 +80,7 @@ example().catch(console.error);
83
80
  ### HTTP response details
84
81
  | Status code | Description | Response headers |
85
82
  |-------------|-------------|------------------|
86
- | **202** | Successful Response | - |
83
+ | **200** | Successful Response | - |
87
84
  | **422** | Validation Error | - |
88
85
  | **0** | Error response. | - |
89
86
 
@@ -92,11 +89,11 @@ example().catch(console.error);
92
89
 
93
90
  ## getTenantSubscription
94
91
 
95
- > SubscriptionPlanResponse getTenantSubscription(tenantId)
92
+ > TenantSubscriptionResponse getTenantSubscription(tenantId)
96
93
 
97
94
  Get Tenant Subscription Handler
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
 
101
98
  ### Example
102
99
 
@@ -143,7 +140,7 @@ example().catch(console.error);
143
140
 
144
141
  ### Return type
145
142
 
146
- [**SubscriptionPlanResponse**](SubscriptionPlanResponse.md)
143
+ [**TenantSubscriptionResponse**](TenantSubscriptionResponse.md)
147
144
 
148
145
  ### Authorization
149
146
 
@@ -0,0 +1,47 @@
1
+
2
+ # TenantSubscriptionResponse
3
+
4
+ The tenant\'s current subscription: plan body + period state.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `plan` | [SubscriptionPlanResponse](SubscriptionPlanResponse.md)
11
+ `numSeats` | number
12
+ `startDate` | Date
13
+ `endDate` | Date
14
+ `billingSystem` | [BillingSystem](BillingSystem.md)
15
+ `interval` | [BillingInterval](BillingInterval.md)
16
+ `willRenew` | boolean
17
+
18
+ ## Example
19
+
20
+ ```typescript
21
+ import type { TenantSubscriptionResponse } from '@knowledge-stack/ksapi'
22
+
23
+ // TODO: Update the object below with actual values
24
+ const example = {
25
+ "plan": null,
26
+ "numSeats": null,
27
+ "startDate": null,
28
+ "endDate": null,
29
+ "billingSystem": null,
30
+ "interval": null,
31
+ "willRenew": null,
32
+ } satisfies TenantSubscriptionResponse
33
+
34
+ console.log(example)
35
+
36
+ // Convert the instance to a JSON string
37
+ const exampleJSON: string = JSON.stringify(example)
38
+ console.log(exampleJSON)
39
+
40
+ // Parse the JSON string back to an object
41
+ const exampleParsed = JSON.parse(exampleJSON) as TenantSubscriptionResponse
42
+ console.log(exampleParsed)
43
+ ```
44
+
45
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
46
+
47
+
@@ -181,7 +181,7 @@ example().catch(console.error);
181
181
 
182
182
  Delete Tenant
183
183
 
184
- Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
184
+ 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.
185
185
 
186
186
  ### Example
187
187
 
package/docs/TrashApi.md CHANGED
@@ -6,6 +6,7 @@ All URIs are relative to *http://localhost:8000*
6
6
  |------------- | ------------- | -------------|
7
7
  | [**bulkPermanentlyDeleteTrash**](TrashApi.md#bulkpermanentlydeletetrash) | **POST** /v1/trash/bulk-delete | Bulk Permanently Delete Trash Handler |
8
8
  | [**bulkRestoreTrash**](TrashApi.md#bulkrestoretrash) | **POST** /v1/trash/bulk-restore | Bulk Restore Trash Handler |
9
+ | [**getTrashItem**](TrashApi.md#gettrashitem) | **GET** /v1/trash/{path_part_id} | Get Trash Item Handler |
9
10
  | [**listTrash**](TrashApi.md#listtrash) | **GET** /v1/trash | List Trash Handler |
10
11
  | [**permanentlyDeleteTrashItem**](TrashApi.md#permanentlydeletetrashitem) | **DELETE** /v1/trash/{path_part_id} | Permanently Delete Trash Item Handler |
11
12
  | [**restoreTrashItem**](TrashApi.md#restoretrashitem) | **POST** /v1/trash/{path_part_id}/restore | Restore Trash Item Handler |
@@ -162,6 +163,81 @@ example().catch(console.error);
162
163
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
163
164
 
164
165
 
166
+ ## getTrashItem
167
+
168
+ > TrashItemDetailResponse getTrashItem(pathPartId)
169
+
170
+ Get Trash Item Handler
171
+
172
+ Fetch a single trash root, with a preview URL for DOCUMENT items.
173
+
174
+ ### Example
175
+
176
+ ```ts
177
+ import {
178
+ Configuration,
179
+ TrashApi,
180
+ } from '@knowledge-stack/ksapi';
181
+ import type { GetTrashItemRequest } from '@knowledge-stack/ksapi';
182
+
183
+ async function example() {
184
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
185
+ const config = new Configuration({
186
+ // To configure API key authorization: cookieAuth
187
+ apiKey: "YOUR API KEY",
188
+ // Configure HTTP bearer authorization: bearerAuth
189
+ accessToken: "YOUR BEARER TOKEN",
190
+ });
191
+ const api = new TrashApi(config);
192
+
193
+ const body = {
194
+ // string | Trashed PathPart ID
195
+ pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
196
+ } satisfies GetTrashItemRequest;
197
+
198
+ try {
199
+ const data = await api.getTrashItem(body);
200
+ console.log(data);
201
+ } catch (error) {
202
+ console.error(error);
203
+ }
204
+ }
205
+
206
+ // Run the test
207
+ example().catch(console.error);
208
+ ```
209
+
210
+ ### Parameters
211
+
212
+
213
+ | Name | Type | Description | Notes |
214
+ |------------- | ------------- | ------------- | -------------|
215
+ | **pathPartId** | `string` | Trashed PathPart ID | [Defaults to `undefined`] |
216
+
217
+ ### Return type
218
+
219
+ [**TrashItemDetailResponse**](TrashItemDetailResponse.md)
220
+
221
+ ### Authorization
222
+
223
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
224
+
225
+ ### HTTP request headers
226
+
227
+ - **Content-Type**: Not defined
228
+ - **Accept**: `application/json`
229
+
230
+
231
+ ### HTTP response details
232
+ | Status code | Description | Response headers |
233
+ |-------------|-------------|------------------|
234
+ | **200** | Successful Response | - |
235
+ | **422** | Validation Error | - |
236
+ | **0** | Error response. | - |
237
+
238
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
239
+
240
+
165
241
  ## listTrash
166
242
 
167
243
  > PaginatedResponseTrashItemResponse listTrash(sortOrder, sortDir, deletedBy, partType, ownerId, limit, offset, createdAfter, createdBefore, updatedAfter, updatedBefore)
@@ -0,0 +1,55 @@
1
+
2
+ # TrashItemDetailResponse
3
+
4
+ A single trash item plus a preview link for DOCUMENT items.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `pathPartId` | string
11
+ `metadataObjId` | string
12
+ `partType` | [PartType](PartType.md)
13
+ `name` | string
14
+ `parentPathPartId` | string
15
+ `materializedPath` | string
16
+ `deletedAt` | Date
17
+ `deletedBy` | string
18
+ `documentType` | [DocumentType](DocumentType.md)
19
+ `owner` | [UserInfo](UserInfo.md)
20
+ `assetS3Url` | string
21
+
22
+ ## Example
23
+
24
+ ```typescript
25
+ import type { TrashItemDetailResponse } from '@knowledge-stack/ksapi'
26
+
27
+ // TODO: Update the object below with actual values
28
+ const example = {
29
+ "pathPartId": null,
30
+ "metadataObjId": null,
31
+ "partType": null,
32
+ "name": null,
33
+ "parentPathPartId": null,
34
+ "materializedPath": null,
35
+ "deletedAt": null,
36
+ "deletedBy": null,
37
+ "documentType": null,
38
+ "owner": null,
39
+ "assetS3Url": null,
40
+ } satisfies TrashItemDetailResponse
41
+
42
+ console.log(example)
43
+
44
+ // Convert the instance to a JSON string
45
+ const exampleJSON: string = JSON.stringify(example)
46
+ console.log(exampleJSON)
47
+
48
+ // Parse the JSON string back to an object
49
+ const exampleParsed = JSON.parse(exampleJSON) as TrashItemDetailResponse
50
+ console.log(exampleParsed)
51
+ ```
52
+
53
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
54
+
55
+
@@ -15,6 +15,7 @@ Name | Type
15
15
  `materializedPath` | string
16
16
  `deletedAt` | Date
17
17
  `deletedBy` | string
18
+ `documentType` | [DocumentType](DocumentType.md)
18
19
  `owner` | [UserInfo](UserInfo.md)
19
20
 
20
21
  ## Example
@@ -32,6 +33,7 @@ const example = {
32
33
  "materializedPath": null,
33
34
  "deletedAt": null,
34
35
  "deletedBy": null,
36
+ "documentType": null,
35
37
  "owner": null,
36
38
  } satisfies TrashItemResponse
37
39
 
@@ -7,6 +7,9 @@ Full replacement (PUT semantics).
7
7
 
8
8
  Name | Type
9
9
  ------------ | -------------
10
+ `scheduleCadence` | [ScheduleCadence](ScheduleCadence.md)
11
+ `scheduleStartAt` | Date
12
+ `scheduleTimezone` | string
10
13
  `name` | string
11
14
  `description` | string
12
15
  `maxRunDurationSeconds` | number
@@ -24,6 +27,9 @@ import type { UpdateWorkflowDefinitionRequest } from '@knowledge-stack/ksapi'
24
27
 
25
28
  // TODO: Update the object below with actual values
26
29
  const example = {
30
+ "scheduleCadence": null,
31
+ "scheduleStartAt": null,
32
+ "scheduleTimezone": null,
27
33
  "name": null,
28
34
  "description": null,
29
35
  "maxRunDurationSeconds": null,
@@ -28,6 +28,9 @@ Name | Type
28
28
  `pendingApprovalCount` | number
29
29
  `approvalState` | [PathPartApprovalState](PathPartApprovalState.md)
30
30
  `owner` | [UserInfo](UserInfo.md)
31
+ `scheduleCadence` | [ScheduleCadence](ScheduleCadence.md)
32
+ `scheduleStartAt` | Date
33
+ `scheduleTimezone` | string
31
34
  `createdAt` | Date
32
35
  `updatedAt` | Date
33
36
  `permissions` | [ItemPermissions](ItemPermissions.md)
@@ -60,6 +63,9 @@ const example = {
60
63
  "pendingApprovalCount": null,
61
64
  "approvalState": null,
62
65
  "owner": null,
66
+ "scheduleCadence": null,
67
+ "scheduleStartAt": null,
68
+ "scheduleTimezone": null,
63
69
  "createdAt": null,
64
70
  "updatedAt": null,
65
71
  "permissions": null,