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 ,
2023-07-19 15:52:19 +02:00
FEATURE_POTENTIALLY_STALE_ON ,
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' ,
2023-09-21 14:55:58 +02:00
deprecated :
'This integration is deprecated. Please try the new Slack App integration instead.' ,
2023-09-15 15:50:59 +02:00
alerts : [
{
type : 'warning' ,
text : ` This integration is deprecated. Please try the new Slack App integration instead. ` ,
} ,
] ,
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
} ,
2023-07-05 09:42:17 +02:00
{
name : 'customHeaders' ,
displayName : 'Extra HTTP Headers' ,
2023-09-20 10:21:30 +02:00
placeholder : ` {
"ISTIO_USER_KEY" : "hunter2" ,
"SOME_OTHER_CUSTOM_HTTP_HEADER" : "SOMEVALUE"
} ` ,
2023-09-14 14:01:29 +02:00
description : ` (Optional) Used to add extra HTTP Headers to the request the plugin fires off. This must be a valid json object of key-value pairs where both the key and the value are strings ` ,
2023-07-05 09:42:17 +02:00
required : false ,
sensitive : true ,
type : 'textfield' ,
} ,
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 ,
2023-07-19 15:52:19 +02:00
FEATURE_POTENTIALLY_STALE_ON ,
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 ;