UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

62 lines 2.03 kB
import * as z from "zod/v3"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Identity } from "./identity.js"; import { KeyCreditsData } from "./keycreditsdata.js"; import { RatelimitResponse } from "./ratelimitresponse.js"; export type KeyResponseData = { /** * Unique identifier for this key. */ keyId: string; /** * First few characters of the key for identification. */ start: string; /** * Whether the key is enabled or disabled. */ enabled: boolean; /** * Human-readable name for this key. */ name?: string | undefined; /** * Custom metadata associated with this key. */ meta?: { [k: string]: any; } | undefined; /** * Unix timestamp in milliseconds when key was created. */ createdAt: number; /** * Unix timestamp in milliseconds when key was last updated. */ updatedAt?: number | undefined; /** * Unix timestamp in milliseconds when key was last used for verification. This is an approximated value, accurate to within 5 minutes. */ lastUsedAt?: number | undefined; /** * Unix timestamp in milliseconds when key expires (if set). */ expires?: number | undefined; permissions?: Array<string> | undefined; roles?: Array<string> | undefined; /** * Credit configuration and remaining balance for this key. */ credits?: KeyCreditsData | undefined; identity?: Identity | undefined; /** * Decrypted key value (only when decrypt=true). */ plaintext?: string | undefined; ratelimits?: Array<RatelimitResponse> | undefined; }; /** @internal */ export declare const KeyResponseData$inboundSchema: z.ZodType<KeyResponseData, z.ZodTypeDef, unknown>; export declare function keyResponseDataFromJSON(jsonString: string): SafeParseResult<KeyResponseData, SDKValidationError>; //# sourceMappingURL=keyresponsedata.d.ts.map