2021-08-12 15:04:37 +02:00
|
|
|
import {
|
2021-01-19 10:42:45 +01:00
|
|
|
FEATURE_CREATED,
|
|
|
|
FEATURE_UPDATED,
|
|
|
|
FEATURE_ARCHIVED,
|
|
|
|
FEATURE_REVIVED,
|
2021-02-18 09:18:04 +01:00
|
|
|
FEATURE_STALE_ON,
|
|
|
|
FEATURE_STALE_OFF,
|
2021-10-07 10:22:20 +02:00
|
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
|
|
FEATURE_STRATEGY_REMOVE,
|
|
|
|
FEATURE_STRATEGY_UPDATE,
|
|
|
|
FEATURE_STRATEGY_ADD,
|
|
|
|
FEATURE_METADATA_UPDATED,
|
|
|
|
FEATURE_PROJECT_CHANGE,
|
2021-12-17 04:30:39 +01:00
|
|
|
FEATURE_VARIANTS_UPDATED,
|
2021-08-12 15:04:37 +02:00
|
|
|
} from '../types/events';
|
|
|
|
import { IAddonDefinition } from '../types/model';
|
2021-01-19 10:42:45 +01:00
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
const slackDefinition: IAddonDefinition = {
|
2021-01-19 10:42:45 +01:00
|
|
|
name: 'slack',
|
|
|
|
displayName: 'Slack',
|
|
|
|
description: 'Allows Unleash to post updates to Slack.',
|
2021-02-25 22:27:11 +01:00
|
|
|
documentationUrl: 'https://docs.getunleash.io/docs/addons/slack',
|
2021-01-19 10:42:45 +01:00
|
|
|
parameters: [
|
|
|
|
{
|
|
|
|
name: 'url',
|
|
|
|
displayName: 'Slack webhook URL',
|
2022-09-05 11:00:59 +02:00
|
|
|
description: '(Required)',
|
2021-01-19 10:42:45 +01:00
|
|
|
type: 'url',
|
|
|
|
required: true,
|
2021-02-04 11:02:58 +01:00
|
|
|
sensitive: true,
|
2021-01-19 10:42:45 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'username',
|
|
|
|
displayName: 'Username',
|
|
|
|
placeholder: 'Unleash',
|
|
|
|
description:
|
|
|
|
'The username to use when posting messages to slack. Defaults to "Unleash".',
|
|
|
|
type: 'text',
|
|
|
|
required: false,
|
2021-08-12 15:04:37 +02:00
|
|
|
sensitive: false,
|
2021-01-19 10:42:45 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'emojiIcon',
|
|
|
|
displayName: 'Emoji Icon',
|
|
|
|
placeholder: ':unleash:',
|
|
|
|
description:
|
|
|
|
'The emoji_icon to use when posting messages to slack. Defaults to ":unleash:".',
|
|
|
|
type: 'text',
|
|
|
|
required: false,
|
2021-08-12 15:04:37 +02:00
|
|
|
sensitive: false,
|
2021-01-19 10:42:45 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'defaultChannel',
|
|
|
|
displayName: 'Default channel',
|
|
|
|
description:
|
2022-09-05 11:00:59 +02:00
|
|
|
'(Required) Default channel to post updates to if not specified in the slack-tag',
|
2021-01-19 10:42:45 +01:00
|
|
|
type: 'text',
|
|
|
|
required: true,
|
2021-08-12 15:04:37 +02:00
|
|
|
sensitive: false,
|
2021-01-19 10:42:45 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
events: [
|
|
|
|
FEATURE_CREATED,
|
|
|
|
FEATURE_UPDATED,
|
|
|
|
FEATURE_ARCHIVED,
|
|
|
|
FEATURE_REVIVED,
|
2021-02-18 09:18:04 +01:00
|
|
|
FEATURE_STALE_ON,
|
|
|
|
FEATURE_STALE_OFF,
|
2021-10-07 10:22:20 +02:00
|
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
|
|
FEATURE_STRATEGY_REMOVE,
|
|
|
|
FEATURE_STRATEGY_UPDATE,
|
|
|
|
FEATURE_STRATEGY_ADD,
|
|
|
|
FEATURE_METADATA_UPDATED,
|
2021-12-17 04:30:39 +01:00
|
|
|
FEATURE_VARIANTS_UPDATED,
|
2021-10-07 10:22:20 +02:00
|
|
|
FEATURE_PROJECT_CHANGE,
|
2021-01-19 10:42:45 +01:00
|
|
|
],
|
|
|
|
tagTypes: [
|
|
|
|
{
|
|
|
|
name: 'slack',
|
|
|
|
description:
|
|
|
|
'Slack tag used by the slack-addon to specify the slack channel.',
|
|
|
|
icon: 'S',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
2021-08-12 15:04:37 +02:00
|
|
|
|
|
|
|
export default slackDefinition;
|