@sd-jwt/sd-jwt-vc 0.1.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/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@sd-jwt/sd-jwt-vc",
3
+ "version": "0.1.0",
4
+ "description": "sd-jwt draft 7 implementation in typescript",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "rm -rf **/dist && tsup",
16
+ "lint": "biome lint ./src",
17
+ "test": "pnpm run test:node && pnpm run test:browser && pnpm run test:e2e && pnpm run test:cov",
18
+ "test:node": "vitest run ./src/test/*.spec.ts",
19
+ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom",
20
+ "test:e2e": "vitest run ./test/*e2e.spec.ts --environment node",
21
+ "test:cov": "vitest run --coverage"
22
+ },
23
+ "keywords": [
24
+ "sd-jwt",
25
+ "sdjwt",
26
+ "sd-jwt-vc"
27
+ ],
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "repository": {
32
+ "url": "https://github.com/openwallet-foundation/sd-jwt-js"
33
+ },
34
+ "author": "Lukas.J.Han <lukas.j.han@gmail.com>",
35
+ "homepage": "https://github.com/openwallet-foundation/sd-jwt-js/wiki",
36
+ "bugs": {
37
+ "url": "https://github.com/openwallet-foundation/sd-jwt-js/issues"
38
+ },
39
+ "license": "Apache-2.0",
40
+ "dependencies": {
41
+ "@owf/token-status-list": "^0.1.0-alpha-20260312123226",
42
+ "@sd-jwt/core": "0.1.0",
43
+ "zod": "^4.3.5"
44
+ },
45
+ "devDependencies": {
46
+ "@owf/crypto": "^0.1.0-alpha-20260312123226",
47
+ "jose": "^6.1.2",
48
+ "msw": "^2.12.3"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "tsup": {
54
+ "entry": [
55
+ "./src/index.ts"
56
+ ],
57
+ "sourceMap": true,
58
+ "splitting": false,
59
+ "clean": true,
60
+ "dts": true,
61
+ "format": [
62
+ "cjs",
63
+ "esm"
64
+ ]
65
+ },
66
+ "gitHead": "13a269ea5d9459fee02dd65de8d13361d94402d2"
67
+ }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './sd-jwt-vc-config';
2
+ export * from './sd-jwt-vc-instance';
3
+ export * from './sd-jwt-vc-payload';
4
+ export * from './sd-jwt-vc-status-reference';
5
+ export * from './sd-jwt-vc-type-metadata-format';
6
+ export * from './sd-jwt-vc-vct';
7
+ export * from './verification-result';
@@ -0,0 +1,25 @@
1
+ import type { SDJWTConfig, Verifier } from '@sd-jwt/core';
2
+ import type { VCTFetcher } from './sd-jwt-vc-vct';
3
+
4
+ export type StatusListFetcher = (uri: string) => Promise<string>;
5
+ export type StatusValidator = (status: number) => Promise<void>;
6
+
7
+ /**
8
+ * Configuration for SD-JWT-VC
9
+ */
10
+ export type SDJWTVCConfig = SDJWTConfig & {
11
+ // A function that fetches the status list from the uri. If not provided, the library will assume that the response is a compact JWT.
12
+ statusListFetcher?: StatusListFetcher;
13
+ // validte the status and decide if the status is valid or not. If not provided, the code will continue if it is 0, otherwise it will throw an error.
14
+ statusValidator?: StatusValidator;
15
+ // a function that fetches the type metadata format from the uri. If not provided, the library will assume that the response is a TypeMetadataFormat. Caching has to be implemented in this function. If the integrity value is passed, it to be validated according to https://www.w3.org/TR/SRI/
16
+ vctFetcher?: VCTFetcher;
17
+ // a function that verifies the status of the JWT. If not provided, the library will assume that the status is valid if it is 0.
18
+ statusVerifier?: Verifier;
19
+ // if set to true, it will load the metadata format based on the vct value. If not provided, it will default to false.
20
+ loadTypeMetadataFormat?: boolean;
21
+ // timeout value in milliseconds when to abort the fetch request. If not provided, it will default to 10000.
22
+ timeout?: number;
23
+ // maximum depth of extends chain to resolve. If not provided, it will default to 5. Set to -1 to not limit the vct extends depth.
24
+ maxVctExtendsDepth?: number;
25
+ };