Skip to content

Commit 8c8730b

Browse files
chore: dedupe license headers and narrow tool dependency type
1 parent 983d485 commit 8c8730b

3 files changed

Lines changed: 2 additions & 47 deletions

File tree

x-pack/solutions/security/packages/kbn-alertzero-common/action_catalog_types.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@
55
* 2.0.
66
*/
77

8-
/*
9-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10-
* or more contributor license agreements. Licensed under the "Elastic License
11-
* 2.0"; you may not use this file except in compliance with the License.
12-
* You may obtain a copy of the License at
13-
*
14-
* http://www.apache.org/licenses/LICENSE-2.0
15-
*
16-
* Unless required by applicable law or agreed to in writing, software
17-
* distributed under the License is distributed on an "AS IS" BASIS,
18-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19-
* See the License for the specific language governing permissions and
20-
* limitations under the License.
21-
*/
22-
238
import type { ActionApprovalPolicy, ActionCategory, ActionImpact } from '@kbn/workflows';
249

2510
export type { ActionApprovalPolicy, ActionCategory, ActionImpact };

x-pack/solutions/security/plugins/alertzero/server/agent_builder_tools/list_actions_by_category_tool.test.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,13 @@
55
* 2.0.
66
*/
77

8-
/*
9-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10-
* or more contributor license agreements. Licensed under the "Elastic License
11-
* 2.0"; you may not use this file except in compliance with the License.
12-
* You may obtain a copy of the License at
13-
*
14-
* http://www.apache.org/licenses/LICENSE-2.0
15-
*
16-
* Unless required by applicable law or agreed to in writing, software
17-
* distributed under the License is distributed on an "AS IS" BASIS,
18-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19-
* See the License for the specific language governing permissions and
20-
* limitations under the License.
21-
*/
22-
238
import { listActionsByCategoryTool } from './list_actions_by_category_tool';
249
import type { ActionsService } from '../services/actions/actions_service';
2510
import { ToolResultType } from '@kbn/agent-builder-common/tools/tool_result';
2611

2712
const logger = () => ({ error: jest.fn(), warn: jest.fn(), info: jest.fn(), debug: jest.fn() });
2813

29-
const serviceWith = (list: jest.Mock) => ({ list } as unknown as ActionsService);
14+
const serviceWith = (list: jest.Mock) => ({ list } as Pick<ActionsService, list>);
3015

3116
const run = async (service: ActionsService, input: { categories?: string[] } = {}) => {
3217
const tool = listActionsByCategoryTool(() => service);

x-pack/solutions/security/plugins/alertzero/server/agent_builder_tools/list_actions_by_category_tool.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@
55
* 2.0.
66
*/
77

8-
/*
9-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10-
* or more contributor license agreements. Licensed under the "Elastic License
11-
* 2.0"; you may not use this file except in compliance with the License.
12-
* You may obtain a copy of the License at
13-
*
14-
* http://www.apache.org/licenses/LICENSE-2.0
15-
*
16-
* Unless required by applicable law or agreed to in writing, software
17-
* distributed under the License is distributed on an "AS IS" BASIS,
18-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19-
* See the License for the specific language governing permissions and
20-
* limitations under the License.
21-
*/
22-
238
import { z } from '@kbn/zod/v4';
249
import { createErrorResult } from '@kbn/agent-builder-server';
2510
import { ToolResultType } from '@kbn/agent-builder-common/tools/tool_result';
@@ -48,7 +33,7 @@ const listByCategorySchema = z.object({
4833
* and the API can never drift.
4934
*/
5035
export const listActionsByCategoryTool = (
51-
getActionsService: () => ActionsService
36+
getActionsService: () => Pick<ActionsService, list>
5237
): BuiltinToolDefinition<typeof listByCategorySchema> => ({
5338
id: ALERTZERO_ACTIONS_LIST_BY_CATEGORY_TOOL_ID,
5439
type: ToolType.builtin,

0 commit comments

Comments
 (0)