From 34ad82732d5bb411903c29f385e694d58c72d958 Mon Sep 17 00:00:00 2001 From: DaevMithran <61043607+DaevMithran@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:48:21 +0530 Subject: [PATCH] feat: Add credential-status check API [DEV-2940] (#293) * feat: Add credential-status check api * build: Bump did-provider-cheqd * Update package-lock.json --------- Co-authored-by: Ankur Banerjee --- package-lock.json | 454 +-- src/app.ts | 7 +- src/controllers/revocation.ts | 34 +- src/services/identity/IIdentity.ts | 7 +- src/services/identity/agent.ts | 12 + src/services/identity/local.ts | 8 +- src/services/identity/postgres.ts | 9 +- src/static/swagger.json | 4660 ++++++++++++++-------------- src/types/types.ts | 7 +- 9 files changed, 2735 insertions(+), 2463 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f365b89..06754293 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cheqd/credential-service", - "version": "2.4.0-develop.8", + "version": "2.4.0-develop.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cheqd/credential-service", - "version": "2.4.0-develop.8", + "version": "2.4.0-develop.9", "license": "Apache-2.0", "dependencies": { "@cheqd/did-provider-cheqd": "^3.6.0", @@ -7219,21 +7219,21 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@react-native-community/cli": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-11.3.3.tgz", - "integrity": "sha512-+XwD9IEtaff0q8hyWTQL4xVc7V4P8B7zD0zpcEV8FVV+qUfIFMbNpaYNJFlNOFYRzZmo0/hXsa66S/Im5perlQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-11.3.5.tgz", + "integrity": "sha512-wMXgKEWe6uesw7vyXKKjx5EDRog0QdXHxdgRguG14AjQRao1+4gXEWq2yyExOTi/GDY6dfJBUGTCwGQxhnk/Lg==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-clean": "11.3.3", - "@react-native-community/cli-config": "11.3.3", - "@react-native-community/cli-debugger-ui": "11.3.3", - "@react-native-community/cli-doctor": "11.3.3", - "@react-native-community/cli-hermes": "11.3.3", - "@react-native-community/cli-plugin-metro": "11.3.3", - "@react-native-community/cli-server-api": "11.3.3", - "@react-native-community/cli-tools": "11.3.3", - "@react-native-community/cli-types": "11.3.3", + "@react-native-community/cli-clean": "11.3.5", + "@react-native-community/cli-config": "11.3.5", + "@react-native-community/cli-debugger-ui": "11.3.5", + "@react-native-community/cli-doctor": "11.3.5", + "@react-native-community/cli-hermes": "11.3.5", + "@react-native-community/cli-plugin-metro": "11.3.5", + "@react-native-community/cli-server-api": "11.3.5", + "@react-native-community/cli-tools": "11.3.5", + "@react-native-community/cli-types": "11.3.5", "chalk": "^4.1.2", "commander": "^9.4.1", "execa": "^5.0.0", @@ -7251,26 +7251,26 @@ } }, "node_modules/@react-native-community/cli-clean": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-11.3.3.tgz", - "integrity": "sha512-5csu0Z2wNkLRZs4AxA+5UVtOdyGqdjZ9DEPccePlkN9IXEHTia2GdDuWZVVnlC50Ab3eTaGDKvFzy9QONHQusw==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-11.3.5.tgz", + "integrity": "sha512-1+7BU962wKkIkHRp/uW3jYbQKKGtU7L+R3g59D8K6uLccuxJYUBJv18753ojMa6SD3SAq5Xh31bAre+YwVcOTA==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "execa": "^5.0.0", "prompts": "^2.4.0" } }, "node_modules/@react-native-community/cli-config": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-11.3.3.tgz", - "integrity": "sha512-j87RHJlybNHD1mYSkHnWA4qLkEO6qVn0+sREZGdQ6gVmOzxvLzvEB+YMoNEEqFGmPiyt3WTMLgi7jUr6WVoKuQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-11.3.5.tgz", + "integrity": "sha512-fMblIsHlUleKfGsgWyjFJYfx1SqrsnhS/QXfA8w7iT6GrNOOjBp5UWx8+xlMDFcmOb9e42g1ExFDKl3n8FWkxQ==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "cosmiconfig": "^5.1.0", "deepmerge": "^4.3.0", @@ -7279,9 +7279,9 @@ } }, "node_modules/@react-native-community/cli-debugger-ui": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-11.3.3.tgz", - "integrity": "sha512-iVKcwyK2iKlq/qVtSbhk5fGsrOamAx7j50QhDMrZ6NmYZq+k75k253+YTzXoxWdPPZhsdhmILuBJgf8orIYCPQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-11.3.5.tgz", + "integrity": "sha512-o5JVCKEpPUXMX4r3p1cYjiy3FgdOEkezZcQ6owWEae2dYvV19lLYyJwnocm9Y7aG9PvpgI3PIMVh3KZbhS21eA==", "optional": true, "peer": true, "dependencies": { @@ -7289,16 +7289,16 @@ } }, "node_modules/@react-native-community/cli-doctor": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-11.3.3.tgz", - "integrity": "sha512-11MlCYZkZ602lmoxZUM6FZYjqFgyYci0X0QoBgBHi+3hqmrlA9JkYR/6OpPo34ASVObhE4DQ7eZ1+EQnVJHXsA==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-11.3.5.tgz", + "integrity": "sha512-+4BuFHjoV4FFjX5y60l0s6nS0agidb1izTVwsFixeFKW73LUkOLu+Ae5HI94RAFEPE4ePEVNgYX3FynIau6K0g==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-config": "11.3.3", - "@react-native-community/cli-platform-android": "11.3.3", - "@react-native-community/cli-platform-ios": "11.3.3", - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-config": "11.3.5", + "@react-native-community/cli-platform-android": "11.3.5", + "@react-native-community/cli-platform-ios": "11.3.5", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "command-exists": "^1.2.8", "envinfo": "^7.7.2", @@ -7502,27 +7502,27 @@ "peer": true }, "node_modules/@react-native-community/cli-hermes": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-11.3.3.tgz", - "integrity": "sha512-IoBLspPg4EwKwYj+5Ki4xrGUz7vVeE9soULCXJij2IKB68U63WmjG42+ng96+ryJDaQqERqF7NGll1jqnenJYQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-11.3.5.tgz", + "integrity": "sha512-+3m34hiaJpFel8BlJE7kJOaPzWR/8U8APZG2LXojbAdBAg99EGmQcwXIgsSVJFvH8h/nezf4DHbsPKigIe33zA==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-platform-android": "11.3.3", - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-platform-android": "11.3.5", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "hermes-profile-transformer": "^0.0.6", "ip": "^1.1.5" } }, "node_modules/@react-native-community/cli-platform-android": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-11.3.3.tgz", - "integrity": "sha512-hjkPTJXKw2PZNKdeZZ1I4Mv2gRbPOfZmpgRVXtDwEP4cXZUGTDP54lBhFnC+8KxiKJBWJ/m4wYyC3ZqX87M2jg==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-11.3.5.tgz", + "integrity": "sha512-s4Lj7FKxJ/BofGi/ifjPfrA9MjFwIgYpHnHBSlqtbsvPoSYzmVCU2qlWM8fb3AmkXIwyYt4A6MEr3MmNT2UoBg==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "execa": "^5.0.0", "glob": "^7.1.3", @@ -7530,13 +7530,13 @@ } }, "node_modules/@react-native-community/cli-platform-ios": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-11.3.3.tgz", - "integrity": "sha512-mFdZjOaPCQy3y4DoMdA5l5/zVXtvsi8pbJFTV7ms7avNShuqqvue/Fm4wmiccZd0Zfi5p9TOP3Bh9Aw/jC+UAQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-11.3.5.tgz", + "integrity": "sha512-ytJC/YCFD7P+KuQHOT5Jzh1ho2XbJEjq71yHa1gJP2PG/Q/uB4h1x2XpxDqv5iXU6E250yjvKMmkReKTW4CTig==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "execa": "^5.0.0", "fast-xml-parser": "^4.0.12", @@ -7678,34 +7678,34 @@ } }, "node_modules/@react-native-community/cli-plugin-metro": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-11.3.3.tgz", - "integrity": "sha512-jbutvKqjIUTIuSK6mGmVt+x/MygLAIG6VNIwbywFtY+P4CCxUxo8o8h3O2cPRB2xeg9qikksm3Wys7fME4Ly+A==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-11.3.5.tgz", + "integrity": "sha512-r9AekfeLKdblB7LfWB71IrNy1XM03WrByQlUQajUOZAP2NmUUBLl9pMZscPjJeOSgLpHB9ixEFTIOhTabri/qg==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-server-api": "11.3.3", - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-server-api": "11.3.5", + "@react-native-community/cli-tools": "11.3.5", "chalk": "^4.1.2", "execa": "^5.0.0", - "metro": "0.76.5", - "metro-config": "0.76.5", - "metro-core": "0.76.5", - "metro-react-native-babel-transformer": "0.76.5", - "metro-resolver": "0.76.5", - "metro-runtime": "0.76.5", + "metro": "0.76.7", + "metro-config": "0.76.7", + "metro-core": "0.76.7", + "metro-react-native-babel-transformer": "0.76.7", + "metro-resolver": "0.76.7", + "metro-runtime": "0.76.7", "readline": "^1.3.0" } }, "node_modules/@react-native-community/cli-server-api": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-11.3.3.tgz", - "integrity": "sha512-3ja7WZzXMCeGTaeWLzKxAoueqLjsuo0YURcAjqf044rkY5F1Xk5yIaTN8fb66Lnl2eB3DwuatqEB4dYl34/GZw==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-11.3.5.tgz", + "integrity": "sha512-PM/jF13uD1eAKuC84lntNuM5ZvJAtyb+H896P1dBIXa9boPLa3KejfUvNVoyOUJ5s8Ht25JKbc3yieV2+GMBDA==", "optional": true, "peer": true, "dependencies": { - "@react-native-community/cli-debugger-ui": "11.3.3", - "@react-native-community/cli-tools": "11.3.3", + "@react-native-community/cli-debugger-ui": "11.3.5", + "@react-native-community/cli-tools": "11.3.5", "compression": "^1.7.1", "connect": "^3.6.5", "errorhandler": "^1.5.1", @@ -7716,9 +7716,9 @@ } }, "node_modules/@react-native-community/cli-tools": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-11.3.3.tgz", - "integrity": "sha512-rRFSOAVVwI9R9PyPMff5WqmHbgJYrzGHFH1PA+tFvuiSmWlAf51bzkZIPehTBAQON03a6d5epNsGlBKMLA/BKw==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-11.3.5.tgz", + "integrity": "sha512-zDklE1+ah/zL4BLxut5XbzqCj9KTHzbYBKX7//cXw2/0TpkNCaY9c+iKx//gZ5m7U1OKbb86Fm2b0AKtKVRf6Q==", "optional": true, "peer": true, "dependencies": { @@ -7913,9 +7913,9 @@ } }, "node_modules/@react-native-community/cli-types": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-11.3.3.tgz", - "integrity": "sha512-/u7N93ZUsKAGv3WSGAjKhpK2uCPBkyaw/SuScjHAuL9ifPjvwDhi71K5NbCcYl3ZYh5K39EF3Hm664Jfk9c0MQ==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-11.3.5.tgz", + "integrity": "sha512-pf0kdWMEfPSV/+8rcViDCFzbLMtWIHMZ8ay7hKwqaoWegsJ0oprSF2tSTH+LSC/7X1Beb9ssIvHj1m5C4es5Xg==", "optional": true, "peer": true, "dependencies": { @@ -17252,20 +17252,20 @@ } }, "node_modules/hermes-estree": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.8.0.tgz", - "integrity": "sha512-W6JDAOLZ5pMPMjEiQGLCXSSV7pIBEgRR5zGkxgmzGSXHOxqV5dC/M1Zevqpbm9TZDE5tu358qZf8Vkzmsc+u7Q==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.12.0.tgz", + "integrity": "sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw==", "optional": true, "peer": true }, "node_modules/hermes-parser": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.8.0.tgz", - "integrity": "sha512-yZKalg1fTYG5eOiToLUaw69rQfZq/fi+/NtEXRU7N87K/XobNRhRWorh80oSge2lWUiZfTgUvRJH+XgZWrhoqA==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.12.0.tgz", + "integrity": "sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw==", "optional": true, "peer": true, "dependencies": { - "hermes-estree": "0.8.0" + "hermes-estree": "0.12.0" } }, "node_modules/hermes-profile-transformer": { @@ -21361,9 +21361,9 @@ } }, "node_modules/metro": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro/-/metro-0.76.5.tgz", - "integrity": "sha512-aEQiqNFibfx4ajUXm7Xatsv43r/UQ0xE53T3XqgZBzsxhF235tf1cl8t0giawi0RbLtDS+Fu4kg2bVBKDYFy7A==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.76.7.tgz", + "integrity": "sha512-67ZGwDeumEPnrHI+pEDSKH2cx+C81Gx8Mn5qOtmGUPm/Up9Y4I1H2dJZ5n17MWzejNo0XAvPh0QL0CrlJEODVQ==", "optional": true, "peer": true, "dependencies": { @@ -21383,28 +21383,28 @@ "denodeify": "^1.2.1", "error-stack-parser": "^2.0.6", "graceful-fs": "^4.2.4", - "hermes-parser": "0.8.0", + "hermes-parser": "0.12.0", "image-size": "^1.0.2", "invariant": "^2.2.4", "jest-worker": "^27.2.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", - "metro-babel-transformer": "0.76.5", - "metro-cache": "0.76.5", - "metro-cache-key": "0.76.5", - "metro-config": "0.76.5", - "metro-core": "0.76.5", - "metro-file-map": "0.76.5", - "metro-inspector-proxy": "0.76.5", - "metro-minify-terser": "0.76.5", - "metro-minify-uglify": "0.76.5", - "metro-react-native-babel-preset": "0.76.5", - "metro-resolver": "0.76.5", - "metro-runtime": "0.76.5", - "metro-source-map": "0.76.5", - "metro-symbolicate": "0.76.5", - "metro-transform-plugins": "0.76.5", - "metro-transform-worker": "0.76.5", + "metro-babel-transformer": "0.76.7", + "metro-cache": "0.76.7", + "metro-cache-key": "0.76.7", + "metro-config": "0.76.7", + "metro-core": "0.76.7", + "metro-file-map": "0.76.7", + "metro-inspector-proxy": "0.76.7", + "metro-minify-terser": "0.76.7", + "metro-minify-uglify": "0.76.7", + "metro-react-native-babel-preset": "0.76.7", + "metro-resolver": "0.76.7", + "metro-runtime": "0.76.7", + "metro-source-map": "0.76.7", + "metro-symbolicate": "0.76.7", + "metro-transform-plugins": "0.76.7", + "metro-transform-worker": "0.76.7", "mime-types": "^2.1.27", "node-fetch": "^2.2.0", "nullthrows": "^1.1.1", @@ -21424,15 +21424,14 @@ } }, "node_modules/metro-babel-transformer": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.76.5.tgz", - "integrity": "sha512-KmsMXY6VHjPLRQLwTITjLo//7ih8Ts39HPF2zODkaYav/ZLNq0QP7eGuW54dvk/sZiL9le1kaBwTN4BWQI1VZQ==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.76.7.tgz", + "integrity": "sha512-bgr2OFn0J4r0qoZcHrwEvccF7g9k3wdgTOgk6gmGHrtlZ1Jn3oCpklW/DfZ9PzHfjY2mQammKTc19g/EFGyOJw==", "optional": true, "peer": true, "dependencies": { "@babel/core": "^7.20.0", - "hermes-parser": "0.8.0", - "metro-source-map": "0.76.5", + "hermes-parser": "0.12.0", "nullthrows": "^1.1.1" }, "engines": { @@ -21440,13 +21439,13 @@ } }, "node_modules/metro-cache": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.76.5.tgz", - "integrity": "sha512-8XalhoMNWDK6bi41oqxIpecTYRt4WsmtoHdqshgJIYshJ6qov0NuDw0pOfnS8rgMNHxPpuWyXc7NyKERqVRzaw==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.76.7.tgz", + "integrity": "sha512-nWBMztrs5RuSxZRI7hgFgob5PhYDmxICh9FF8anm9/ito0u0vpPvRxt7sRu8fyeD2AHdXqE7kX32rWY0LiXgeg==", "optional": true, "peer": true, "dependencies": { - "metro-core": "0.76.5", + "metro-core": "0.76.7", "rimraf": "^3.0.2" }, "engines": { @@ -21454,9 +21453,9 @@ } }, "node_modules/metro-cache-key": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.76.5.tgz", - "integrity": "sha512-QERX6ejYMt4BPr0ZMf7adnrOivmFSUbCim9FlU6cAeWUib+pV5P/Ph3KicWnOzJpbQz93+tHHG7vcsP6OrvLMw==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.76.7.tgz", + "integrity": "sha512-0pecoIzwsD/Whn/Qfa+SDMX2YyasV0ndbcgUFx7w1Ct2sLHClujdhQ4ik6mvQmsaOcnGkIyN0zcceMDjC2+BFQ==", "optional": true, "peer": true, "engines": { @@ -21464,41 +21463,42 @@ } }, "node_modules/metro-config": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.5.tgz", - "integrity": "sha512-SCMVIDOtm8s3H62E9z2IcY4Q9GVMqDurbiJS3PHrWgTZjwZFaL59lrW4W6DvzvFZHa9bbxKric5TFtwvVuyOCg==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.7.tgz", + "integrity": "sha512-CFDyNb9bqxZemiChC/gNdXZ7OQkIwmXzkrEXivcXGbgzlt/b2juCv555GWJHyZSlorwnwJfY3uzAFu4A9iRVfg==", "optional": true, "peer": true, "dependencies": { + "connect": "^3.6.5", "cosmiconfig": "^5.0.5", "jest-validate": "^29.2.1", - "metro": "0.76.5", - "metro-cache": "0.76.5", - "metro-core": "0.76.5", - "metro-runtime": "0.76.5" + "metro": "0.76.7", + "metro-cache": "0.76.7", + "metro-core": "0.76.7", + "metro-runtime": "0.76.7" }, "engines": { "node": ">=16" } }, "node_modules/metro-core": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.76.5.tgz", - "integrity": "sha512-yJvIe8a3sAG92U7+E7Bw6m4lae9RB180fp9iQZFBqY437Ilv4nE6PR8EWB6d8c4yt9fXIL1Hc+KyQv7OPFx/rQ==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.76.7.tgz", + "integrity": "sha512-0b8KfrwPmwCMW+1V7ZQPkTy2tsEKZjYG9Pu1PTsu463Z9fxX7WaR0fcHFshv+J1CnQSUTwIGGjbNvj1teKe+pw==", "optional": true, "peer": true, "dependencies": { "lodash.throttle": "^4.1.1", - "metro-resolver": "0.76.5" + "metro-resolver": "0.76.7" }, "engines": { "node": ">=16" } }, "node_modules/metro-file-map": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.76.5.tgz", - "integrity": "sha512-9VS7zsec7BpTb+0v1DObOXso6XU/7oVBObQWp0EWBQpFcU1iF1lit2nnLQh2AyGCnSr8JVnuUe8gXhNH6xtPMg==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.76.7.tgz", + "integrity": "sha512-s+zEkTcJ4mOJTgEE2ht4jIo1DZfeWreQR3tpT3gDV/Y/0UQ8aJBTv62dE775z0GLsWZApiblAYZsj7ZE8P06nw==", "optional": true, "peer": true, "dependencies": { @@ -21626,9 +21626,9 @@ } }, "node_modules/metro-inspector-proxy": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-inspector-proxy/-/metro-inspector-proxy-0.76.5.tgz", - "integrity": "sha512-leqwei1qNMKOEbhqlQ37K+7OIp1JRgvS5qERO+J0ZTg7ZeJTaBHSFU7FnCeRHB9Tu7/FSfypY2PxjydZDwvUEQ==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-inspector-proxy/-/metro-inspector-proxy-0.76.7.tgz", + "integrity": "sha512-rNZ/6edTl/1qUekAhAbaFjczMphM50/UjtxiKulo6vqvgn/Mjd9hVqDvVYfAMZXqPvlusD88n38UjVYPkruLSg==", "optional": true, "peer": true, "dependencies": { @@ -21707,9 +21707,9 @@ } }, "node_modules/metro-minify-terser": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.76.5.tgz", - "integrity": "sha512-zizTXqlHcG7PArB5hfz1Djz/oCaOaTSXTZDNp8Y9K2FmmfLU3dU2eoDbNNiCnm5QdDtFIndLMXdqqe6omTfp4g==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.76.7.tgz", + "integrity": "sha512-FQiZGhIxCzhDwK4LxyPMLlq0Tsmla10X7BfNGlYFK0A5IsaVKNJbETyTzhpIwc+YFRT4GkFFwgo0V2N5vxO5HA==", "optional": true, "peer": true, "dependencies": { @@ -21720,9 +21720,9 @@ } }, "node_modules/metro-minify-uglify": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-minify-uglify/-/metro-minify-uglify-0.76.5.tgz", - "integrity": "sha512-JZNO5eK8r625/cheWSl+y7n0RlHLt03iSMgXPAxirH8BiFqPzs7h+c57r4AvSs793VXcF7L3sI1sAOj+nRqTeg==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-minify-uglify/-/metro-minify-uglify-0.76.7.tgz", + "integrity": "sha512-FuXIU3j2uNcSvQtPrAJjYWHruPiQ+EpE++J9Z+VznQKEHcIxMMoQZAfIF2IpZSrZYfLOjVFyGMvj41jQMxV1Vw==", "optional": true, "peer": true, "dependencies": { @@ -21787,18 +21787,16 @@ } }, "node_modules/metro-react-native-babel-transformer": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.76.5.tgz", - "integrity": "sha512-7m2u7jQ1I2mwGm48Vrki5cNNSv4d2HegHMGmE5G2AAa6Pr2O3ajaX2yNoAKF8TCLO38/8pa9fZd0VWAlO/YMcA==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.76.7.tgz", + "integrity": "sha512-W6lW3J7y/05ph3c2p3KKJNhH0IdyxdOCbQ5it7aM2MAl0SM4wgKjaV6EYv9b3rHklpV6K3qMH37UKVcjMooWiA==", "optional": true, "peer": true, "dependencies": { "@babel/core": "^7.20.0", "babel-preset-fbjs": "^3.4.0", - "hermes-parser": "0.8.0", - "metro-babel-transformer": "0.76.5", - "metro-react-native-babel-preset": "0.76.5", - "metro-source-map": "0.76.5", + "hermes-parser": "0.12.0", + "metro-react-native-babel-preset": "0.76.7", "nullthrows": "^1.1.1" }, "engines": { @@ -21808,10 +21806,64 @@ "@babel/core": "*" } }, + "node_modules/metro-react-native-babel-transformer/node_modules/metro-react-native-babel-preset": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.76.7.tgz", + "integrity": "sha512-R25wq+VOSorAK3hc07NW0SmN8z9S/IR0Us0oGAsBcMZnsgkbOxu77Mduqf+f4is/wnWHc5+9bfiqdLnaMngiVw==", + "optional": true, + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/plugin-proposal-async-generator-functions": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.18.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.20.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.18.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.20.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.20.0", + "@babel/plugin-transform-flow-strip-types": "^7.20.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-sticky-regex": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.5.0", + "@babel/plugin-transform-unicode-regex": "^7.0.0", + "@babel/template": "^7.0.0", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.4.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, "node_modules/metro-resolver": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.76.5.tgz", - "integrity": "sha512-QNsbDdf0xL1HefP6fhh1g3umqiX1qWEuCiBaTFroYRqM7u7RATt8mCu4n/FwSYhATuUUujHTIb2EduuQPbSGRQ==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.76.7.tgz", + "integrity": "sha512-pC0Wgq29HHIHrwz23xxiNgylhI8Rq1V01kQaJ9Kz11zWrIdlrH0ZdnJ7GC6qA0ErROG+cXmJ0rJb8/SW1Zp2IA==", "optional": true, "peer": true, "engines": { @@ -21819,9 +21871,9 @@ } }, "node_modules/metro-runtime": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.76.5.tgz", - "integrity": "sha512-1JAf9/v/NDHLhoTfiJ0n25G6dRkX7mjTkaMJ6UUXIyfIuSucoK5yAuOBx8OveNIekoLRjmyvSmyN5ojEeRmpvQ==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.76.7.tgz", + "integrity": "sha512-MuWHubQHymUWBpZLwuKZQgA/qbb35WnDAKPo83rk7JRLIFPvzXSvFaC18voPuzJBt1V98lKQIonh6MiC9gd8Ug==", "optional": true, "peer": true, "dependencies": { @@ -21833,18 +21885,18 @@ } }, "node_modules/metro-source-map": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.76.5.tgz", - "integrity": "sha512-1EhYPcoftONlvnOzgos7daE8hsJKOgSN3nD3Xf/yaY1F0aLeGeuWfpiNLLeFDNyUhfObHSuNxNhDQF/x1GFEbw==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.76.7.tgz", + "integrity": "sha512-Prhx7PeRV1LuogT0Kn5VjCuFu9fVD68eefntdWabrksmNY6mXK8pRqzvNJOhTojh6nek+RxBzZeD6MIOOyXS6w==", "optional": true, "peer": true, "dependencies": { "@babel/traverse": "^7.20.0", "@babel/types": "^7.20.0", "invariant": "^2.2.4", - "metro-symbolicate": "0.76.5", + "metro-symbolicate": "0.76.7", "nullthrows": "^1.1.1", - "ob1": "0.76.5", + "ob1": "0.76.7", "source-map": "^0.5.6", "vlq": "^1.0.0" }, @@ -21863,14 +21915,14 @@ } }, "node_modules/metro-symbolicate": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.76.5.tgz", - "integrity": "sha512-7iftzh6G6HO4UDBmjsi2Yu4d6IkApv6Kg+jmBvkTjCXr8HwnKKum89gMg/FRMix+Rhhut0dnMpz6mAbtKTU9JQ==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.76.7.tgz", + "integrity": "sha512-p0zWEME5qLSL1bJb93iq+zt5fz3sfVn9xFYzca1TJIpY5MommEaS64Va87lp56O0sfEIvh4307Oaf/ZzRjuLiQ==", "optional": true, "peer": true, "dependencies": { "invariant": "^2.2.4", - "metro-source-map": "0.76.5", + "metro-source-map": "0.76.7", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "through2": "^2.0.1", @@ -21894,9 +21946,9 @@ } }, "node_modules/metro-transform-plugins": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.76.5.tgz", - "integrity": "sha512-7pJ24aRuvzdQYpX/eOyodr4fnwVJP5ArNLBE1d0DOU9sQxsGplOORDTGAqw2L01+UgaSJiiwEoFMw7Z91HAS+Q==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.76.7.tgz", + "integrity": "sha512-iSmnjVApbdivjuzb88Orb0JHvcEt5veVyFAzxiS5h0QB+zV79w6JCSqZlHCrbNOkOKBED//LqtKbFVakxllnNg==", "optional": true, "peer": true, "dependencies": { @@ -21911,9 +21963,9 @@ } }, "node_modules/metro-transform-worker": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.76.5.tgz", - "integrity": "sha512-xN6Kb06o9u5A7M1bbl7oPfQFmt4Kmi3CMXp5j9OcK37AFc+u6YXH8x/6e9b3Cq50rlBYuCXDOOYAWI5/tYNt2w==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.76.7.tgz", + "integrity": "sha512-cGvELqFMVk9XTC15CMVzrCzcO6sO1lURfcbgjuuPdzaWuD11eEyocvkTX0DPiRjsvgAmicz4XYxVzgYl3MykDw==", "optional": true, "peer": true, "dependencies": { @@ -21922,12 +21974,12 @@ "@babel/parser": "^7.20.0", "@babel/types": "^7.20.0", "babel-preset-fbjs": "^3.4.0", - "metro": "0.76.5", - "metro-babel-transformer": "0.76.5", - "metro-cache": "0.76.5", - "metro-cache-key": "0.76.5", - "metro-source-map": "0.76.5", - "metro-transform-plugins": "0.76.5", + "metro": "0.76.7", + "metro-babel-transformer": "0.76.7", + "metro-cache": "0.76.7", + "metro-cache-key": "0.76.7", + "metro-source-map": "0.76.7", + "metro-transform-plugins": "0.76.7", "nullthrows": "^1.1.1" }, "engines": { @@ -21981,6 +22033,60 @@ "node": ">= 10.13.0" } }, + "node_modules/metro/node_modules/metro-react-native-babel-preset": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.76.7.tgz", + "integrity": "sha512-R25wq+VOSorAK3hc07NW0SmN8z9S/IR0Us0oGAsBcMZnsgkbOxu77Mduqf+f4is/wnWHc5+9bfiqdLnaMngiVw==", + "optional": true, + "peer": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/plugin-proposal-async-generator-functions": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.18.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.20.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.18.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.20.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.20.0", + "@babel/plugin-transform-flow-strip-types": "^7.20.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-sticky-regex": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.5.0", + "@babel/plugin-transform-unicode-regex": "^7.0.0", + "@babel/template": "^7.0.0", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.4.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, "node_modules/metro/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -26027,9 +26133,9 @@ "peer": true }, "node_modules/ob1": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.76.5.tgz", - "integrity": "sha512-HoxZXMXNuY/eIXGoX7gx1C4O3eB4kJJMola6KoFaMm7PGGg39+AnhbgMASYVmSvP2lwU3545NyiR63g8J9PW3w==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.76.7.tgz", + "integrity": "sha512-BQdRtxxoUNfSoZxqeBGOyuT9nEYSn18xZHwGMb0mMVpn2NBcYbnyKY4BK2LIHRgw33CBGlUmE+KMaNvyTpLLtQ==", "optional": true, "peer": true, "engines": { @@ -28146,16 +28252,16 @@ "peer": true }, "node_modules/react-native": { - "version": "0.72.1", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.1.tgz", - "integrity": "sha512-O9cIVD++kt2XQl0XLCUGUgwSKr8xp+yo0ho5QK6KYWJrCFnnvQLTKL0+HD0rZUcuqFfGknHQJh3h0moQO2EMDg==", + "version": "0.72.2", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.2.tgz", + "integrity": "sha512-f/pQ9CE4ybXT/Pl3WcnLx/fgrk2MzEDJLIHmcuus6MpNue/R8SroCWdlunx4upXV9uGaUkfxd/wpsws8qqyHHw==", "optional": true, "peer": true, "dependencies": { "@jest/create-cache-key-function": "^29.2.1", - "@react-native-community/cli": "11.3.3", - "@react-native-community/cli-platform-android": "11.3.3", - "@react-native-community/cli-platform-ios": "11.3.3", + "@react-native-community/cli": "11.3.5", + "@react-native-community/cli-platform-android": "11.3.5", + "@react-native-community/cli-platform-ios": "11.3.5", "@react-native/assets-registry": "^0.72.0", "@react-native/codegen": "^0.72.6", "@react-native/gradle-plugin": "^0.72.11", @@ -28172,8 +28278,8 @@ "jest-environment-node": "^29.2.1", "jsc-android": "^250231.0.0", "memoize-one": "^5.0.0", - "metro-runtime": "0.76.5", - "metro-source-map": "0.76.5", + "metro-runtime": "0.76.7", + "metro-source-map": "0.76.7", "mkdirp": "^0.5.1", "nullthrows": "^1.1.1", "pretty-format": "^26.5.2", diff --git a/src/app.ts b/src/app.ts index 7db1db5e..d0ffeee0 100644 --- a/src/app.ts +++ b/src/app.ts @@ -99,10 +99,11 @@ class App { app.post(`/presentation/verify`, CredentialController.presentationValidator, new CredentialController().verifyPresentation) //revocation - app.post('/credential-status/create', RevocationController.queryValidator, RevocationController.statusListValidator, new RevocationController().createStatusList) + app.post('/credential-status/create', RevocationController.commonValidator, RevocationController.statusListValidator, new RevocationController().createStatusList) app.post('/credential-status/update', RevocationController.updateValidator, new RevocationController().updateStatusList) - app.post('/credential-status/publish', RevocationController.queryValidator, new RevocationController().createStatusList) - app.get('/credential-status/search', RevocationController.queryValidator, new RevocationController().fetchStatusList) + app.post('/credential-status/publish', RevocationController.commonValidator, new RevocationController().createStatusList) + app.post('/credential-status/check', RevocationController.commonValidator, RevocationController.checkValidator, new RevocationController().checkStatusList) + app.get('/credential-status/search', RevocationController.commonValidator, new RevocationController().fetchStatusList) // store app.post(`/store`, new StoreController().set) diff --git a/src/controllers/revocation.ts b/src/controllers/revocation.ts index ec23e71d..80cfffaf 100644 --- a/src/controllers/revocation.ts +++ b/src/controllers/revocation.ts @@ -15,7 +15,7 @@ export class RevocationController { check('statusPurpose').optional().isIn(['revocation', 'suspension']).withMessage('invalid statusPurpose') ] - static queryValidator = [ + static commonValidator = [ check('did').isString().withMessage('DID is required') .contains('did:cheqd:').withMessage('Provide a valid cheqd DID'), query('statusPurpose').optional().isString().withMessage('statusPurpose should be a string') @@ -34,6 +34,13 @@ export class RevocationController { query('publish').isBoolean().withMessage('publish should be a boolean value') ] + static checkValidator = [ + check('index').exists().withMessage('Index is required') + .isNumeric().withMessage('Index should be a number'), + check('statusListName').exists().withMessage('StatusListName is required') + .isString().withMessage('Invalid statusListName') + ] + async createStatusList(request: Request, response: Response) { const result = validationResult(request) if (!result.isEmpty()) { @@ -101,7 +108,7 @@ export class RevocationController { } } - async updateStatusList(request: Request, response: Response) { + async updateStatusList(request: Request, response: Response) { const result = validationResult(request) if (!result.isEmpty()) { return response.status(400).json({ error: result.array()[0].msg }) @@ -125,4 +132,27 @@ export class RevocationController { }) } } + + async checkStatusList(request: Request, response: Response) { + const result = validationResult(request) + if (!result.isEmpty()) { + return response.status(400).json({ error: result.array()[0].msg }) + } + + let { did, statusListName, index } = request.body + const statusPurpose = request.query.statusPurpose as 'revocation' | 'suspension' + + try { + let result: any + result = await Identity.instance.checkStatusList2021(did, { statusListIndex: index, statusListName, statusPurpose }, response.locals.customerId) + if (result.error) { + return response.status(400).json(result) + } + return response.status(200).json(result) + } catch (error) { + return response.status(500).json({ + error: `Internal error: ${error}` + }) + } + } } diff --git a/src/services/identity/IIdentity.ts b/src/services/identity/IIdentity.ts index c96b53d1..8e82d22f 100644 --- a/src/services/identity/IIdentity.ts +++ b/src/services/identity/IIdentity.ts @@ -11,8 +11,8 @@ import type { } from '@veramo/core' import type { AbstractPrivateKeyStore } from '@veramo/key-manager' import type { ResourcePayload } from '@cheqd/did-provider-cheqd' -import type { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result, RevocationResult, SuspensionResult, UnsuspensionResult } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' -import type { BroadCastStatusListOptions, CreateStatusListOptions, CredentialRequest, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types' +import type { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result, RevocationResult, StatusCheckResult, SuspensionResult, UnsuspensionResult } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' +import type { BroadCastStatusListOptions, CheckStatusListOptions, CreateStatusListOptions, CredentialRequest, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types' export interface IIdentity { agent?: TAgent @@ -35,7 +35,8 @@ export interface IIdentity { createStatusList2021(did: string, resourceOptions: ResourcePayload, statusOptions: CreateStatusListOptions, agentId: string): Promise updateStatusList2021(did: string, statusOptions: UpdateStatusListOptions, publish?: boolean, agentId?: string): Promise broadcastStatusList2021(did: string, resourceOptions: ResourcePayload, statusOptions: BroadCastStatusListOptions, agentId?: string): Promise + checkStatusList2021(did: string, statusOptions: CheckStatusListOptions, agentId?: string): Promise revokeCredentials(credential: VerifiableCredential | VerifiableCredential[], publish: boolean, agentId?: string): Promise suspendCredentials(credential: VerifiableCredential | VerifiableCredential[], publish: boolean, agentId?: string): Promise - reinstateCredentials(credential: VerifiableCredential | VerifiableCredential[], publish: boolean, agentId?: string): Promise + reinstateCredentials(credential: VerifiableCredential | VerifiableCredential[], publish: boolean, agentId?: string): Promise } diff --git a/src/services/identity/agent.ts b/src/services/identity/agent.ts index 259b2a8b..21bc011e 100644 --- a/src/services/identity/agent.ts +++ b/src/services/identity/agent.ts @@ -29,6 +29,7 @@ import { CheqdNetwork } from '@cheqd/sdk' import { Resolver, ResolverRegistry } from 'did-resolver' import type { ICheqdBroadcastStatusList2021Args, + ICheqdCheckCredentialStatusWithStatusList2021Args, ICheqdCreateStatusList2021Args, ICheqdDeactivateIdentifierArgs, ICheqdRevokeBulkCredentialsWithStatusList2021Args, @@ -38,6 +39,7 @@ import type { } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' import { BroadCastStatusListOptions, + CheckStatusListOptions, cheqdDidRegex, CreateAgentRequest, CreateStatusListOptions, @@ -409,4 +411,14 @@ export class Veramo { }) } } + + async checkStatusList2021(agent: VeramoAgent, did: string, statusOptions: CheckStatusListOptions) { + return await agent.cheqdCheckCredentialStatus({ + statusOptions: { + issuerDid: did, + ...statusOptions, + }, + fetchList: true + } satisfies ICheqdCheckCredentialStatusWithStatusList2021Args) + } } diff --git a/src/services/identity/local.ts b/src/services/identity/local.ts index f21c4dbe..7d07932d 100644 --- a/src/services/identity/local.ts +++ b/src/services/identity/local.ts @@ -9,10 +9,10 @@ import { import { AbstractPrivateKeyStore, MemoryPrivateKeyStore } from '@veramo/key-manager' import { KeyManagementSystem } from '@veramo/kms-local' import { CheqdDIDProvider, ResourcePayload } from '@cheqd/did-provider-cheqd' -import { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' +import { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result, StatusCheckResult } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' import { CheqdNetwork } from '@cheqd/sdk' -import { BroadCastStatusListOptions, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types.js' +import { BroadCastStatusListOptions, CheckStatusListOptions, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types.js' import { Connection } from '../../database/connection/connection.js' import { IIdentity } from './IIdentity.js' import { Veramo } from './agent.js' @@ -166,6 +166,10 @@ export class LocalIdentity implements IIdentity { return await Veramo.instance.broadcastStatusList2021(this.initAgent(), did, resourceOptions, statusOptions) } + async checkStatusList2021(did: string, statusOptions: CheckStatusListOptions): Promise { + return await Veramo.instance.checkStatusList2021(this.initAgent(), did, statusOptions) + } + async revokeCredentials(credentials: VerifiableCredential | VerifiableCredential[], publish: boolean) { return await Veramo.instance.revokeCredentials(this.initAgent(), credentials, publish) } diff --git a/src/services/identity/postgres.ts b/src/services/identity/postgres.ts index 8b3c9ac8..3ad22c53 100644 --- a/src/services/identity/postgres.ts +++ b/src/services/identity/postgres.ts @@ -16,7 +16,7 @@ import { KeyManagementSystem, SecretBox } from '@veramo/kms-local' import { PrivateKeyStore } from '@veramo/data-store' import { CheqdDIDProvider, ResourcePayload } from '@cheqd/did-provider-cheqd' import { CheqdNetwork } from '@cheqd/sdk' -import { BroadCastStatusListOptions, cheqdDidRegex, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types.js' +import { BroadCastStatusListOptions, CheckStatusListOptions, cheqdDidRegex, CreateStatusListOptions, CredentialRequest, DefaultRPCUrl, StatusOptions, UpdateStatusListOptions, VeramoAgent, VerificationOptions } from '../../types/types.js' import { Connection } from '../../database/connection/connection.js' import { CustomerEntity } from '../../database/entities/customer.entity.js' import { IIdentity } from './IIdentity.js' @@ -24,7 +24,7 @@ import { CustomerService } from '../customer.js' import { Veramo } from './agent.js' import * as dotenv from 'dotenv' -import { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd.js' +import { BulkRevocationResult, BulkSuspensionResult, BulkUnsuspensionResult, CreateStatusList2021Result, StatusCheckResult } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd.js' dotenv.config() const { @@ -234,6 +234,11 @@ export class PostgresIdentity implements IIdentity { return await Veramo.instance.updateStatusList2021(agent, did, statusOptions, publish) } + async checkStatusList2021(did: string, statusOptions: CheckStatusListOptions, agentId: string): Promise { + const agent = await this.createAgent(agentId) + return await Veramo.instance.checkStatusList2021(agent, did, statusOptions) + } + async broadcastStatusList2021(did: string, resourceOptions: ResourcePayload, statusOptions: BroadCastStatusListOptions, agentId: string): Promise { const agent = await this.createAgent(agentId) return await Veramo.instance.broadcastStatusList2021(agent, did, resourceOptions, statusOptions) diff --git a/src/static/swagger.json b/src/static/swagger.json index fe331960..cac6d529 100644 --- a/src/static/swagger.json +++ b/src/static/swagger.json @@ -1,2401 +1,2513 @@ { - "openapi": "3.0.0", - "servers": [ - { - "url": "/" + "openapi": "3.0.0", + "servers": [ + { + "url": "/" + } + ], + "info": { + "description": "API service to create and manage DIDs and credentials on cheqd network.", + "version": "2.0.0", + "title": "Credential Service for cheqd network" + }, + "tags": [ + { + "name": "Credential", + "externalDocs": { + "url": "https://github.com/cheqd/credential-service#readme" + } + } + ], + "paths": { + "/key/create": { + "post": { + "tags": [ + "Key" + ], + "summary": "Create a Keypair", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KeyResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } + } } - ], - "info": { - "description": "API service to create and manage DIDs and credentials on cheqd network.", - "version": "2.0.0", - "title": "Credential Service for cheqd network" + } }, - "tags": [ - { - "name": "Credential", - "externalDocs": { - "url": "https://github.com/cheqd/credential-service#readme" + "/key/{kid}": { + "get": { + "tags": [ + "Key" + ], + "summary": "Fetch keypair", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "kid", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KeyResult" + } + } } - } - ], - "paths": { - "/key/create": { - "post": { - "tags": [ - "Key" - ], - "summary": "Create a Keypair", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KeyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/did/create": { + "post": { + "tags": [ + "DID" + ], + "summary": "Create a DID", + "description": "

This endpoint creates a DID by taking a set of input parameters or the whole didDocument itself

", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/DIDCreateRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/DIDCreateRequest" + } } + } }, - "/key/{kid}": { - "get": { - "tags": [ - "Key" - ], - "summary": "Fetch keypair", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "kid", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KeyResult" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" } + } } - }, - "/did/create": { - "post": { - "tags": [ - "DID" - ], - "summary": "Create a DID", - "description": "

This endpoint creates a DID by taking a set of input parameters or the whole didDocument itself

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/DIDCreateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/DIDCreateRequest" - } - } - } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/did/update": { - "post": { - "tags": [ - "DID" - ], - "summary": "Update a DID", - "description": "

This endpoint updates a DID by taking DID document or the particular fields needed to be updated

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/DIDUpdateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/DIDUpdateRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/did/update": { + "post": { + "tags": [ + "DID" + ], + "summary": "Update a DID", + "description": "

This endpoint updates a DID by taking DID document or the particular fields needed to be updated

", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/DIDUpdateRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/DIDUpdateRequest" + } } + } }, - "/did/deactivate/{did}": { - "post": { - "tags": [ - "DID" - ], - "summary": "Deactivate a DID", - "description": "

This endpoint deactivates a DID by taking DID document or a verification method as an input.

", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "did", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" } + } } - }, - "/did/list": { - "get": { - "tags": [ - "DID" - ], - "summary": "Fetch DIDs from wallet", - "description": "

This endpoint returns the list of DIDs controlled by the account

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } + } } - }, - "/did/{did}": { - "get": { - "tags": [ - "DID" - ], - "summary": "Resolve a DID", - "description": "

This endpoint resolved a DID

", - "parameters": [ - { - "in": "path", - "name": "did", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidDocument" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } } - }, - "/credential/issue": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Issue a credential", - "description": "

