Made changs to allow params and schemas to be defaulted and required only when there is params defined.

Co-authored-by: Vincenzo Scamporlino <vincenzos@spotify.com>
Co-authored-by: Mike Lewis <mlewis@spotify.com>

Signed-off-by: Harry Hogg <hhogg@spotify.com>
This commit is contained in:
Harry Hogg
2022-10-06 12:04:31 +01:00
parent a3fef466ef
commit fa40df2bc7
17 changed files with 53 additions and 84 deletions
+4 -2
View File
@@ -177,7 +177,7 @@ export type PermissionCondition<
> = {
resourceType: TResourceType;
rule: string;
params: TParams;
params?: TParams;
};
// @public
@@ -208,7 +208,9 @@ export type PermissionMessageBatch<T> = {
export type PermissionRuleParam = undefined | JsonPrimitive | JsonPrimitive[];
// @public
export type PermissionRuleParams = Record<string, PermissionRuleParam>;
export type PermissionRuleParams =
| undefined
| Record<string, PermissionRuleParam>;
// @public
export type PolicyDecision =
+4 -2
View File
@@ -106,7 +106,7 @@ export type PermissionCondition<
> = {
resourceType: TResourceType;
rule: string;
params: TParams;
params?: TParams;
};
/**
@@ -161,7 +161,9 @@ export type PermissionRuleParam = undefined | JsonPrimitive | JsonPrimitive[];
*
* @public
*/
export type PermissionRuleParams = Record<string, PermissionRuleParam>;
export type PermissionRuleParams =
| undefined
| Record<string, PermissionRuleParam>;
/**
* An individual request sent to the permission backend.