kibana/x-pack/test/alerting_api_integration/common/types.ts
Patrick Mueller 5853360d75
pass more alert info into alert executor (#54035)
resolves https://github.com/elastic/kibana/issues/50522

The alert executor function is now passed these additional alert-specific
properties as parameters:

- spaceId
- namespace
- name
- tags
- createdBy
- updatedBy
2020-01-09 18:14:53 -05:00

58 lines
1.5 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
interface FeaturesPrivileges {
[featureId: string]: string[];
}
// TODO: Consolidate the following type definitions
interface CustomRoleSpecificationElasticsearchIndices {
names: string[];
privileges: string[];
}
export interface RoleKibanaPrivilege {
spaces: string[];
base?: string[];
feature?: FeaturesPrivileges;
}
export interface CustomRoleSpecification {
name: string;
elasticsearch?: {
cluster?: string[];
indices?: CustomRoleSpecificationElasticsearchIndices[];
};
kibana?: RoleKibanaPrivilege[];
}
interface ReservedRoleSpecification {
name: string;
}
export function isCustomRoleSpecification(
roleSpecification: CustomRoleSpecification | ReservedRoleSpecification
): roleSpecification is CustomRoleSpecification {
const customRoleDefinition = roleSpecification as CustomRoleSpecification;
return (
customRoleDefinition.kibana !== undefined || customRoleDefinition.elasticsearch !== undefined
);
}
export interface User {
username: string;
fullName: string;
password: string;
role?: ReservedRoleSpecification | CustomRoleSpecification;
roles?: Array<ReservedRoleSpecification | CustomRoleSpecification>;
}
export interface Space {
id: string;
namespace?: string;
name: string;
disabledFeatures: string[];
}