create.config.ts 1.34 KB
import { useRuleChainI18n } from '../../../hook/useRuleChainI18n';
import { FormSchema } from '/@/components/Form';

export enum AwsSnsFieldsEnum {
  TOPIC_ARN_PATTERN = 'topicArnPattern',
  ACCESS_KEY_ID = 'accessKeyId',
  SECRET_ACCESS_KEY = 'secretAccessKey',
  REGION = 'region',
}

const { tLabel, tPlaceholder } = useRuleChainI18n('external', 'awsSns');

export const formSchemas: FormSchema[] = [
  {
    field: AwsSnsFieldsEnum.TOPIC_ARN_PATTERN,
    label: tLabel(AwsSnsFieldsEnum.TOPIC_ARN_PATTERN),
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: tPlaceholder(AwsSnsFieldsEnum.TOPIC_ARN_PATTERN),
    },
  },
  {
    field: AwsSnsFieldsEnum.ACCESS_KEY_ID,
    label: tLabel(AwsSnsFieldsEnum.ACCESS_KEY_ID),
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: tPlaceholder(AwsSnsFieldsEnum.ACCESS_KEY_ID),
    },
  },
  {
    field: AwsSnsFieldsEnum.SECRET_ACCESS_KEY,
    label: tLabel(AwsSnsFieldsEnum.SECRET_ACCESS_KEY),
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: tPlaceholder(AwsSnsFieldsEnum.SECRET_ACCESS_KEY),
    },
  },
  {
    field: AwsSnsFieldsEnum.REGION,
    label: tLabel(AwsSnsFieldsEnum.REGION),
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: tPlaceholder(AwsSnsFieldsEnum.REGION),
    },
  },
];