import type { GraphQLClient } from '../client.js'; import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, type UserQuery, type UsersPaginatedQuery, type UsersPaginatedQueryVariables, type UsersConnectionQuery, type UsersConnectionQueryVariables, type SetSuperAdminMutation, type SetOperatorMutation, type SetEarlyAccessOverrideMutation, type UpdateUserTypeMutation, type ForceLogoutUserMutation, type UpdateUserStateMutation, type UpdateUserStateInput, type FreePlayWindowQuery } from '../generated/graphql.js'; /** * User identity & account management — exposed as `client.users`. * * Part of the management surface. After * the database split the users table is management-owned, so game-api no longer * exposes these identity mutations — calling them against a game-api endpoint * throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the * management API. Only the read/identity surface a game client realistically * needs lives here; super-admin / operator screens use the management UI * directly rather than the SDK. * * Every method needs a valid session (a bearer token set by * `client.auth.login()` / `register()` or `client.setToken()`); without one the * server returns `UNAUTHENTICATED` — except {@link me}, which resolves to * `null`. `BigInt` ids such as `userId` and `orgId` are decimal strings. */ export declare class UsersAPI { private readonly graphql; constructor(graphql: GraphQLClient); /** * Validate the current bearer token and return the authenticated user record. * Handy for restoring a session on SDK init. * * @returns The {@link User}, or `null` if the token is missing, expired, or * revoked (an invalid token resolves to `null` rather than throwing). * @throws {CrowdyGraphQLError} on transport/validation failures. */ me(): Promise; /** * Set the authenticated user's gamertag and disambiguation (and append a * gamertag-history row). Only ever updates the caller. Requires a valid * session. * * @param input - {@link UpdateGamertagInput}: the new `gamertag` (max 64 * characters) and `disambiguation` (max 128 characters); the pair must be * unique across the platform. * @returns The updated {@link User} (its `userId`, `gamertag`, * `disambiguation`, and `userType`). * @throws {CrowdyGraphQLError} `BAD_USER_INPUT` if the gamertag + * disambiguation pair is already taken, `UNAUTHENTICATED` without a session, * or `FORBIDDEN` when called against game-api (call the management API). */ updateGamertag(input: UpdateGamertagInput): Promise; /** * **Destructive, self-service** soft-delete of the caller's **own** account: * anonymizes PII and revokes all sessions. Wallet, voxel, and donation history * stay intact via foreign keys. Acts only on the caller (no target argument). * Requires a valid session. * * @returns `true` on success. * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session, or * `FORBIDDEN` when called against game-api (call the management API). */ deleteMyAccount(): Promise; /** * Report whether a free-play window is currently active and when the next one * starts. **Public** — no session required. * * @returns The {@link FreePlayWindowInfo}. */ freePlayWindow(): Promise; /** * Look up any user by id. **Super-admin only** (regular callers can only read * their own profile via {@link me}). * * @param id - Numeric user id (`BigInt` as a decimal string). * @returns The {@link User}, or `null` if no such user. */ get(id: string): Promise; /** * Search/list users with offset pagination. **Super-admin only.** * * @param opts - Optional `query` (prefix match over email/gamertag/id) and * `limit` / `offset`. * @returns A page of users. * @remarks Prefer {@link listConnection} (Relay cursor pagination) for large * result sets; the offset args here are deprecated server-side. */ paginated(opts?: { query?: UsersPaginatedQueryVariables['query']; limit?: UsersPaginatedQueryVariables['limit']; offset?: UsersPaginatedQueryVariables['offset']; }): Promise; /** * Relay-style cursor pagination over users — the preferred alternative to * {@link paginated}. **Super-admin only.** Page with `first` plus the previous * page's `pageInfo.endCursor` as `after`. See * https://docs.crowdedkingdoms.com/overview/pagination. * * @param args - Optional `first`, `after`, and `query`. * @returns A {@link UsersConnection}. */ listConnection(args?: UsersConnectionQueryVariables): Promise; /** * Grant or revoke the platform `is_super_admin` flag on a user. **Super-admin * only.** * * @param userId - Target user id. * @param value - `true` to grant, `false` to revoke. * @returns The updated user's `userId` + `isSuperAdmin`. */ setSuperAdmin(userId: string, value: boolean): Promise; /** * Grant or revoke the platform `is_operator` flag (control-plane access) on a * user. **Super-admin only.** * * @param userId - Target user id. * @param value - `true` to grant, `false` to revoke. * @returns The updated user's `userId` + `isOperator`. */ setOperator(userId: string, value: boolean): Promise; /** * Force an early-access override on a user (bypasses the early-access gate). * **Super-admin only.** * * @param userId - Target user id. * @param value - `true` to grant the override, `false` to clear it. * @returns The updated user's `userId` + `grantEarlyAccessOverride`. */ setEarlyAccessOverride(userId: string, value: boolean): Promise; /** * Set a user's `user_type`. **Super-admin only.** * * @param userId - Target user id. * @param value - The new user type string. * @returns The updated user's `userId` + `userType`. */ updateType(userId: string, value: string): Promise; /** * Revoke all of a user's sessions (force logout everywhere). **Super-admin * only.** * * @param userId - Target user id. * @returns `true` on success. */ forceLogout(userId: string): Promise; /** * Replace a user's top-level state blob. **Super-admin only.** * * @param input - {@link UpdateUserStateInput} (`userId` + base64 `state`). * @returns The updated user's `userId` + `state`. */ updateState(input: UpdateUserStateInput): Promise; } //# sourceMappingURL=users.d.ts.map