Skip to content

Commit

Permalink
fix(access): condition types
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jun 6, 2024
1 parent 20461a0 commit 5ccd204
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/access/src/structs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export const SchemaStruct = nonempty(array(RoleStruct));
export type Action = Infer<typeof ActionStruct>;
export type Attributes = Infer<typeof AttributesStruct>;
export type ConditionMethod = (typeof siftMethods)[number];
export type Condition = Record<string, { [key in ConditionMethod]?: any }>;
export type ConditionMethodRecord = { [key in ConditionMethod]?: any };
export type Condition = Record<string, ConditionMethodRecord>;
export type Conditions = Infer<typeof ConditionsStruct>;
export type Resource = Infer<typeof ResourceStruct>;
export type Role = Infer<typeof RoleStruct>;
Expand Down
2 changes: 1 addition & 1 deletion packages/access/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type FixedLengthArray<T extends any[]> = Pick<T, Exclude<keyof T, ArrayLengthMut

export const ALL = '*';
export type Condition = BaseCondition;
export type Conditions = FixedLengthArray<['*']> | Record<string, Condition>[];
export type Conditions = FixedLengthArray<['*']> | Condition[];

export interface Dict {
[key: string]: any;
Expand Down

0 comments on commit 5ccd204

Please sign in to comment.