This endpoint issues a credential. As input it takes the list of attributes, subjectDid, context and expiration date of the credential to be issued.

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRequest" - } - } - } + } + } + } + }, + "/did/deactivate/{did}": { + "post": { + "tags": [ + "DID" + ], + "summary": "Deactivate a DID", + "description": "

This endpoint deactivates a DID by taking DID document or a verification method as an input.

", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Credential" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential/verify": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Verify a credential", - "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", - "operationId": "verify", - "parameters": [ - { - "in": "query", - "name": "verifyStatus", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "in": "query", - "name": "fetchRemoteContexts", - "description": "When dealing with JSON-LD you also MUST provide the proper contexts. * Set this to `true` ONLY if you want the `@context` URLs to be fetched in case they are a custom context.", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialVerifyRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialVerifyRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } } - }, - "/credential/revoke": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Revoke a credential", - "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", - "operationId": "revoke", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - } - } + } + } + } + }, + "/did/list": { + "get": { + "tags": [ + "DID" + ], + "summary": "Fetch DIDs from wallet", + "description": "

This endpoint returns the list of DIDs controlled by the account

", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RevocationResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential/suspend": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Suspend a credential", - "description": "

This endpoint suspends the credential. As input it takes the entire credential itself

", - "operationId": "suspend", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "schema": { - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SuspensionResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } } - }, - "/credential/reinstate": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Reinstate a credential", - "description": "

