import { Result } from "@adviser/cement"; import { z } from "zod"; import type { ClerkClaim } from "../clerk-claim.js"; interface JWKCommonFields { use?: "sig" | "enc"; key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[]; alg?: string; kid?: string; x5u?: string; x5c?: string[]; x5t?: string; "x5t#S256"?: string; } export type JWKPublic = JWKCommonFields & ({ kty: "RSA"; n: string; e: string; } | { kty: "EC"; crv: "P-256" | "P-384" | "P-521" | "secp256k1"; x: string; y: string; } | { kty: "oct"; k: string; } | { kty: "OKP"; crv: "Ed25519" | "Ed448" | "X25519" | "X448"; x: string; }); export type JWKPrivate = JWKCommonFields & ({ kty: "RSA"; n: string; e: string; d: string; p: string; q: string; dp: string; dq: string; qi: string; } | { kty: "EC"; crv: "P-256" | "P-384" | "P-521" | "secp256k1"; x: string; y: string; d: string; } | { kty: "oct"; k: string; } | { kty: "OKP"; crv: "Ed25519" | "Ed448" | "X25519" | "X448"; x: string; d: string; }); export declare const JWKPrivateSchema: z.ZodIntersection; use: z.ZodOptional>; key_ops: z.ZodOptional>>; alg: z.ZodOptional; kid: z.ZodOptional; x5u: z.ZodOptional; x5c: z.ZodOptional>; x5t: z.ZodOptional; "x5t#S256": z.ZodOptional; }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{ kty: z.ZodLiteral<"RSA">; n: z.ZodString; e: z.ZodString; d: z.ZodString; p: z.ZodString; q: z.ZodString; dp: z.ZodString; dq: z.ZodString; qi: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kty: z.ZodLiteral<"EC">; crv: z.ZodEnum<{ "P-256": "P-256"; "P-384": "P-384"; "P-521": "P-521"; secp256k1: "secp256k1"; }>; x: z.ZodString; y: z.ZodString; d: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kty: z.ZodLiteral<"oct">; k: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kty: z.ZodLiteral<"OKP">; crv: z.ZodEnum<{ Ed25519: "Ed25519"; Ed448: "Ed448"; X25519: "X25519"; X448: "X448"; }>; x: z.ZodString; d: z.ZodString; }, z.core.$strip>], "kty">>; export declare const JWKPublicSchema: z.ZodIntersection; use: z.ZodOptional>; key_ops: z.ZodOptional>>; alg: z.ZodOptional; kid: z.ZodOptional; x5u: z.ZodOptional; x5c: z.ZodOptional>; x5t: z.ZodOptional; "x5t#S256": z.ZodOptional; }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{ kty: z.ZodLiteral<"RSA">; n: z.ZodString; e: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kty: z.ZodLiteral<"EC">; crv: z.ZodEnum<{ "P-256": "P-256"; "P-384": "P-384"; "P-521": "P-521"; secp256k1: "secp256k1"; }>; x: z.ZodString; y: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kty: z.ZodLiteral<"oct">; k: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kty: z.ZodLiteral<"OKP">; crv: z.ZodEnum<{ Ed25519: "Ed25519"; Ed448: "Ed448"; X25519: "X25519"; X448: "X448"; }>; x: z.ZodString; }, z.core.$strip>], "kty">>; export declare function toJwksAlg(jwk: { kty?: string; crv?: string; alg?: string; }): Result; export interface DashAuthType { readonly type: "ucan" | "clerk" | "device-id"; readonly token: string; } export interface WithAuth { readonly auth: DashAuthType; } export interface ReqCertFromCsr { readonly type: "reqCertFromCsr"; readonly auth: DashAuthType; readonly csr: string; } export interface ResCertFromCsr { readonly type: "resCertFromCsr"; readonly certificate: string; } export interface VerifiedClaimsResult { readonly type: DashAuthType["type"]; readonly token: string; readonly claims: unknown; } export interface ClerkVerifiedAuth { readonly type: "clerk"; readonly claims: ClerkClaim; } export interface VerifiedAuthResult { readonly type: "VerifiedAuthResult"; readonly inDashAuth: DashAuthType; readonly verifiedAuth: ClerkVerifiedAuth; } export interface FPApiToken { verify(token: string): Promise>; decode(token: string): Promise>; } export interface FPApiParameters { cloudPublicKeys: JWKPublic[]; clerkPublishableKey: string; maxTenants: number; maxAdminUsers: number; maxMemberUsers: number; maxInvites: number; maxLedgers: number; maxAppIdBindings: number; } export {};