From 9774aa541ae258115aced39ff25a68d5f2de766b Mon Sep 17 00:00:00 2001 From: nghaninn Date: Fri, 4 Oct 2024 10:15:19 +0800 Subject: [PATCH] feat: allow any credentialStatus for v4 Removing restriction for credetialStatus --- .../__generated__/v4-document.schema.json | 12 ++++++++++++ .../v4-signed-wrapped-document.schema.json | 12 ++++++++++++ .../__generated__/v4-wrapped-document.schema.json | 12 ++++++++++++ src/4.0/types.ts | 4 +++- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/4.0/jsonSchemas/__generated__/v4-document.schema.json b/src/4.0/jsonSchemas/__generated__/v4-document.schema.json index a112453a..0b68998b 100644 --- a/src/4.0/jsonSchemas/__generated__/v4-document.schema.json +++ b/src/4.0/jsonSchemas/__generated__/v4-document.schema.json @@ -216,6 +216,18 @@ "type" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true } ] }, diff --git a/src/4.0/jsonSchemas/__generated__/v4-signed-wrapped-document.schema.json b/src/4.0/jsonSchemas/__generated__/v4-signed-wrapped-document.schema.json index 720aceba..61bba2d6 100644 --- a/src/4.0/jsonSchemas/__generated__/v4-signed-wrapped-document.schema.json +++ b/src/4.0/jsonSchemas/__generated__/v4-signed-wrapped-document.schema.json @@ -216,6 +216,18 @@ "type" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true } ] }, diff --git a/src/4.0/jsonSchemas/__generated__/v4-wrapped-document.schema.json b/src/4.0/jsonSchemas/__generated__/v4-wrapped-document.schema.json index 4593f440..f8699651 100644 --- a/src/4.0/jsonSchemas/__generated__/v4-wrapped-document.schema.json +++ b/src/4.0/jsonSchemas/__generated__/v4-wrapped-document.schema.json @@ -216,6 +216,18 @@ "type" ], "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true } ] }, diff --git a/src/4.0/types.ts b/src/4.0/types.ts index 94b09e11..17d2d3dd 100644 --- a/src/4.0/types.ts +++ b/src/4.0/types.ts @@ -234,7 +234,9 @@ export const V4OpenAttestationDocument = _W3cVerifiableCredential }), // [Optional] Credential Status - credentialStatus: z.discriminatedUnion("type", [OscpResponderRevocation, RevocationStoreRevocation]).optional(), + credentialStatus: z + .union([OscpResponderRevocation, RevocationStoreRevocation, z.object({ type: z.string() }).passthrough()]) + .optional(), // [Optional] Render Method renderMethod: z.array(z.discriminatedUnion("type", [DecentralisedEmbeddedRenderer, SvgRenderer])).optional(),