@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.
- package/.openapi-generator/FILES +20 -2
- package/README.md +13 -3
- package/dist/apis/BillingApi.d.ts +70 -0
- package/dist/apis/BillingApi.js +120 -0
- package/dist/apis/DocumentVersionsApi.d.ts +8 -8
- package/dist/apis/DocumentVersionsApi.js +4 -4
- package/dist/apis/DocumentsApi.d.ts +4 -4
- package/dist/apis/DocumentsApi.js +2 -2
- package/dist/apis/SubscriptionsApi.d.ts +17 -20
- package/dist/apis/SubscriptionsApi.js +6 -9
- package/dist/apis/TenantsApi.d.ts +4 -4
- package/dist/apis/TenantsApi.js +2 -2
- package/dist/apis/TrashApi.d.ts +39 -1
- package/dist/apis/TrashApi.js +48 -0
- package/dist/apis/WorkflowRunsApi.d.ts +4 -4
- package/dist/apis/WorkflowRunsApi.js +2 -2
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/BillingApi.d.ts +70 -0
- package/dist/esm/apis/BillingApi.js +83 -0
- package/dist/esm/apis/DocumentVersionsApi.d.ts +8 -8
- package/dist/esm/apis/DocumentVersionsApi.js +4 -4
- package/dist/esm/apis/DocumentsApi.d.ts +4 -4
- package/dist/esm/apis/DocumentsApi.js +2 -2
- package/dist/esm/apis/SubscriptionsApi.d.ts +17 -20
- package/dist/esm/apis/SubscriptionsApi.js +7 -10
- package/dist/esm/apis/TenantsApi.d.ts +4 -4
- package/dist/esm/apis/TenantsApi.js +2 -2
- package/dist/esm/apis/TrashApi.d.ts +39 -1
- package/dist/esm/apis/TrashApi.js +49 -1
- package/dist/esm/apis/WorkflowRunsApi.d.ts +4 -4
- package/dist/esm/apis/WorkflowRunsApi.js +2 -2
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/BillingInterval.d.ts +25 -0
- package/dist/esm/models/BillingInterval.js +43 -0
- package/dist/esm/models/BillingPaymentResponse.d.ts +100 -0
- package/dist/esm/models/BillingPaymentResponse.js +75 -0
- package/dist/esm/models/BillingSystem.d.ts +30 -0
- package/dist/esm/models/BillingSystem.js +48 -0
- package/dist/esm/models/ChangeSubscriptionRequest.d.ts +34 -0
- package/dist/esm/models/ChangeSubscriptionRequest.js +10 -0
- package/dist/esm/models/CheckoutAction.d.ts +27 -0
- package/dist/esm/models/CheckoutAction.js +45 -0
- package/dist/esm/models/CheckoutResponse.d.ts +76 -0
- package/dist/esm/models/{SubmitSubscriptionResponse.js → CheckoutResponse.js} +20 -20
- package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +19 -0
- package/dist/esm/models/CreateWorkflowDefinitionRequest.js +10 -0
- package/dist/esm/models/IdpConfig.d.ts +6 -0
- package/dist/esm/models/IdpConfig.js +10 -1
- package/dist/esm/models/PaginatedResponseBillingPaymentResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseBillingPaymentResponse.js +70 -0
- package/dist/esm/models/ScheduleCadence.d.ts +32 -0
- package/dist/esm/models/ScheduleCadence.js +50 -0
- package/dist/esm/models/SubscriptionPlanResponse.d.ts +24 -0
- package/dist/esm/models/SubscriptionPlanResponse.js +8 -0
- package/dist/esm/models/{SubmitSubscriptionResponse.d.ts → TenantSubscriptionResponse.d.ts} +49 -38
- package/dist/esm/models/TenantSubscriptionResponse.js +67 -0
- package/dist/esm/models/TrashItemDetailResponse.d.ts +110 -0
- package/dist/esm/models/TrashItemDetailResponse.js +81 -0
- package/dist/esm/models/TrashItemResponse.d.ts +7 -0
- package/dist/esm/models/TrashItemResponse.js +3 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +19 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +10 -0
- package/dist/esm/models/WorkflowDefinitionResponse.d.ts +19 -0
- package/dist/esm/models/WorkflowDefinitionResponse.js +7 -0
- package/dist/esm/models/index.d.ts +9 -1
- package/dist/esm/models/index.js +9 -1
- package/dist/models/BillingInterval.d.ts +25 -0
- package/dist/models/BillingInterval.js +51 -0
- package/dist/models/BillingPaymentResponse.d.ts +100 -0
- package/dist/models/BillingPaymentResponse.js +83 -0
- package/dist/models/BillingSystem.d.ts +30 -0
- package/dist/models/BillingSystem.js +56 -0
- package/dist/models/ChangeSubscriptionRequest.d.ts +34 -0
- package/dist/models/ChangeSubscriptionRequest.js +10 -0
- package/dist/models/CheckoutAction.d.ts +27 -0
- package/dist/models/CheckoutAction.js +53 -0
- package/dist/models/CheckoutResponse.d.ts +76 -0
- package/dist/models/{SubmitSubscriptionResponse.js → CheckoutResponse.js} +26 -26
- package/dist/models/CreateWorkflowDefinitionRequest.d.ts +19 -0
- package/dist/models/CreateWorkflowDefinitionRequest.js +10 -0
- package/dist/models/IdpConfig.d.ts +6 -0
- package/dist/models/IdpConfig.js +10 -1
- package/dist/models/PaginatedResponseBillingPaymentResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseBillingPaymentResponse.js +78 -0
- package/dist/models/ScheduleCadence.d.ts +32 -0
- package/dist/models/ScheduleCadence.js +58 -0
- package/dist/models/SubscriptionPlanResponse.d.ts +24 -0
- package/dist/models/SubscriptionPlanResponse.js +8 -0
- package/dist/models/{SubmitSubscriptionResponse.d.ts → TenantSubscriptionResponse.d.ts} +49 -38
- package/dist/models/TenantSubscriptionResponse.js +75 -0
- package/dist/models/TrashItemDetailResponse.d.ts +110 -0
- package/dist/models/TrashItemDetailResponse.js +89 -0
- package/dist/models/TrashItemResponse.d.ts +7 -0
- package/dist/models/TrashItemResponse.js +3 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +19 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.js +10 -0
- package/dist/models/WorkflowDefinitionResponse.d.ts +19 -0
- package/dist/models/WorkflowDefinitionResponse.js +7 -0
- package/dist/models/index.d.ts +9 -1
- package/dist/models/index.js +9 -1
- package/docs/BillingApi.md +90 -0
- package/docs/BillingInterval.md +33 -0
- package/docs/BillingPaymentResponse.md +51 -0
- package/docs/BillingSystem.md +33 -0
- package/docs/ChangeSubscriptionRequest.md +9 -1
- package/docs/CheckoutAction.md +33 -0
- package/docs/CheckoutResponse.md +41 -0
- package/docs/CreateWorkflowDefinitionRequest.md +6 -0
- package/docs/DocumentVersionsApi.md +2 -2
- package/docs/DocumentsApi.md +1 -1
- package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +6 -0
- package/docs/IdpConfig.md +2 -0
- package/docs/PaginatedResponseBillingPaymentResponse.md +40 -0
- package/docs/ScheduleCadence.md +33 -0
- package/docs/SubscriptionPlanResponse.md +8 -0
- package/docs/SubscriptionsApi.md +7 -10
- package/docs/TenantSubscriptionResponse.md +47 -0
- package/docs/TenantsApi.md +1 -1
- package/docs/TrashApi.md +76 -0
- package/docs/TrashItemDetailResponse.md +55 -0
- package/docs/TrashItemResponse.md +2 -0
- package/docs/UpdateWorkflowDefinitionRequest.md +6 -0
- package/docs/WorkflowDefinitionResponse.md +6 -0
- package/docs/WorkflowRunsApi.md +1 -1
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +142 -0
- package/src/apis/DocumentVersionsApi.ts +8 -8
- package/src/apis/DocumentsApi.ts +4 -4
- package/src/apis/SubscriptionsApi.ts +24 -31
- package/src/apis/TenantsApi.ts +4 -4
- package/src/apis/TrashApi.ts +86 -0
- package/src/apis/WorkflowRunsApi.ts +4 -4
- package/src/apis/index.ts +1 -0
- package/src/models/BillingInterval.ts +53 -0
- package/src/models/BillingPaymentResponse.ts +168 -0
- package/src/models/BillingSystem.ts +58 -0
- package/src/models/ChangeSubscriptionRequest.ts +55 -0
- package/src/models/CheckoutAction.ts +55 -0
- package/src/models/{SubmitSubscriptionResponse.ts → CheckoutResponse.ts} +61 -47
- package/src/models/CreateWorkflowDefinitionRequest.ts +37 -0
- package/src/models/IdpConfig.ts +14 -0
- package/src/models/PaginatedResponseBillingPaymentResponse.ts +130 -0
- package/src/models/ScheduleCadence.ts +60 -0
- package/src/models/SubscriptionPlanResponse.ts +32 -0
- package/src/models/TenantSubscriptionResponse.ts +159 -0
- package/src/models/TrashItemDetailResponse.ts +194 -0
- package/src/models/TrashItemResponse.ts +15 -0
- package/src/models/UpdateWorkflowDefinitionRequest.ts +37 -0
- package/src/models/WorkflowDefinitionResponse.ts +31 -0
- package/src/models/index.ts +9 -1
- package/docs/SubmitSubscriptionResponse.md +0 -39
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { PaginatedResponseBillingPaymentResponseFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class BillingApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for listBillingPayments without sending the request
|
|
31
|
+
*/
|
|
32
|
+
listBillingPaymentsRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['tenantId'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('tenantId', 'Required parameter "tenantId" was null or undefined when calling listBillingPayments().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
if (requestParameters['limit'] != null) {
|
|
39
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['offset'] != null) {
|
|
42
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
43
|
+
}
|
|
44
|
+
const headerParameters = {};
|
|
45
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
46
|
+
const token = this.configuration.accessToken;
|
|
47
|
+
const tokenString = yield token("bearerAuth", []);
|
|
48
|
+
if (tokenString) {
|
|
49
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
let urlPath = `/v1/tenants/{tenant_id}/billing/payments`;
|
|
53
|
+
urlPath = urlPath.replace(`{${"tenant_id"}}`, encodeURIComponent(String(requestParameters['tenantId'])));
|
|
54
|
+
return {
|
|
55
|
+
path: urlPath,
|
|
56
|
+
method: 'GET',
|
|
57
|
+
headers: headerParameters,
|
|
58
|
+
query: queryParameters,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Newest-first payment history for the tenant (OWNER/ADMIN only). Backs the billing page\'s receipts list. ``invoice_url`` links the Stripe-hosted invoice when the payment ran through Stripe; CN (Ping++) payments render an in-app receipt from the row itself.
|
|
64
|
+
* List Billing Payments Handler
|
|
65
|
+
*/
|
|
66
|
+
listBillingPaymentsRaw(requestParameters, initOverrides) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const requestOptions = yield this.listBillingPaymentsRequestOpts(requestParameters);
|
|
69
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
70
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseBillingPaymentResponseFromJSON(jsonValue));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Newest-first payment history for the tenant (OWNER/ADMIN only). Backs the billing page\'s receipts list. ``invoice_url`` links the Stripe-hosted invoice when the payment ran through Stripe; CN (Ping++) payments render an in-app receipt from the row itself.
|
|
75
|
+
* List Billing Payments Handler
|
|
76
|
+
*/
|
|
77
|
+
listBillingPayments(requestParameters, initOverrides) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const response = yield this.listBillingPaymentsRaw(requestParameters, initOverrides);
|
|
80
|
+
return yield response.value();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -122,7 +122,7 @@ export interface DocumentVersionsApiInterface {
|
|
|
122
122
|
*/
|
|
123
123
|
createDocumentVersionRequestOpts(requestParameters: CreateDocumentVersionRequest): Promise<runtime.RequestOpts>;
|
|
124
124
|
/**
|
|
125
|
-
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
125
|
+
* 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.
|
|
126
126
|
* @summary Create Document Version Handler
|
|
127
127
|
* @param {string} documentId Document ID
|
|
128
128
|
* @param {*} [options] Override http request option.
|
|
@@ -131,7 +131,7 @@ export interface DocumentVersionsApiInterface {
|
|
|
131
131
|
*/
|
|
132
132
|
createDocumentVersionRaw(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
|
|
133
133
|
/**
|
|
134
|
-
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
134
|
+
* 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.
|
|
135
135
|
* Create Document Version Handler
|
|
136
136
|
*/
|
|
137
137
|
createDocumentVersion(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
|
|
@@ -143,7 +143,7 @@ export interface DocumentVersionsApiInterface {
|
|
|
143
143
|
*/
|
|
144
144
|
deleteDocumentVersionRequestOpts(requestParameters: DeleteDocumentVersionRequest): Promise<runtime.RequestOpts>;
|
|
145
145
|
/**
|
|
146
|
-
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
146
|
+
* 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.
|
|
147
147
|
* @summary Delete Document Version Handler
|
|
148
148
|
* @param {string} versionId DocumentVersion ID
|
|
149
149
|
* @param {*} [options] Override http request option.
|
|
@@ -152,7 +152,7 @@ export interface DocumentVersionsApiInterface {
|
|
|
152
152
|
*/
|
|
153
153
|
deleteDocumentVersionRaw(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
154
154
|
/**
|
|
155
|
-
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
155
|
+
* 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.
|
|
156
156
|
* Delete Document Version Handler
|
|
157
157
|
*/
|
|
158
158
|
deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
@@ -376,12 +376,12 @@ export declare class DocumentVersionsApi extends runtime.BaseAPI implements Docu
|
|
|
376
376
|
*/
|
|
377
377
|
createDocumentVersionRequestOpts(requestParameters: CreateDocumentVersionRequest): Promise<runtime.RequestOpts>;
|
|
378
378
|
/**
|
|
379
|
-
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
379
|
+
* 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.
|
|
380
380
|
* Create Document Version Handler
|
|
381
381
|
*/
|
|
382
382
|
createDocumentVersionRaw(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
|
|
383
383
|
/**
|
|
384
|
-
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
384
|
+
* 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.
|
|
385
385
|
* Create Document Version Handler
|
|
386
386
|
*/
|
|
387
387
|
createDocumentVersion(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
|
|
@@ -390,12 +390,12 @@ export declare class DocumentVersionsApi extends runtime.BaseAPI implements Docu
|
|
|
390
390
|
*/
|
|
391
391
|
deleteDocumentVersionRequestOpts(requestParameters: DeleteDocumentVersionRequest): Promise<runtime.RequestOpts>;
|
|
392
392
|
/**
|
|
393
|
-
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
393
|
+
* 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.
|
|
394
394
|
* Delete Document Version Handler
|
|
395
395
|
*/
|
|
396
396
|
deleteDocumentVersionRaw(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
397
397
|
/**
|
|
398
|
-
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
398
|
+
* 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.
|
|
399
399
|
* Delete Document Version Handler
|
|
400
400
|
*/
|
|
401
401
|
deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
@@ -171,7 +171,7 @@ export class DocumentVersionsApi extends runtime.BaseAPI {
|
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
|
-
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
174
|
+
* 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.
|
|
175
175
|
* Create Document Version Handler
|
|
176
176
|
*/
|
|
177
177
|
createDocumentVersionRaw(requestParameters, initOverrides) {
|
|
@@ -182,7 +182,7 @@ export class DocumentVersionsApi extends runtime.BaseAPI {
|
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
|
-
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
185
|
+
* 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.
|
|
186
186
|
* Create Document Version Handler
|
|
187
187
|
*/
|
|
188
188
|
createDocumentVersion(requestParameters, initOverrides) {
|
|
@@ -219,7 +219,7 @@ export class DocumentVersionsApi extends runtime.BaseAPI {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
|
-
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
222
|
+
* 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.
|
|
223
223
|
* Delete Document Version Handler
|
|
224
224
|
*/
|
|
225
225
|
deleteDocumentVersionRaw(requestParameters, initOverrides) {
|
|
@@ -230,7 +230,7 @@ export class DocumentVersionsApi extends runtime.BaseAPI {
|
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
233
|
-
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
233
|
+
* 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.
|
|
234
234
|
* Delete Document Version Handler
|
|
235
235
|
*/
|
|
236
236
|
deleteDocumentVersion(requestParameters, initOverrides) {
|
|
@@ -323,7 +323,7 @@ export interface DocumentsApiInterface {
|
|
|
323
323
|
*/
|
|
324
324
|
ingestDocumentVersionRequestOpts(requestParameters: IngestDocumentVersionRequest): Promise<runtime.RequestOpts>;
|
|
325
325
|
/**
|
|
326
|
-
* 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.
|
|
326
|
+
* 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.
|
|
327
327
|
* @summary Ingest Document Version Handler
|
|
328
328
|
* @param {string} documentId Document ID
|
|
329
329
|
* @param {Blob} file
|
|
@@ -339,7 +339,7 @@ export interface DocumentsApiInterface {
|
|
|
339
339
|
*/
|
|
340
340
|
ingestDocumentVersionRaw(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
|
|
341
341
|
/**
|
|
342
|
-
* 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.
|
|
342
|
+
* 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.
|
|
343
343
|
* Ingest Document Version Handler
|
|
344
344
|
*/
|
|
345
345
|
ingestDocumentVersion(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
|
|
@@ -595,12 +595,12 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
|
|
|
595
595
|
*/
|
|
596
596
|
ingestDocumentVersionRequestOpts(requestParameters: IngestDocumentVersionRequest): Promise<runtime.RequestOpts>;
|
|
597
597
|
/**
|
|
598
|
-
* 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.
|
|
598
|
+
* 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.
|
|
599
599
|
* Ingest Document Version Handler
|
|
600
600
|
*/
|
|
601
601
|
ingestDocumentVersionRaw(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
|
|
602
602
|
/**
|
|
603
|
-
* 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.
|
|
603
|
+
* 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.
|
|
604
604
|
* Ingest Document Version Handler
|
|
605
605
|
*/
|
|
606
606
|
ingestDocumentVersion(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
|
|
@@ -586,7 +586,7 @@ export class DocumentsApi extends runtime.BaseAPI {
|
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
588
|
/**
|
|
589
|
-
* 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.
|
|
589
|
+
* 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.
|
|
590
590
|
* Ingest Document Version Handler
|
|
591
591
|
*/
|
|
592
592
|
ingestDocumentVersionRaw(requestParameters, initOverrides) {
|
|
@@ -597,7 +597,7 @@ export class DocumentsApi extends runtime.BaseAPI {
|
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
599
|
/**
|
|
600
|
-
* 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.
|
|
600
|
+
* 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.
|
|
601
601
|
* Ingest Document Version Handler
|
|
602
602
|
*/
|
|
603
603
|
ingestDocumentVersion(requestParameters, initOverrides) {
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ChangeSubscriptionRequest,
|
|
13
|
+
import type { ChangeSubscriptionRequest, CheckoutResponse, TenantSubscriptionResponse } from '../models/index';
|
|
14
14
|
export interface ChangeTenantSubscriptionRequest {
|
|
15
15
|
tenantId: string;
|
|
16
16
|
changeSubscriptionRequest: ChangeSubscriptionRequest;
|
|
17
|
-
idempotencyKey?: string | null;
|
|
18
17
|
}
|
|
19
18
|
export interface GetTenantSubscriptionRequest {
|
|
20
19
|
tenantId: string;
|
|
@@ -30,27 +29,25 @@ export interface SubscriptionsApiInterface {
|
|
|
30
29
|
* Creates request options for changeTenantSubscription without sending the request
|
|
31
30
|
* @param {string} tenantId
|
|
32
31
|
* @param {ChangeSubscriptionRequest} changeSubscriptionRequest
|
|
33
|
-
* @param {string} [idempotencyKey]
|
|
34
32
|
* @throws {RequiredError}
|
|
35
33
|
* @memberof SubscriptionsApiInterface
|
|
36
34
|
*/
|
|
37
35
|
changeTenantSubscriptionRequestOpts(requestParameters: ChangeTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
|
|
38
36
|
/**
|
|
39
|
-
*
|
|
37
|
+
* Start a subscription change (OWNER only). Priced plan → validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it — nothing is written until the provider\'s webhook confirms payment. Free plan → applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional — local-first).
|
|
40
38
|
* @summary Change Tenant Subscription Handler
|
|
41
39
|
* @param {string} tenantId
|
|
42
40
|
* @param {ChangeSubscriptionRequest} changeSubscriptionRequest
|
|
43
|
-
* @param {string} [idempotencyKey]
|
|
44
41
|
* @param {*} [options] Override http request option.
|
|
45
42
|
* @throws {RequiredError}
|
|
46
43
|
* @memberof SubscriptionsApiInterface
|
|
47
44
|
*/
|
|
48
|
-
changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
45
|
+
changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckoutResponse>>;
|
|
49
46
|
/**
|
|
50
|
-
*
|
|
47
|
+
* Start a subscription change (OWNER only). Priced plan → validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it — nothing is written until the provider\'s webhook confirms payment. Free plan → applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional — local-first).
|
|
51
48
|
* Change Tenant Subscription Handler
|
|
52
49
|
*/
|
|
53
|
-
changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
50
|
+
changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckoutResponse>;
|
|
54
51
|
/**
|
|
55
52
|
* Creates request options for getTenantSubscription without sending the request
|
|
56
53
|
* @param {string} tenantId
|
|
@@ -59,19 +56,19 @@ export interface SubscriptionsApiInterface {
|
|
|
59
56
|
*/
|
|
60
57
|
getTenantSubscriptionRequestOpts(requestParameters: GetTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
|
|
61
58
|
/**
|
|
62
|
-
* Read the tenant\'s current subscription plan
|
|
59
|
+
* Read the tenant\'s current subscription: plan body + period state. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
63
60
|
* @summary Get Tenant Subscription Handler
|
|
64
61
|
* @param {string} tenantId
|
|
65
62
|
* @param {*} [options] Override http request option.
|
|
66
63
|
* @throws {RequiredError}
|
|
67
64
|
* @memberof SubscriptionsApiInterface
|
|
68
65
|
*/
|
|
69
|
-
getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
66
|
+
getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantSubscriptionResponse>>;
|
|
70
67
|
/**
|
|
71
|
-
* Read the tenant\'s current subscription plan
|
|
68
|
+
* Read the tenant\'s current subscription: plan body + period state. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
72
69
|
* Get Tenant Subscription Handler
|
|
73
70
|
*/
|
|
74
|
-
getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
71
|
+
getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantSubscriptionResponse>;
|
|
75
72
|
}
|
|
76
73
|
/**
|
|
77
74
|
*
|
|
@@ -82,27 +79,27 @@ export declare class SubscriptionsApi extends runtime.BaseAPI implements Subscri
|
|
|
82
79
|
*/
|
|
83
80
|
changeTenantSubscriptionRequestOpts(requestParameters: ChangeTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
|
|
84
81
|
/**
|
|
85
|
-
*
|
|
82
|
+
* Start a subscription change (OWNER only). Priced plan → validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it — nothing is written until the provider\'s webhook confirms payment. Free plan → applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional — local-first).
|
|
86
83
|
* Change Tenant Subscription Handler
|
|
87
84
|
*/
|
|
88
|
-
changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
85
|
+
changeTenantSubscriptionRaw(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckoutResponse>>;
|
|
89
86
|
/**
|
|
90
|
-
*
|
|
87
|
+
* Start a subscription change (OWNER only). Priced plan → validates the request, creates a provider checkout (Stripe Checkout redirect / Ping++ charge credential), and returns it — nothing is written until the provider\'s webhook confirms payment. Free plan → applied immediately for unbilled tenants, or scheduled for period end when a billed subscription is active (Stripe: ``cancel_at_period_end``; Ping++ prepay simply isn\'t renewed). Re-picking the current plan/seats while a Stripe cancellation is scheduled resumes the renewal. Deployments with no payment provider configured return 501 for priced checkouts (billing is optional — local-first).
|
|
91
88
|
* Change Tenant Subscription Handler
|
|
92
89
|
*/
|
|
93
|
-
changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
90
|
+
changeTenantSubscription(requestParameters: ChangeTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckoutResponse>;
|
|
94
91
|
/**
|
|
95
92
|
* Creates request options for getTenantSubscription without sending the request
|
|
96
93
|
*/
|
|
97
94
|
getTenantSubscriptionRequestOpts(requestParameters: GetTenantSubscriptionRequest): Promise<runtime.RequestOpts>;
|
|
98
95
|
/**
|
|
99
|
-
* Read the tenant\'s current subscription plan
|
|
96
|
+
* Read the tenant\'s current subscription: plan body + period state. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
100
97
|
* Get Tenant Subscription Handler
|
|
101
98
|
*/
|
|
102
|
-
getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
99
|
+
getTenantSubscriptionRaw(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TenantSubscriptionResponse>>;
|
|
103
100
|
/**
|
|
104
|
-
* Read the tenant\'s current subscription plan
|
|
101
|
+
* Read the tenant\'s current subscription: plan body + period state. Any active member of the tenant can read. This is the only path that surfaces private (custom enterprise) plans to non-admin users — ``GET /public/subscriptions`` filters them out, but tenants on a private plan still need to see their own caps. The period fields let the FE render renewal/expiry state (billed subscriptions carry the paid-through date; unbilled ones a 100-year horizon), and ``will_renew`` distinguishes an auto-renewing Stripe subscription from one whose cancellation is scheduled (or a prepay/unbilled period that simply runs out). Returns 404 when the user is not a member of the tenant — same response shape as a non-existent tenant so we don\'t leak existence to outsiders.
|
|
105
102
|
* Get Tenant Subscription Handler
|
|
106
103
|
*/
|
|
107
|
-
getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
104
|
+
getTenantSubscription(requestParameters: GetTenantSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantSubscriptionResponse>;
|
|
108
105
|
}
|
|
@@ -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 { ChangeSubscriptionRequestToJSON,
|
|
24
|
+
import { ChangeSubscriptionRequestToJSON, CheckoutResponseFromJSON, TenantSubscriptionResponseFromJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
@@ -40,9 +40,6 @@ export class SubscriptionsApi extends runtime.BaseAPI {
|
|
|
40
40
|
const queryParameters = {};
|
|
41
41
|
const headerParameters = {};
|
|
42
42
|
headerParameters['Content-Type'] = 'application/json';
|
|
43
|
-
if (requestParameters['idempotencyKey'] != null) {
|
|
44
|
-
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
45
|
-
}
|
|
46
43
|
if (this.configuration && this.configuration.accessToken) {
|
|
47
44
|
const token = this.configuration.accessToken;
|
|
48
45
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -62,18 +59,18 @@ export class SubscriptionsApi extends runtime.BaseAPI {
|
|
|
62
59
|
});
|
|
63
60
|
}
|
|
64
61
|
/**
|
|
65
|
-
*
|
|
62
|
+
* 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).
|
|
66
63
|
* Change Tenant Subscription Handler
|
|
67
64
|
*/
|
|
68
65
|
changeTenantSubscriptionRaw(requestParameters, initOverrides) {
|
|
69
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
67
|
const requestOptions = yield this.changeTenantSubscriptionRequestOpts(requestParameters);
|
|
71
68
|
const response = yield this.request(requestOptions, initOverrides);
|
|
72
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
69
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CheckoutResponseFromJSON(jsonValue));
|
|
73
70
|
});
|
|
74
71
|
}
|
|
75
72
|
/**
|
|
76
|
-
*
|
|
73
|
+
* 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).
|
|
77
74
|
* Change Tenant Subscription Handler
|
|
78
75
|
*/
|
|
79
76
|
changeTenantSubscription(requestParameters, initOverrides) {
|
|
@@ -110,18 +107,18 @@ export class SubscriptionsApi extends runtime.BaseAPI {
|
|
|
110
107
|
});
|
|
111
108
|
}
|
|
112
109
|
/**
|
|
113
|
-
* Read the tenant\'s current subscription plan
|
|
110
|
+
* 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.
|
|
114
111
|
* Get Tenant Subscription Handler
|
|
115
112
|
*/
|
|
116
113
|
getTenantSubscriptionRaw(requestParameters, initOverrides) {
|
|
117
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
115
|
const requestOptions = yield this.getTenantSubscriptionRequestOpts(requestParameters);
|
|
119
116
|
const response = yield this.request(requestOptions, initOverrides);
|
|
120
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
117
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TenantSubscriptionResponseFromJSON(jsonValue));
|
|
121
118
|
});
|
|
122
119
|
}
|
|
123
120
|
/**
|
|
124
|
-
* Read the tenant\'s current subscription plan
|
|
121
|
+
* 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.
|
|
125
122
|
* Get Tenant Subscription Handler
|
|
126
123
|
*/
|
|
127
124
|
getTenantSubscription(requestParameters, initOverrides) {
|
|
@@ -125,7 +125,7 @@ export interface TenantsApiInterface {
|
|
|
125
125
|
*/
|
|
126
126
|
deleteTenantRequestOpts(requestParameters: DeleteTenantRequest): Promise<runtime.RequestOpts>;
|
|
127
127
|
/**
|
|
128
|
-
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
128
|
+
* Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
129
129
|
* @summary Delete Tenant
|
|
130
130
|
* @param {string} tenantId
|
|
131
131
|
* @param {*} [options] Override http request option.
|
|
@@ -134,7 +134,7 @@ export interface TenantsApiInterface {
|
|
|
134
134
|
*/
|
|
135
135
|
deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
136
136
|
/**
|
|
137
|
-
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
137
|
+
* Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
138
138
|
* Delete Tenant
|
|
139
139
|
*/
|
|
140
140
|
deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
@@ -395,12 +395,12 @@ export declare class TenantsApi extends runtime.BaseAPI implements TenantsApiInt
|
|
|
395
395
|
*/
|
|
396
396
|
deleteTenantRequestOpts(requestParameters: DeleteTenantRequest): Promise<runtime.RequestOpts>;
|
|
397
397
|
/**
|
|
398
|
-
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
398
|
+
* Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
399
399
|
* Delete Tenant
|
|
400
400
|
*/
|
|
401
401
|
deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
402
402
|
/**
|
|
403
|
-
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
403
|
+
* Delete a tenant. Requires OWNER role in the tenant. Refused (409) while a provider-billed subscription is live — deleting the tenant would not stop Stripe/Ping++ from charging for it; the OWNER must downgrade to free (or let the prepay period expire) first. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
404
404
|
* Delete Tenant
|
|
405
405
|
*/
|
|
406
406
|
deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
@@ -158,7 +158,7 @@ export class TenantsApi extends runtime.BaseAPI {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
-
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
161
|
+
* 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.
|
|
162
162
|
* Delete Tenant
|
|
163
163
|
*/
|
|
164
164
|
deleteTenantRaw(requestParameters, initOverrides) {
|
|
@@ -169,7 +169,7 @@ export class TenantsApi extends runtime.BaseAPI {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
|
-
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s LiteLLM team/keys and S3 bucket after the DB transaction commits.
|
|
172
|
+
* 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.
|
|
173
173
|
* Delete Tenant
|
|
174
174
|
*/
|
|
175
175
|
deleteTenant(requestParameters, initOverrides) {
|
|
@@ -10,13 +10,16 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { BulkOperationResponse, BulkTrashRequest, PaginatedResponseTrashItemResponse, PartType, PathOrder, SortDirection } from '../models/index';
|
|
13
|
+
import type { BulkOperationResponse, BulkTrashRequest, PaginatedResponseTrashItemResponse, PartType, PathOrder, SortDirection, TrashItemDetailResponse } from '../models/index';
|
|
14
14
|
export interface BulkPermanentlyDeleteTrashRequest {
|
|
15
15
|
bulkTrashRequest: BulkTrashRequest;
|
|
16
16
|
}
|
|
17
17
|
export interface BulkRestoreTrashRequest {
|
|
18
18
|
bulkTrashRequest: BulkTrashRequest;
|
|
19
19
|
}
|
|
20
|
+
export interface GetTrashItemRequest {
|
|
21
|
+
pathPartId: string;
|
|
22
|
+
}
|
|
20
23
|
export interface ListTrashRequest {
|
|
21
24
|
sortOrder?: PathOrder;
|
|
22
25
|
sortDir?: SortDirection;
|
|
@@ -85,6 +88,27 @@ export interface TrashApiInterface {
|
|
|
85
88
|
* Bulk Restore Trash Handler
|
|
86
89
|
*/
|
|
87
90
|
bulkRestoreTrash(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Creates request options for getTrashItem without sending the request
|
|
93
|
+
* @param {string} pathPartId Trashed PathPart ID
|
|
94
|
+
* @throws {RequiredError}
|
|
95
|
+
* @memberof TrashApiInterface
|
|
96
|
+
*/
|
|
97
|
+
getTrashItemRequestOpts(requestParameters: GetTrashItemRequest): Promise<runtime.RequestOpts>;
|
|
98
|
+
/**
|
|
99
|
+
* Fetch a single trash root, with a preview URL for DOCUMENT items.
|
|
100
|
+
* @summary Get Trash Item Handler
|
|
101
|
+
* @param {string} pathPartId Trashed PathPart ID
|
|
102
|
+
* @param {*} [options] Override http request option.
|
|
103
|
+
* @throws {RequiredError}
|
|
104
|
+
* @memberof TrashApiInterface
|
|
105
|
+
*/
|
|
106
|
+
getTrashItemRaw(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TrashItemDetailResponse>>;
|
|
107
|
+
/**
|
|
108
|
+
* Fetch a single trash root, with a preview URL for DOCUMENT items.
|
|
109
|
+
* Get Trash Item Handler
|
|
110
|
+
*/
|
|
111
|
+
getTrashItem(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TrashItemDetailResponse>;
|
|
88
112
|
/**
|
|
89
113
|
* Creates request options for listTrash without sending the request
|
|
90
114
|
* @param {PathOrder} [sortOrder] Sort order (default: LOGICAL = deletion recency)
|
|
@@ -201,6 +225,20 @@ export declare class TrashApi extends runtime.BaseAPI implements TrashApiInterfa
|
|
|
201
225
|
* Bulk Restore Trash Handler
|
|
202
226
|
*/
|
|
203
227
|
bulkRestoreTrash(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
|
|
228
|
+
/**
|
|
229
|
+
* Creates request options for getTrashItem without sending the request
|
|
230
|
+
*/
|
|
231
|
+
getTrashItemRequestOpts(requestParameters: GetTrashItemRequest): Promise<runtime.RequestOpts>;
|
|
232
|
+
/**
|
|
233
|
+
* Fetch a single trash root, with a preview URL for DOCUMENT items.
|
|
234
|
+
* Get Trash Item Handler
|
|
235
|
+
*/
|
|
236
|
+
getTrashItemRaw(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TrashItemDetailResponse>>;
|
|
237
|
+
/**
|
|
238
|
+
* Fetch a single trash root, with a preview URL for DOCUMENT items.
|
|
239
|
+
* Get Trash Item Handler
|
|
240
|
+
*/
|
|
241
|
+
getTrashItem(requestParameters: GetTrashItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TrashItemDetailResponse>;
|
|
204
242
|
/**
|
|
205
243
|
* Creates request options for listTrash without sending the request
|
|
206
244
|
*/
|