@sd-jwt/core 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/build/base64url.d.ts +28 -0
- package/build/base64url.js +40 -0
- package/build/base64url.js.map +1 -0
- package/build/hasherAlgorithm.d.ts +70 -0
- package/build/hasherAlgorithm.js +75 -0
- package/build/hasherAlgorithm.js.map +1 -0
- package/build/index.d.ts +11 -0
- package/build/index.js +20 -0
- package/build/index.js.map +1 -0
- package/build/jwt/compact.d.ts +6 -0
- package/build/jwt/compact.js +27 -0
- package/build/jwt/compact.js.map +1 -0
- package/build/jwt/error.d.ts +2 -0
- package/build/jwt/error.js +7 -0
- package/build/jwt/error.js.map +1 -0
- package/build/jwt/index.d.ts +3 -0
- package/build/jwt/index.js +20 -0
- package/build/jwt/index.js.map +1 -0
- package/build/jwt/jwt.d.ts +204 -0
- package/build/jwt/jwt.js +324 -0
- package/build/jwt/jwt.js.map +1 -0
- package/build/keyBinding/index.d.ts +1 -0
- package/build/keyBinding/index.js +18 -0
- package/build/keyBinding/index.js.map +1 -0
- package/build/keyBinding/keyBinding.d.ts +56 -0
- package/build/keyBinding/keyBinding.js +99 -0
- package/build/keyBinding/keyBinding.js.map +1 -0
- package/build/sdJwt/compact.d.ts +8 -0
- package/build/sdJwt/compact.js +39 -0
- package/build/sdJwt/compact.js.map +1 -0
- package/build/sdJwt/decoys.d.ts +2 -0
- package/build/sdJwt/decoys.js +35 -0
- package/build/sdJwt/decoys.js.map +1 -0
- package/build/sdJwt/disclosureFrame.d.ts +7 -0
- package/build/sdJwt/disclosureFrame.js +89 -0
- package/build/sdJwt/disclosureFrame.js.map +1 -0
- package/build/sdJwt/disclosureMapping.d.ts +44 -0
- package/build/sdJwt/disclosureMapping.js +289 -0
- package/build/sdJwt/disclosureMapping.js.map +1 -0
- package/build/sdJwt/disclosures.d.ts +14 -0
- package/build/sdJwt/disclosures.js +59 -0
- package/build/sdJwt/disclosures.js.map +1 -0
- package/build/sdJwt/error.d.ts +2 -0
- package/build/sdJwt/error.js +7 -0
- package/build/sdJwt/error.js.map +1 -0
- package/build/sdJwt/index.d.ts +7 -0
- package/build/sdJwt/index.js +24 -0
- package/build/sdJwt/index.js.map +1 -0
- package/build/sdJwt/presentationFrame.d.ts +4 -0
- package/build/sdJwt/presentationFrame.js +73 -0
- package/build/sdJwt/presentationFrame.js.map +1 -0
- package/build/sdJwt/sdJwt.d.ts +204 -0
- package/build/sdJwt/sdJwt.js +383 -0
- package/build/sdJwt/sdJwt.js.map +1 -0
- package/build/sdJwt/swapClaim.d.ts +3 -0
- package/build/sdJwt/swapClaim.js +90 -0
- package/build/sdJwt/swapClaim.js.map +1 -0
- package/build/sdJwt/types.d.ts +5 -0
- package/build/sdJwt/types.js +3 -0
- package/build/sdJwt/types.js.map +1 -0
- package/build/sdJwtVc/error.d.ts +2 -0
- package/build/sdJwtVc/error.js +7 -0
- package/build/sdJwtVc/error.js.map +1 -0
- package/build/sdJwtVc/index.d.ts +2 -0
- package/build/sdJwtVc/index.js +19 -0
- package/build/sdJwtVc/index.js.map +1 -0
- package/build/sdJwtVc/sdJwtVc.d.ts +47 -0
- package/build/sdJwtVc/sdJwtVc.js +125 -0
- package/build/sdJwtVc/sdJwtVc.js.map +1 -0
- package/build/signatureAndEncryptionAlgorithm.d.ts +105 -0
- package/build/signatureAndEncryptionAlgorithm.js +110 -0
- package/build/signatureAndEncryptionAlgorithm.js.map +1 -0
- package/build/types/disclosure.d.ts +5 -0
- package/build/types/disclosure.js +3 -0
- package/build/types/disclosure.js.map +1 -0
- package/build/types/frame.d.ts +5 -0
- package/build/types/frame.js +3 -0
- package/build/types/frame.js.map +1 -0
- package/build/types/hasher.d.ts +14 -0
- package/build/types/hasher.js +3 -0
- package/build/types/hasher.js.map +1 -0
- package/build/types/index.d.ts +6 -0
- package/build/types/index.js +23 -0
- package/build/types/index.js.map +1 -0
- package/build/types/present.d.ts +2 -0
- package/build/types/present.js +3 -0
- package/build/types/present.js.map +1 -0
- package/build/types/saltGenerator.d.ts +17 -0
- package/build/types/saltGenerator.js +3 -0
- package/build/types/saltGenerator.js.map +1 -0
- package/build/types/signer.d.ts +2 -0
- package/build/types/signer.js +3 -0
- package/build/types/signer.js.map +1 -0
- package/build/types/utils.d.ts +5 -0
- package/build/types/utils.js +3 -0
- package/build/types/utils.js.map +1 -0
- package/build/types/verifier.d.ts +14 -0
- package/build/types/verifier.js +3 -0
- package/build/types/verifier.js.map +1 -0
- package/build/utils/index.d.ts +2 -0
- package/build/utils/index.js +19 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/traverse.d.ts +8 -0
- package/build/utils/traverse.js +29 -0
- package/build/utils/traverse.js.map +1 -0
- package/build/utils/utils.d.ts +7 -0
- package/build/utils/utils.js +109 -0
- package/build/utils/utils.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"present.js","sourceRoot":"","sources":["../../src/types/present.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OrPromise } from './utils';
|
|
2
|
+
/**
|
|
3
|
+
* Function which returns a salt generated by a CSPRNG.
|
|
4
|
+
*
|
|
5
|
+
* Recommended size is 128 bits (i.e. 16 bytes).
|
|
6
|
+
*
|
|
7
|
+
* Salts will not be seeded and a new one will be used for each claim.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* Node.js: `crypto.randomBytes(128 / 8)`
|
|
12
|
+
*
|
|
13
|
+
* React Native: `expo-standard-web-crypto`
|
|
14
|
+
*
|
|
15
|
+
* Browser: `crypto.getRandomValues(new Uint8Array(128 / 8))`
|
|
16
|
+
*/
|
|
17
|
+
export type SaltGenerator = () => OrPromise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saltGenerator.js","sourceRoot":"","sources":["../../src/types/saltGenerator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/types/signer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OrPromise } from './utils';
|
|
2
|
+
export type VerifyOptions<Header extends Record<string, unknown>> = {
|
|
3
|
+
message: string;
|
|
4
|
+
signature: Uint8Array;
|
|
5
|
+
header: Header;
|
|
6
|
+
/**
|
|
7
|
+
* The public key jwk is included when the `sd-jwt` has the following properties:
|
|
8
|
+
*
|
|
9
|
+
* - A `cnf` claim inside the cleartext payload
|
|
10
|
+
* - A Keybinding at the end
|
|
11
|
+
*/
|
|
12
|
+
publicKeyJwk?: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
export type Verifier<Header extends Record<string, unknown> = Record<string, unknown>, options extends Record<string, unknown> = VerifyOptions<Header>> = (options: options) => OrPromise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifier.js","sourceRoot":"","sources":["../../src/types/verifier.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./traverse"), exports);
|
|
18
|
+
__exportStar(require("./utils"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,0CAAuB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.traverseNodes = void 0;
|
|
4
|
+
const traverseNodes = (object, path = []) => {
|
|
5
|
+
const result = [];
|
|
6
|
+
if (typeof object !== 'object' || object === null) {
|
|
7
|
+
return [{ path: [], value: object, isLeaf: true }];
|
|
8
|
+
}
|
|
9
|
+
for (const key in object) {
|
|
10
|
+
if (object.hasOwnProperty(key)) {
|
|
11
|
+
const currentPath = [...path, key];
|
|
12
|
+
const value = object[key];
|
|
13
|
+
// Value must be object / array, and have at least some values in it
|
|
14
|
+
if (typeof value === 'object' &&
|
|
15
|
+
value !== null &&
|
|
16
|
+
Object.keys(value).length > 0) {
|
|
17
|
+
// Recursively traverse nested objects or arrays
|
|
18
|
+
result.push(...(0, exports.traverseNodes)(value, currentPath));
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// Leaf node found
|
|
22
|
+
result.push({ path: currentPath, value, isLeaf: true });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
exports.traverseNodes = traverseNodes;
|
|
29
|
+
//# sourceMappingURL=traverse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CACzB,MAAW,EACX,OAAmB,EAAE,EACX,EAAE;IACZ,MAAM,MAAM,GAAe,EAAE,CAAA;IAE7B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAA;YAClC,MAAM,KAAK,GAAG,MAAM,CAAC,GAA0B,CAAC,CAAA;YAEhD,oEAAoE;YACpE,IACI,OAAO,KAAK,KAAK,QAAQ;gBACzB,KAAK,KAAK,IAAI;gBACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAC/B,CAAC;gBACC,gDAAgD;gBAChD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAa,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAA;YACrD,CAAC;iBAAM,CAAC;gBACJ,kBAAkB;gBAClB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;YAC3D,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAA;AACjB,CAAC,CAAA;AA/BY,QAAA,aAAa,iBA+BzB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getAllKeys: (object: unknown, keys?: Array<string>) => Array<string>;
|
|
2
|
+
export declare const getValueByKeyAnyLevel: <T = unknown>(obj: Record<string, unknown>, key: string) => T | undefined;
|
|
3
|
+
export declare const simpleDeepEqual: (lhs: unknown, rhs: unknown) => boolean;
|
|
4
|
+
export declare const deleteByPath: (object: Record<string, unknown>, path: string[]) => void;
|
|
5
|
+
export declare const getByPath: (item: any[] | Record<string, unknown>, path: Array<string | number>) => unknown;
|
|
6
|
+
export declare const hasByPath: (item: any[] | Record<string, unknown>, path: Array<string | number>) => boolean;
|
|
7
|
+
export declare function isObject(input: any): boolean;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isObject = exports.hasByPath = exports.getByPath = exports.deleteByPath = exports.simpleDeepEqual = exports.getValueByKeyAnyLevel = exports.getAllKeys = void 0;
|
|
4
|
+
const sdJwt_1 = require("../sdJwt");
|
|
5
|
+
const getAllKeys = (object, keys = []) => {
|
|
6
|
+
if (typeof object !== 'object' || typeof object === null)
|
|
7
|
+
return keys;
|
|
8
|
+
const record = object;
|
|
9
|
+
const objectKeys = Object.keys(record);
|
|
10
|
+
const objectValues = Object.values(record);
|
|
11
|
+
keys.push(...objectKeys);
|
|
12
|
+
for (const objectValue of objectValues) {
|
|
13
|
+
if (typeof objectValue === 'object' &&
|
|
14
|
+
objectValue !== null &&
|
|
15
|
+
!Array.isArray(objectValue)) {
|
|
16
|
+
(0, exports.getAllKeys)(objectValue, keys);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return keys;
|
|
20
|
+
};
|
|
21
|
+
exports.getAllKeys = getAllKeys;
|
|
22
|
+
const getValueByKeyAnyLevel = (obj, key) => {
|
|
23
|
+
// Check if the current object has the key
|
|
24
|
+
if (obj && obj.hasOwnProperty(key)) {
|
|
25
|
+
return obj[key];
|
|
26
|
+
}
|
|
27
|
+
// If not found in the current object, iterate over its properties
|
|
28
|
+
for (const prop in obj) {
|
|
29
|
+
if (obj.hasOwnProperty(prop) && typeof obj[prop] === 'object') {
|
|
30
|
+
const result = (0, exports.getValueByKeyAnyLevel)(obj[prop], key);
|
|
31
|
+
if (result !== undefined) {
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.getValueByKeyAnyLevel = getValueByKeyAnyLevel;
|
|
38
|
+
const simpleDeepEqual = (lhs, rhs) => {
|
|
39
|
+
if (lhs === rhs)
|
|
40
|
+
return true;
|
|
41
|
+
if (typeof lhs !== 'object' || typeof rhs !== 'object')
|
|
42
|
+
return false;
|
|
43
|
+
const l = Object.assign({}, lhs);
|
|
44
|
+
const r = Object.assign({}, rhs);
|
|
45
|
+
Object.keys(l).forEach((key) => l[key] === undefined && delete l[key]);
|
|
46
|
+
Object.keys(r).forEach((key) => r[key] === undefined && delete r[key]);
|
|
47
|
+
const keys1 = Object.keys(l);
|
|
48
|
+
const keys2 = Object.keys(r);
|
|
49
|
+
if (keys1.length !== keys2.length)
|
|
50
|
+
return false;
|
|
51
|
+
return keys1.every((key) => (0, exports.simpleDeepEqual)(l[key], r[key]));
|
|
52
|
+
};
|
|
53
|
+
exports.simpleDeepEqual = simpleDeepEqual;
|
|
54
|
+
const deleteByPath = (object, path) => {
|
|
55
|
+
let currentObject = object;
|
|
56
|
+
const parts = [...path];
|
|
57
|
+
const last = parts.pop();
|
|
58
|
+
for (const part of parts) {
|
|
59
|
+
currentObject = currentObject[part];
|
|
60
|
+
if (!currentObject) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (last) {
|
|
65
|
+
delete currentObject[last];
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.deleteByPath = deleteByPath;
|
|
69
|
+
const getByPath = (item, path) => {
|
|
70
|
+
let current = item;
|
|
71
|
+
for (const key of path) {
|
|
72
|
+
if (Array.isArray(current)) {
|
|
73
|
+
const keyAsNumber = Number(key);
|
|
74
|
+
if (isNaN(keyAsNumber)) {
|
|
75
|
+
throw new sdJwt_1.SdJwtError(`Unable to get ${path.join('.')} from array ${item}. ${key} is not a number.`);
|
|
76
|
+
}
|
|
77
|
+
if (keyAsNumber >= current.length) {
|
|
78
|
+
throw new sdJwt_1.SdJwtError(`Unable to get ${path.join('.')} from array ${item}. ${key} is out of bounds.`);
|
|
79
|
+
}
|
|
80
|
+
current = current[keyAsNumber];
|
|
81
|
+
}
|
|
82
|
+
else if (typeof current === 'object' && current !== null) {
|
|
83
|
+
if (!(key in current)) {
|
|
84
|
+
throw new sdJwt_1.SdJwtError(`Unable to get ${path.join('.')} from ${item}. ${key} does not exists in ${current}.`);
|
|
85
|
+
}
|
|
86
|
+
current = current[key];
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
throw new sdJwt_1.SdJwtError(`Unable to get ${path.join('.')} from ${item}. ${key} is not an object or array.`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return current;
|
|
93
|
+
};
|
|
94
|
+
exports.getByPath = getByPath;
|
|
95
|
+
const hasByPath = (item, path) => {
|
|
96
|
+
try {
|
|
97
|
+
(0, exports.getByPath)(item, path);
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
catch (_a) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
exports.hasByPath = hasByPath;
|
|
105
|
+
function isObject(input) {
|
|
106
|
+
return typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
107
|
+
}
|
|
108
|
+
exports.isObject = isObject;
|
|
109
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":";;;AAAA,oCAAqC;AAE9B,MAAM,UAAU,GAAG,CACtB,MAAe,EACf,OAAsB,EAAE,EACX,EAAE;IACf,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACrE,MAAM,MAA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AAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;QAC1B,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,kBAAU,CAChB,iBAAiB,IAAI,CAAC,IAAI,CACtB,GAAG,CACN,SAAS,IAAI,KAAK,GAAG,6BAA6B,CACtD,CAAA;QACL,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAA;AAClB,CAAC,CAAA;AAzCY,QAAA,SAAS,aAyCrB;AAEM,MAAM,SAAS,GAAG,CACrB,IAAqC,EACrC,IAA4B,EACrB,EAAE;IACT,IAAI,CAAC;QACD,IAAA,iBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACrB,OAAO,IAAI,CAAA;IACf,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,KAAK,CAAA;IAChB,CAAC;AACL,CAAC,CAAA;AAVY,QAAA,SAAS,aAUrB;AAED,SAAgB,QAAQ,CAAC,KAAU;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC/E,CAAC;AAFD,4BAEC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sd-jwt/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core implementation of sd-jwt Draft 06 and sd-jwt-vc Draft 01",
|
|
5
|
+
"license": "(MIT OR Apache-2.0)",
|
|
6
|
+
"author": "Berend Sliedrecht <sliedrecht@berend.io>",
|
|
7
|
+
"readme": "README.md",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"jwt",
|
|
10
|
+
"jwt-sd",
|
|
11
|
+
"sd-jwt",
|
|
12
|
+
"sd-jwt-vc",
|
|
13
|
+
"decentralized-identity",
|
|
14
|
+
"ssi",
|
|
15
|
+
"oauth",
|
|
16
|
+
"oauth2",
|
|
17
|
+
"openid-connect"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"url": "https://github.com/berendsliedrecht/sd-jwt-ts",
|
|
21
|
+
"type": "git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/berendsliedrecht/sd-jwt-ts",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/berendsliedrecht/sd-jwt-ts/issues",
|
|
26
|
+
"email": "sliedrecht@berend.io"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"main": "build/index.js",
|
|
32
|
+
"files": [
|
|
33
|
+
"build",
|
|
34
|
+
"LICENSE-MIT",
|
|
35
|
+
"LICENSE-APACHE-2.0"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"test": "node --require ts-node/register --test ./tests/*.test.ts",
|
|
40
|
+
"release": "release-it"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"buffer": "*"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "*",
|
|
47
|
+
"ts-node": "*",
|
|
48
|
+
"typescript": "*"
|
|
49
|
+
}
|
|
50
|
+
}
|