mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
e97859af91
## About the changes Redesigned/refactored integrations form. ![image](https://github.com/Unleash/unleash/assets/2625371/9f3ad019-e367-4f89-932d-539d7a370f88) Closes [1-1298/resesign-of-integrations-form](https://linear.app/unleash/issue/1-1298/resesign-of-integrations-form)
124 lines
4.0 KiB
TypeScript
124 lines
4.0 KiB
TypeScript
import {
|
|
FEATURE_ARCHIVED,
|
|
FEATURE_CREATED,
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
FEATURE_METADATA_UPDATED,
|
|
FEATURE_VARIANTS_UPDATED,
|
|
FEATURE_PROJECT_CHANGE,
|
|
FEATURE_REVIVED,
|
|
FEATURE_STALE_OFF,
|
|
FEATURE_STALE_ON,
|
|
FEATURE_STRATEGY_ADD,
|
|
FEATURE_STRATEGY_REMOVE,
|
|
FEATURE_STRATEGY_UPDATE,
|
|
FEATURE_UPDATED,
|
|
FEATURE_TAGGED,
|
|
FEATURE_UNTAGGED,
|
|
CHANGE_REQUEST_CREATED,
|
|
CHANGE_REQUEST_DISCARDED,
|
|
CHANGE_ADDED,
|
|
CHANGE_DISCARDED,
|
|
CHANGE_REQUEST_APPROVED,
|
|
CHANGE_REQUEST_APPROVAL_ADDED,
|
|
CHANGE_REQUEST_CANCELLED,
|
|
CHANGE_REQUEST_SENT_TO_REVIEW,
|
|
CHANGE_REQUEST_APPLIED,
|
|
FEATURE_POTENTIALLY_STALE_ON,
|
|
} from '../types/events';
|
|
import { IAddonDefinition } from '../types/model';
|
|
|
|
const webhookDefinition: IAddonDefinition = {
|
|
name: 'webhook',
|
|
displayName: 'Webhook',
|
|
description:
|
|
'A Webhook is a generic way to post messages from Unleash to third party services.',
|
|
documentationUrl: 'https://docs.getunleash.io/docs/addons/webhook',
|
|
parameters: [
|
|
{
|
|
name: 'url',
|
|
displayName: 'Webhook URL',
|
|
description:
|
|
'(Required) Unleash will perform a HTTP Post to the specified URL (one retry if first attempt fails)',
|
|
type: 'url',
|
|
required: true,
|
|
sensitive: true,
|
|
},
|
|
{
|
|
name: 'contentType',
|
|
displayName: 'Content-Type',
|
|
placeholder: 'application/json',
|
|
description:
|
|
'(Optional) The Content-Type header to use. Defaults to "application/json".',
|
|
type: 'text',
|
|
required: false,
|
|
sensitive: false,
|
|
},
|
|
{
|
|
name: 'authorization',
|
|
displayName: 'Authorization',
|
|
placeholder: '',
|
|
description:
|
|
'(Optional) The Authorization header to use. Not used if left blank.',
|
|
type: 'text',
|
|
required: false,
|
|
sensitive: true,
|
|
},
|
|
{
|
|
name: 'bodyTemplate',
|
|
displayName: 'Body template',
|
|
placeholder: `{
|
|
"event": "{{event.type}}",
|
|
"createdBy": "{{event.createdBy}}",
|
|
"featureToggle": "{{event.data.name}}",
|
|
"timestamp": "{{event.data.createdAt}}"
|
|
}`,
|
|
description:
|
|
"(Optional) You may format the body using a mustache template. If you don't specify anything, the format will similar to the events format (https://docs.getunleash.io/reference/api/legacy/unleash/admin/events)",
|
|
type: 'textfield',
|
|
required: false,
|
|
sensitive: false,
|
|
},
|
|
{
|
|
name: 'customHeaders',
|
|
displayName: 'Extra HTTP Headers',
|
|
placeholder:
|
|
'{\n"ISTIO_USER_KEY": "hunter2",\n"SOME_OTHER_CUSTOM_HTTP_HEADER": "SOMEVALUE"\n}',
|
|
description: `(Optional) Used to add extra HTTP Headers to the request the plugin fires off. Format here needs to be a valid json object of key value pairs where both key and value are strings`,
|
|
required: false,
|
|
sensitive: true,
|
|
type: 'textfield',
|
|
},
|
|
],
|
|
events: [
|
|
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_VARIANTS_UPDATED,
|
|
FEATURE_PROJECT_CHANGE,
|
|
FEATURE_TAGGED,
|
|
FEATURE_UNTAGGED,
|
|
CHANGE_REQUEST_CREATED,
|
|
CHANGE_REQUEST_DISCARDED,
|
|
CHANGE_ADDED,
|
|
CHANGE_DISCARDED,
|
|
CHANGE_REQUEST_APPROVED,
|
|
CHANGE_REQUEST_APPROVAL_ADDED,
|
|
CHANGE_REQUEST_CANCELLED,
|
|
CHANGE_REQUEST_SENT_TO_REVIEW,
|
|
CHANGE_REQUEST_APPLIED,
|
|
FEATURE_POTENTIALLY_STALE_ON,
|
|
],
|
|
};
|
|
|
|
export default webhookDefinition;
|