mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
62 lines
1.8 KiB
TypeScript
62 lines
1.8 KiB
TypeScript
import type { AdminConsoleKey } from '@logto/phrases';
|
|
import { ConnectorPlatform, ConnectorType } from '@logto/schemas';
|
|
|
|
import EmailConnector from '@/assets/images/connector-email.svg';
|
|
import SmsConnectorIcon from '@/assets/images/connector-sms.svg';
|
|
import type { ConnectorGroup } from '@/types/connector';
|
|
|
|
type TitlePlaceHolder = {
|
|
[key in ConnectorType]: AdminConsoleKey;
|
|
};
|
|
|
|
export const connectorTitlePlaceHolder: TitlePlaceHolder = Object.freeze({
|
|
[ConnectorType.Sms]: 'connectors.type.sms',
|
|
[ConnectorType.Email]: 'connectors.type.email',
|
|
[ConnectorType.Social]: 'connectors.type.social',
|
|
});
|
|
|
|
type ConnectorPlatformLabel = {
|
|
[key in ConnectorPlatform]: AdminConsoleKey;
|
|
};
|
|
|
|
export const connectorPlatformLabel: ConnectorPlatformLabel = Object.freeze({
|
|
[ConnectorPlatform.Native]: 'connectors.platform.native',
|
|
[ConnectorPlatform.Universal]: 'connectors.platform.universal',
|
|
[ConnectorPlatform.Web]: 'connectors.platform.web',
|
|
});
|
|
|
|
type ConnectorPlaceholderIcon = {
|
|
[key in ConnectorType]?: SvgComponent;
|
|
};
|
|
|
|
export const connectorPlaceholderIcon: ConnectorPlaceholderIcon = Object.freeze({
|
|
[ConnectorType.Sms]: SmsConnectorIcon,
|
|
[ConnectorType.Email]: EmailConnector,
|
|
} as const);
|
|
|
|
export const defaultSmsConnectorGroup: ConnectorGroup = {
|
|
id: 'default-sms-connector',
|
|
type: ConnectorType.Sms,
|
|
connectors: [],
|
|
name: { en: '' },
|
|
description: { en: '' },
|
|
logo: '',
|
|
logoDark: null,
|
|
target: '',
|
|
};
|
|
|
|
export const defaultEmailConnectorGroup: ConnectorGroup = {
|
|
id: 'default-email-connector',
|
|
type: ConnectorType.Email,
|
|
connectors: [],
|
|
name: { en: '' },
|
|
description: { en: '' },
|
|
logo: '',
|
|
logoDark: null,
|
|
target: '',
|
|
};
|
|
|
|
/**
|
|
* Note: this feature has not been implemented yet; @xiaoyijun will refactor this once the internal Logto connectors are ready.
|
|
*/
|
|
export const isDemoConnector = true;
|