kibana/x-pack/plugins/saved_objects_tagging/common/assignments.ts
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00

41 lines
989 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
/**
* `type`+`id` tuple of a saved object
*/
export interface ObjectReference {
type: string;
id: string;
}
/**
* Represent an assignable saved object, as returned by the `_find_assignable_objects` API
*/
export interface AssignableObject extends ObjectReference {
icon?: string;
title: string;
tags: string[];
}
export interface UpdateTagAssignmentsOptions {
tags: string[];
assign: ObjectReference[];
unassign: ObjectReference[];
}
export interface FindAssignableObjectsOptions {
search?: string;
maxResults?: number;
types?: string[];
}
/**
* Return a string that can be used as an unique identifier for given saved object
*/
export const getKey = ({ id, type }: ObjectReference) => `${type}|${id}`;