import type { GraphQLClient } from '../client.js'; import { type AppAccessTiersQuery, type MyAppAccessQuery, type AppUserAccessByAppQuery, type AppUserAccessConnectionQuery, type AppUserAccessConnectionQueryVariables, type RuntimePermissionsQuery, type AppGrantMemberCandidatesQuery, type ClaimFreeAppAccessMutation, type GrantMyAppAccessMutation, type CreateAccessTierMutation, type UpdateAccessTierMutation, type ArchiveAccessTierMutation, type GrantAppAccessMutation, type RevokeAppAccessMutation, type CreateAccessTierInput, type UpdateAccessTierInput, type GrantAppAccessInput } from '../generated/graphql.js'; /** * App access tiers + per-user access grants — exposed as `client.appAccess` * (and grouped under `client.admin`). * * Part of the management surface. Tiers define the runtime-permission bundles * (`access`, `teleport`, `update_voxel_data`, `use_voice_chat`, ...) a player * gets; grants attach a user to a tier. New apps auto-provision an open default * tier, so most players need no explicit grant. * * Reads of the tier catalog ({@link tiers}) are public; {@link myAccess} needs * a session; tier admin and grant/revoke require the `manage_access_tiers` app * permission. `BigInt` ids are decimal strings. * * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING` * per the permission notes above. */ export declare class AppAccessAPI { private readonly api; constructor(api: GraphQLClient); /** * List the access tiers defined for an app. **Public.** * * @param appId - Numeric app id (`BigInt` as a decimal string). * @returns The app's tiers, ordered. */ tiers(appId: string): Promise; /** * Return the authenticated caller's access record for an app (which tier they * hold and its status), or `null` if they have none. * * @param appId - Numeric app id. * @returns The caller's {@link AppUserAccess}, or `null`. */ myAccess(appId: string): Promise; /** * List the users who hold access to an app (paginated). Requires the * `manage_access_tiers` app permission. * * @param appId - Numeric app id. * @param opts - Optional `status` filter and `limit` / `offset` (default * limit 50). * @returns The matching access records. */ usersByApp(appId: string, opts?: { status?: string; limit?: number; offset?: number; }): Promise; /** * Relay-style cursor pagination over an app's access grants — the preferred * alternative to {@link usersByApp}. Page with `first` plus the previous * page's `pageInfo.endCursor` as `after`; optional `status` filter. Requires * the `manage_access_tiers` app permission. See * https://docs.crowdedkingdoms.com/overview/pagination. * * @param args - `appId` plus optional `status`, `first`, and `after`. * @returns An {@link AppUserAccessConnection}. */ usersByAppConnection(args: AppUserAccessConnectionQueryVariables): Promise; /** * List every valid runtime permission key (e.g. `access`, `teleport`, * `update_voxel_data`, `use_voice_chat`) that a tier or grid grant can * reference. **Public.** * * @returns The runtime permission keys. */ runtimePermissions(): Promise; /** * List org members eligible for a manual app-access grant (those without an * active grant yet). Requires the `manage_access_tiers` app permission. Pair * with {@link grant} to grant the chosen candidate. * * @param appId - Numeric app id. * @returns The candidate users (id + email/gamertag where known). */ grantMemberCandidates(appId: string): Promise; /** * Self-service: claim the app's free/default tier for the authenticated * caller (no admin permission required). Use when an app exposes a free tier * a player can opt into themselves. * * @param appId - Numeric app id. * @returns The caller's new {@link AppUserAccess} record. */ claimFree(appId: string): Promise; /** * Self-grant access to an app via its default tier for the authenticated * caller, when the caller is an org member of the app's owning org. * * @param appId - Numeric app id. * @returns The caller's new {@link AppUserAccess} record. */ grantMine(appId: string): Promise; /** * Create a new access tier for an app. Requires the `manage_access_tiers` app * permission. * * @param input - {@link CreateAccessTierInput}: `appId`, `name`, runtime * `permissions`, pricing/free flags. * @returns The created tier. */ createTier(input: CreateAccessTierInput): Promise; /** * Update an existing access tier. Requires the `manage_access_tiers` app * permission. * * @param tierId - Numeric tier id. * @param input - {@link UpdateAccessTierInput} fields to change. * @returns The updated tier. */ updateTier(tierId: string, input: UpdateAccessTierInput): Promise; /** * Archive (soft-delete) an access tier so it can no longer be granted. * Requires the `manage_access_tiers` app permission. * * @param tierId - Numeric tier id. * @returns The archived tier's new status. */ archiveTier(tierId: string): Promise; /** * Grant a user access to an app at a given tier. Requires the * `manage_access_tiers` app permission. Triggers replica-sync so the grant * (and its grid permissions) reaches the game DB / Buddy. * * @param input - {@link GrantAppAccessInput}: `appId`, `userId`, `tierId`. * @returns The created/updated access record. */ grant(input: GrantAppAccessInput): Promise; /** * Revoke a user's access to an app. Requires the `manage_access_tiers` app * permission. * * @param appId - Numeric app id. * @param userId - Numeric id of the user whose access is revoked. * @returns `true` on success. */ revoke(appId: string, userId: string): Promise; } //# sourceMappingURL=appAccess.d.ts.map