This endpoint reinstates the credential. As input it takes the entire credential itself

", - "operationId": "reinstate", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "schema": { - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - } - } + } + } + } + }, + "/did/{did}": { + "get": { + "tags": [ + "DID" + ], + "summary": "Resolve a DID", + "description": "

This endpoint resolved a DID

", + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidDocument" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnSuspensionResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/presentation/verify": { - "post": { - "tags": [ - "Presentation" - ], - "summary": "Verify a credential presentation", - "description": "

This endpoint verifies the credential presentation. As input it takes the entire presentation itself

", - "operationId": "presentation", - "parameters": [ - { - "in": "query", - "name": "verifyStatus", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "in": "query", - "name": "fetchRemoteContexts", - "description": "When dealing with JSON-LD you also MUST provide the proper contexts. * Set this to `true` ONLY if you want the `@context` URLs to be fetched in case they are a custom context.", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/PresentationRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/PresentationRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/issue": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Issue a credential", + "description": "

This endpoint issues a credential. As input it takes the list of attributes, subjectDid, context and expiration date of the credential to be issued.

", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRequest" + } } + } }, - "/account": { - "post": { - "tags": [ - "Account" - ], - "summary": "Create a client", - "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Credential" } - }, - "get": { - "tags": [ - "Account" - ], - "summary": "Fetch a client", - "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } + } } - }, - "/resource/create/{did}": { - "post": { - "tags": [ - "Resource" - ], - "summary": "Create a Resource", - "parameters": [ - { - "in": "path", - "name": "did", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CreateResourceRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateResourceRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The resource is created successfully" - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/verify": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Verify a credential", + "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", + "operationId": "verify", + "parameters": [ + { + "in": "query", + "name": "verifyStatus", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "fetchRemoteContexts", + "description": "When dealing with JSON-LD you also MUST provide the proper contexts. * Set this to `true` ONLY if you want the `@context` URLs to be fetched in case they are a custom context.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialVerifyRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialVerifyRequest" + } } + } }, - "/credential-status/create": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Create statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - } - }, - { - "in": "query", - "name": "encrypted", - "required": true, - "schema": { - "type": "boolean", - "default": false - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusCreateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusCreateRequest" - } - } - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IVerifyResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "StatusList is created successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential-status/update": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Publish statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusAction", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revoke", - "suspend", - "reinstate" - ] - } - }, - { - "in": "query", - "name": "publish", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusUpdateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusUpdateRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/revoke": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Revoke a credential", + "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", + "operationId": "revoke", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } } + } }, - "/credential-status/publish": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Publish statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - } - }, - { - "in": "query", - "name": "encrypted", - "required": true, - "schema": { - "type": "boolean", - "default": false - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusPublishRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusPublishRequest" - } - } - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevocationResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential-status/search": { - "get": { - "tags": [ - "Credential Status" - ], - "summary": "Fetch statusList's published by a DID", - "parameters": [ - { - "in": "query", - "name": "did", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "statusPurpose", - "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - } - }, - { - "in": "query", - "name": "statusListName", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "StatusList is fetched successfully", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "statusListName": { - "type": "string" - }, - "statusListVersion": { - "type": "string" - }, - "statusListId": { - "type": "string" - }, - "statusListNextVersion": { - "type": "string" - } - } - } - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } } + } } + } }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" + "/credential/suspend": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Suspend a credential", + "description": "

