/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { authClusterAcceptInvite } from "../funcs/authClusterAcceptInvite.js"; import { authClusterCreateInvite } from "../funcs/authClusterCreateInvite.js"; import { authClusterDeleteOrg } from "../funcs/authClusterDeleteOrg.js"; import { authClusterGetOrg } from "../funcs/authClusterGetOrg.js"; import { authClusterInviteInfo } from "../funcs/authClusterInviteInfo.js"; import { authClusterListInvites } from "../funcs/authClusterListInvites.js"; import { authClusterListOrgs } from "../funcs/authClusterListOrgs.js"; import { authClusterReissueOwnerKey } from "../funcs/authClusterReissueOwnerKey.js"; import { authClusterRevokeInvite } from "../funcs/authClusterRevokeInvite.js"; import { authClusterSuspendOrg } from "../funcs/authClusterSuspendOrg.js"; import { authClusterUnsuspendOrg } from "../funcs/authClusterUnsuspendOrg.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Cluster extends ClientSDK { /** * Create a cluster invitation * * @remarks * Issue a one-shot invite that provisions a new org on acceptance. Email-bound invites can be accepted headless (passwordless + issueApiKey). */ async createInvite( request: operations.CreateClusterInviteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterCreateInvite( this, request, options, )); } /** * List cluster invitations */ async listInvites( request: operations.ListClusterInvitesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterListInvites( this, request, options, )); } /** * Revoke a cluster invitation */ async revokeInvite( request: operations.RevokeClusterInviteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterRevokeInvite( this, request, options, )); } /** * List all organizations */ async listOrgs( request: operations.ListClusterOrgsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterListOrgs( this, request, options, )); } /** * Get an organization */ async getOrg( request: operations.GetClusterOrgRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterGetOrg( this, request, options, )); } /** * Soft-delete an organization */ async deleteOrg( request: operations.DeleteClusterOrgRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterDeleteOrg( this, request, options, )); } /** * Suspend an organization */ async suspendOrg( request: operations.SuspendClusterOrgRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterSuspendOrg( this, request, options, )); } /** * Unsuspend an organization */ async unsuspendOrg( request: operations.UnsuspendClusterOrgRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterUnsuspendOrg( this, request, options, )); } /** * Re-issue an org owner key (recovery) * * @remarks * Mint a fresh owner-bound key for an org whose credential was lost. Cluster-admin only (`write:cluster`). Defaults to the org's oldest human owner and oldest team; `userId` / `teamId` override. */ async reissueOwnerKey( request: operations.ReissueOwnerKeyRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterReissueOwnerKey( this, request, options, )); } /** * Read cluster-invite info (public) */ async inviteInfo( request: operations.GetClusterInviteInfoRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterInviteInfo( this, request, options, )); } /** * Accept a cluster invitation (public) * * @remarks * Accept an invite and create the org. Existing signed-in user, new email/password owner, or (email-bound) headless machine owner with `passwordless: true, issueApiKey: true`. A reserved slug (`api`, whether supplied as `orgSlug` or derived from `orgName`) is refused with 400 `reserved_org_slug`; a slug another org already holds is refused with 409. Note `POST /organization/check-slug` does not know about reserved slugs and will report `api` as available. */ async acceptInvite( request: operations.AcceptClusterInviteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(authClusterAcceptInvite( this, request, options, )); } }