Explicitly type optional parameters so the definitions are accurate
Signed-off-by: Harry Hogg <hhogg@spotify.com>
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user