This endpoint suspends the credential. As input it takes the entire credential itself

", + "operationId": "suspend", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "schema": { + "type": "boolean" } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + } + } }, - "schemas": { - "DidResult": { - "type": "object", - "properties": { - "did": { - "type": "string" - }, - "controllerKeyId": { - "type": "string" - }, - "keys": { - "type": "array", - "items": { - "type": "object" - } - }, - "services": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Service" - } - } + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuspensionResult" } - }, - "KeyResult": { - "type": "object", - "properties": { - "kid": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "Ed25519", - "Secp256k1" - ] - }, - "publicKeyHex": { - "type": "string" - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, - "DidDocument": { - "description": "This input field contains a complete DID document", - "type": "object", - "properties": { - "context": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "controller": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - ] - }, - "authentication": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" - ] - }, - "assertionMethod": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilityInvocation": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilityDelegation": { - "type": "array", - "items": { - "type": "string" - } - }, - "keyAgreement": { - "type": "array", - "items": { - "type": "string" - } - }, - "verificationMethod": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VerificationMethod" - } - }, - "service": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Service" - } - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "controller": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - ], - "verificationMethod": [ - { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "type": "Ed25519VerificationKey2018", - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - } - ], - "authentication": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1" - ] + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/reinstate": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Reinstate a credential", + "description": "

