permissions: move MetadataResponse type to permission-common
This was missed when moving
MetadataResponseSerializedRule in
137fa342b4 - seems
useful to keep these two types together.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
@@ -126,6 +126,12 @@ export function isResourcePermission<T extends string = string>(
|
||||
// @public
|
||||
export function isUpdatePermission(permission: Permission): boolean;
|
||||
|
||||
// @public
|
||||
export type MetadataResponse = {
|
||||
permissions?: Permission[];
|
||||
rules: MetadataResponseSerializedRule[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export type MetadataResponseSerializedRule = {
|
||||
name: string;
|
||||
|
||||
@@ -40,7 +40,10 @@ export type {
|
||||
NotCriteria,
|
||||
} from './api';
|
||||
export type { DiscoveryApi } from './discovery';
|
||||
export type { MetadataResponseSerializedRule } from './integration';
|
||||
export type {
|
||||
MetadataResponse,
|
||||
MetadataResponseSerializedRule,
|
||||
} from './integration';
|
||||
export type {
|
||||
BasicPermission,
|
||||
PermissionAttributes,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import zodToJsonSchema from 'zod-to-json-schema';
|
||||
import { Permission } from './permission';
|
||||
|
||||
/**
|
||||
* Serialized permission rules, with the paramsSchema
|
||||
@@ -28,3 +29,14 @@ export type MetadataResponseSerializedRule = {
|
||||
resourceType: string;
|
||||
paramsSchema?: ReturnType<typeof zodToJsonSchema>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Response type for the .metadata endpoint in
|
||||
* {@link @backstage/plugin-permission-node#createPermissionIntegrationRouter}
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type MetadataResponse = {
|
||||
permissions?: Permission[];
|
||||
rules: MetadataResponseSerializedRule[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user