2022-10-21 00:14:17 -05:00
|
|
|
import type { AdminConsoleKey } from '@logto/phrases';
|
2022-05-30 00:51:11 -05:00
|
|
|
import { ConnectorPlatform, ConnectorType } from '@logto/schemas';
|
2022-05-26 00:07:52 -05:00
|
|
|
|
2022-06-26 21:04:46 -05:00
|
|
|
import EmailConnector from '@/assets/images/connector-email.svg';
|
|
|
|
import SmsConnectorIcon from '@/assets/images/connector-sms.svg';
|
2023-01-04 03:43:58 -05:00
|
|
|
import type { ConnectorGroup } from '@/types/connector';
|
2022-06-26 21:04:46 -05:00
|
|
|
|
2022-05-26 00:07:52 -05:00
|
|
|
type TitlePlaceHolder = {
|
2022-07-11 04:28:51 -05:00
|
|
|
[key in ConnectorType]: AdminConsoleKey;
|
2022-05-26 00:07:52 -05:00
|
|
|
};
|
|
|
|
|
2023-04-21 11:55:17 -05:00
|
|
|
export const connectorTitlePlaceHolder = Object.freeze({
|
2022-08-31 23:21:42 -05:00
|
|
|
[ConnectorType.Sms]: 'connectors.type.sms',
|
2022-07-11 04:28:51 -05:00
|
|
|
[ConnectorType.Email]: 'connectors.type.email',
|
|
|
|
[ConnectorType.Social]: 'connectors.type.social',
|
2023-04-21 11:55:17 -05:00
|
|
|
}) satisfies TitlePlaceHolder;
|
2022-05-26 00:07:52 -05:00
|
|
|
|
2022-05-30 00:51:11 -05:00
|
|
|
type ConnectorPlatformLabel = {
|
2022-06-05 22:36:58 -05:00
|
|
|
[key in ConnectorPlatform]: AdminConsoleKey;
|
2022-05-30 00:51:11 -05:00
|
|
|
};
|
|
|
|
|
2023-04-21 11:55:17 -05:00
|
|
|
export const connectorPlatformLabel = Object.freeze({
|
2022-06-05 22:36:58 -05:00
|
|
|
[ConnectorPlatform.Native]: 'connectors.platform.native',
|
|
|
|
[ConnectorPlatform.Universal]: 'connectors.platform.universal',
|
|
|
|
[ConnectorPlatform.Web]: 'connectors.platform.web',
|
2023-04-21 11:55:17 -05:00
|
|
|
}) satisfies ConnectorPlatformLabel;
|
2022-06-26 21:04:46 -05:00
|
|
|
|
|
|
|
type ConnectorPlaceholderIcon = {
|
|
|
|
[key in ConnectorType]?: SvgComponent;
|
|
|
|
};
|
|
|
|
|
2022-07-08 00:49:22 -05:00
|
|
|
export const connectorPlaceholderIcon: ConnectorPlaceholderIcon = Object.freeze({
|
2022-08-31 23:21:42 -05:00
|
|
|
[ConnectorType.Sms]: SmsConnectorIcon,
|
2022-06-26 21:04:46 -05:00
|
|
|
[ConnectorType.Email]: EmailConnector,
|
2023-04-21 11:55:17 -05:00
|
|
|
});
|
2023-01-04 03:43:58 -05:00
|
|
|
|
|
|
|
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: '',
|
|
|
|
};
|
2023-03-30 04:44:46 -05:00
|
|
|
|
|
|
|
// Note: these connector targets will need a native connector to support the native platform
|
|
|
|
export const supportNativePlatformTargets = ['wechat', 'alipay'];
|