committed by
Joe Porpeglia
parent
08ce0c83dd
commit
9d91a6965c
@@ -5,6 +5,16 @@
|
||||
```ts
|
||||
import { Config } from '@backstage/config';
|
||||
|
||||
// @public
|
||||
export type AllOfCriteria<TQuery> = {
|
||||
allOf: NonEmptyArray<PermissionCriteria<TQuery>>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type AnyOfCriteria<TQuery> = {
|
||||
anyOf: NonEmptyArray<PermissionCriteria<TQuery>>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type AuthorizeDecision =
|
||||
| {
|
||||
@@ -65,6 +75,14 @@ export function isReadPermission(permission: Permission): boolean;
|
||||
// @public
|
||||
export function isUpdatePermission(permission: Permission): boolean;
|
||||
|
||||
// @public
|
||||
export type NonEmptyArray<T> = [T, ...T[]];
|
||||
|
||||
// @public
|
||||
export type NotCriteria<TQuery> = {
|
||||
not: PermissionCriteria<TQuery>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type Permission = {
|
||||
name: string;
|
||||
@@ -103,14 +121,8 @@ export type PermissionCondition<TParams extends unknown[] = unknown[]> = {
|
||||
|
||||
// @public
|
||||
export type PermissionCriteria<TQuery> =
|
||||
| {
|
||||
allOf: PermissionCriteria<TQuery>[];
|
||||
}
|
||||
| {
|
||||
anyOf: PermissionCriteria<TQuery>[];
|
||||
}
|
||||
| {
|
||||
not: PermissionCriteria<TQuery>;
|
||||
}
|
||||
| AllOfCriteria<TQuery>
|
||||
| AnyOfCriteria<TQuery>
|
||||
| NotCriteria<TQuery>
|
||||
| TQuery;
|
||||
```
|
||||
|
||||
@@ -74,19 +74,30 @@ export type PermissionCondition<TParams extends unknown[] = unknown[]> = {
|
||||
|
||||
/**
|
||||
* Utility type to represent an array with 1 or more elements.
|
||||
*
|
||||
* @private
|
||||
* @public
|
||||
*/
|
||||
export type NonEmptyArray<T> = [T, ...T[]];
|
||||
|
||||
/**
|
||||
* Represnts a logical AND for the provided criteria.
|
||||
* @public
|
||||
*/
|
||||
export type AllOfCriteria<TQuery> = {
|
||||
allOf: NonEmptyArray<PermissionCriteria<TQuery>>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Represnts a logical OR for the provided criteria.
|
||||
* @public
|
||||
*/
|
||||
export type AnyOfCriteria<TQuery> = {
|
||||
anyOf: NonEmptyArray<PermissionCriteria<TQuery>>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents a negation of the provided criteria.
|
||||
* @public
|
||||
*/
|
||||
export type NotCriteria<TQuery> = {
|
||||
not: PermissionCriteria<TQuery>;
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@ export type {
|
||||
AllOfCriteria,
|
||||
AnyOfCriteria,
|
||||
NotCriteria,
|
||||
NonEmptyArray,
|
||||
} from './api';
|
||||
export type { DiscoveryApi } from './discovery';
|
||||
export type {
|
||||
|
||||
Reference in New Issue
Block a user