@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
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { BulkOperationResponseFromJSON, BulkTrashRequestToJSON, PaginatedResponseTrashItemResponseFromJSON, } from '../models/index';
24
+ import { BulkOperationResponseFromJSON, BulkTrashRequestToJSON, PaginatedResponseTrashItemResponseFromJSON, TrashItemDetailResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -124,6 +124,54 @@ export class TrashApi extends runtime.BaseAPI {
124
124
  return yield response.value();
125
125
  });
126
126
  }
127
+ /**
128
+ * Creates request options for getTrashItem without sending the request
129
+ */
130
+ getTrashItemRequestOpts(requestParameters) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ if (requestParameters['pathPartId'] == null) {
133
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling getTrashItem().');
134
+ }
135
+ const queryParameters = {};
136
+ const headerParameters = {};
137
+ if (this.configuration && this.configuration.accessToken) {
138
+ const token = this.configuration.accessToken;
139
+ const tokenString = yield token("bearerAuth", []);
140
+ if (tokenString) {
141
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
142
+ }
143
+ }
144
+ let urlPath = `/v1/trash/{path_part_id}`;
145
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
146
+ return {
147
+ path: urlPath,
148
+ method: 'GET',
149
+ headers: headerParameters,
150
+ query: queryParameters,
151
+ };
152
+ });
153
+ }
154
+ /**
155
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
156
+ * Get Trash Item Handler
157
+ */
158
+ getTrashItemRaw(requestParameters, initOverrides) {
159
+ return __awaiter(this, void 0, void 0, function* () {
160
+ const requestOptions = yield this.getTrashItemRequestOpts(requestParameters);
161
+ const response = yield this.request(requestOptions, initOverrides);
162
+ return new runtime.JSONApiResponse(response, (jsonValue) => TrashItemDetailResponseFromJSON(jsonValue));
163
+ });
164
+ }
165
+ /**
166
+ * Fetch a single trash root, with a preview URL for DOCUMENT items.
167
+ * Get Trash Item Handler
168
+ */
169
+ getTrashItem(requestParameters, initOverrides) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const response = yield this.getTrashItemRaw(requestParameters, initOverrides);
172
+ return yield response.value();
173
+ });
174
+ }
127
175
  /**
128
176
  * Creates request options for listTrash without sending the request
129
177
  */
@@ -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>;
@@ -648,7 +648,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
648
648
  });
649
649
  }
650
650
  /**
651
- * 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.
651
+ * 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.
652
652
  * Workflow Run Callback Handler
653
653
  */
654
654
  workflowRunCallbackRaw(requestParameters, initOverrides) {
@@ -659,7 +659,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
659
659
  });
660
660
  }
661
661
  /**
662
- * 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.
662
+ * 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.
663
663
  * Workflow Run Callback Handler
664
664
  */
665
665
  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';
@@ -7,6 +7,7 @@ export * from './ApiConnectionsApi';
7
7
  export * from './ApiKeysApi';
8
8
  export * from './AuditEventsApi';
9
9
  export * from './AuthApi';
10
+ export * from './BillingApi';
10
11
  export * from './BulkDeleteApi';
11
12
  export * from './BulkDownloadApi';
12
13
  export * from './BulkMoveApi';
