@trustvc/trustvc 0.0.0 → 1.0.0-alpha.2
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/LICENSE +201 -0
- package/dist/__tests__/fixtures/fixtures.d.mts +436 -0
- package/dist/__tests__/fixtures/fixtures.d.ts +436 -0
- package/dist/__tests__/fixtures/fixtures.js +715 -0
- package/dist/core/decrypt.d.mts +3 -0
- package/dist/core/decrypt.d.ts +3 -0
- package/dist/core/decrypt.js +23 -0
- package/dist/core/encrypt.d.mts +3 -0
- package/dist/core/encrypt.d.ts +3 -0
- package/dist/core/encrypt.js +23 -0
- package/dist/core/fragments/document-integrity/w3cSignatureIntegrity.d.mts +5 -0
- package/dist/core/fragments/document-integrity/w3cSignatureIntegrity.d.ts +5 -0
- package/dist/core/fragments/document-integrity/w3cSignatureIntegrity.js +48 -0
- package/dist/core/fragments/document-status/w3cCredentialStatus.d.mts +5 -0
- package/dist/core/fragments/document-status/w3cCredentialStatus.d.ts +5 -0
- package/dist/core/fragments/document-status/w3cCredentialStatus.js +54 -0
- package/dist/core/fragments/issuer-identity/w3cIssuerIdentity.d.mts +5 -0
- package/dist/core/fragments/issuer-identity/w3cIssuerIdentity.d.ts +5 -0
- package/dist/core/fragments/issuer-identity/w3cIssuerIdentity.js +74 -0
- package/dist/core/index.d.mts +5 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +26 -0
- package/dist/core/verify.d.mts +6 -0
- package/dist/core/verify.d.ts +6 -0
- package/dist/core/verify.js +34 -0
- package/dist/esm/__tests__/fixtures/fixtures.js +701 -0
- package/dist/esm/core/decrypt.js +21 -0
- package/dist/esm/core/encrypt.js +21 -0
- package/dist/esm/core/fragments/document-integrity/w3cSignatureIntegrity.js +46 -0
- package/dist/esm/core/fragments/document-status/w3cCredentialStatus.js +52 -0
- package/dist/esm/core/fragments/issuer-identity/w3cIssuerIdentity.js +72 -0
- package/dist/esm/core/index.js +3 -0
- package/dist/esm/core/verify.js +32 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/open-attestation/index.js +4 -0
- package/dist/esm/open-attestation/sign.js +10 -0
- package/dist/esm/open-attestation/types.js +1 -0
- package/dist/esm/open-attestation/verify.js +13 -0
- package/dist/esm/open-attestation/wrap.js +10 -0
- package/dist/esm/utils/stringUtils.js +21 -0
- package/dist/esm/w3c/index.js +3 -0
- package/dist/esm/w3c/sign.js +9 -0
- package/dist/esm/w3c/types.js +2 -0
- package/dist/esm/w3c/verify.js +9 -0
- package/dist/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +24 -0
- package/dist/open-attestation/index.d.mts +6 -0
- package/dist/open-attestation/index.d.ts +6 -0
- package/dist/open-attestation/index.js +33 -0
- package/dist/open-attestation/sign.d.mts +7 -0
- package/dist/open-attestation/sign.d.ts +7 -0
- package/dist/open-attestation/sign.js +12 -0
- package/dist/open-attestation/types.d.mts +8 -0
- package/dist/open-attestation/types.d.ts +8 -0
- package/dist/open-attestation/types.js +18 -0
- package/dist/open-attestation/verify.d.mts +5 -0
- package/dist/open-attestation/verify.d.ts +5 -0
- package/dist/open-attestation/verify.js +15 -0
- package/dist/open-attestation/wrap.d.mts +5 -0
- package/dist/open-attestation/wrap.d.ts +5 -0
- package/dist/open-attestation/wrap.js +12 -0
- package/dist/utils/stringUtils.d.mts +5 -0
- package/dist/utils/stringUtils.d.ts +5 -0
- package/dist/utils/stringUtils.js +25 -0
- package/dist/w3c/index.d.mts +4 -0
- package/dist/w3c/index.d.ts +4 -0
- package/dist/w3c/index.js +26 -0
- package/dist/w3c/sign.d.mts +6 -0
- package/dist/w3c/sign.d.ts +6 -0
- package/dist/w3c/sign.js +11 -0
- package/dist/w3c/types.d.mts +2 -0
- package/dist/w3c/types.d.ts +2 -0
- package/dist/w3c/types.js +27 -0
- package/dist/w3c/verify.d.mts +5 -0
- package/dist/w3c/verify.d.ts +5 -0
- package/dist/w3c/verify.js +11 -0
- package/package.json +16 -2
- package/dist/.coverage/.tmp/coverage-0.json +0 -1
- package/dist/esm/.coverage/.tmp/coverage-0.json +0 -1
- package/dist/esm/node_modules/.vitest/vitest/results.json +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/node_modules/.vitest/vitest/results.json +0 -1
- package/dist/types.d.mts +0 -2
- package/dist/types.d.ts +0 -2
- package/dist/types.js +0 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var sign = require('./sign');
|
|
4
|
+
var verify = require('./verify');
|
|
5
|
+
var types = require('./types');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.keys(sign).forEach(function (k) {
|
|
10
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return sign[k]; }
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
Object.keys(verify).forEach(function (k) {
|
|
16
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return verify[k]; }
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
Object.keys(types).forEach(function (k) {
|
|
22
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return types[k]; }
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RawVerifiableCredential, SigningResult } from '@trustvc/w3c-vc';
|
|
2
|
+
import { PrivateKeyPair } from '@trustvc/w3c-issuer';
|
|
3
|
+
|
|
4
|
+
declare const signW3C: (credential: RawVerifiableCredential, keyPair: PrivateKeyPair, cryptoSuite?: string) => Promise<SigningResult>;
|
|
5
|
+
|
|
6
|
+
export { signW3C };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RawVerifiableCredential, SigningResult } from '@trustvc/w3c-vc';
|
|
2
|
+
import { PrivateKeyPair } from '@trustvc/w3c-issuer';
|
|
3
|
+
|
|
4
|
+
declare const signW3C: (credential: RawVerifiableCredential, keyPair: PrivateKeyPair, cryptoSuite?: string) => Promise<SigningResult>;
|
|
5
|
+
|
|
6
|
+
export { signW3C };
|
package/dist/w3c/sign.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var w3cVc = require('@trustvc/w3c-vc');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
const signW3C = /* @__PURE__ */ __name(async (credential, keyPair, cryptoSuite = "BbsBlsSignature2020") => {
|
|
8
|
+
return w3cVc.signCredential(credential, keyPair, cryptoSuite);
|
|
9
|
+
}, "signW3C");
|
|
10
|
+
|
|
11
|
+
exports.signW3C = signW3C;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var w3cVc = require('@trustvc/w3c-vc');
|
|
4
|
+
var w3cIssuer = require('@trustvc/w3c-issuer');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "RawVerifiableCredential", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return w3cVc.RawVerifiableCredential; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SignedVerifiableCredential", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return w3cVc.SignedVerifiableCredential; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "SigningResult", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return w3cVc.SigningResult; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "VerificationResult", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return w3cVc.VerificationResult; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "PrivateKeyPair", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return w3cIssuer.PrivateKeyPair; }
|
|
27
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var w3cVc = require('@trustvc/w3c-vc');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
const verifyW3CSignature = /* @__PURE__ */ __name(async (credential) => {
|
|
8
|
+
return w3cVc.verifyCredential(credential);
|
|
9
|
+
}, "verifyW3CSignature");
|
|
10
|
+
|
|
11
|
+
exports.verifyW3CSignature = verifyW3CSignature;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustvc/trustvc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"description": "TrustVC library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"test": "npx vitest --run",
|
|
12
|
+
"test": "npx vitest --run --test-timeout=15000",
|
|
13
13
|
"lint": "tsc && npx eslint . --color --format=table --max-warnings=0",
|
|
14
14
|
"build": "npm run clean && tsup",
|
|
15
15
|
"clean": "rm -rf dist/",
|
|
@@ -32,13 +32,27 @@
|
|
|
32
32
|
"require": "./dist/index.js"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@govtechsg/oa-verify": "9.3.0-beta.4",
|
|
37
|
+
"@govtechsg/open-attestation": "6.10.0-beta.7",
|
|
38
|
+
"@trustvc/w3c-context": "1.0.0-alpha.1",
|
|
39
|
+
"@trustvc/w3c-issuer": "1.0.0-alpha.1",
|
|
40
|
+
"@trustvc/w3c-vc": "1.0.0-alpha.1",
|
|
41
|
+
"did-resolver": "^4.1.0",
|
|
42
|
+
"js-sha3": "^0.9.3",
|
|
43
|
+
"ts-chacha20": "^1.2.0",
|
|
44
|
+
"web-did-resolver": "^2.0.27"
|
|
45
|
+
},
|
|
35
46
|
"devDependencies": {
|
|
36
47
|
"@commitlint/cli": "^19.3.0",
|
|
37
48
|
"@commitlint/config-conventional": "^19.2.2",
|
|
38
49
|
"@commitlint/config-nx-scopes": "^19.5.0",
|
|
39
50
|
"@commitlint/prompt": "^19.3.1",
|
|
51
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
52
|
+
"@semantic-release/git": "^10.0.1",
|
|
40
53
|
"@semantic-release/npm": "^9.0.2",
|
|
41
54
|
"@types/conventional-commits-parser": "^5.0.0",
|
|
55
|
+
"@types/lodash": "^4.17.10",
|
|
42
56
|
"@types/node": "^18.17.0",
|
|
43
57
|
"@vitest/coverage-v8": "^1.6.0",
|
|
44
58
|
"cpy": "^11.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"result":[{"scriptId":"662","url":"file:///Users/haninn/Documents/Git/TradeTrust/trustvc/src/index.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1301,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1301,"count":1},{"startOffset":295,"endOffset":1300,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":331,"endOffset":439,"count":0}],"isBlockCoverage":false}]}]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"result":[{"scriptId":"662","url":"file:///Users/haninn/Documents/Git/TradeTrust/trustvc/src/index.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1301,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1301,"count":1},{"startOffset":295,"endOffset":1300,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":331,"endOffset":439,"count":0}],"isBlockCoverage":false}]}]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"1.6.0","results":[[":index.test.ts",{"duration":0,"failed":true}]]}
|
package/dist/esm/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"1.6.0","results":[[":index.test.ts",{"duration":0,"failed":true}]]}
|
package/dist/types.d.mts
DELETED
package/dist/types.d.ts
DELETED
package/dist/types.js
DELETED