From 1e1998de46bf81dd57e62b0282822462ee2e6927 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Wed, 24 Apr 2024 22:47:17 +0200 Subject: [PATCH] feat: Add optional property to field. Partially fixes #150 --- CHANGELOG.md | 11 ++++- .../core/presentationDefinitionSchema.ts | 2 + package.json | 2 +- pnpm-lock.yaml | 48 ++++--------------- 4 files changed, 22 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4e80ca4..a3d8de79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Release Notes +## v3.3.2 - 2024-04-24 + +- Updated: + - Allow to use const boolean in filters. + - Allow to use 'optional' boolean in V2 Fields object. Please be aware we do not take that value into account yet. + We just added the field, so it doesn't fail validation + - Update to PEX models 2.2.4 + ## v3.3.1 - 2024-03-19 - Updated: @@ -7,7 +15,6 @@ - Update to latest @sphereon/ssi-types - Move to pnpm from yarn, given our other libraries also use pnpm - ## v3.3.0 - 2024-02-29 - Added: @@ -17,7 +24,7 @@ - Expose jwt_vp_json format - Updated: - Update to PEX models 2.2.2 - + ## v3.2.0 - 2024-02-05 - Added: diff --git a/lib/validation/core/presentationDefinitionSchema.ts b/lib/validation/core/presentationDefinitionSchema.ts index 1ccb4646..dec13c4c 100644 --- a/lib/validation/core/presentationDefinitionSchema.ts +++ b/lib/validation/core/presentationDefinitionSchema.ts @@ -680,6 +680,7 @@ export class PresentationDefinitionSchema { }, purpose: { type: 'string' }, intent_to_retain: { type: 'boolean' }, + optional: { type: 'boolean' }, filter: { $ref: 'http://json-schema.org/schema#' }, }, required: ['path'], @@ -694,6 +695,7 @@ export class PresentationDefinitionSchema { }, purpose: { type: 'string' }, intent_to_retain: { type: 'boolean' }, + optional: { type: 'boolean' }, filter: { $ref: 'http://json-schema.org/schema#' }, predicate: { type: 'string', diff --git a/package.json b/package.json index 2486ddf4..767b0018 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@sd-jwt/decode": "^0.6.1", "@sd-jwt/present": "^0.6.1", "@sd-jwt/types": "^0.6.1", - "@sphereon/pex-models": "^2.2.2", + "@sphereon/pex-models": "^2.2.4", "@sphereon/ssi-types": "0.22.0", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58536e03..88f5ee0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,11 +18,11 @@ dependencies: specifier: ^0.6.1 version: 0.6.1 '@sphereon/pex-models': - specifier: ^2.2.2 - version: 2.2.2 + specifier: ^2.2.4 + version: 2.2.4 '@sphereon/ssi-types': - specifier: 0.19.0 - version: 0.19.0 + specifier: 0.22.0 + version: 0.22.0 ajv: specifier: ^8.12.0 version: 8.12.0 @@ -823,13 +823,6 @@ packages: dev: true optional: true - /@sd-jwt/decode@0.2.1: - resolution: {integrity: sha512-rs55WB3llrMObxN8jeMl06km/h0WivO9jSWNubO9JUIdlfrVhssU38xoXakvQeSDjAJkUUhfZcvmC2vNo1X6Wg==} - dependencies: - '@sd-jwt/types': 0.2.1 - '@sd-jwt/utils': 0.2.1 - dev: false - /@sd-jwt/decode@0.6.1: resolution: {integrity: sha512-QgTIoYd5zyKKLgXB4xEYJTrvumVwtsj5Dog0v0L9UH9ZvHekDaeexS247X7A4iSdzTvmZzUpGskgABOa4D8NmQ==} engines: {node: '>=16'} @@ -847,22 +840,11 @@ packages: '@sd-jwt/utils': 0.6.1 dev: false - /@sd-jwt/types@0.2.1: - resolution: {integrity: sha512-nbNik/cq6UIMsN144FcgPZQzaqIsjEEj307j3ZSFORkQBR4Tsmcj54aswTuNh0Z0z/4aSbfw14vOKBZvRWyVLQ==} - dev: false - /@sd-jwt/types@0.6.1: resolution: {integrity: sha512-LKpABZJGT77jNhOLvAHIkNNmGqXzyfwBT+6r+DN9zNzMx1CzuNR0qXk1GMUbast9iCfPkGbnEpUv/jHTBvlIvg==} engines: {node: '>=16'} dev: false - /@sd-jwt/utils@0.2.1: - resolution: {integrity: sha512-9eRrge44dhE3fenawR/RZGxP5iuW9DtgdOVANu/JK5PEl80r0fDsMwm/gDjuv8OgLDCmQ6uSaVte1lYaTG71bQ==} - dependencies: - '@sd-jwt/types': 0.2.1 - buffer: 6.0.3 - dev: false - /@sd-jwt/utils@0.6.1: resolution: {integrity: sha512-1NHZ//+GecGQJb+gSdDicnrHG0DvACUk9jTnXA5yLZhlRjgkjyfJLNsCZesYeCyVp/SiyvIC9B+JwoY4kI0TwQ==} engines: {node: '>=16'} @@ -887,14 +869,14 @@ packages: '@sinonjs/commons': 3.0.1 dev: true - /@sphereon/pex-models@2.2.2: - resolution: {integrity: sha512-CZIsBoaV5rMZEWYBsmH+RxsdoxpXf5FSDwDz0GB0qOf5WFk1BGUnzpZzi5yJ+2L151mhPk97dlRc9Wb01Awr4Q==} + /@sphereon/pex-models@2.2.4: + resolution: {integrity: sha512-pGlp+wplneE1+Lk3U48/2htYKTbONMeG5/x7vhO6AnPUOsnOXeJdftPrBYWVSzz/JH5GJptAc6+pAyYE1zMu4Q==} dev: false - /@sphereon/ssi-types@0.19.0: - resolution: {integrity: sha512-C4NW4a9rhnEApkQvMYQx3GFboyZDwS0C0Ec6vVRuhFp7AZU4EBMBZsfP3wXUjoBHBdTF4ru/SdriCs7XvN5wIg==} + /@sphereon/ssi-types@0.22.0: + resolution: {integrity: sha512-YPJAZlKmzNALXK8ohP3ETxj1oVzL4+M9ljj3fD5xrbacvYax1JPCVKc8BWSubGcQckKHPbgbpcS7LYEeghyT9Q==} dependencies: - '@sd-jwt/decode': 0.2.1 + '@sd-jwt/decode': 0.6.1 jwt-decode: 3.1.2 dev: false @@ -1443,10 +1425,6 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - dev: false - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1495,13 +1473,6 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /buffer@6.0.3: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: false - /bundle-name@4.1.0: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} @@ -2593,6 +2564,7 @@ packages: /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: true /ignore-walk@3.0.4: resolution: {integrity: sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==}