Explicitly type optional parameters so the definitions are accurate

Signed-off-by: Harry Hogg <hhogg@spotify.com>
This commit is contained in:
Harry Hogg
2022-10-03 13:05:16 +01:00
parent 1e621ba7c8
commit 708ff4761a
2 changed files with 8 additions and 2 deletions
@@ -20,7 +20,10 @@ import { createCatalogPermissionRule } from './util';
import { z } from 'zod';
export const createPropertyRule = (propertyType: 'metadata' | 'spec') =>
createCatalogPermissionRule({
createCatalogPermissionRule<{
key: string;
value?: string;
}>({
name: `HAS_${propertyType.toUpperCase()}`,
description: `Allow entities which have the specified ${propertyType} subfield.`,
resourceType: RESOURCE_TYPE_CATALOG_ENTITY,
@@ -26,7 +26,10 @@ import { createCatalogPermissionRule } from './util';
*
* @alpha
*/
export const hasAnnotation = createCatalogPermissionRule({
export const hasAnnotation = createCatalogPermissionRule<{
annotation: string;
value?: string;
}>({
name: 'HAS_ANNOTATION',
description:
'Allow entities which are annotated with the specified annotation',