Skip to content

Commit

Permalink
chore: simplify types
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Oct 25, 2024
1 parent db4b2d5 commit c235d89
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions lib/validation/validators.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { PresentationDefinitionV1, PresentationDefinitionV2 } from '@sphereon/pex-models';

export interface ValidateFunction {
(data: unknown): boolean;

errors?: ValidationError[];
}

Expand Down Expand Up @@ -27,27 +30,6 @@ export type ValidationParentSchema = {
};
};

export type ValidationData = {
id?: string;
name?: string;
purpose?: string;
constraints?: {
limit_disclosure?: string;
fields?: Array<{
path?: string[];
purpose?: string;
filter?: {
type?: string;
pattern?: string;
};
}>;
};
schema?: Array<{
uri?: string;
}>;
[key: string]: unknown;
};

export type ValidationError = {
instancePath: string;
schemaPath: string;
Expand All @@ -67,5 +49,5 @@ export type ValidationError = {
message: string;
schema: boolean | ValidationParentSchema;
parentSchema: ValidationParentSchema;
data: ValidationData;
data: PresentationDefinitionV1 | PresentationDefinitionV2;
};

0 comments on commit c235d89

Please sign in to comment.