import * as yup from "yup"; import { TeamApiKeysCrud, UserApiKeysCrud, teamApiKeysCreateInputSchema, userApiKeysCreateInputSchema } from "@stackframe/stack-shared/dist/interface/crud/project-api-keys"; import { IfAndOnlyIf, PrettifyType } from "@stackframe/stack-shared/dist/utils/types"; //#region src/lib/stack-app/api-keys/index.d.ts type ApiKeyType = "user" | "team"; type ApiKey = { id: string; description: string; expiresAt?: Date; manuallyRevokedAt?: Date | null; createdAt: Date; value: IfAndOnlyIf; update(options: ApiKeyUpdateOptions): Promise; revoke: () => Promise; isValid: () => boolean; whyInvalid: () => "manually-revoked" | "expired" | null; } & (("user" extends Type ? { type: "user"; userId: string; } : never) | ("team" extends Type ? { type: "team"; teamId: string; } : never)); type UserApiKeyFirstView = PrettifyType>; type UserApiKey = PrettifyType>; type TeamApiKeyFirstView = PrettifyType>; type TeamApiKey = PrettifyType>; type ApiKeyCreationOptions = { description: string; expiresAt: Date | null; /** * Whether the API key should be considered public. A public API key will not be detected by the secret scanner, which * automatically revokes API keys when it detects that they may have been exposed to the public. */ isPublic?: boolean; }; declare function apiKeyCreationOptionsToCrud(type: "user", userId: string, options: ApiKeyCreationOptions<"user">): Promise>; declare function apiKeyCreationOptionsToCrud(type: "team", teamId: string, options: ApiKeyCreationOptions<"team">): Promise>; declare function apiKeyCreationOptionsToCrud(type: ApiKeyType, userIdOrTeamId: string, options: ApiKeyCreationOptions): Promise | yup.InferType>; type ApiKeyUpdateOptions = { description?: string; expiresAt?: Date | null; revoked?: boolean; }; declare function apiKeyUpdateOptionsToCrud(type: "user", options: ApiKeyUpdateOptions<"user">): Promise; declare function apiKeyUpdateOptionsToCrud(type: "team", options: ApiKeyUpdateOptions<"team">): Promise; declare function apiKeyUpdateOptionsToCrud(type: ApiKeyType, options: ApiKeyUpdateOptions): Promise; //#endregion export { ApiKey, ApiKeyCreationOptions, ApiKeyType, ApiKeyUpdateOptions, TeamApiKey, TeamApiKeyFirstView, UserApiKey, UserApiKeyFirstView, apiKeyCreationOptionsToCrud, apiKeyUpdateOptionsToCrud }; //# sourceMappingURL=index.d.ts.map