@supertokens-plugins/user-banning-react
Public root exports for @supertokens-plugins/user-banning-react 0.2.1.
Package version: 0.2.1
Generated from the packed release’s root declaration, ./dist/index.d.ts. Only exports reachable from that root are
listed. See the immutable release source.
Public root exports
| Export | Kind |
|---|---|
default |
Constant |
init |
Constant |
PLUGIN_ID |
Constant |
usePluginContext |
Constant |
default
Published from the emitted _default declaration.
Root export:
export default _default;
Resolved declaration:
declare const _default: {
init: (config?: (import('./types').SuperTokensPluginUserBanningPluginConfig & {
override?: ((oI: undefined) => undefined) | undefined;
}) | undefined) => import('supertokens-auth-react').SuperTokensPlugin;
};
init
Root export:
import { init, usePluginContext } from './plugin';
import { PLUGIN_ID } from './constants';
export { init, PLUGIN_ID, usePluginContext };
Resolved declaration:
import { SuperTokensPluginUserBanningPluginConfig, TranslationKeys, SuperTokensPluginUserBanningPluginNormalisedConfig } from './types';
import { SuperTokensPlugin } from 'supertokens-auth-react/lib/build/types';
export declare const init: (config?: (SuperTokensPluginUserBanningPluginConfig & {
override?: ((oI: undefined) => undefined) | undefined;
}) | undefined) => SuperTokensPlugin;
PLUGIN_ID
Root export:
import { init, usePluginContext } from './plugin';
import { PLUGIN_ID } from './constants';
export { init, PLUGIN_ID, usePluginContext };
Resolved declaration:
export declare const PLUGIN_ID = "supertokens-plugin-user-banning";
usePluginContext
Root export:
import { init, usePluginContext } from './plugin';
import { PLUGIN_ID } from './constants';
export { init, PLUGIN_ID, usePluginContext };
Resolved declaration:
import { SuperTokensPublicConfig, SuperTokensPublicPlugin } from 'supertokens-auth-react';
import { SuperTokensPluginUserBanningPluginConfig, TranslationKeys, SuperTokensPluginUserBanningPluginNormalisedConfig } from './types';
import { getQuerier } from '@shared/react';
import { getApi } from './api';
declare const usePluginContext: () => {
plugins: SuperTokensPublicPlugin[];
sdkVersion: string;
appConfig: SuperTokensPublicConfig;
pluginConfig: SuperTokensPluginUserBanningPluginNormalisedConfig;
querier: ReturnType<typeof getQuerier>;
api: ReturnType<typeof getApi>;
t: (key: TranslationKeys) => string;
};
Required signature types
These declarations are not additional package-root exports. They are included because the public signatures above depend on them.
defaultTranslationsUserBanning
export declare const defaultTranslationsUserBanning: {
readonly en: {
readonly PL_UB_BAN_PAGE_TITLE: "Ban User";
readonly PL_UB_BAN_PAGE_DESCRIPTION: "This page is used to ban and unban users. It is useful for preventing users from accessing your application.";
readonly PL_UB_BAN_PAGE_CHECK_STATUS_BUTTON: "Check Status";
readonly PL_UB_BAN_PAGE_BAN_BUTTON: "Ban";
readonly PL_UB_BAN_PAGE_UNBAN_BUTTON: "Unban";
readonly PL_UB_BAN_PAGE_EMAIL_LABEL: "Email";
readonly PL_UB_BAN_PAGE_EMAIL_PLACEHOLDER: "Enter email";
readonly PL_UB_BAN_PAGE_TENANT_ID_LABEL: "Tenant";
readonly PL_UB_BAN_PAGE_TENANT_ID_PLACEHOLDER: "Enter tenant ID";
readonly PL_UB_BAN_PAGE_BANNED_STATUS: "Banned";
readonly PL_UB_BAN_PAGE_NOT_BANNED_STATUS: "Not Banned";
readonly PL_UB_BAN_PAGE_GENERAL_ERROR: "An error occurred while checking the status of the user";
readonly PL_UB_BAN_PAGE_UNKNOWN_ERROR: "An unknown error occurred";
readonly PL_UB_BAN_PAGE_UNKNOWN_ERROR_MESSAGE: "An unknown error occurred while checking the status of the user";
readonly PL_UB_BAN_PAGE_UNKNOWN_ERROR_MESSAGE_MESSAGE: "An unknown error occurred while checking the status of the user";
};
};
getApi
import { getQuerier } from '@shared/react';
export declare const getApi: (querier: ReturnType<typeof getQuerier>) => {
getBanStatus: (tenantId: string, email: string) => Promise<{
status: "OK";
banned: boolean;
} | {
status: "ERROR";
message: string;
}>;
updateBanStatus: (tenantId: string, email: string, isBanned: boolean) => Promise<{
status: "OK";
} | {
status: "ERROR";
message: string;
}>;
};
SuperTokensPluginUserBanningPluginConfig
export type SuperTokensPluginUserBanningPluginConfig = {
userBanningPermission?: string;
bannedUserRole?: string;
onPermissionFailureRedirectPath?: string;
};
SuperTokensPluginUserBanningPluginNormalisedConfig
export type SuperTokensPluginUserBanningPluginNormalisedConfig = {
userBanningPermission: string;
bannedUserRole: string;
onPermissionFailureRedirectPath: string;
};
TranslationKeys
import { defaultTranslationsUserBanning } from './translations';
export type TranslationKeys = keyof typeof defaultTranslationsUserBanning["en"];