This endpoint reinstates the credential. As input it takes the entire credential itself

", + "operationId": "reinstate", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } }, - "VerificationMethod": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" - }, - "type": { - "type": "string", - "example": "Ed25519VerificationKey2018" - }, - "controller": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "publicKeyBase58": { - "type": "string", - "example": "so1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - }, - "publicKeyMultibase": { - "type": "string", - "example": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - }, - "publicKeyJwk": { - "type": "array", - "items": { - "type": "string" - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnSuspensionResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", - "type": "Ed25519VerificationKey2018" + "error": "Invalid Request" } - }, - "Service": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#rand" - }, - "type": { - "type": "string", - "example": "rand" - }, - "serviceEndpoint": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "https://rand.in" - ] - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/presentation/verify": { + "post": { + "tags": [ + "Presentation" + ], + "summary": "Verify a credential presentation", + "description": "

This endpoint verifies the credential presentation. As input it takes the entire presentation itself

", + "operationId": "presentation", + "parameters": [ + { + "in": "query", + "name": "verifyStatus", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "fetchRemoteContexts", + "description": "When dealing with JSON-LD you also MUST provide the proper contexts. * Set this to `true` ONLY if you want the `@context` URLs to be fetched in case they are a custom context.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/PresentationRequest" + } }, - "CredentialRequest": { - "description": "Input fields for the create operation.", - "type": "object", - "additionalProperties": false, - "properties": { - "issuerDid": { - "description": "This input field is the Issuer's DID", - "type": "string" - }, - "subjectDid": { - "description": "This input field is the holder's DID", - "type": "string" - }, - "attributes": { - "description": "Json input of the attributes", - "type": "object" - }, - "@context": { - "description": "Additional contexts to be included in the credential", - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "description": "Additional type property to be included in the credential", - "type": "array", - "items": { - "type": "string" - } - }, - "expirationDate": { - "description": "Optional expiration date according to the specification", - "type": "string" - }, - "format": { - "description": "Select one of the supported credential formats, jwt by default", - "type": "string", - "enum": [ - "jwt", - "lds" - ] - }, - "credentialStatus": { - "description": "Optional field to support revocation or suspension, which takes statusListName and statusListPurpose as inputs.", - "type": "object", - "required": [ - "statusPurpose", - "statusListName" - ], - "properties": { - "statusPurpose": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - }, - "statusListName": { - "type": "string" - }, - "statusListIndex": { - "type": "number" - }, - "statusListVersipon": { - "type": "string" - }, - "statusListRangeStart": { - "type": "number" - }, - "statusListRangeEnd": { - "type": "number" - }, - "indexNotIn": { - "type": "number" - } - }, - "example": { - "statusPurpose": "revocation", - "statusListName": "employee-credentials" - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/PresentationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IVerifyResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "required": [ - "issuerDid", - "subjectDid", - "attributes" - ], "example": { - "issuerDid": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "subjectDid": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", - "attributes": { - "gender": "male", - "name": "Bob" - }, - "@context": [ - "https://schema.org" - ], - "type": [ - "Person" - ], - "format": "jwt", - "credentialStatus": { - "statusPurpose": "revocation", - "statusListName": "employee-credentials", - "statusListIndex": 10 - } + "error": "Invalid Request" } - }, - "Credential": { - "description": "Input fields for the update operation.", - "type": "object", - "additionalProperties": false, - "properties": { - "@context": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "array", - "items": { - "type": "string" - } - }, - "expirationDate": { - "type": "string" - }, - "issuer": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "credentialSubject": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "credentialStatus": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "statusListIndex": { - "type": "string" - }, - "statusPurpose": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - }, - "type": { - "type": "string", - "enum": [ - "StatusList2021Entry" - ] - } - } - }, - "issuanceDate": { - "type": "string" - }, - "proof": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "jwt": { - "type": "string" - } - } - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://schema.org", - "https://veramo.io/contexts/profile/v1" - ], - "credentialSubject": { - "gender": "male", - "id": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", - "name": "Bob" - }, - "credentialStatus": { - "id": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-suspension-1&resourceType=StatusList2021Suspension#20", - "statusListIndex": "20", - "statusPurpose": "suspension", - "type": "StatusList2021Entry" - }, - "issuanceDate": "2023-06-08T13:49:28.000Z", - "issuer": { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "proof": { - "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6Y2hlcWQ6dGVzdG5ldDo3YmY4MWEyMC02MzNjLTRjYzctYmM0YS01YTQ1ODAxMDA1ZTAiLCJuYmYiOjE2ODYyMzIxNjgsInN1YiI6ImRpZDprZXk6ejZNa2hhWGdCWkR2b3REa0w1MjU3ZmFpenRpR2lDMlF0S0xHcGJubkVHdGEyZG9LIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5vcmciLCJodHRwczovL3ZlcmFtby5pby9jb250ZXh0cy9wcm9maWxlL3YxIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImdlbmRlciI6Im1hbGUiLCJuYW1lIjoiQm9iIn0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQZXJzb24iXX19.wMfdR6RtyAZA4eoWya5Aw97wwER2Cm5Guk780Xw8H9fA3sfudIJeLRLboqixpTchqSbYeA7KbuCTAnLgXTD_Cg", - "type": "JwtProof2020" - }, - "type": [ - "VerifiableCredential", - "Person" - ] + "error": "Internal Error" } - }, - "Customer": { - "type": "object", - "properties": { - "customerId": { - "type": "string" - }, - "address": { - "type": "string" - } + } + } + } + } + } + }, + "/account": { + "post": { + "tags": [ + "Account" + ], + "summary": "Create a client", + "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" } - }, - "InvalidRequest": { - "type": "object", - "properties": { - "error": { - "type": "string" - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, - "UnauthorizedError": { - "description": "Access token is missing or invalid", - "type": "object", - "properties": { - "error": { - "type": "string" - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "error": "Unauthorized Error" + "error": "Internal Error" } - }, - "IVerifyResult": { - "type": "object", - "properties": { - "verified": { - "type": "boolean" - }, - "issuer": { - "type": "string" - }, - "signer": { - "type": "object" - }, - "jwt": { - "type": "string" - }, - "verifiableCredential": { - "type": "object" - } + } + } + } + } + }, + "get": { + "tags": [ + "Account" + ], + "summary": "Fetch a client", + "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "verified": true, - "policies": {}, - "issuer": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "signer": { - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", - "type": "Ed25519VerificationKey2018" - } + "error": "Invalid Request" } - }, - "CreateResourceRequest": { - "description": "Input fields for the resource creation", - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "type", - "data", - "encoding" - ], - "properties": { - "data": { - "description": "Provide encoded string for the resource data", - "type": "string" - }, - "encoding": { - "description": "The encoding format of the resource data", - "type": "string", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "name": { - "description": "Resource name", - "type": "string" - }, - "type": { - "description": "Resource type", - "type": "string" - }, - "alsoKnownAs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - }, - "version": { - "type": "string" - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "data": "SGVsbG8gV29ybGQ=", - "name": "ResourceName", - "type": "TextDocument" + "error": "Internal Error" } + } + } + } + } + } + }, + "/resource/create/{did}": { + "post": { + "tags": [ + "Resource" + ], + "summary": "Create a Resource", + "parameters": [ + { + "in": "path", + "name": "did", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CreateResourceRequest" + } }, - "RevocationResult": { - "properties": { - "revoked": { - "type": "boolean" - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateResourceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The resource is created successfully" + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, - "SuspensionResult": { - "properties": { - "suspended": { - "type": "boolean" - }, - "statusList": { - "type": "string" - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential-status/create": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Create statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCreateRequest" + } }, - "UnSuspensionResult": { - "properties": { - "unsuspended": { - "type": "boolean" - }, - "statusList": { - "type": "string" - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCreateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "StatusList is created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential-status/update": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Publish statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusAction", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revoke", + "suspend", + "reinstate" + ] + } + }, + { + "in": "query", + "name": "publish", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusUpdateRequest" + } }, - "DIDCreateRequest": { - "type": "object", - "properties": { - "network": { - "type": "string", - "enum": [ - "testnet", - "mainnet" - ] - }, - "methodSpecificIdAlgo": { - "type": "string", - "enum": [ - "uuid", - "base58btc" - ] - }, - "verificationMethodType": { - "type": "string", - "enum": [ - "Ed25519VerificationKey2018", - "JsonWebKey2020", - "Ed25519VerificationKey2020" - ] - }, - "serviceEndpoint": { - "type": "string" - }, - "assertionMethod": { - "description": "An assertion method is required to issue JSONLD credentials", - "type": "boolean", - "default": true - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusUpdateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "StatusList is published successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } + } + } + } + }, + "/credential-status/publish": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Publish statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } }, - "DIDUpdateRequest": { - "type": "object", - "properties": { - "did": { - "type": "string" - }, - "service": { - "type": "array", - "description": "This input field assigns the provided service array to the didDocument", - "items": { - "$ref": "#/components/schemas/Service" - } - }, - "verificationMethod": { - "type": "array", - "description": "This input field assigns the provided verificationMethod array to the didDocument", - "items": { - "$ref": "#/components/schemas/VerificationMethod" - } - }, - "authentication": { - "description": "This input field assigns the provided authentication array to the didDocument", - "type": "array", - "items": { - "type": "string" - } - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } + } + } + }, + "responses": { + "200": { + "description": "StatusList is published successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } + } + } + } + }, + "/credential-status/check": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Check Credential Status of an index in statuslist 2021", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCheckRequest" + } }, - "CredentialVerifyRequest": { - "type": "object", - "properties": { - "credential": { - "description": "This input field takes the credential object or the JWT string", - "allOf": [ - { - "type": "object" - }, - { - "type": "string" - } - ] + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCheckRequest" + } + } + } + }, + "responses": { + "200": { + "description": "StatusList is published successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "revoked": { + "type": "boolean" }, - "policies": { - "description": "Custom verification policies to execute when verifying credential", - "type": "object", - "properties": { - "now": { - "description": "policy to verify over the now (current time) during the verification check (UNIX time in seconds)", - "type": "number" - }, - "issuanceDate": { - "description": "policy to skip the issuanceDate (nbf) timestamp check when set to `false`", - "type": "boolean" - }, - "expirationDate": { - "description": "policy to skip the expirationDate (exp) timestamp check when set to `false`", - "type": "boolean" - }, - "audience": { - "description": "policy to skip the audience check when set to `false`", - "type": "boolean" - } - } + "suspended": { + "type": "boolean", + "example": "false" } + } } - }, - "CredentialRevokeRequest": { - "type": "object", - "properties": { - "credential": { - "description": "This input field takes the credential object or the JWT string", - "oneOf": [ - { - "type": "object" - }, - { - "type": "string" - } - ] - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, - "CredentialStatusCreateRequest": { - "allOf": [ - { - "type": "object", - "required": [ - "did", - "statusListName" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be created", - "type": "string" - }, - "length": { - "description": "The length of the statusList to be created, The default and minimum length is 140000 which is 16kb", - "type": "number" - }, - "encoding": { - "description": "The encoding format of the statusList to be published", - "type": "string", - "default": "base64url", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", - "type": "string" - }, - "alsoKnownAs": { - "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } - } - } - ], + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, "example": { - "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "statusListName": "cheqd-employee-credentials" + "error": "Internal Error" } - }, - "CredentialStatusUpdateRequest": { - "type": "object", - "required": [ - "did", - "statusListName", - "indices" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", + } + } + } + } + } + }, + "/credential-status/search": { + "get": { + "tags": [ + "Credential Status" + ], + "summary": "Fetch statusList's published by a DID", + "parameters": [ + { + "in": "query", + "name": "did", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "statusPurpose", + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "statusListName", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "StatusList is fetched successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "statusListName": { "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be created", + }, + "statusListVersion": { "type": "string" - }, - "indices": { - "description": "Provide the list of indices to be updated", - "type": "array", - "items": { - "type": "number" - } - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present uses the provided statusListVersion for the update operation", + }, + "statusListId": { "type": "string" + }, + "statusListNextVersion": { + "type": "string" + } } + } } - }, - "CredentialStatusPublishRequest": { - "allOf": [ - { - "type": "object", - "required": [ - "did", - "encodedList", - "statusListName", - "encoding" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be published", - "type": "string" - }, - "encodedList": { - "description": "Provide encoded string for the resource data", - "type": "string" - }, - "encoding": { - "description": "The encoding format of the statusList provided", - "type": "string", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", - "type": "string" - }, - "alsoKnownAs": { - "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } - } - } - ], + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, "example": { - "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "name": "cheqd-employee-credentials", - "version": "2023", - "data": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", - "encoding": "base64url" + "error": "Invalid Request" } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "DidResult": { + "type": "object", + "properties": { + "did": { + "type": "string" + }, + "controllerKeyId": { + "type": "string" + }, + "keys": { + "type": "array", + "items": { + "type": "object" + } + }, + "services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "KeyResult": { + "type": "object", + "properties": { + "kid": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "Ed25519", + "Secp256k1" + ] + }, + "publicKeyHex": { + "type": "string" + } + } + }, + "DidDocument": { + "description": "This input field contains a complete DID document", + "type": "object", + "properties": { + "context": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "controller": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + ] + }, + "authentication": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" + ] + }, + "assertionMethod": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilityInvocation": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilityDelegation": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyAgreement": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationMethod": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VerificationMethod" + } + }, + "service": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "example": { + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "controller": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + ], + "verificationMethod": [ + { + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "type": "Ed25519VerificationKey2018", + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + } + ], + "authentication": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1" + ] + } + }, + "VerificationMethod": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" + }, + "type": { + "type": "string", + "example": "Ed25519VerificationKey2018" + }, + "controller": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "publicKeyBase58": { + "type": "string", + "example": "so1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + }, + "publicKeyMultibase": { + "type": "string", + "example": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + }, + "publicKeyJwk": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "example": { + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", + "type": "Ed25519VerificationKey2018" + } + }, + "Service": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#rand" + }, + "type": { + "type": "string", + "example": "rand" + }, + "serviceEndpoint": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "https://rand.in" + ] + } + } + }, + "CredentialRequest": { + "description": "Input fields for the create operation.", + "type": "object", + "additionalProperties": false, + "properties": { + "issuerDid": { + "description": "This input field is the Issuer's DID", + "type": "string" + }, + "subjectDid": { + "description": "This input field is the holder's DID", + "type": "string" + }, + "attributes": { + "description": "Json input of the attributes", + "type": "object" + }, + "@context": { + "description": "Additional contexts to be included in the credential", + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "description": "Additional type property to be included in the credential", + "type": "array", + "items": { + "type": "string" + } + }, + "expirationDate": { + "description": "Optional expiration date according to the specification", + "type": "string" + }, + "format": { + "description": "Select one of the supported credential formats, jwt by default", + "type": "string", + "enum": [ + "jwt", + "lds" + ] + }, + "credentialStatus": { + "description": "Optional field to support revocation or suspension, which takes statusListName and statusListPurpose as inputs.", + "type": "object", + "required": [ + "statusPurpose", + "statusListName" + ], + "properties": { + "statusPurpose": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + }, + "statusListName": { + "type": "string" + }, + "statusListIndex": { + "type": "number" + }, + "statusListVersipon": { + "type": "string" + }, + "statusListRangeStart": { + "type": "number" + }, + "statusListRangeEnd": { + "type": "number" + }, + "indexNotIn": { + "type": "number" + } }, - "PresentationRequest": { + "example": { + "statusPurpose": "revocation", + "statusListName": "employee-credentials" + } + } + }, + "required": [ + "issuerDid", + "subjectDid", + "attributes" + ], + "example": { + "issuerDid": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "subjectDid": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", + "attributes": { + "gender": "male", + "name": "Bob" + }, + "@context": [ + "https://schema.org" + ], + "type": [ + "Person" + ], + "format": "jwt", + "credentialStatus": { + "statusPurpose": "revocation", + "statusListName": "employee-credentials", + "statusListIndex": 10 + } + } + }, + "Credential": { + "description": "Input fields for the update operation.", + "type": "object", + "additionalProperties": false, + "properties": { + "@context": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "array", + "items": { + "type": "string" + } + }, + "expirationDate": { + "type": "string" + }, + "issuer": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "credentialSubject": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "credentialStatus": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "statusListIndex": { + "type": "string" + }, + "statusPurpose": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + }, + "type": { + "type": "string", + "enum": [ + "StatusList2021Entry" + ] + } + } + }, + "issuanceDate": { + "type": "string" + }, + "proof": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "jwt": { + "type": "string" + } + } + } + }, + "example": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://schema.org", + "https://veramo.io/contexts/profile/v1" + ], + "credentialSubject": { + "gender": "male", + "id": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", + "name": "Bob" + }, + "credentialStatus": { + "id": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-suspension-1&resourceType=StatusList2021Suspension#20", + "statusListIndex": "20", + "statusPurpose": "suspension", + "type": "StatusList2021Entry" + }, + "issuanceDate": "2023-06-08T13:49:28.000Z", + "issuer": { + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "proof": { + "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6Y2hlcWQ6dGVzdG5ldDo3YmY4MWEyMC02MzNjLTRjYzctYmM0YS01YTQ1ODAxMDA1ZTAiLCJuYmYiOjE2ODYyMzIxNjgsInN1YiI6ImRpZDprZXk6ejZNa2hhWGdCWkR2b3REa0w1MjU3ZmFpenRpR2lDMlF0S0xHcGJubkVHdGEyZG9LIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5vcmciLCJodHRwczovL3ZlcmFtby5pby9jb250ZXh0cy9wcm9maWxlL3YxIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImdlbmRlciI6Im1hbGUiLCJuYW1lIjoiQm9iIn0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQZXJzb24iXX19.wMfdR6RtyAZA4eoWya5Aw97wwER2Cm5Guk780Xw8H9fA3sfudIJeLRLboqixpTchqSbYeA7KbuCTAnLgXTD_Cg", + "type": "JwtProof2020" + }, + "type": [ + "VerifiableCredential", + "Person" + ] + } + }, + "Customer": { + "type": "object", + "properties": { + "customerId": { + "type": "string" + }, + "address": { + "type": "string" + } + } + }, + "InvalidRequest": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "UnauthorizedError": { + "description": "Access token is missing or invalid", + "type": "object", + "properties": { + "error": { + "type": "string" + } + }, + "example": { + "error": "Unauthorized Error" + } + }, + "IVerifyResult": { + "type": "object", + "properties": { + "verified": { + "type": "boolean" + }, + "issuer": { + "type": "string" + }, + "signer": { + "type": "object" + }, + "jwt": { + "type": "string" + }, + "verifiableCredential": { + "type": "object" + } + }, + "example": { + "verified": true, + "policies": {}, + "issuer": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "signer": { + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", + "type": "Ed25519VerificationKey2018" + } + } + }, + "CreateResourceRequest": { + "description": "Input fields for the resource creation", + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "type", + "data", + "encoding" + ], + "properties": { + "data": { + "description": "Provide encoded string for the resource data", + "type": "string" + }, + "encoding": { + "description": "The encoding format of the resource data", + "type": "string", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "name": { + "description": "Resource name", + "type": "string" + }, + "type": { + "description": "Resource type", + "type": "string" + }, + "alsoKnownAs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + }, + "version": { + "type": "string" + } + }, + "example": { + "data": "SGVsbG8gV29ybGQ=", + "name": "ResourceName", + "type": "TextDocument" + } + }, + "RevocationResult": { + "properties": { + "revoked": { + "type": "boolean" + } + } + }, + "SuspensionResult": { + "properties": { + "suspended": { + "type": "boolean" + }, + "statusList": { + "type": "string" + } + } + }, + "UnSuspensionResult": { + "properties": { + "unsuspended": { + "type": "boolean" + }, + "statusList": { + "type": "string" + } + } + }, + "DIDCreateRequest": { + "type": "object", + "properties": { + "network": { + "type": "string", + "enum": [ + "testnet", + "mainnet" + ] + }, + "methodSpecificIdAlgo": { + "type": "string", + "enum": [ + "uuid", + "base58btc" + ] + }, + "verificationMethodType": { + "type": "string", + "enum": [ + "Ed25519VerificationKey2018", + "JsonWebKey2020", + "Ed25519VerificationKey2020" + ] + }, + "serviceEndpoint": { + "type": "string" + }, + "assertionMethod": { + "description": "An assertion method is required to issue JSONLD credentials", + "type": "boolean", + "default": true + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + } + } + }, + "DIDUpdateRequest": { + "type": "object", + "properties": { + "did": { + "type": "string" + }, + "service": { + "type": "array", + "description": "This input field assigns the provided service array to the didDocument", + "items": { + "$ref": "#/components/schemas/Service" + } + }, + "verificationMethod": { + "type": "array", + "description": "This input field assigns the provided verificationMethod array to the didDocument", + "items": { + "$ref": "#/components/schemas/VerificationMethod" + } + }, + "authentication": { + "description": "This input field assigns the provided authentication array to the didDocument", + "type": "array", + "items": { + "type": "string" + } + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + } + } + }, + "CredentialVerifyRequest": { + "type": "object", + "properties": { + "credential": { + "description": "This input field takes the credential object or the JWT string", + "allOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + }, + "policies": { + "description": "Custom verification policies to execute when verifying credential", + "type": "object", + "properties": { + "now": { + "description": "policy to verify over the now (current time) during the verification check (UNIX time in seconds)", + "type": "number" + }, + "issuanceDate": { + "description": "policy to skip the issuanceDate (nbf) timestamp check when set to `false`", + "type": "boolean" + }, + "expirationDate": { + "description": "policy to skip the expirationDate (exp) timestamp check when set to `false`", + "type": "boolean" + }, + "audience": { + "description": "policy to skip the audience check when set to `false`", + "type": "boolean" + } + } + } + } + }, + "CredentialRevokeRequest": { + "type": "object", + "properties": { + "credential": { + "description": "This input field takes the credential object or the JWT string", + "oneOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + } + } + }, + "CredentialStatusCreateRequest": { + "allOf": [ + { + "type": "object", + "required": [ + "did", + "statusListName" + ], + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be created", + "type": "string" + }, + "length": { + "description": "The length of the statusList to be created, The default and minimum length is 140000 which is 16kb", + "type": "number" + }, + "encoding": { + "description": "The encoding format of the statusList to be published", + "type": "string", + "default": "base64url", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", + "type": "string" + }, + "alsoKnownAs": { + "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + } + } + } + ], + "example": { + "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "statusListName": "cheqd-employee-credentials" + } + }, + "CredentialStatusUpdateRequest": { + "type": "object", + "required": [ + "did", + "statusListName", + "indices" + ], + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be created", + "type": "string" + }, + "indices": { + "description": "Provide the list of indices to be updated", + "type": "array", + "items": { + "type": "number" + } + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present uses the provided statusListVersion for the update operation", + "type": "string" + } + } + }, + "CredentialStatusPublishRequest": { + "allOf": [ + { + "type": "object", + "required": [ + "did", + "encodedList", + "statusListName", + "encoding" + ], + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be published", + "type": "string" + }, + "encodedList": { + "description": "Provide encoded string for the resource data", + "type": "string" + }, + "encoding": { + "description": "The encoding format of the statusList provided", + "type": "string", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", + "type": "string" + }, + "alsoKnownAs": { + "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + } + } + } + ], + "example": { + "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "name": "cheqd-employee-credentials", + "version": "2023", + "data": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", + "encoding": "base64url" + } + }, + "PresentationRequest": { + "type": "object", + "required": [ + "presentation" + ], + "properties": { + "presentation": { + "description": "This input field takes the presentation object or the JWT string", + "allOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + }, + "verifierDid": { + "description": "Provide an optional verifier DID (also known as 'domain' parameter), if the verifier DID in the presentation is not managed in the wallet", + "type": "string" + }, + "policies": { + "description": "Custom verification policies to execute when verifying presentation", + "type": "object", + "properties": { + "now": { + "description": "policy to verify over the now (current time) during the verification check (UNIX time in seconds)", + "type": "number" + }, + "issuanceDate": { + "description": "policy to skip the issuanceDate (nbf) timestamp check when set to `false`", + "type": "boolean" + }, + "expirationDate": { + "description": "policy to skip the expirationDate (exp) timestamp check when set to `false`", + "type": "boolean" + }, + "audience": { + "description": "policy to skip the audience check when set to `false`", + "type": "boolean" + } + } + } + } + }, + "CredentialStatusResult": { + "type": "object", + "properties": { + "success": { + "type": "object", + "properties": { + "created": { + "type": "boolean" + }, + "resourceNetadata": { + "type": "object" + }, + "statusList2021": { "type": "object", - "required": [ - "presentation" - ], "properties": { - "presentation": { - "description": "This input field takes the presentation object or the JWT string", - "allOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - }, - "verifierDid": { - "description": "Provide an optional verifier DID (also known as 'domain' parameter), if the verifier DID in the presentation is not managed in the wallet", + "StatusList2021": { + "type": "object", + "properties": { + "encodedList": { "type": "string" - }, - "policies": { - "description": "Custom verification policies to execute when verifying presentation", - "type": "object", - "properties": { - "now": { - "description": "policy to verify over the now (current time) during the verification check (UNIX time in seconds)", - "type": "number" - }, - "issuanceDate": { - "description": "policy to skip the issuanceDate (nbf) timestamp check when set to `false`", - "type": "boolean" - }, - "expirationDate": { - "description": "policy to skip the expirationDate (exp) timestamp check when set to `false`", - "type": "boolean" - }, - "audience": { - "description": "policy to skip the audience check when set to `false`", - "type": "boolean" - } - } + }, + "type": { + "type": "string" + }, + "validFrom": { + "type": "string" + } } + } } - }, - "CredentialStatusResult": { - "type": "object", + }, + "metadata": { + "type": "string", "properties": { - "success": { - "type": "object", - "properties": { - "created": { - "type": "boolean" - }, - "resourceNetadata": { - "type": "object" - }, - "statusList2021": { - "type": "object", - "properties": { - "StatusList2021": { - "type": "object", - "properties": { - "encodedList": { - "type": "string" - }, - "type": { - "type": "string" - }, - "validFrom": { - "type": "string" - } - } - } - } - }, - "metadata": { - "type": "string", - "properties": { - "encoding": { - "type": "string" - }, - "encrypted": { - "type": "boolean" - } - } - } - } - } - }, - "example": { - "created": true, - "resource": { - "StatusList2021": { - "encodedList": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", - "type": "StatusList2021Revocation", - "validFrom": "2023-06-26T11:45:19.349Z" - }, - "metadata": { - "encoding": "base64url", - "encrypted": false - } - }, - "resourceMetadata": { - "checksum": "909e22e371a41afbb96c330a97752cf7c8856088f1f937f87decbef06cbe9ca2", - "created": "2023-06-26T11:45:20Z", - "mediaType": "application/json", - "nextVersionId": null, - "previousVersionId": null, - "resourceCollectionId": "7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "resourceId": "5945233a-a4b5-422b-b893-eaed5cedd2dc", - "resourceName": "cheqd-revocation-1", - "resourceType": "StatusList2021Revocation", - "resourceURI": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e/resources/5945233a-a4b5-422b-b893-eaed5cedd2dc", - "resourceVersion": "2023-06-26T11:45:19.349Z" - } + "encoding": { + "type": "string" + }, + "encrypted": { + "type": "boolean" + } } + } } + } + }, + "example": { + "created": true, + "resource": { + "StatusList2021": { + "encodedList": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", + "type": "StatusList2021Revocation", + "validFrom": "2023-06-26T11:45:19.349Z" + }, + "metadata": { + "encoding": "base64url", + "encrypted": false + } + }, + "resourceMetadata": { + "checksum": "909e22e371a41afbb96c330a97752cf7c8856088f1f937f87decbef06cbe9ca2", + "created": "2023-06-26T11:45:20Z", + "mediaType": "application/json", + "nextVersionId": null, + "previousVersionId": null, + "resourceCollectionId": "7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "resourceId": "5945233a-a4b5-422b-b893-eaed5cedd2dc", + "resourceName": "cheqd-revocation-1", + "resourceType": "StatusList2021Revocation", + "resourceURI": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e/resources/5945233a-a4b5-422b-b893-eaed5cedd2dc", + "resourceVersion": "2023-06-26T11:45:19.349Z" + } + } + }, + "CredentialStatusCheckRequest": { + "type": "object", + "properties": { + "did": { + "description": "The DID of the statuslist publisher", + "type": "string" + }, + "statusListName": { + "description": "The name of the statusList to be published", + "type": "string" + }, + "index": { + "description": "Provide the statusList index to be verified", + "type": "number" + } } + } } + } } \ No newline at end of file diff --git a/src/types/types.ts b/src/types/types.ts index f3a1fb0b..f6f563ef 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -9,13 +9,12 @@ import { TAgent, VerificationPolicies } from '@veramo/core' -import { ICheqd, ICheqdStatusList2021Options } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' +import { ICheqd, ICheqdCheckCredentialWithStatusList2021StatusOptions } from '@cheqd/did-provider-cheqd/build/types/agent/ICheqd' import { ICredentialIssuerLD } from '@veramo/credential-ld' import { AbstractIdentifierProvider } from '@veramo/did-manager' import { AbstractKeyManagementSystem } from '@veramo/key-manager' import { DataSource } from 'typeorm' import { CheqdDIDProvider } from '@cheqd/did-provider-cheqd' -import { CosmosAccessControlCondition } from '@cheqd/did-provider-cheqd/build/types/dkg-threshold/lit-protocol' export type ErrorResponse = { name: string @@ -161,9 +160,11 @@ export interface UpdateStatusListOptions { statusAction: 'revoke' | 'suspend' | 'reinstate' } +export type CheckStatusListOptions = Omit + export interface VerificationOptions { fetchRemoteContexts?: boolean policies?: VerificationPolicies domain?: string verifyStatus?: boolean -} \ No newline at end of file +}