UNPKG

@nocobase/plugin-verification

Version:

User identity verification management, including SMS, TOTP authenticator, with extensibility.

62 lines (61 loc) 2.15 kB
/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import React from 'react'; export type VerifierOptions = Record<string, unknown>; export type VerifierRecord = { name?: string; title?: string | null; description?: string | null; verificationType?: string; options?: VerifierOptions; }; export type VerifierFormValues = { name?: string; title?: string | null; description?: string | null; verificationType?: string; options?: VerifierOptions; }; export declare function recursiveTrim<T>(value: T): T; /** * Submit pipeline for the create/edit verifier drawer. * * Extracted from the React component so the request layer can be tested * directly without spinning up the full FlowEngine + viewer stack. * * The fallthrough `else` is deliberate — it converts what used to be a * silent no-op (when `record.name` was undefined because we read the * wrong primary key) into a loud error. The `verifiers` collection uses * `name` as its primary key (`autoGenId: false`), so `filterByTk` must * be the name string. */ export type VerifierResource = { create(params: { values: VerifierFormValues; }): Promise<unknown>; update(params: { filterByTk: string; values: VerifierFormValues; }): Promise<unknown>; }; export declare function submitVerifierForm(args: { raw: VerifierFormValues; mode: 'create' | 'edit'; record?: VerifierRecord; resource: VerifierResource; onSubmitted: () => void; }): Promise<void>; /** * Admin settings page for the Verification plugin. Lists all configured * verifiers with create / edit / delete + bulk delete. Per-type fields * are injected from `verificationManager` registered via the plugin * registry so third-party verifier types (TOTP, future biometric, …) * plug in without touching this page. */ export default function VerifiersPage(): React.JSX.Element;