1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +02:00
unleash.unleash/src/lib/addons/slack-app-definition.ts
Gastón Fournier adec9138ea
fix: Add feature environment variants updated event (#4598)
## About the changes
Add additional event that can be configured inside Slack App Addon
2023-09-01 16:54:09 +02:00

99 lines
3.5 KiB
TypeScript

import {
FEATURE_CREATED,
FEATURE_UPDATED,
FEATURE_ARCHIVED,
FEATURE_REVIVED,
FEATURE_STALE_ON,
FEATURE_STALE_OFF,
FEATURE_ENVIRONMENT_ENABLED,
FEATURE_ENVIRONMENT_DISABLED,
FEATURE_STRATEGY_REMOVE,
FEATURE_STRATEGY_UPDATE,
FEATURE_STRATEGY_ADD,
FEATURE_METADATA_UPDATED,
FEATURE_PROJECT_CHANGE,
FEATURE_VARIANTS_UPDATED,
FEATURE_POTENTIALLY_STALE_ON,
FEATURE_ENVIRONMENT_VARIANTS_UPDATED,
} from '../types/events';
import { IAddonDefinition } from '../types/model';
const slackAppDefinition: IAddonDefinition = {
name: 'slack-app',
displayName: 'Slack App',
description:
'The Unleash Slack App posts messages to your Slack workspace. You can decide which channels to post to by configuring your feature toggles with "slack" tags. For example, if you\'d like the bot to post messages to the #general channel, you should configure your feature toggle with the "slack:general" tag.',
documentationUrl: 'https://docs.getunleash.io/docs/addons/slack-app',
alerts: [
{
type: 'info',
text: `The Unleash Slack App bot has access to public channels by default. If you want the bot to post messages to private channels, you'll need to invite it to those channels.`,
},
{
type: 'warning',
text: `Please ensure you have the Unleash Slack App installed in your Slack workspace if you haven't installed it already.`,
},
],
installation: {
url: 'https://unleash-slack-app.vercel.app/install',
title: 'Slack App installation',
helpText:
'After installing the Unleash Slack app in your Slack workspace, paste the access token into the appropriate field below in order to configure this addon.',
},
parameters: [
{
name: 'accessToken',
displayName: 'Access token',
description: '(Required)',
type: 'text',
required: true,
sensitive: true,
},
{
name: 'defaultChannels',
displayName: 'Default channels',
description:
'A comma-separated list of channels to post to if no tagged channels are found (e.g. a toggle without tags, or an event with no tags associated).',
type: 'text',
required: false,
sensitive: false,
},
{
name: 'alwaysPostToDefault',
displayName: 'Always post to default channels',
description: `If set to 'true' or 'yes', the app will always post events to the default channels, even if the feature toggle has slack tags`,
type: 'text',
required: false,
sensitive: false,
},
],
events: [
FEATURE_CREATED,
FEATURE_UPDATED,
FEATURE_ARCHIVED,
FEATURE_REVIVED,
FEATURE_STALE_ON,
FEATURE_STALE_OFF,
FEATURE_ENVIRONMENT_ENABLED,
FEATURE_ENVIRONMENT_DISABLED,
FEATURE_ENVIRONMENT_VARIANTS_UPDATED,
FEATURE_STRATEGY_REMOVE,
FEATURE_STRATEGY_UPDATE,
FEATURE_STRATEGY_ADD,
FEATURE_METADATA_UPDATED,
FEATURE_VARIANTS_UPDATED,
FEATURE_PROJECT_CHANGE,
FEATURE_POTENTIALLY_STALE_ON,
],
tagTypes: [
{
name: 'slack',
description:
'Slack tag used by the slack-addon to specify the slack channel.',
icon: 'S',
},
],
};
export default slackAppDefinition;