@@ -0,0 +1,25 @@
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
+ /**
13
+ * Self-serve billing period length.
14
+ * @export
15
+ */
16
+ export declare const BillingInterval: {
17
+ readonly Monthly: 'MONTHLY';
18
+ readonly Annual: 'ANNUAL';
19
+ };
20
+ export type BillingInterval = typeof BillingInterval[keyof typeof BillingInterval];
21
+ export declare function instanceOfBillingInterval(value: any): boolean;
22
+ export declare function BillingIntervalFromJSON(json: any): BillingInterval;
23
+ export declare function BillingIntervalFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingInterval;
24
+ export declare function BillingIntervalToJSON(value?: BillingInterval | null): any;
25
+ export declare function BillingIntervalToJSONTyped(value: any, ignoreDiscriminator: boolean): BillingInterval;
@@ -0,0 +1,43 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * 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.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Self-serve billing period length.
16
+ * @export
17
+ */
18
+ export const BillingInterval = {
19
+ Monthly: 'MONTHLY',
20
+ Annual: 'ANNUAL'
21
+ };
22
+ export function instanceOfBillingInterval(value) {
23
+ for (const key in BillingInterval) {
24
+ if (Object.prototype.hasOwnProperty.call(BillingInterval, key)) {
25
+ if (BillingInterval[key] === value) {
26
+ return true;
27
+ }
28
+ }
29
+ }
30
+ return false;
31
+ }
32
+ export function BillingIntervalFromJSON(json) {
33
+ return BillingIntervalFromJSONTyped(json, false);
34
+ }
35
+ export function BillingIntervalFromJSONTyped(json, ignoreDiscriminator) {
36
+ return json;
37
+ }
38
+ export function BillingIntervalToJSON(value) {
39
+ return value;
40
+ }
41
+ export function BillingIntervalToJSONTyped(value, ignoreDiscriminator) {
42
+ return value;
43
+ }
@@ -0,0 +1,100 @@
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 type { BillingSystem } from './BillingSystem';
13
+ /**
14
+ * One confirmed payment, as shown in the tenant's billing history.
15
+ *
16
+ * Backs in-app receipts: CN payments have no provider-hosted invoice
17
+ * (``invoice_url`` is NULL) — the frontend renders a receipt from
18
+ * these fields. Stripe payments link the hosted invoice.
19
+ * @export
20
+ * @interface BillingPaymentResponse
21
+ */
22
+ export interface BillingPaymentResponse {
23
+ /**
24
+ * Payment id.
25
+ * @type {string}
26
+ * @memberof BillingPaymentResponse
27
+ */
28
+ id: string;
29
+ /**
30
+ *
31
+ * @type {BillingSystem}
32
+ * @memberof BillingPaymentResponse
33
+ */
34
+ billingSystem: BillingSystem;
35
+ /**
36
+ * Plan purchased.
37
+ * @type {string}
38
+ * @memberof BillingPaymentResponse
39
+ */
40
+ planId: string;
41
+ /**
42
+ * Billing period purchased.
43
+ * @type {string}
44
+ * @memberof BillingPaymentResponse
45
+ */
46
+ interval: string;
47
+ /**
48
+ * Seats purchased.
49
+ * @type {number}
50
+ * @memberof BillingPaymentResponse
51
+ */
52
+ numSeats: number;
53
+ /**
54
+ * Total charged, in the currency's minor unit.
55
+ * @type {number}
56
+ * @memberof BillingPaymentResponse
57
+ */
58
+ amount: number;
59
+ /**
60
+ * USD (cents) or CNY (fen).
61
+ * @type {string}
62
+ * @memberof BillingPaymentResponse
63
+ */
64
+ currency: string;
65
+ /**
66
+ * Provider-hosted invoice/receipt, when available.
67
+ * @type {string}
68
+ * @memberof BillingPaymentResponse
69
+ */
70
+ invoiceUrl?: string | null;
71
+ /**
72
+ * When the payment confirmed.
73
+ * @type {Date}
74
+ * @memberof BillingPaymentResponse
75
+ */
76
+ createdAt: Date;
77
+ }
78
+ export declare const BillingPaymentResponsePropertyValidationAttributesMap: {
79
+ [property: string]: {
80
+ maxLength?: number;
81
+ minLength?: number;
82
+ pattern?: string;
83
+ maximum?: number;
84
+ exclusiveMaximum?: boolean;
85
+ minimum?: number;
86
+ exclusiveMinimum?: boolean;
87
+ multipleOf?: number;
88
+ maxItems?: number;
89
+ minItems?: number;
90
+ uniqueItems?: boolean;
91
+ };
92
+ };
93
+ /**
94
+ * Check if a given object implements the BillingPaymentResponse interface.
95
+ */
96
+ export declare function instanceOfBillingPaymentResponse(value: object): value is BillingPaymentResponse;
97
+ export declare function BillingPaymentResponseFromJSON(json: any): BillingPaymentResponse;
98
+ export declare function BillingPaymentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingPaymentResponse;
99
+ export declare function BillingPaymentResponseToJSON(json: any): BillingPaymentResponse;
100
+ export declare function BillingPaymentResponseToJSONTyped(value?: BillingPaymentResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,75 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * 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.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import { BillingSystemFromJSON, BillingSystemToJSON, } from './BillingSystem';
15
+ export const BillingPaymentResponsePropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the BillingPaymentResponse interface.
18
+ */
19
+ export function instanceOfBillingPaymentResponse(value) {
20
+ if (!('id' in value) || value['id'] === undefined)
21
+ return false;
22
+ if (!('billingSystem' in value) || value['billingSystem'] === undefined)
23
+ return false;
24
+ if (!('planId' in value) || value['planId'] === undefined)
25
+ return false;
26
+ if (!('interval' in value) || value['interval'] === undefined)
27
+ return false;
28
+ if (!('numSeats' in value) || value['numSeats'] === undefined)
29
+ return false;
30
+ if (!('amount' in value) || value['amount'] === undefined)
31
+ return false;
32
+ if (!('currency' in value) || value['currency'] === undefined)
33
+ return false;
34
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
35
+ return false;
36
+ return true;
37
+ }
38
+ export function BillingPaymentResponseFromJSON(json) {
39
+ return BillingPaymentResponseFromJSONTyped(json, false);
40
+ }
41
+ export function BillingPaymentResponseFromJSONTyped(json, ignoreDiscriminator) {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+ 'id': json['id'],
47
+ 'billingSystem': BillingSystemFromJSON(json['billing_system']),
48
+ 'planId': json['plan_id'],
49
+ 'interval': json['interval'],
50
+ 'numSeats': json['num_seats'],
51
+ 'amount': json['amount'],
52
+ 'currency': json['currency'],
53
+ 'invoiceUrl': json['invoice_url'] == null ? undefined : json['invoice_url'],
54
+ 'createdAt': (new Date(json['created_at'])),
55
+ };
56
+ }
57
+ export function BillingPaymentResponseToJSON(json) {
58
+ return BillingPaymentResponseToJSONTyped(json, false);
59
+ }
60
+ export function BillingPaymentResponseToJSONTyped(value, ignoreDiscriminator = false) {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+ 'id': value['id'],
66
+ 'billing_system': BillingSystemToJSON(value['billingSystem']),
67
+ 'plan_id': value['planId'],
68
+ 'interval': value['interval'],
69
+ 'num_seats': value['numSeats'],
70
+ 'amount': value['amount'],
71
+ 'currency': value['currency'],
72
+ 'invoice_url': value['invoiceUrl'],
73
+ 'created_at': value['createdAt'].toISOString(),
74
+ };
75
+ }
@@ -0,0 +1,30 @@
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
+ /**
13
+ * External payment platform a subscription or payment is linked to.
14
+ *
15
+ * ``STRIPE`` serves North America; ``PING_PP`` (Ping++, a mainland-China
16
+ * payment aggregator fronting Alipay + WeChat Pay) serves China. Rows
17
+ * with no external billing linkage (free / admin-issued / synthetic
18
+ * fall-back subscriptions) carry NULL instead of a value.
19
+ * @export
20
+ */
21
+ export declare const BillingSystem: {
22
+ readonly Stripe: 'STRIPE';
23
+ readonly PingPp: 'PING_PP';
24
+ };
25
+ export type BillingSystem = typeof BillingSystem[keyof typeof BillingSystem];
26
+ export declare function instanceOfBillingSystem(value: any): boolean;
27
+ export declare function BillingSystemFromJSON(json: any): BillingSystem;
28
+ export declare function BillingSystemFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingSystem;
29
+ export declare function BillingSystemToJSON(value?: BillingSystem | null): any;
30
+ export declare function BillingSystemToJSONTyped(value: any, ignoreDiscriminator: boolean): BillingSystem;
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * 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.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * External payment platform a subscription or payment is linked to.
16
+ *
17
+ * ``STRIPE`` serves North America; ``PING_PP`` (Ping++, a mainland-China
18
+ * payment aggregator fronting Alipay + WeChat Pay) serves China. Rows
19
+ * with no external billing linkage (free / admin-issued / synthetic
20
+ * fall-back subscriptions) carry NULL instead of a value.
21
+ * @export
22
+ */
23
+ export const BillingSystem = {
24
+ Stripe: 'STRIPE',
25
+ PingPp: 'PING_PP'
26
+ };
27
+ export function instanceOfBillingSystem(value) {
28
+ for (const key in BillingSystem) {
29
+ if (Object.prototype.hasOwnProperty.call(BillingSystem, key)) {
30
+ if (BillingSystem[key] === value) {
31
+ return true;
32
+ }
33
+ }
34
+ }
35
+ return false;
36
+ }
37
+ export function BillingSystemFromJSON(json) {
38
+ return BillingSystemFromJSONTyped(json, false);
39
+ }
40
+ export function BillingSystemFromJSONTyped(json, ignoreDiscriminator) {
41
+ return json;
42
+ }
43
+ export function BillingSystemToJSON(value) {
44
+ return value;
45
+ }
46
+ export function BillingSystemToJSONTyped(value, ignoreDiscriminator) {
47
+ return value;
48
+ }
@@ -9,8 +9,16 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { BillingInterval } from './BillingInterval';
13
+ import type { BillingSystem } from './BillingSystem';
12
14
  /**
13
15
  * Body for ``POST /v1/tenants/{tenant_id}/subscriptions``.
16
+ *
17
+ * For a priced plan, ``interval`` and ``billing_system`` are required
18
+ * (``channel`` too for Ping++); the response carries the provider
19
+ * checkout to complete. For the free plan they are ignored — the
20
+ * downgrade is applied immediately (unbilled tenants) or scheduled
21
+ * for period end (billed tenants).
14
22
  * @export
15
23
  * @interface ChangeSubscriptionRequest
16
24
  */
