diff options
Diffstat (limited to 'packages/plugin/src')
| -rw-r--r-- | packages/plugin/src/index.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index b78bcae17..7e5ae7a6e 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -34,6 +34,12 @@ export type PluginInput = { export type Plugin = (input: PluginInput) => Promise<Hooks> +type Rule = { + key: string + op: "eq" | "neq" + value: string +} + export type AuthHook = { provider: string loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>> @@ -48,7 +54,9 @@ export type AuthHook = { message: string placeholder?: string validate?: (value: string) => string | undefined + /** @deprecated Use `when` instead */ condition?: (inputs: Record<string, string>) => boolean + when?: Rule } | { type: "select" @@ -59,7 +67,9 @@ export type AuthHook = { value: string hint?: string }> + /** @deprecated Use `when` instead */ condition?: (inputs: Record<string, string>) => boolean + when?: Rule } > authorize(inputs?: Record<string, string>): Promise<AuthOuathResult> @@ -74,7 +84,9 @@ export type AuthHook = { message: string placeholder?: string validate?: (value: string) => string | undefined + /** @deprecated Use `when` instead */ condition?: (inputs: Record<string, string>) => boolean + when?: Rule } | { type: "select" @@ -85,7 +97,9 @@ export type AuthHook = { value: string hint?: string }> + /** @deprecated Use `when` instead */ condition?: (inputs: Record<string, string>) => boolean + when?: Rule } > authorize?(inputs?: Record<string, string>): Promise< |
