UNPKG

studiocms

Version:

Astro Native CMS for AstroDB. Built from the ground up by the Astro community.

28 lines (27 loc) 1.49 kB
import { Effect } from '../../../effect.js'; import { SDKCoreError } from '../errors.js'; import { type JwtVerificationResult } from './lib/jwt-generator.js'; declare const SDKCore_Generators_base: Effect.Service.Class<SDKCore_Generators, "studiocms/sdk/SDKCore_Generators", { readonly effect: Effect.Effect<{ generateRandomIDNumber: (length: number) => Effect.Effect<number, SDKCoreError, never>; generateRandomPassword: (length: number) => Effect.Effect<string, SDKCoreError, never>; generateToken: (userId: string, noExpire?: boolean) => Effect.Effect<string, SDKCoreError, never>; testToken: (token: string) => Effect.Effect<JwtVerificationResult, SDKCoreError, never>; }, never, never>; }>; /** * Provides generator utilities for the StudioCMS SDK core, including random ID and password generation, * JWT token creation, and token verification. All generator functions are wrapped in Effect for error handling. * * @remarks * - `generateRandomIDNumber`: Generates a random numeric ID of specified length. * - `generateRandomPassword`: Generates a secure random password containing uppercase, lowercase letters, and digits. * - `generateToken`: Creates a signed JWT for a given user ID, with optional expiration. * - `testToken`: Verifies a JWT token and returns the decoded result. * * @service studiocms/sdk/SDKCore_Generators * @accessors true */ export declare class SDKCore_Generators extends SDKCore_Generators_base { } export {};