@@ -27,6 +35,32 @@ export interface ChangeSubscriptionRequest {
27
35
  * @memberof ChangeSubscriptionRequest
28
36
  */
29
37
  numSeats: number;
38
+ /**
39
+ *
40
+ * @type {BillingInterval}
41
+ * @memberof ChangeSubscriptionRequest
42
+ */
43
+ interval?: BillingInterval;
44
+ /**
45
+ *
46
+ * @type {BillingSystem}
47
+ * @memberof ChangeSubscriptionRequest
48
+ */
49
+ billingSystem?: BillingSystem;
50
+ /**
51
+ * Ping++ payment channel chosen in the UI (e.g. 'alipay_pc_direct', 'wx_pub_qr'). Required when billing_system=PING_PP.
52
+ * @type {string}
53
+ * @memberof ChangeSubscriptionRequest
54
+ */
55
+ channel?: string | null;
56
+ /**
57
+ * Channel-specific Ping++ charge `extra` parameters (success_url, product ids, ... — see the Ping++ charge API for the chosen channel). Passed through verbatim; amounts are always resolved server-side.
58
+ * @type {{ [key: string]: any; }}
59
+ * @memberof ChangeSubscriptionRequest
60
+ */
61
+ channelExtra?: {
62
+ [key: string]: any;
63
+ } | null;
30
64
  }
