Namespaces
subscription
Methods and types of the `subscription` namespace (`client.subscription` / `bot.subscription`).
Interfaces
CreateWorkspaceOrderParams
Properties
GetSubscriptionOrdersParams
Properties
GetSubscriptionsParams
Extends
Properties
| Property | Type | Inherited from |
|---|---|---|
limit? | number | - |
page? | number | - |
sort? | Record<string, -1 | 1> | SortParams.sort |
status? | SubscriptionStatus | - |
ResourceLimits
Properties
RoleSeatUsage
Properties
| Property | Type | Description |
|---|---|---|
limit | number | null | Plan cap for this seat type, or null when the plan is unlimited for it. |
used | number | Distinct users occupying this seat type across the workspace + projects. |
RoleUsage
Properties
| Property | Type |
|---|---|
creators | RoleSeatUsage |
reviewers | RoleSeatUsage |
SeatUsage
Properties
SortParams
Extended by
Properties
StorageUsage
Properties
Type Aliases
PlanChangeWarning
type PlanChangeWarning =
| {
capability: string;
type: "capabilityRemoved";
}
| {
currency: string;
currentSeats: number;
period: "month" | "year";
total: number | null;
type: "seatMigration";
unitPrice: number | null;
};Soft warnings returned by a plan swap / dry-run. STRUCTURED (not localized strings) so your app can render localized copy from these values.
SubscriptionStatus
type SubscriptionStatus =
| "active"
| "pending"
| "canceled"
| "expired"
| "pastDue"
| "paused"
| "paymentFailed"
| "unpaid";Functions
default()
function default(client): {
cancelWorkspaceSubscription: Promise<any>;
createWorkspaceOrder: Promise<any>;
getResourceLimits: Promise<ResourceLimits>;
getRoleUsage: Promise<RoleUsage>;
getSeatUsage: Promise<SeatUsage>;
getStorageUsage: Promise<StorageUsage>;
getUserSubscriptions: Promise<Subscription[]>;
getWorkspaceOrders: Promise<any[]>;
getWorkspaceSubscription: Promise<Subscription>;
getWorkspaceUsageSummary: Promise<{
billableSeatCount: number;
storageUsedInBytes: number;
}>;
resumeWorkspaceSubscription: Promise<any>;
swapWorkspacePlan: Promise<{
subscription: Subscription | null;
warnings: PlanChangeWarning[];
}>;
};Defines subscription-related methods for the NuramaClient.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | default | The NuramaClient instance. |
Returns
An object containing the subscription-related methods.
| Name | Type | Description |
|---|---|---|
cancelWorkspaceSubscription() | (workspaceId) => Promise<any> | Cancels the subscription for a specific workspace. Requires authentication and permission. |
createWorkspaceOrder() | (workspaceId, orderData) => Promise<any> | Creates a subscription order for a specific workspace. Requires authentication and permission. |
getResourceLimits() | (resourceId) => Promise<ResourceLimits> | Retrieves the resource limits (e.g., storage, seats) for a specific resource (typically workspace). Requires authentication. |
getRoleUsage() | (resourceId) => Promise<RoleUsage> | Retrieves per-role (creator / reviewer) seat usage and caps for a workspace. limit is null when the plan is unlimited for that seat type. Requires authentication. |
getSeatUsage() | (resourceId) => Promise<SeatUsage> | Retrieves the seat usage for a specific resource (typically workspace). Requires authentication. |
getStorageUsage() | (resourceId) => Promise<StorageUsage> | Retrieves the storage usage for a specific resource (typically workspace). Requires authentication. |
getUserSubscriptions() | (params?) => Promise<Subscription[]> | Retrieves all subscriptions owned by the currently authenticated user. Requires authentication. |
getWorkspaceOrders() | (workspaceId, params?) => Promise<any[]> | Retrieves subscription orders for a specific workspace. Requires authentication and permission. |
getWorkspaceSubscription() | (workspaceId) => Promise<Subscription> | Retrieves the active subscription for a specific workspace. Requires authentication and permission. |
getWorkspaceUsageSummary() | (workspaceId) => Promise<{ billableSeatCount: number; storageUsedInBytes: number; }> | Retrieves the workspace usage summary (billable seats and storage used). Requires authentication and subscription management permission. |
resumeWorkspaceSubscription() | (workspaceId) => Promise<any> | Reverse a scheduled (period-end) cancellation, keeping the workspace's subscription on its normal renewal cycle. Only valid while the subscription is still active with a pending cancellation; a fully lapsed subscription can't be resumed (the owner must re-subscribe). Requires authentication and permission. |
swapWorkspacePlan() | (workspaceId, params) => Promise<{ subscription: Subscription | null; warnings: PlanChangeWarning[]; }> | Swap the workspace's active basePlan line for a different basePlan product. Same code path both upgrades and downgrades; the API's pre-flight capacity check is what distinguishes a permitted change from a refused one. Pass dryRun: true to get the pre-flight verdict without mutating. On over-allocation the API returns 400 planCapacityInsufficient with errorData.violations: [{ resource, current, newLimit }], surfaced via the SDK's normal error path. On success, returns the updated subscription plus a warnings[] array of feature-gate capabilities the destination plan does NOT include (suitable for showing as a confirmation notice). |