@trustvc/trustvc 1.1.3 → 1.2.0
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.
- package/dist/cjs/verify/fragments/document-status/w3cEmptyCredentialStatus/index.js +50 -0
- package/dist/cjs/verify/fragments/index.js +5 -0
- package/dist/cjs/verify/verify.js +3 -0
- package/dist/esm/verify/fragments/document-status/w3cEmptyCredentialStatus/index.js +48 -0
- package/dist/esm/verify/fragments/index.js +1 -0
- package/dist/esm/verify/verify.js +3 -0
- package/dist/types/{index-BVNDN0vp.d.ts → index-CRVFHzes.d.ts} +3 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/verify/fragments/document-status/w3cEmptyCredentialStatus/index.d.ts +5 -0
- package/dist/types/verify/fragments/index.d.ts +1 -0
- package/dist/types/verify/index.d.ts +2 -1
- package/dist/types/verify/verify.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var w3c = require('src/w3c');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
const type = "DOCUMENT_STATUS";
|
|
8
|
+
const name = "W3CEmptyCredentialStatus";
|
|
9
|
+
const w3cEmptyCredentialStatus = {
|
|
10
|
+
skip: /* @__PURE__ */ __name(async () => {
|
|
11
|
+
return {
|
|
12
|
+
type,
|
|
13
|
+
name,
|
|
14
|
+
reason: {
|
|
15
|
+
code: 0,
|
|
16
|
+
codeString: "SKIPPED",
|
|
17
|
+
message: `Document contains a credentialStatus.`
|
|
18
|
+
},
|
|
19
|
+
status: "SKIPPED"
|
|
20
|
+
};
|
|
21
|
+
}, "skip"),
|
|
22
|
+
test: /* @__PURE__ */ __name((document) => {
|
|
23
|
+
const doc = document;
|
|
24
|
+
return !!doc.credentialStatus === false || Array.isArray(doc.credentialStatus) && doc.credentialStatus.length === 0 || Object.keys(doc.credentialStatus)?.length === 0;
|
|
25
|
+
}, "test"),
|
|
26
|
+
verify: /* @__PURE__ */ __name(async (document) => {
|
|
27
|
+
const doc = document;
|
|
28
|
+
const verificationResult = await w3c.verifyW3CSignature(doc);
|
|
29
|
+
if (verificationResult.verified) {
|
|
30
|
+
return {
|
|
31
|
+
type,
|
|
32
|
+
name,
|
|
33
|
+
data: true,
|
|
34
|
+
status: "VALID"
|
|
35
|
+
};
|
|
36
|
+
} else {
|
|
37
|
+
return {
|
|
38
|
+
type,
|
|
39
|
+
name,
|
|
40
|
+
data: false,
|
|
41
|
+
reason: {
|
|
42
|
+
message: verificationResult.error
|
|
43
|
+
},
|
|
44
|
+
status: "INVALID"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, "verify")
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.w3cEmptyCredentialStatus = w3cEmptyCredentialStatus;
|
|
@@ -5,6 +5,7 @@ var w3cSignatureIntegrity = require('./document-integrity/w3cSignatureIntegrity'
|
|
|
5
5
|
var transferableRecordVerifier = require('./document-status/transferableRecords/transferableRecordVerifier');
|
|
6
6
|
var w3cCredentialStatus = require('./document-status/w3cCredentialStatus');
|
|
7
7
|
var w3cIssuerIdentity = require('./issuer-identity/w3cIssuerIdentity');
|
|
8
|
+
var w3cEmptyCredentialStatus = require('./document-status/w3cEmptyCredentialStatus');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
@@ -56,3 +57,7 @@ Object.defineProperty(exports, "w3cIssuerIdentity", {
|
|
|
56
57
|
enumerable: true,
|
|
57
58
|
get: function () { return w3cIssuerIdentity.w3cIssuerIdentity; }
|
|
58
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "w3cEmptyCredentialStatus", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return w3cEmptyCredentialStatus.w3cEmptyCredentialStatus; }
|
|
63
|
+
});
|
|
@@ -5,6 +5,7 @@ var w3cSignatureIntegrity = require('./fragments/document-integrity/w3cSignature
|
|
|
5
5
|
var transferableRecordVerifier = require('./fragments/document-status/transferableRecords/transferableRecordVerifier');
|
|
6
6
|
var w3cCredentialStatus = require('./fragments/document-status/w3cCredentialStatus');
|
|
7
7
|
var w3cIssuerIdentity = require('./fragments/issuer-identity/w3cIssuerIdentity');
|
|
8
|
+
var fragments = require('./fragments');
|
|
8
9
|
|
|
9
10
|
const verifiers = {
|
|
10
11
|
documentIntegrity: {
|
|
@@ -16,6 +17,7 @@ const verifiers = {
|
|
|
16
17
|
openAttestationEthereumDocumentStoreStatus: ttVerify.openAttestationEthereumDocumentStoreStatus,
|
|
17
18
|
openAttestationEthereumTokenRegistryStatus: ttVerify.openAttestationEthereumTokenRegistryStatus,
|
|
18
19
|
w3cCredentialStatus: w3cCredentialStatus.w3cCredentialStatus,
|
|
20
|
+
w3cEmptyCredentialStatus: fragments.w3cEmptyCredentialStatus,
|
|
19
21
|
credentialStatusTransferableRecordVerifier: transferableRecordVerifier.credentialStatusTransferableRecordVerifier
|
|
20
22
|
},
|
|
21
23
|
issuerIdentity: {
|
|
@@ -33,6 +35,7 @@ const w3cVerifiers = [
|
|
|
33
35
|
w3cSignatureIntegrity.w3cSignatureIntegrity,
|
|
34
36
|
w3cCredentialStatus.w3cCredentialStatus,
|
|
35
37
|
transferableRecordVerifier.credentialStatusTransferableRecordVerifier,
|
|
38
|
+
fragments.w3cEmptyCredentialStatus,
|
|
36
39
|
w3cIssuerIdentity.w3cIssuerIdentity
|
|
37
40
|
];
|
|
38
41
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { verifyW3CSignature } from 'src/w3c';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
const type = "DOCUMENT_STATUS";
|
|
6
|
+
const name = "W3CEmptyCredentialStatus";
|
|
7
|
+
const w3cEmptyCredentialStatus = {
|
|
8
|
+
skip: /* @__PURE__ */ __name(async () => {
|
|
9
|
+
return {
|
|
10
|
+
type,
|
|
11
|
+
name,
|
|
12
|
+
reason: {
|
|
13
|
+
code: 0,
|
|
14
|
+
codeString: "SKIPPED",
|
|
15
|
+
message: `Document contains a credentialStatus.`
|
|
16
|
+
},
|
|
17
|
+
status: "SKIPPED"
|
|
18
|
+
};
|
|
19
|
+
}, "skip"),
|
|
20
|
+
test: /* @__PURE__ */ __name((document) => {
|
|
21
|
+
const doc = document;
|
|
22
|
+
return !!doc.credentialStatus === false || Array.isArray(doc.credentialStatus) && doc.credentialStatus.length === 0 || Object.keys(doc.credentialStatus)?.length === 0;
|
|
23
|
+
}, "test"),
|
|
24
|
+
verify: /* @__PURE__ */ __name(async (document) => {
|
|
25
|
+
const doc = document;
|
|
26
|
+
const verificationResult = await verifyW3CSignature(doc);
|
|
27
|
+
if (verificationResult.verified) {
|
|
28
|
+
return {
|
|
29
|
+
type,
|
|
30
|
+
name,
|
|
31
|
+
data: true,
|
|
32
|
+
status: "VALID"
|
|
33
|
+
};
|
|
34
|
+
} else {
|
|
35
|
+
return {
|
|
36
|
+
type,
|
|
37
|
+
name,
|
|
38
|
+
data: false,
|
|
39
|
+
reason: {
|
|
40
|
+
message: verificationResult.error
|
|
41
|
+
},
|
|
42
|
+
status: "INVALID"
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}, "verify")
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { w3cEmptyCredentialStatus };
|
|
@@ -3,3 +3,4 @@ export { w3cSignatureIntegrity } from './document-integrity/w3cSignatureIntegrit
|
|
|
3
3
|
export { TRANSFERABLE_RECORDS_TYPE, credentialStatusTransferableRecordVerifier } from './document-status/transferableRecords/transferableRecordVerifier';
|
|
4
4
|
export { w3cCredentialStatus } from './document-status/w3cCredentialStatus';
|
|
5
5
|
export { w3cIssuerIdentity } from './issuer-identity/w3cIssuerIdentity';
|
|
6
|
+
export { w3cEmptyCredentialStatus } from './document-status/w3cEmptyCredentialStatus';
|
|
@@ -4,6 +4,7 @@ import { w3cSignatureIntegrity } from './fragments/document-integrity/w3cSignatu
|
|
|
4
4
|
import { credentialStatusTransferableRecordVerifier } from './fragments/document-status/transferableRecords/transferableRecordVerifier';
|
|
5
5
|
import { w3cCredentialStatus } from './fragments/document-status/w3cCredentialStatus';
|
|
6
6
|
import { w3cIssuerIdentity } from './fragments/issuer-identity/w3cIssuerIdentity';
|
|
7
|
+
import { w3cEmptyCredentialStatus } from './fragments';
|
|
7
8
|
|
|
8
9
|
const verifiers = {
|
|
9
10
|
documentIntegrity: {
|
|
@@ -15,6 +16,7 @@ const verifiers = {
|
|
|
15
16
|
openAttestationEthereumDocumentStoreStatus,
|
|
16
17
|
openAttestationEthereumTokenRegistryStatus,
|
|
17
18
|
w3cCredentialStatus,
|
|
19
|
+
w3cEmptyCredentialStatus,
|
|
18
20
|
credentialStatusTransferableRecordVerifier
|
|
19
21
|
},
|
|
20
22
|
issuerIdentity: {
|
|
@@ -32,6 +34,7 @@ const w3cVerifiers = [
|
|
|
32
34
|
w3cSignatureIntegrity,
|
|
33
35
|
w3cCredentialStatus,
|
|
34
36
|
credentialStatusTransferableRecordVerifier,
|
|
37
|
+
w3cEmptyCredentialStatus,
|
|
35
38
|
w3cIssuerIdentity
|
|
36
39
|
];
|
|
37
40
|
|
|
@@ -3,6 +3,7 @@ import { w3cSignatureIntegrity } from './verify/fragments/document-integrity/w3c
|
|
|
3
3
|
import { TRANSFERABLE_RECORDS_TYPE, credentialStatusTransferableRecordVerifier } from './verify/fragments/document-status/transferableRecords/transferableRecordVerifier.js';
|
|
4
4
|
import { w3cCredentialStatus } from './verify/fragments/document-status/w3cCredentialStatus.js';
|
|
5
5
|
import { w3cIssuerIdentity } from './verify/fragments/issuer-identity/w3cIssuerIdentity.js';
|
|
6
|
+
import { w3cEmptyCredentialStatus } from './verify/fragments/document-status/w3cEmptyCredentialStatus/index.js';
|
|
6
7
|
|
|
7
8
|
declare const index_TRANSFERABLE_RECORDS_TYPE: typeof TRANSFERABLE_RECORDS_TYPE;
|
|
8
9
|
declare const index_credentialStatusTransferableRecordVerifier: typeof credentialStatusTransferableRecordVerifier;
|
|
@@ -14,10 +15,11 @@ declare const index_openAttestationEthereumDocumentStoreStatus: typeof openAttes
|
|
|
14
15
|
declare const index_openAttestationEthereumTokenRegistryStatus: typeof openAttestationEthereumTokenRegistryStatus;
|
|
15
16
|
declare const index_openAttestationHash: typeof openAttestationHash;
|
|
16
17
|
declare const index_w3cCredentialStatus: typeof w3cCredentialStatus;
|
|
18
|
+
declare const index_w3cEmptyCredentialStatus: typeof w3cEmptyCredentialStatus;
|
|
17
19
|
declare const index_w3cIssuerIdentity: typeof w3cIssuerIdentity;
|
|
18
20
|
declare const index_w3cSignatureIntegrity: typeof w3cSignatureIntegrity;
|
|
19
21
|
declare namespace index {
|
|
20
|
-
export { index_TRANSFERABLE_RECORDS_TYPE as TRANSFERABLE_RECORDS_TYPE, index_credentialStatusTransferableRecordVerifier as credentialStatusTransferableRecordVerifier, index_openAttestationDidIdentityProof as openAttestationDidIdentityProof, index_openAttestationDidSignedDocumentStatus as openAttestationDidSignedDocumentStatus, index_openAttestationDnsDidIdentityProof as openAttestationDnsDidIdentityProof, index_openAttestationDnsTxtIdentityProof as openAttestationDnsTxtIdentityProof, index_openAttestationEthereumDocumentStoreStatus as openAttestationEthereumDocumentStoreStatus, index_openAttestationEthereumTokenRegistryStatus as openAttestationEthereumTokenRegistryStatus, index_openAttestationHash as openAttestationHash, index_w3cCredentialStatus as w3cCredentialStatus, index_w3cIssuerIdentity as w3cIssuerIdentity, index_w3cSignatureIntegrity as w3cSignatureIntegrity };
|
|
22
|
+
export { index_TRANSFERABLE_RECORDS_TYPE as TRANSFERABLE_RECORDS_TYPE, index_credentialStatusTransferableRecordVerifier as credentialStatusTransferableRecordVerifier, index_openAttestationDidIdentityProof as openAttestationDidIdentityProof, index_openAttestationDidSignedDocumentStatus as openAttestationDidSignedDocumentStatus, index_openAttestationDnsDidIdentityProof as openAttestationDnsDidIdentityProof, index_openAttestationDnsTxtIdentityProof as openAttestationDnsTxtIdentityProof, index_openAttestationEthereumDocumentStoreStatus as openAttestationEthereumDocumentStoreStatus, index_openAttestationEthereumTokenRegistryStatus as openAttestationEthereumTokenRegistryStatus, index_openAttestationHash as openAttestationHash, index_w3cCredentialStatus as w3cCredentialStatus, index_w3cEmptyCredentialStatus as w3cEmptyCredentialStatus, index_w3cIssuerIdentity as w3cIssuerIdentity, index_w3cSignatureIntegrity as w3cSignatureIntegrity };
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export { index as i };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL
|
|
|
24
24
|
export { verifyOASignature } from './open-attestation/verify.js';
|
|
25
25
|
export { wrapOADocument, wrapOADocumentV2, wrapOADocuments, wrapOADocumentsV2 } from './open-attestation/wrap.js';
|
|
26
26
|
export { openAttestationVerifiers, verifiers, w3cVerifiers } from './verify/verify.js';
|
|
27
|
-
export { i as fragments } from './index-
|
|
27
|
+
export { i as fragments } from './index-CRVFHzes.js';
|
|
28
28
|
export { i as context } from './index-DwAYXQn2.js';
|
|
29
29
|
export { i as credentialStatus } from './index-CjwEVGoM.js';
|
|
30
30
|
export { i as isser } from './index-ClF4_Nqk.js';
|
|
@@ -57,5 +57,6 @@ import './verify/fragments/document-integrity/w3cSignatureIntegrity.js';
|
|
|
57
57
|
import './verify/fragments/document-status/transferableRecords/transferableRecordVerifier.js';
|
|
58
58
|
import './verify/fragments/document-status/w3cCredentialStatus.js';
|
|
59
59
|
import './verify/fragments/issuer-identity/w3cIssuerIdentity.js';
|
|
60
|
+
import './verify/fragments/document-status/w3cEmptyCredentialStatus/index.js';
|
|
60
61
|
import '@trustvc/w3c-context';
|
|
61
62
|
import '@trustvc/w3c-credential-status';
|
|
@@ -3,4 +3,5 @@ export { w3cSignatureIntegrity } from './document-integrity/w3cSignatureIntegrit
|
|
|
3
3
|
export { TRANSFERABLE_RECORDS_TYPE, credentialStatusTransferableRecordVerifier } from './document-status/transferableRecords/transferableRecordVerifier.js';
|
|
4
4
|
export { w3cCredentialStatus } from './document-status/w3cCredentialStatus.js';
|
|
5
5
|
export { w3cIssuerIdentity } from './issuer-identity/w3cIssuerIdentity.js';
|
|
6
|
+
export { w3cEmptyCredentialStatus } from './document-status/w3cEmptyCredentialStatus/index.js';
|
|
6
7
|
import './document-status/transferableRecords/transferableRecordVerifier.types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { openAttestationVerifiers, verifiers, w3cVerifiers } from './verify.js';
|
|
2
|
-
export { i as fragments } from '../index-
|
|
2
|
+
export { i as fragments } from '../index-CRVFHzes.js';
|
|
3
3
|
export { createResolver, getIdentifier, isValid, openAttestationDidIdentityProof, utils, verificationBuilder, verify } from '@tradetrust-tt/tt-verify';
|
|
4
4
|
export { DocumentsToVerify, ErrorVerificationFragment, InvalidVerificationFragment, ProviderDetails, providerType as ProviderType, SkippedVerificationFragment, ValidVerificationFragment, VerificationBuilderOptions, VerificationFragment, VerificationFragmentStatus, VerificationFragmentType, VerificationFragmentWithData, Verifier, VerifierOptions } from '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
|
5
5
|
import './fragments/document-status/transferableRecords/transferableRecordVerifier.types.js';
|
|
@@ -7,3 +7,4 @@ import './fragments/document-integrity/w3cSignatureIntegrity.js';
|
|
|
7
7
|
import './fragments/document-status/transferableRecords/transferableRecordVerifier.js';
|
|
8
8
|
import './fragments/document-status/w3cCredentialStatus.js';
|
|
9
9
|
import './fragments/issuer-identity/w3cIssuerIdentity.js';
|
|
10
|
+
import './fragments/document-status/w3cEmptyCredentialStatus/index.js';
|
|
@@ -14,6 +14,7 @@ declare const verifiers: {
|
|
|
14
14
|
openAttestationEthereumDocumentStoreStatus: Verifier<_tradetrust_tt_tt_verify.OpenAttestationEthereumDocumentStoreStatusFragment>;
|
|
15
15
|
openAttestationEthereumTokenRegistryStatus: Verifier<_tradetrust_tt_tt_verify.OpenAttestationEthereumTokenRegistryStatusFragment>;
|
|
16
16
|
w3cCredentialStatus: Verifier<VerificationFragment>;
|
|
17
|
+
w3cEmptyCredentialStatus: Verifier<VerificationFragment>;
|
|
17
18
|
credentialStatusTransferableRecordVerifier: VerifierType;
|
|
18
19
|
};
|
|
19
20
|
issuerIdentity: {
|