@trustvc/trustvc 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var w3cVc = require('@trustvc/w3c-vc');
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -23,10 +23,11 @@ const w3cEmptyCredentialStatus = {
|
|
|
23
23
|
const doc = document;
|
|
24
24
|
return !!doc.credentialStatus === false || Array.isArray(doc.credentialStatus) && doc.credentialStatus.length === 0 || Object.keys(doc.credentialStatus)?.length === 0;
|
|
25
25
|
}, "test"),
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
27
|
verify: /* @__PURE__ */ __name(async (document, verifierOptions) => {
|
|
27
28
|
const doc = document;
|
|
28
|
-
const verificationResult =
|
|
29
|
-
if (verificationResult
|
|
29
|
+
const verificationResult = w3cVc.isSignedDocument(doc);
|
|
30
|
+
if (verificationResult) {
|
|
30
31
|
return {
|
|
31
32
|
type,
|
|
32
33
|
name,
|
|
@@ -39,7 +40,7 @@ const w3cEmptyCredentialStatus = {
|
|
|
39
40
|
name,
|
|
40
41
|
data: false,
|
|
41
42
|
reason: {
|
|
42
|
-
message:
|
|
43
|
+
message: "Document is not a valid SignedVerifiableCredential"
|
|
43
44
|
},
|
|
44
45
|
status: "INVALID"
|
|
45
46
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isSignedDocument } from '@trustvc/w3c-vc';
|
|
2
2
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -21,10 +21,11 @@ const w3cEmptyCredentialStatus = {
|
|
|
21
21
|
const doc = document;
|
|
22
22
|
return !!doc.credentialStatus === false || Array.isArray(doc.credentialStatus) && doc.credentialStatus.length === 0 || Object.keys(doc.credentialStatus)?.length === 0;
|
|
23
23
|
}, "test"),
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
25
|
verify: /* @__PURE__ */ __name(async (document, verifierOptions) => {
|
|
25
26
|
const doc = document;
|
|
26
|
-
const verificationResult =
|
|
27
|
-
if (verificationResult
|
|
27
|
+
const verificationResult = isSignedDocument(doc);
|
|
28
|
+
if (verificationResult) {
|
|
28
29
|
return {
|
|
29
30
|
type,
|
|
30
31
|
name,
|
|
@@ -37,7 +38,7 @@ const w3cEmptyCredentialStatus = {
|
|
|
37
38
|
name,
|
|
38
39
|
data: false,
|
|
39
40
|
reason: {
|
|
40
|
-
message:
|
|
41
|
+
message: "Document is not a valid SignedVerifiableCredential"
|
|
41
42
|
},
|
|
42
43
|
status: "INVALID"
|
|
43
44
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustvc/trustvc",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "TrustVC library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -121,11 +121,11 @@
|
|
|
121
121
|
"@tradetrust-tt/tradetrust": "^6.10.2",
|
|
122
122
|
"@tradetrust-tt/tradetrust-utils": "^2.4.2",
|
|
123
123
|
"@tradetrust-tt/tt-verify": "^9.5.1",
|
|
124
|
-
"@trustvc/w3c": "^1.3.0-alpha.
|
|
125
|
-
"@trustvc/w3c-context": "^1.3.0-alpha.
|
|
126
|
-
"@trustvc/w3c-credential-status": "^1.3.0-alpha.
|
|
127
|
-
"@trustvc/w3c-issuer": "^1.3.0-alpha.
|
|
128
|
-
"@trustvc/w3c-vc": "^1.3.0-alpha.
|
|
124
|
+
"@trustvc/w3c": "^1.3.0-alpha.9",
|
|
125
|
+
"@trustvc/w3c-context": "^1.3.0-alpha.8",
|
|
126
|
+
"@trustvc/w3c-credential-status": "^1.3.0-alpha.8",
|
|
127
|
+
"@trustvc/w3c-issuer": "^1.3.0-alpha.6",
|
|
128
|
+
"@trustvc/w3c-vc": "^1.3.0-alpha.9",
|
|
129
129
|
"ethers": "^5.8.0",
|
|
130
130
|
"ethersV6": "npm:ethers@^6.14.4",
|
|
131
131
|
"js-sha3": "^0.9.3",
|