31
65
  export declare const ChangeSubscriptionRequestPropertyValidationAttributesMap: {
32
66
  [property: string]: {
@@ -11,6 +11,8 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { BillingIntervalFromJSON, BillingIntervalToJSON, } from './BillingInterval';
15
+ import { BillingSystemFromJSON, BillingSystemToJSON, } from './BillingSystem';
14
16
  export const ChangeSubscriptionRequestPropertyValidationAttributesMap = {
15
17
  numSeats: {
16
18
  minimum: 1,
@@ -37,6 +39,10 @@ export function ChangeSubscriptionRequestFromJSONTyped(json, ignoreDiscriminator
37
39
  return {
38
40
  'subscriptionId': json['subscription_id'],
39
41
  'numSeats': json['num_seats'],
42
+ 'interval': json['interval'] == null ? undefined : BillingIntervalFromJSON(json['interval']),
43
+ 'billingSystem': json['billing_system'] == null ? undefined : BillingSystemFromJSON(json['billing_system']),
44
+ 'channel': json['channel'] == null ? undefined : json['channel'],
45
+ 'channelExtra': json['channel_extra'] == null ? undefined : json['channel_extra'],
40
46
  };
41
47
  }
42
48
  export function ChangeSubscriptionRequestToJSON(json) {
@@ -49,5 +55,9 @@ export function ChangeSubscriptionRequestToJSONTyped(value, ignoreDiscriminator
49
55
  return {
50
56
  'subscription_id': value['subscriptionId'],
51
57
  'num_seats': value['numSeats'],
58
+ 'interval': BillingIntervalToJSON(value['interval']),
59
+ 'billing_system': BillingSystemToJSON(value['billingSystem']),
60
+ 'channel': value['channel'],
61
+ 'channel_extra': value['channelExtra'],
52
62
  };
53
63
  }
@@ -0,0 +1,27 @@
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
+ /**
13
+ * What the client must do next after a subscription-change request.
14
+ * @export
15
+ */
16
+ export declare const CheckoutAction: {
17
+ readonly Redirect: 'REDIRECT';
18
+ readonly Credential: 'CREDENTIAL';
19
+ readonly Scheduled: 'SCHEDULED';
20
+ readonly Applied: 'APPLIED';
21
+ };
22
+ export type CheckoutAction = typeof CheckoutAction[keyof typeof CheckoutAction];
23
+ export declare function instanceOfCheckoutAction(value: any): boolean;
24
+ export declare function CheckoutActionFromJSON(json: any): CheckoutAction;
25
+ export declare function CheckoutActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): CheckoutAction;
26
+ export declare function CheckoutActionToJSON(value?: CheckoutAction | null): any;
27
+ export declare function CheckoutActionToJSONTyped(value: any, ignoreDiscriminator: boolean): CheckoutAction;
@@ -0,0 +1,45 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * 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.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * What the client must do next after a subscription-change request.
16
+ * @export
17
+ */
18
+ export const CheckoutAction = {
19
+ Redirect: 'REDIRECT',
20
+ Credential: 'CREDENTIAL',
21
+ Scheduled: 'SCHEDULED',
22
+ Applied: 'APPLIED'
23
+ };
24
+ export function instanceOfCheckoutAction(value) {
25
+ for (const key in CheckoutAction) {
26
+ if (Object.prototype.hasOwnProperty.call(CheckoutAction, key)) {
27
+ if (CheckoutAction[key] === value) {
28
+ return true;
29
+ }
30
+ }
31
+ }
32
+ return false;
33
+ }
34
+ export function CheckoutActionFromJSON(json) {
35
+ return CheckoutActionFromJSONTyped(json, false);
36
+ }
37
+ export function CheckoutActionFromJSONTyped(json, ignoreDiscriminator) {
38
+ return json;
39
+ }
40
+ export function CheckoutActionToJSON(value) {
41
+ return value;
42
+ }
43
+ export function CheckoutActionToJSONTyped(value, ignoreDiscriminator) {
44
+ return value;
45
+ }