Skip to content

Commit

Permalink
GeneralFeature to GenerativeAIFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Sep 26, 2023
1 parent 06445ca commit e3e5278
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
16 changes: 8 additions & 8 deletions api_docs/actions.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5273,10 +5273,10 @@
},
{
"parentPluginId": "actions",
"id": "def-common.GeneralConnectorFeatureId",
"id": "def-common.GenerativeAIConnectorFeatureId",
"type": "string",
"tags": [],
"label": "GeneralConnectorFeatureId",
"label": "GenerativeAIConnectorFeatureId",
"description": [],
"signature": [
"\"general\""
Expand Down Expand Up @@ -5613,18 +5613,18 @@
},
{
"parentPluginId": "actions",
"id": "def-common.GeneralFeature",
"id": "def-common.GenerativeAIFeature",
"type": "Object",
"tags": [],
"label": "GeneralFeature",
"label": "GenerativeAIFeature",
"description": [],
"path": "x-pack/plugins/actions/common/connector_feature_config.ts",
"deprecated": false,
"trackAdoption": false,
"children": [
{
"parentPluginId": "actions",
"id": "def-common.GeneralFeature.id",
"id": "def-common.GenerativeAIFeature.id",
"type": "string",
"tags": [],
"label": "id",
Expand All @@ -5635,7 +5635,7 @@
},
{
"parentPluginId": "actions",
"id": "def-common.GeneralFeature.name",
"id": "def-common.GenerativeAIFeature.name",
"type": "string",
"tags": [],
"label": "name",
Expand All @@ -5646,7 +5646,7 @@
},
{
"parentPluginId": "actions",
"id": "def-common.GeneralFeature.compatibility",
"id": "def-common.GenerativeAIFeature.compatibility",
"type": "string",
"tags": [],
"label": "compatibility",
Expand Down Expand Up @@ -5769,4 +5769,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { IHttpFetchError } from '@kbn/core-http-browser';
import type { ActionType } from '@kbn/actions-plugin/common';
import { HttpSetup } from '@kbn/core-http-browser';
import { IToasts } from '@kbn/core-notifications-browser';
import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common';
import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common';
import * as i18n from '../translations';

/**
Expand All @@ -37,7 +37,10 @@ export const useLoadActionTypes = ({
QUERY_KEY,

async () => {
const queryResult = await loadActionTypes({ http, featureId: GeneralConnectorFeatureId });
const queryResult = await loadActionTypes({
http,
featureId: GenerativeAIConnectorFeatureId,
});
const sortedData = queryResult.sort((a, b) => a.name.localeCompare(b.name));

return sortedData;
Expand Down
18 changes: 9 additions & 9 deletions x-pack/plugins/actions/common/connector_feature_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export const AlertingConnectorFeatureId = 'alerting';
export const CasesConnectorFeatureId = 'cases';
export const UptimeConnectorFeatureId = 'uptime';
export const SecurityConnectorFeatureId = 'siem';
export const GeneralConnectorFeatureId = 'general';
export const GenerativeAIConnectorFeatureId = 'generativeAI';

const compatibilityGeneral = i18n.translate(
'xpack.actions.availableConnectorFeatures.compatibility.general',
const compatibilityGenerativeAI = i18n.translate(
'xpack.actions.availableConnectorFeatures.compatibility.generativeAI',
{
defaultMessage: 'General',
defaultMessage: 'Generative AI',
}
);

Expand Down Expand Up @@ -80,18 +80,18 @@ export const SecuritySolutionFeature: ConnectorFeatureConfig = {
compatibility: compatibilityAlertingRules,
};

export const GeneralFeature: ConnectorFeatureConfig = {
id: GeneralConnectorFeatureId,
name: compatibilityGeneral,
compatibility: compatibilityGeneral,
export const GenerativeAIFeature: ConnectorFeatureConfig = {
id: GenerativeAIConnectorFeatureId,
name: compatibilityGenerativeAI,
compatibility: compatibilityGenerativeAI,
};

const AllAvailableConnectorFeatures = {
[AlertingConnectorFeature.id]: AlertingConnectorFeature,
[CasesConnectorFeature.id]: CasesConnectorFeature,
[UptimeConnectorFeature.id]: UptimeConnectorFeature,
[SecuritySolutionFeature.id]: SecuritySolutionFeature,
[GeneralFeature.id]: GeneralFeature,
[GenerativeAIFeature.id]: GenerativeAIFeature,
};

export function areValidFeatures(ids: string[]) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export {
CasesConnectorFeatureId,
UptimeConnectorFeatureId,
SecurityConnectorFeatureId,
GeneralConnectorFeatureId,
GenerativeAIConnectorFeatureId,
} from './connector_feature_config';
export interface ActionType {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
SubActionConnectorType,
ValidatorType,
} from '@kbn/actions-plugin/server/sub_action_framework/types';
import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common';
import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common';
import { urlAllowListValidator } from '@kbn/actions-plugin/server';
import { ValidatorServices } from '@kbn/actions-plugin/server/types';
import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators';
Expand All @@ -29,7 +29,7 @@ export const getConnectorType = (): SubActionConnectorType<Config, Secrets> => (
secrets: SecretsSchema,
},
validators: [{ type: ValidatorType.CONFIG, validator: configValidator }],
supportedFeatureIds: [GeneralConnectorFeatureId],
supportedFeatureIds: [GenerativeAIConnectorFeatureId],
minimumLicenseRequired: 'enterprise' as const,
renderParameterTemplates,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
SubActionConnectorType,
ValidatorType,
} from '@kbn/actions-plugin/server/sub_action_framework/types';
import { GeneralConnectorFeatureId } from '@kbn/actions-plugin/common';
import { GenerativeAIConnectorFeatureId } from '@kbn/actions-plugin/common';
import { urlAllowListValidator } from '@kbn/actions-plugin/server';
import { ValidatorServices } from '@kbn/actions-plugin/server/types';
import { assertURL } from '@kbn/actions-plugin/server/sub_action_framework/helpers/validators';
Expand All @@ -33,7 +33,7 @@ export const getConnectorType = (): SubActionConnectorType<Config, Secrets> => (
secrets: SecretsSchema,
},
validators: [{ type: ValidatorType.CONFIG, validator: configValidator }],
supportedFeatureIds: [GeneralConnectorFeatureId],
supportedFeatureIds: [GenerativeAIConnectorFeatureId],
minimumLicenseRequired: 'enterprise' as const,
renderParameterTemplates,
});
Expand Down

0 comments on commit e3e5278

Please sign in to comment.