@enbox/dids 0.0.2 → 0.0.3
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/README.md +41 -1
- package/dist/browser.js +6 -10
- package/dist/browser.js.map +4 -4
- package/dist/browser.mjs +6 -10
- package/dist/browser.mjs.map +4 -4
- package/dist/esm/bearer-did.js +5 -5
- package/dist/esm/bearer-did.js.map +1 -1
- package/dist/esm/did.js +13 -6
- package/dist/esm/did.js.map +1 -1
- package/dist/esm/methods/did-dht.js +34 -25
- package/dist/esm/methods/did-dht.js.map +1 -1
- package/dist/esm/methods/did-ion.js +9 -7
- package/dist/esm/methods/did-ion.js.map +1 -1
- package/dist/esm/methods/did-jwk.js +3 -3
- package/dist/esm/methods/did-jwk.js.map +1 -1
- package/dist/esm/methods/did-key.js +12 -240
- package/dist/esm/methods/did-key.js.map +1 -1
- package/dist/esm/methods/did-web.js +3 -2
- package/dist/esm/methods/did-web.js.map +1 -1
- package/dist/esm/resolver/resolver-cache-level.js +1 -1
- package/dist/esm/resolver/resolver-cache-level.js.map +1 -1
- package/dist/esm/resolver/resolver-cache-noop.js +10 -10
- package/dist/esm/resolver/resolver-cache-noop.js.map +1 -1
- package/dist/esm/resolver/universal-resolver.js +3 -3
- package/dist/esm/resolver/universal-resolver.js.map +1 -1
- package/dist/esm/utils.js +37 -21
- package/dist/esm/utils.js.map +1 -1
- package/dist/types/bearer-did.d.ts +3 -2
- package/dist/types/bearer-did.d.ts.map +1 -1
- package/dist/types/did.d.ts.map +1 -1
- package/dist/types/methods/did-dht.d.ts +4 -4
- package/dist/types/methods/did-dht.d.ts.map +1 -1
- package/dist/types/methods/did-ion.d.ts +3 -2
- package/dist/types/methods/did-ion.d.ts.map +1 -1
- package/dist/types/methods/did-jwk.d.ts +2 -2
- package/dist/types/methods/did-jwk.d.ts.map +1 -1
- package/dist/types/methods/did-key.d.ts +3 -52
- package/dist/types/methods/did-key.d.ts.map +1 -1
- package/dist/types/methods/did-method.d.ts +3 -3
- package/dist/types/methods/did-method.d.ts.map +1 -1
- package/dist/types/resolver/resolver-cache-level.d.ts.map +1 -1
- package/dist/types/resolver/universal-resolver.d.ts +2 -2
- package/dist/types/resolver/universal-resolver.d.ts.map +1 -1
- package/dist/types/types/did-core.d.ts +1 -1
- package/dist/types/types/did-core.d.ts.map +1 -1
- package/dist/types/utils.d.ts +8 -5
- package/dist/types/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -5
- package/dist/utils.js.map +4 -4
- package/package.json +30 -40
- package/src/bearer-did.ts +12 -11
- package/src/did.ts +8 -6
- package/src/methods/did-dht.ts +35 -35
- package/src/methods/did-ion.ts +12 -11
- package/src/methods/did-jwk.ts +6 -6
- package/src/methods/did-key.ts +24 -305
- package/src/methods/did-method.ts +3 -3
- package/src/methods/did-web.ts +2 -2
- package/src/resolver/resolver-cache-level.ts +4 -4
- package/src/resolver/resolver-cache-noop.ts +10 -10
- package/src/resolver/universal-resolver.ts +5 -5
- package/src/types/did-core.ts +3 -3
- package/src/utils.ts +28 -26
- package/dist/cjs/index.js +0 -6303
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/utils.js +0 -245
- package/dist/cjs/utils.js.map +0 -7
package/dist/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type": "commonjs"}
|
package/dist/cjs/utils.js
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// dist/esm/utils.js
|
|
21
|
-
var utils_exports = {};
|
|
22
|
-
__export(utils_exports, {
|
|
23
|
-
extractDidFragment: () => extractDidFragment,
|
|
24
|
-
getServices: () => getServices,
|
|
25
|
-
getVerificationMethodByKey: () => getVerificationMethodByKey,
|
|
26
|
-
getVerificationMethodTypes: () => getVerificationMethodTypes,
|
|
27
|
-
getVerificationMethods: () => getVerificationMethods,
|
|
28
|
-
getVerificationRelationshipsById: () => getVerificationRelationshipsById,
|
|
29
|
-
isDidService: () => isDidService,
|
|
30
|
-
isDidVerificationMethod: () => isDidVerificationMethod,
|
|
31
|
-
isDwnDidService: () => isDwnDidService,
|
|
32
|
-
keyBytesToMultibaseId: () => keyBytesToMultibaseId,
|
|
33
|
-
multibaseIdToKeyBytes: () => multibaseIdToKeyBytes
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(utils_exports);
|
|
36
|
-
var import_common = require("@enbox/common");
|
|
37
|
-
var import_crypto = require("@enbox/crypto");
|
|
38
|
-
|
|
39
|
-
// dist/esm/did-error.js
|
|
40
|
-
var DidError = class _DidError extends Error {
|
|
41
|
-
/**
|
|
42
|
-
* Constructs an instance of DidError, a custom error class for handling DID-related errors.
|
|
43
|
-
*
|
|
44
|
-
* @param code - A {@link DidErrorCode} representing the specific type of error encountered.
|
|
45
|
-
* @param message - A human-readable description of the error.
|
|
46
|
-
*/
|
|
47
|
-
constructor(code, message) {
|
|
48
|
-
super(`${code}: ${message}`);
|
|
49
|
-
this.code = code;
|
|
50
|
-
this.name = "DidError";
|
|
51
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
52
|
-
if (Error.captureStackTrace) {
|
|
53
|
-
Error.captureStackTrace(this, _DidError);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
var DidErrorCode;
|
|
58
|
-
(function(DidErrorCode2) {
|
|
59
|
-
DidErrorCode2["InvalidDid"] = "invalidDid";
|
|
60
|
-
DidErrorCode2["MethodNotSupported"] = "methodNotSupported";
|
|
61
|
-
DidErrorCode2["InternalError"] = "internalError";
|
|
62
|
-
DidErrorCode2["InvalidDidDocument"] = "invalidDidDocument";
|
|
63
|
-
DidErrorCode2["InvalidDidDocumentLength"] = "invalidDidDocumentLength";
|
|
64
|
-
DidErrorCode2["InvalidDidUrl"] = "invalidDidUrl";
|
|
65
|
-
DidErrorCode2["InvalidPreviousDidProof"] = "invalidPreviousDidProof";
|
|
66
|
-
DidErrorCode2["InvalidPublicKey"] = "invalidPublicKey";
|
|
67
|
-
DidErrorCode2["InvalidPublicKeyLength"] = "invalidPublicKeyLength";
|
|
68
|
-
DidErrorCode2["InvalidPublicKeyType"] = "invalidPublicKeyType";
|
|
69
|
-
DidErrorCode2["InvalidSignature"] = "invalidSignature";
|
|
70
|
-
DidErrorCode2["NotFound"] = "notFound";
|
|
71
|
-
DidErrorCode2["RepresentationNotSupported"] = "representationNotSupported";
|
|
72
|
-
DidErrorCode2["UnsupportedPublicKeyType"] = "unsupportedPublicKeyType";
|
|
73
|
-
})(DidErrorCode || (DidErrorCode = {}));
|
|
74
|
-
|
|
75
|
-
// dist/esm/types/did-core.js
|
|
76
|
-
var DidVerificationRelationship;
|
|
77
|
-
(function(DidVerificationRelationship2) {
|
|
78
|
-
DidVerificationRelationship2["authentication"] = "authentication";
|
|
79
|
-
DidVerificationRelationship2["assertionMethod"] = "assertionMethod";
|
|
80
|
-
DidVerificationRelationship2["keyAgreement"] = "keyAgreement";
|
|
81
|
-
DidVerificationRelationship2["capabilityInvocation"] = "capabilityInvocation";
|
|
82
|
-
DidVerificationRelationship2["capabilityDelegation"] = "capabilityDelegation";
|
|
83
|
-
})(DidVerificationRelationship || (DidVerificationRelationship = {}));
|
|
84
|
-
|
|
85
|
-
// dist/esm/utils.js
|
|
86
|
-
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
87
|
-
function adopt(value) {
|
|
88
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
89
|
-
resolve(value);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
93
|
-
function fulfilled(value) {
|
|
94
|
-
try {
|
|
95
|
-
step(generator.next(value));
|
|
96
|
-
} catch (e) {
|
|
97
|
-
reject(e);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
function rejected(value) {
|
|
101
|
-
try {
|
|
102
|
-
step(generator["throw"](value));
|
|
103
|
-
} catch (e) {
|
|
104
|
-
reject(e);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function step(result) {
|
|
108
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
109
|
-
}
|
|
110
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
function extractDidFragment(input) {
|
|
114
|
-
if (typeof input !== "string")
|
|
115
|
-
return void 0;
|
|
116
|
-
if (input.length === 0)
|
|
117
|
-
return void 0;
|
|
118
|
-
return input.split("#").pop();
|
|
119
|
-
}
|
|
120
|
-
function getServices({ didDocument, id, type }) {
|
|
121
|
-
var _a, _b;
|
|
122
|
-
return (_b = (_a = didDocument === null || didDocument === void 0 ? void 0 : didDocument.service) === null || _a === void 0 ? void 0 : _a.filter((service) => {
|
|
123
|
-
if (id && service.id !== id)
|
|
124
|
-
return false;
|
|
125
|
-
if (type && service.type !== type)
|
|
126
|
-
return false;
|
|
127
|
-
return true;
|
|
128
|
-
})) !== null && _b !== void 0 ? _b : [];
|
|
129
|
-
}
|
|
130
|
-
function getVerificationMethodByKey(_a) {
|
|
131
|
-
return __awaiter(this, arguments, void 0, function* ({ didDocument, publicKeyJwk, publicKeyMultibase }) {
|
|
132
|
-
const verificationMethods = getVerificationMethods({ didDocument });
|
|
133
|
-
for (let method of verificationMethods) {
|
|
134
|
-
if (publicKeyJwk && method.publicKeyJwk) {
|
|
135
|
-
const publicKeyThumbprint = yield (0, import_crypto.computeJwkThumbprint)({ jwk: publicKeyJwk });
|
|
136
|
-
if (publicKeyThumbprint === (yield (0, import_crypto.computeJwkThumbprint)({ jwk: method.publicKeyJwk }))) {
|
|
137
|
-
return method;
|
|
138
|
-
}
|
|
139
|
-
} else if (publicKeyMultibase && method.publicKeyMultibase) {
|
|
140
|
-
if (publicKeyMultibase === method.publicKeyMultibase) {
|
|
141
|
-
return method;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return null;
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
function getVerificationMethods({ didDocument }) {
|
|
149
|
-
var _a, _b;
|
|
150
|
-
if (!didDocument)
|
|
151
|
-
throw new TypeError(`Required parameter missing: 'didDocument'`);
|
|
152
|
-
const verificationMethods = [];
|
|
153
|
-
verificationMethods.push(...(_b = (_a = didDocument.verificationMethod) === null || _a === void 0 ? void 0 : _a.filter(isDidVerificationMethod)) !== null && _b !== void 0 ? _b : []);
|
|
154
|
-
Object.keys(DidVerificationRelationship).forEach((relationship) => {
|
|
155
|
-
var _a2, _b2;
|
|
156
|
-
verificationMethods.push(...(_b2 = (_a2 = didDocument[relationship]) === null || _a2 === void 0 ? void 0 : _a2.filter(isDidVerificationMethod)) !== null && _b2 !== void 0 ? _b2 : []);
|
|
157
|
-
});
|
|
158
|
-
return verificationMethods;
|
|
159
|
-
}
|
|
160
|
-
function getVerificationMethodTypes({ didDocument }) {
|
|
161
|
-
const verificationMethods = getVerificationMethods({ didDocument });
|
|
162
|
-
const types = verificationMethods.map((method) => method.type);
|
|
163
|
-
return [...new Set(types)];
|
|
164
|
-
}
|
|
165
|
-
function getVerificationRelationshipsById({ didDocument, methodId }) {
|
|
166
|
-
const relationships = [];
|
|
167
|
-
Object.keys(DidVerificationRelationship).forEach((relationship) => {
|
|
168
|
-
if (Array.isArray(didDocument[relationship])) {
|
|
169
|
-
const relationshipMethods = didDocument[relationship];
|
|
170
|
-
const methodIdFragment = extractDidFragment(methodId);
|
|
171
|
-
const containsMethodId = relationshipMethods.some((method) => {
|
|
172
|
-
const isByReferenceMatch = extractDidFragment(method) === methodIdFragment;
|
|
173
|
-
const isEmbeddedMethodMatch = isDidVerificationMethod(method) && extractDidFragment(method.id) === methodIdFragment;
|
|
174
|
-
return isByReferenceMatch || isEmbeddedMethodMatch;
|
|
175
|
-
});
|
|
176
|
-
if (containsMethodId) {
|
|
177
|
-
relationships.push(relationship);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
return relationships;
|
|
182
|
-
}
|
|
183
|
-
function isDidService(obj) {
|
|
184
|
-
if (!obj || typeof obj !== "object" || obj === null)
|
|
185
|
-
return false;
|
|
186
|
-
return "id" in obj && "type" in obj && "serviceEndpoint" in obj;
|
|
187
|
-
}
|
|
188
|
-
function isDwnDidService(obj) {
|
|
189
|
-
if (!isDidService(obj))
|
|
190
|
-
return false;
|
|
191
|
-
if (obj.type !== "DecentralizedWebNode")
|
|
192
|
-
return false;
|
|
193
|
-
if (!("enc" in obj && "sig" in obj))
|
|
194
|
-
return false;
|
|
195
|
-
const isStringOrStringArray = (prop) => typeof prop === "string" || Array.isArray(prop) && prop.every((item) => typeof item === "string");
|
|
196
|
-
return isStringOrStringArray(obj.enc) && isStringOrStringArray(obj.sig);
|
|
197
|
-
}
|
|
198
|
-
function isDidVerificationMethod(obj) {
|
|
199
|
-
if (!obj || typeof obj !== "object" || obj === null)
|
|
200
|
-
return false;
|
|
201
|
-
if (!("id" in obj && "type" in obj && "controller" in obj))
|
|
202
|
-
return false;
|
|
203
|
-
if (typeof obj.id !== "string")
|
|
204
|
-
return false;
|
|
205
|
-
if (typeof obj.type !== "string")
|
|
206
|
-
return false;
|
|
207
|
-
if (typeof obj.controller !== "string")
|
|
208
|
-
return false;
|
|
209
|
-
return true;
|
|
210
|
-
}
|
|
211
|
-
function keyBytesToMultibaseId({ keyBytes, multicodecCode, multicodecName }) {
|
|
212
|
-
const prefixedKey = import_common.Multicodec.addPrefix({
|
|
213
|
-
code: multicodecCode,
|
|
214
|
-
data: keyBytes,
|
|
215
|
-
name: multicodecName
|
|
216
|
-
});
|
|
217
|
-
const prefixedKeyB58 = import_common.Convert.uint8Array(prefixedKey).toBase58Btc();
|
|
218
|
-
const multibaseKeyId = import_common.Convert.base58Btc(prefixedKeyB58).toMultibase();
|
|
219
|
-
return multibaseKeyId;
|
|
220
|
-
}
|
|
221
|
-
function multibaseIdToKeyBytes({ multibaseKeyId }) {
|
|
222
|
-
try {
|
|
223
|
-
const prefixedKeyB58 = import_common.Convert.multibase(multibaseKeyId).toBase58Btc();
|
|
224
|
-
const prefixedKey = import_common.Convert.base58Btc(prefixedKeyB58).toUint8Array();
|
|
225
|
-
const { code, data, name } = import_common.Multicodec.removePrefix({ prefixedData: prefixedKey });
|
|
226
|
-
return { keyBytes: data, multicodecCode: code, multicodecName: name };
|
|
227
|
-
} catch (error) {
|
|
228
|
-
throw new DidError(DidErrorCode.InvalidDid, `Invalid multibase identifier: ${multibaseKeyId}`);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
232
|
-
0 && (module.exports = {
|
|
233
|
-
extractDidFragment,
|
|
234
|
-
getServices,
|
|
235
|
-
getVerificationMethodByKey,
|
|
236
|
-
getVerificationMethodTypes,
|
|
237
|
-
getVerificationMethods,
|
|
238
|
-
getVerificationRelationshipsById,
|
|
239
|
-
isDidService,
|
|
240
|
-
isDidVerificationMethod,
|
|
241
|
-
isDwnDidService,
|
|
242
|
-
keyBytesToMultibaseId,
|
|
243
|
-
multibaseIdToKeyBytes
|
|
244
|
-
});
|
|
245
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/cjs/utils.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils.ts", "../../src/did-error.ts", "../../src/types/did-core.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Jwk } from '@enbox/crypto';\nimport type { RequireOnly } from '@enbox/common';\n\nimport { Convert, Multicodec } from '@enbox/common';\nimport { computeJwkThumbprint } from '@enbox/crypto';\n\nimport type { KeyWithMulticodec } from './types/multibase.js';\n\nimport { DidError, DidErrorCode } from './did-error.js';\nimport {\n DidService,\n DidDocument,\n DidVerificationMethod,\n DidVerificationRelationship,\n} from './types/did-core.js';\n\n/**\n * Represents a Decentralized Web Node (DWN) service in a DID Document.\n *\n * A DWN DID service is a specialized type of DID service with the `type` set to\n * `DecentralizedWebNode`. It includes specific properties `enc` and `sig` that are used to identify\n * the public keys that can be used to interact with the DID Subject. The values of these properties\n * are strings or arrays of strings containing one or more verification method `id` values present in\n * the same DID document. If the `enc` and/or `sig` properties are an array of strings, an entity\n * interacting with the DID subject is expected to use the verification methods in the order they\n * are listed.\n *\n * @example\n * ```ts\n * const service: DwnDidService = {\n * id: 'did:example:123#dwn',\n * type: 'DecentralizedWebNode',\n * serviceEndpoint: 'https://enbox-production.up.railway.app',\n * enc: 'did:example:123#key-1',\n * sig: 'did:example:123#key-2'\n * }\n * ```\n *\n * @see {@link https://identity.foundation/decentralized-web-node/spec/ | DIF Decentralized Web Node (DWN) Specification}\n */\nexport interface DwnDidService extends DidService {\n /**\n * One or more verification method `id` values that can be used to encrypt information\n * intended for the DID subject.\n */\n enc?: string | string[];\n\n /**\n * One or more verification method `id` values that will be used by the DID subject to sign data\n * or by another entity to verify signatures created by the DID subject.\n */\n sig: string | string[];\n}\n\n/**\n * Extracts the fragment part of a Decentralized Identifier (DID) verification method identifier.\n *\n * This function takes any input and aims to return only the fragment of a DID identifier,\n * which comes after the '#' symbol in a DID string. It's designed specifically for handling\n * DID verification method identifiers. The function returns undefined for non-string inputs, inputs\n * that do not contain a '#', or complex data structures like objects or arrays, ensuring that only\n * the fragment part of a DID string is extracted when present.\n *\n * @example\n * ```ts\n * console.log(extractDidFragment(\"did:example:123#key-1\")); // Output: \"key-1\"\n * console.log(extractDidFragment(\"did:example:123\")); // Output: undefined\n * console.log(extractDidFragment({ id: \"did:example:123#0\", type: \"JsonWebKey\" })); // Output: undefined\n * console.log(extractDidFragment(undefined)); // Output: undefined\n * ```\n *\n * @param input - The input to be processed. Can be of any type, but the function is designed\n * to work with strings that represent DID verification method identifiers.\n * @returns The fragment part of the DID identifier if the input is a string containing a '#'.\n * Returns an empty string for all other inputs, including non-string types, strings\n * without a '#', and complex data structures.\n */\nexport function extractDidFragment(input: unknown): string | undefined {\n if (typeof input !== 'string') return undefined;\n if (input.length === 0) return undefined;\n return input.split('#').pop();\n}\n\n/**\n * Retrieves services from a given DID document, optionally filtered by `id` or `type`.\n *\n * If no `id` or `type` filters are provided, all defined services are returned.\n *\n * The given DID Document must adhere to the\n * {@link https://www.w3.org/TR/did-core/ | W3C DID Core Specification}.\n *\n * @example\n * ```ts\n * const didDocument = { ... }; // W3C DID document\n * const services = getServices({ didDocument, type: 'DecentralizedWebNode' });\n * ```\n *\n * @param params - An object containing input parameters for retrieving services.\n * @param params.didDocument - The DID document from which services are retrieved.\n * @param params.id - Optional. A string representing the specific service ID to match. If provided, only the service with this ID will be returned.\n * @param params.type - Optional. A string representing the specific service type to match. If provided, only the service(s) of this type will be returned.\n * @returns An array of services. If no matching service is found, an empty array is returned.\n */\nexport function getServices({ didDocument, id, type }: {\n didDocument: DidDocument;\n id?: string;\n type?: string;\n}): DidService[] {\n return didDocument?.service?.filter(service => {\n if (id && service.id !== id) return false;\n if (type && service.type !== type) return false;\n return true;\n }) ?? [];\n}\n\n/**\n * Retrieves a verification method object from a DID document if there is a match for the given\n * public key.\n *\n * This function searches the verification methods in a given DID document for a match with the\n * provided public key (either in JWK or multibase format). If a matching verification method is\n * found it is returned. If no match is found `null` is returned.\n *\n *\n * @example\n * ```ts\n * const didDocument = {\n * // ... contents of a DID document ...\n * };\n * const publicKeyJwk = { kty: 'OKP', crv: 'Ed25519', x: '...' };\n *\n * const verificationMethod = await getVerificationMethodByKey({\n * didDocument,\n * publicKeyJwk\n * });\n * ```\n *\n * @param params - An object containing input parameters for retrieving the verification method ID.\n * @param params.didDocument - The DID document to search for the verification method.\n * @param params.publicKeyJwk - The public key in JSON Web Key (JWK) format to match against the verification methods in the DID document.\n * @param params.publicKeyMultibase - The public key as a multibase encoded string to match against the verification methods in the DID document.\n * @returns A promise that resolves with the matching verification method, or `null` if no match is found.\n * @throws Throws an `Error` if the `didDocument` parameter is missing or if the `didDocument` does not contain any verification methods.\n */\nexport async function getVerificationMethodByKey({ didDocument, publicKeyJwk, publicKeyMultibase }: {\n didDocument: DidDocument;\n publicKeyJwk?: Jwk;\n publicKeyMultibase?: string;\n}): Promise<DidVerificationMethod | null> {\n // Collect all verification methods from the DID document.\n const verificationMethods = getVerificationMethods({ didDocument });\n\n for (let method of verificationMethods) {\n if (publicKeyJwk && method.publicKeyJwk) {\n const publicKeyThumbprint = await computeJwkThumbprint({ jwk: publicKeyJwk });\n if (publicKeyThumbprint === await computeJwkThumbprint({ jwk: method.publicKeyJwk })) {\n return method;\n }\n } else if (publicKeyMultibase && method.publicKeyMultibase) {\n if (publicKeyMultibase === method.publicKeyMultibase) {\n return method;\n }\n }\n }\n\n return null;\n}\n\n/**\n * Retrieves all verification methods from a given DID document, including embedded methods.\n *\n * This function consolidates all verification methods into a single array for easy access and\n * processing. It checks both the primary `verificationMethod` array and the individual verification\n * relationship properties `authentication`, `assertionMethod`, `keyAgreement`,\n * `capabilityInvocation`, and `capabilityDelegation` for embedded methods.\n *\n * The given DID Document must adhere to the\n * {@link https://www.w3.org/TR/did-core/ | W3C DID Core Specification}.\n *\n * @example\n * ```ts\n * const didDocument = { ... }; // W3C DID document\n * const verificationMethods = getVerificationMethods({ didDocument });\n * ```\n *\n * @param params - An object containing input parameters for retrieving verification methods.\n * @param params.didDocument - The DID document from which verification methods are retrieved.\n * @returns An array of `DidVerificationMethod`. If no verification methods are found, an empty array is returned.\n * @throws Throws an `TypeError` if the `didDocument` parameter is missing.\n */\nexport function getVerificationMethods({ didDocument }: {\n didDocument: DidDocument;\n}): DidVerificationMethod[] {\n if (!didDocument) throw new TypeError(`Required parameter missing: 'didDocument'`);\n\n const verificationMethods: DidVerificationMethod[] = [];\n\n // Check the 'verificationMethod' array.\n verificationMethods.push(...didDocument.verificationMethod?.filter(isDidVerificationMethod) ?? []);\n\n // Check verification relationship properties for embedded verification methods.\n Object.keys(DidVerificationRelationship).forEach((relationship) => {\n verificationMethods.push(\n ...(didDocument[relationship as keyof DidDocument] as (string | DidVerificationMethod)[])\n ?.filter(isDidVerificationMethod) ?? []\n );\n });\n\n return verificationMethods;\n}\n\n/**\n * Retrieves all DID verification method types from a given DID document.\n *\n * The given DID Document must adhere to the\n * {@link https://www.w3.org/TR/did-core/ | W3C DID Core Specification}.\n *\n * @example\n * ```ts\n * const didDocument = {\n * verificationMethod: [\n * {\n * 'id' : 'did:example:123#key-0',\n * 'type' : 'Ed25519VerificationKey2018',\n * 'controller' : 'did:example:123',\n * 'publicKeyBase58' : '3M5RCDjPTWPkKSN3sxUmmMqHbmRPegYP1tjcKyrDbt9J'\n * },\n * {\n * 'id' : 'did:example:123#key-1',\n * 'type' : 'X25519KeyAgreementKey2019',\n * 'controller' : 'did:example:123',\n * 'publicKeyBase58' : 'FbQWLPRhTH95MCkQUeFYdiSoQt8zMwetqfWoxqPgaq7x'\n * },\n * {\n * 'id' : 'did:example:123#key-3',\n * 'type' : 'JsonWebKey2020',\n * 'controller' : 'did:example:123',\n * 'publicKeyJwk' : {\n * 'kty' : 'EC',\n * 'crv' : 'P-256',\n * 'x' : 'Er6KSSnAjI70ObRWhlaMgqyIOQYrDJTE94ej5hybQ2M',\n * 'y' : 'pPVzCOTJwgikPjuUE6UebfZySqEJ0ZtsWFpj7YSPGEk'\n * }\n * }\n * ]\n * },\n * const vmTypes = getVerificationMethodTypes({ didDocument });\n * console.log(vmTypes);\n * // Output: ['Ed25519VerificationKey2018', 'X25519KeyAgreementKey2019', 'JsonWebKey2020']\n * ```\n *\n * @param params - An object containing input parameters for retrieving types.\n * @param params.didDocument - The DID document from which types are retrieved.\n * @returns An array of types. If no types were found, an empty array is returned.\n */\nexport function getVerificationMethodTypes({ didDocument }: {\n didDocument: DidDocument;\n}): string[] {\n // Collect all verification methods from the DID document.\n const verificationMethods = getVerificationMethods({ didDocument });\n\n // Map to extract 'type' from each verification method.\n const types = verificationMethods.map(method => method.type);\n\n return [...new Set(types)]; // Return only unique types.\n}\n\n/**\n * Retrieves a list of DID verification relationships by a specific method ID from a DID document.\n *\n * This function examines the specified DID document to identify any verification relationships\n * (e.g., `authentication`, `assertionMethod`) that reference a verification method by its method ID\n * or contain an embedded verification method matching the method ID. The method ID is typically a\n * fragment of a DID (e.g., `did:example:123#key-1`) that uniquely identifies a verification method\n * within the DID document.\n *\n * The search considers both direct references to verification methods by their IDs and verification\n * methods embedded within the verification relationship arrays. It returns an array of\n * `DidVerificationRelationship` enums corresponding to the verification relationships that contain\n * the specified method ID.\n *\n * @param params - An object containing input parameters for retrieving verification relationships.\n * @param params.didDocument - The DID document to search for verification relationships.\n * @param params.methodId - The method ID to search for within the verification relationships.\n * @returns An array of `DidVerificationRelationship` enums representing the types of verification\n * relationships that reference the specified method ID.\n *\n * @example\n * ```ts\n * const didDocument: DidDocument = {\n * // ...contents of a DID document...\n * };\n *\n * const relationships = getVerificationRelationshipsById({\n * didDocument,\n * methodId: 'key-1'\n * });\n * console.log(relationships);\n * // Output might include ['authentication', 'assertionMethod'] if those relationships\n * // reference or contain the specified method ID.\n * ```\n */\nexport function getVerificationRelationshipsById({ didDocument, methodId }: {\n didDocument: DidDocument;\n methodId: string;\n}): DidVerificationRelationship[] {\n const relationships: DidVerificationRelationship[] = [];\n\n Object.keys(DidVerificationRelationship).forEach((relationship) => {\n if (Array.isArray(didDocument[relationship as keyof DidDocument])) {\n const relationshipMethods = didDocument[relationship as keyof DidDocument] as (string | DidVerificationMethod)[];\n\n const methodIdFragment = extractDidFragment(methodId);\n\n // Check if the verification relationship property contains a matching method ID either\n // directly referenced or as an embedded verification method.\n const containsMethodId = relationshipMethods.some(method => {\n const isByReferenceMatch = extractDidFragment(method) === methodIdFragment;\n const isEmbeddedMethodMatch = isDidVerificationMethod(method) && extractDidFragment(method.id) === methodIdFragment;\n return isByReferenceMatch || isEmbeddedMethodMatch;\n });\n\n if (containsMethodId) {\n relationships.push(relationship as DidVerificationRelationship);\n }\n }\n });\n\n return relationships;\n}\n\n/**\n * Checks if a given object is a {@link DidService}.\n *\n * A {@link DidService} in the context of DID resources must include the properties `id`, `type`,\n * and `serviceEndpoint`. The `serviceEndpoint` can be a `DidServiceEndpoint` or an array of\n * `DidServiceEndpoint` objects.\n *\n * @example\n * ```ts\n * const service = {\n * id: \"did:example:123#service-1\",\n * type: \"OidcService\",\n * serviceEndpoint: \"https://example.com/oidc\"\n * };\n *\n * if (isDidService(service)) {\n * console.log('The object is a DidService');\n * } else {\n * console.log('The object is not a DidService');\n * }\n * ```\n *\n * @param obj - The object to be checked.\n * @returns `true` if `obj` is a `DidService`; otherwise, `false`.\n */\nexport function isDidService(obj: unknown): obj is DidService {\n // Validate that the given value is an object.\n if (!obj || typeof obj !== 'object' || obj === null) return false;\n\n // Validate that the object has the necessary properties of DidService.\n return 'id' in obj && 'type' in obj && 'serviceEndpoint' in obj;\n}\n\n/**\n * Checks if a given object is a {@link DwnDidService}.\n *\n * A {@link DwnDidService} is defined as {@link DidService} object with a `type` of\n * \"DecentralizedWebNode\" and `enc` and `sig` properties, where both properties are either strings\n * or arrays of strings.\n *\n * @example\n * ```ts\n * const didDocument: DidDocument = {\n * id: 'did:example:123',\n * verificationMethod: [\n * {\n * id: 'did:example:123#key-1',\n * type: 'JsonWebKey2020',\n * controller: 'did:example:123',\n * publicKeyJwk: { ... }\n * },\n * {\n * id: 'did:example:123#key-2',\n * type: 'JsonWebKey2020',\n * controller: 'did:example:123',\n * publicKeyJwk: { ... }\n * }\n * ],\n * service: [\n * {\n * id: 'did:example:123#dwn',\n * type: 'DecentralizedWebNode',\n * serviceEndpoint: 'https://enbox-production.up.railway.app',\n * enc: 'did:example:123#key-1',\n * sig: 'did:example:123#key-2'\n * }\n * ]\n * };\n *\n * if (isDwnService(didDocument.service[0])) {\n * console.log('The object is a DwnDidService');\n * } else {\n * console.log('The object is not a DwnDidService');\n * }\n * ```\n *\n * @see {@link https://identity.foundation/decentralized-web-node/spec/ | Decentralized Web Node (DWN) Specification}\n *\n * @param obj - The object to be checked.\n * @returns `true` if `obj` is a DwnDidService; otherwise, `false`.\n */\nexport function isDwnDidService(obj: unknown): obj is DwnDidService {\n // Validate that the given value is a {@link DidService}.\n if (!isDidService(obj)) return false;\n\n // Validate that the `type` property is `DecentralizedWebNode`.\n if (obj.type !== 'DecentralizedWebNode') return false;\n\n // Validate that the given object has the `enc` and `sig` properties.\n if (!('enc' in obj && 'sig' in obj)) return false;\n\n // Validate that the `enc` and `sig` properties are either strings or arrays of strings.\n const isStringOrStringArray = (prop: any): boolean =>\n typeof prop === 'string' || Array.isArray(prop) && prop.every(item => typeof item === 'string');\n return (isStringOrStringArray(obj.enc)) && (isStringOrStringArray(obj.sig));\n}\n\n/**\n * Checks if a given object is a DID Verification Method.\n *\n * A {@link DidVerificationMethod} in the context of DID resources must include the properties `id`,\n * `type`, and `controller`.\n *\n * @example\n * ```ts\n * const resource = {\n * id : \"did:example:123#0\",\n * type : \"JsonWebKey2020\",\n * controller : \"did:example:123\",\n * publicKeyJwk : { ... }\n * };\n *\n * if (isDidVerificationMethod(resource)) {\n * console.log('The resource is a DidVerificationMethod');\n * } else {\n * console.log('The resource is not a DidVerificationMethod');\n * }\n * ```\n *\n * @param obj - The object to be checked.\n * @returns `true` if `obj` is a `DidVerificationMethod`; otherwise, `false`.\n */\nexport function isDidVerificationMethod(obj: unknown): obj is DidVerificationMethod {\n // Validate that the given value is an object.\n if (!obj || typeof obj !== 'object' || obj === null) return false;\n\n // Validate that the object has the necessary properties of a DidVerificationMethod.\n if (!('id' in obj && 'type' in obj && 'controller' in obj)) return false;\n\n if (typeof obj.id !== 'string') return false;\n if (typeof obj.type !== 'string') return false;\n if (typeof obj.controller !== 'string') return false;\n\n return true;\n}\n\n/**\n * Converts a cryptographic key to a multibase identifier.\n *\n * @remarks\n * This method provides a way to represent a cryptographic key as a multibase identifier.\n * It takes a `Uint8Array` representing the key, and either the multicodec code or multicodec name\n * as input. The method first adds the multicodec prefix to the key, then encodes it into Base58\n * format. Finally, it converts the Base58 encoded key into a multibase identifier.\n *\n * @example\n * ```ts\n * const key = new Uint8Array([...]); // Cryptographic key as Uint8Array\n * const multibaseId = keyBytesToMultibaseId({ key, multicodecName: 'ed25519-pub' });\n * ```\n *\n * @param params - The parameters for the conversion.\n * @returns The multibase identifier as a string.\n */\nexport function keyBytesToMultibaseId({ keyBytes, multicodecCode, multicodecName }:\n RequireOnly<KeyWithMulticodec, 'keyBytes'>\n): string {\n const prefixedKey = Multicodec.addPrefix({\n code : multicodecCode,\n data : keyBytes,\n name : multicodecName\n });\n const prefixedKeyB58 = Convert.uint8Array(prefixedKey).toBase58Btc();\n const multibaseKeyId = Convert.base58Btc(prefixedKeyB58).toMultibase();\n\n return multibaseKeyId;\n}\n\n/**\n * Converts a multibase identifier to a cryptographic key.\n *\n * @remarks\n * This function decodes a multibase identifier back into a cryptographic key. It first decodes the\n * identifier from multibase format into Base58 format, and then converts it into a `Uint8Array`.\n * Afterward, it removes the multicodec prefix, extracting the raw key data along with the\n * multicodec code and name.\n *\n * @example\n * ```ts\n * const multibaseKeyId = '...'; // Multibase identifier of the key\n * const { key, multicodecCode, multicodecName } = multibaseIdToKey({ multibaseKeyId });\n * ```\n *\n * @param params - The parameters for the conversion.\n * @param params.multibaseKeyId - The multibase identifier string of the key.\n * @returns An object containing the key as a `Uint8Array` and its multicodec code and name.\n * @throws `DidError` if the multibase identifier is invalid.\n */\nexport function multibaseIdToKeyBytes({ multibaseKeyId }: {\n multibaseKeyId: string\n}): Required<KeyWithMulticodec> {\n try {\n const prefixedKeyB58 = Convert.multibase(multibaseKeyId).toBase58Btc();\n const prefixedKey = Convert.base58Btc(prefixedKeyB58).toUint8Array();\n const { code, data, name } = Multicodec.removePrefix({ prefixedData: prefixedKey });\n\n return { keyBytes: data, multicodecCode: code, multicodecName: name };\n } catch (error: any) {\n throw new DidError(DidErrorCode.InvalidDid, `Invalid multibase identifier: ${multibaseKeyId}`);\n }\n}", "/**\n * A custom error class for DID-related errors.\n */\nexport class DidError extends Error {\n /**\n * Constructs an instance of DidError, a custom error class for handling DID-related errors.\n *\n * @param code - A {@link DidErrorCode} representing the specific type of error encountered.\n * @param message - A human-readable description of the error.\n */\n constructor(public code: DidErrorCode, message: string) {\n super(`${code}: ${message}`);\n this.name = 'DidError';\n\n // Ensures that instanceof works properly, the correct prototype chain when using inheritance,\n // and that V8 stack traces (like Chrome, Edge, and Node.js) are more readable and relevant.\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Captures the stack trace in V8 engines (like Chrome, Edge, and Node.js).\n // In non-V8 environments, the stack trace will still be captured.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, DidError);\n }\n }\n}\n\n/**\n * An enumeration of possible DID error codes.\n */\nexport enum DidErrorCode {\n /** The DID supplied does not conform to valid syntax. */\n InvalidDid = 'invalidDid',\n\n /** The supplied method name is not supported by the DID method and/or DID resolver implementation. */\n MethodNotSupported = 'methodNotSupported',\n\n /** An unexpected error occurred during the requested DID operation. */\n InternalError = 'internalError',\n\n /** The DID document supplied does not conform to valid syntax. */\n InvalidDidDocument = 'invalidDidDocument',\n\n /** The byte length of a DID document does not match the expected value. */\n InvalidDidDocumentLength = 'invalidDidDocumentLength',\n\n /** The DID URL supplied to the dereferencing function does not conform to valid syntax. */\n InvalidDidUrl = 'invalidDidUrl',\n\n /** The given proof of a previous DID is invalid */\n InvalidPreviousDidProof = 'invalidPreviousDidProof',\n\n /** An invalid public key is detected during a DID operation. */\n InvalidPublicKey = 'invalidPublicKey',\n\n /** The byte length of a public key does not match the expected value. */\n InvalidPublicKeyLength = 'invalidPublicKeyLength',\n\n /** An invalid public key type was detected during a DID operation. */\n InvalidPublicKeyType = 'invalidPublicKeyType',\n\n /** Verification of a signature failed during a DID operation. */\n InvalidSignature = 'invalidSignature',\n\n /** The DID resolver was unable to find the DID document resulting from the resolution request. */\n NotFound = 'notFound',\n\n /**\n * The representation requested via the `accept` input metadata property is not supported by the\n * DID method and/or DID resolver implementation.\n */\n RepresentationNotSupported = 'representationNotSupported',\n\n /** The type of a public key is not supported by the DID method and/or DID resolver implementation. */\n UnsupportedPublicKeyType = 'unsupportedPublicKeyType',\n}", "import { Jwk } from '@enbox/crypto';\n\n/**\n * Represents metadata related to the process of DID dereferencing.\n *\n * This type includes fields that provide information about the outcome of a DID dereferencing operation,\n * including the content type of the returned resource and any errors that occurred during the dereferencing process.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-url-dereferencing-metadata | DID Core Specification, \u00A7 DID URL Dereferencing Metadata}\n */\nexport type DidDereferencingMetadata = {\n /**\n * The Media Type of the returned contentStream SHOULD be expressed using this property if\n * dereferencing is successful.\n */\n contentType?: string;\n\n /**\n * The error code from the dereferencing process. This property is REQUIRED when there is an\n * error in the dereferencing process. The value of this property MUST be a single keyword\n * expressed as an ASCII string. The possible property values of this field SHOULD be registered\n * in the {@link https://www.w3.org/TR/did-spec-registries/ | DID Specification Registries}.\n * The DID Core specification defines the following common error values:\n *\n * - `invalidDidUrl`: The DID URL supplied to the DID URL dereferencing function does not conform\n * to valid syntax.\n * - `notFound`: The DID URL dereferencer was unable to find the `contentStream` resulting from\n * this dereferencing request.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-url-dereferencing-metadata | DID Core Specification, \u00A7 DID URL Dereferencing Metadata}\n */\n error?: string;\n\n // Additional output metadata generated during DID Resolution.\n [key: string]: any;\n}\n\n/**\n * Represents the options that can be used during the process of DID dereferencing.\n *\n * This interface allows the caller to specify preferences and additional parameters for the DID\n * dereferencing operation.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-url-dereferencing-options}\n */\nexport interface DidDereferencingOptions {\n /** The Media Type that the caller prefers for contentStream. */\n accept?: string;\n\n /** Additional properties used during DID dereferencing. */\n [key: string]: any;\n}\n\n/**\n * Represents the result of a DID dereferencing operation.\n *\n * This type encapsulates the outcomes of the DID URL dereferencing process, including metadata\n * about the dereferencing operation, the content stream retrieved (if any), and metadata about the\n * content stream.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-url-dereferencing | DID Core Specification, \u00A7 DID URL Dereferencing}\n */\nexport type DidDereferencingResult = {\n /**\n * A metadata structure consisting of values relating to the results of the DID URL dereferencing\n * process. This structure is REQUIRED, and in the case of an error in the dereferencing process,\n * this MUST NOT be empty. Properties defined by this specification are in 7.2.2 DID URL\n * Dereferencing Metadata. If the dereferencing is not successful, this structure MUST contain an\n * `error` property describing the error.\n */\n dereferencingMetadata: DidDereferencingMetadata;\n\n /**\n * If the `dereferencing` function was called and successful, this MUST contain a resource\n * corresponding to the DID URL. The contentStream MAY be a resource such as:\n * - a DID document that is serializable in one of the conformant representations\n * - a Verification Method\n * - a service.\n * - any other resource format that can be identified via a Media Type and obtained through the\n * resolution process.\n *\n * If the dereferencing is unsuccessful, this value MUST be empty.\n */\n contentStream: DidResource | null;\n\n /**\n * If the dereferencing is successful, this MUST be a metadata structure, but the structure MAY be\n * empty. This structure contains metadata about the contentStream. If the contentStream is a DID\n * document, this MUST be a didDocumentMetadata structure as described in DID Resolution. If the\n * dereferencing is unsuccessful, this output MUST be an empty metadata structure.\n */\n contentMetadata: DidDocumentMetadata;\n}\n\n/**\n * A set of data describing the Decentralized Identifierr (DID) subject.\n *\n * A DID Document contains information associated with the DID, such as cryptographic public keys\n * and service endpoints, enabling trustable interactions associated with the DID subject.\n *\n * - Cryptographic public keys - Used by the DID subject or a DID delegate to authenticate itself\n * and prove its association with the DID.\n * - Service endpoints - Used to communicate or interact with the DID subject or associated\n * entities. Examples include discovery, agent, social networking, file\n * storage, and verifiable credential repository services.\n *\n * A DID Document can be retrieved by resolving a DID, as described in\n * {@link https://www.w3.org/TR/did-core/#did-resolution | DID Core Specification, \u00A7 DID Resolution}.\n */\nexport interface DidDocument {\n /**\n * A JSON-LD context link, which provides a JSON-LD processor with the information necessary to\n * interpret the DID document JSON. The default context URL is 'https://www.w3.org/ns/did/v1'.\n */\n '@context'?: 'https://www.w3.org/ns/did/v1' | string | (string | Record<string, any>)[];\n\n /**\n * The DID Subject to which this DID Document pertains.\n *\n * The `id` property is REQUIRED and must be a valid DID.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-subject | DID Core Specification, \u00A7 DID Subject}\n */\n id: string;\n\n /**\n * A DID subject can have multiple identifiers for different purposes, or at different times.\n * The assertion that two or more DIDs (or other types of URI) refer to the same DID subject can\n * be made using the `alsoKnownAs` property.\n *\n * @see {@link https://www.w3.org/TR/did-core/#also-known-as | DID Core Specification, \u00A7 Also Known As}\n */\n alsoKnownAs?: string[];\n\n /**\n * A DID controller is an entity that is authorized to make changes to a DID document. Typically,\n * only the DID Subject (i.e., the value of `id` property in the DID document) is authoritative.\n * However, another DID can be specified as the DID controller, and when doing so, any\n * verification methods contained in the DID document for the other DID should be accepted as\n * authoritative. In other words, proofs created by the controller DID should be considered\n * equivalent to proofs created by the DID Subject.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-controller | DID Core Specification, \u00A7 DID Controller}\n */\n controller?: string | string[];\n\n /**\n * A DID document can express verification methods, such as cryptographic public keys, which can\n * be used to authenticate or authorize interactions with the DID subject or associated parties.\n *\n * @see {@link https://www.w3.org/TR/did-core/#verification-methods | DID Core Specification, \u00A7 Verification Methods}\n */\n verificationMethod?: DidVerificationMethod[];\n\n /**\n * The `assertionMethod` verification relationship is used to specify how the DID subject is\n * expected to express claims, such as for the purposes of issuing a Verifiable Credential.\n *\n * @see {@link https://www.w3.org/TR/did-core/#assertion | DID Core Specification, \u00A7 Assertion}\n */\n assertionMethod?: (DidVerificationMethod | string)[];\n\n /**\n * The `authentication` verification relationship is used to specify how the DID subject is expected\n * to be authenticated, for purposes such as logging into a website or engaging in any sort of\n * challenge-response protocol.\n\n * @see {@link https://www.w3.org/TR/did-core/#authentication | DID Core Specification, \u00A7 Authentication}\n */\n authentication?: (DidVerificationMethod | string)[];\n\n /**\n * The `keyAgreement` verification relationship is used to specify how an entity can generate\n * encryption material in order to transmit confidential information intended for the DID\n * subject, such as for the purposes of establishing a secure communication channel with the\n * recipient.\n *\n * @see {@link https://www.w3.org/TR/did-core/#key-agreement | DID Core Specification, \u00A7 Key Agreement}\n */\n keyAgreement?: (DidVerificationMethod | string)[];\n\n /**\n * The `capabilityDelegation` verification relationship is used to specify a mechanism that might\n * be used by the DID subject to delegate a cryptographic capability to another party, such as\n * delegating the authority to access a specific HTTP API to a subordinate.\n *\n * @see {@link https://www.w3.org/TR/did-core/#capability-delegation | DID Core Specification, \u00A7 Capability Delegation}\n */\n capabilityDelegation?: (DidVerificationMethod | string)[];\n\n /**\n * The `capabilityInvocation` verification relationship is used to specify a verification method\n * that might be used by the DID subject to invoke a cryptographic capability, such as the\n * authorization to update the DID Document.\n */\n capabilityInvocation?: (DidVerificationMethod | string)[];\n\n /**\n * Services are used in DID documents to express ways of communicating with the DID subject or\n * associated entities. A service can be any type of service the DID subject wants to advertise,\n * including decentralized identity management services for further discovery, authentication,\n * authorization, or interaction.\n *\n * @see {@link https://www.w3.org/TR/did-core/#services | DID Core Specification, \u00A7 Services}\n */\n service?: DidService[];\n}\n\n/**\n * Represents metadata about the DID document resulting from a DID resolution operation.\n *\n * This metadata typically does not change between invocations of the `resolve` and\n * `resolveRepresentation` functions unless the DID document changes, as it represents metadata\n * about the DID document.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-document-metadata | DID Core Specification, \u00A7 DID Document Metadata}\n */\nexport interface DidDocumentMetadata {\n /**\n * Timestamp of the Create operation.\n *\n * The value of the property MUST be a string formatted as an XML Datetime normalized to\n * UTC 00:00:00 and without sub-second decimal precision. For example: `2020-12-20T19:17:47Z`.\n */\n created?: string;\n\n /**\n * Timestamp of the last Update operation for the document version which was resolved.\n *\n * The value of the property MUST follow the same formatting rules as the `created` property.\n * The `updated` property is omitted if an Update operation has never been performed on the DID\n * document. If an `updated` property exists, it can be the same value as the `created` property\n * when the difference between the two timestamps is less than one second.\n */\n updated?: string;\n\n /**\n * Whether the DID has been deactivated.\n *\n * If a DID has been deactivated, DID document metadata MUST include this property with the\n * boolean value `true`. If a DID has not been deactivated, this properrty is OPTIONAL, but if\n * present, MUST have the boolean value `false`.\n */\n deactivated?: boolean;\n\n /**\n * Version ID of the last Update operation for the document version which was resolved.\n */\n versionId?: string;\n\n /**\n * Timestamp of the next Update operation if the resolved document version is not the latest\n * version of the document.\n *\n * The value of the property MUST follow the same formatting rules as the `created` property.\n */\n nextUpdate?: string;\n\n /**\n * Version ID of the next Update operation if the resolved document version is not the latest\n * version of the document.\n */\n nextVersionId?: string;\n\n /**\n * A DID method can define different forms of a DID that are logically equivalent. An example is\n * when a DID takes one form prior to registration in a verifiable data registry and another form\n * after such registration. In this case, the DID method specification might need to express one\n * or more DIDs that are logically equivalent to the resolved DID as a property of the DID\n * document. This is the purpose of the `equivalentId` property.\n *\n * A requesting party is expected to retain the values from the id and equivalentId properties to\n * ensure any subsequent interactions with any of the values they contain are correctly handled as\n * logically equivalent (e.g., retain all variants in a database so an interaction with any one\n * maps to the same underlying account).\n *\n * @see {@link https://www.w3.org/TR/did-core/#dfn-equivalentid | DID Core Specification, \u00A7 DID Document Metadata}\n */\n equivalentId?: string[];\n\n /**\n * The `canonicalId` property is identical to the `equivalentId` property except:\n * - it is associated with a single value rather than a set\n * - the DID is defined to be the canonical ID for the DID subject within the scope of the\n * containing DID document.\n *\n * A requesting party is expected to use the `canonicalId` value as its primary ID value for the\n * DID subject and treat all other equivalent values as secondary aliases (e.g., update\n * corresponding primary references in their systems to reflect the new canonical ID directive).\n *\n * @see {@link https://www.w3.org/TR/did-core/#dfn-canonicalid | DID Core Specification, \u00A7 DID Document Metadata}\n */\n canonicalId?: string;\n\n // Additional output metadata generated during DID Resolution.\n [key: string]: any;\n}\n\n/**\n * Represents metadata related to the result of a DID resolution operation.\n *\n * This type includes fields that provide information about the outcome of a DID resolution process,\n * including the content type of the returned DID document and any errors that occurred during the\n * resolution process.\n *\n * This metadata typically changes between invocations of the `resolve` and `resolveRepresentation`\n * functions, as it represents data about the resolution process itself.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-resolution-metadata | DID Core Specification, \u00A7 DID Resolution Metadata}\n */\nexport type DidResolutionMetadata = {\n /**\n * The Media Type of the returned `didDocumentStream`.\n *\n * This property is REQUIRED if resolution is successful and if the `resolveRepresentation`\n * function was called. This property MUST NOT be present if the `resolve` function was called.\n * The value of this property MUST be an ASCII string that is the Media Type of the conformant\n * representations. The caller of the `resolveRepresentation` function MUST use this value when\n * determining how to parse and process the `didDocumentStream` returned by this function into the\n * data model.\n */\n contentType?: string;\n\n /**\n * An error code indicating issues encountered during the DID Resolution or DID URL\n * Dereferencing process.\n *\n * Defined error codes include:\n * - `internalError`: An unexpected error occurred during DID Resolution or DID URL\n * dereferencing process.\n * - `invalidDid`: The provided DID is invalid.\n * - `methodNotSupported`: The DID method specified is not supported.\n * - `notFound`: The DID or DID URL does not exist.\n * - `representationNotSupported`: The DID document representation is not supported.\n * - Custom error codes can also be provided as strings.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-resolution-metadata | DID Core Specification, \u00A7 DID Resolution Metadata}\n * @see {@link https://www.w3.org/TR/did-spec-registries/#error | DID Specification Registries, \u00A7 Error}\n */\n error?: string;\n\n // Additional output metadata generated during DID Resolution.\n [key: string]: any;\n};\n\n/**\n * DID Resolution input metadata.\n*\n* The DID Core specification defines the following common properties:\n* - `accept`: The Media Type that the caller prefers for the returned representation of the DID\n* Document.\n*\n* The possible properties within this structure and their possible values are registered in the\n* {@link https://www.w3.org/TR/did-spec-registries/#did-resolution-options | DID Specification Registries}.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-resolution-options | DID Core Specification, \u00A7 DID Resolution Options}\n */\nexport interface DidResolutionOptions {\n /**\n * The Media Type that the caller prefers for the returned representation of the DID Document.\n *\n * This property is REQUIRED if the `resolveRepresentation` function was called. This property\n * MUST NOT be present if the `resolve` function was called.\n *\n * The value of this property MUST be an ASCII string that is the Media Type of the conformant\n * representations. The caller of the `resolveRepresentation` function MUST use this value when\n * determining how to parse and process the `didDocumentStream` returned by this function into the\n * data model.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-resolution-options | DID Core Specification, \u00A7 DID Resolution Options}\n */\n accept?: string;\n\n // Additional properties used during DID Resolution.\n [key: string]: any;\n}\n\n/**\n * Represents the result of a Decentralized Identifier (DID) resolution operation.\n *\n * This type encapsulates the complete outcome of resolving a DID, including the resolution metadata,\n * the DID document (if resolution is successful), and metadata about the DID document.\n *\n * @see {@link https://www.w3.org/TR/did-core/#did-resolution | DID Core Specification, \u00A7 DID Resolution}\n */\nexport type DidResolutionResult = {\n /**\n * A JSON-LD context link, which provides the JSON-LD processor with the information necessary to\n * interpret the resolution result JSON. The default context URL is\n * 'https://w3id.org/did-resolution/v1'.\n */\n '@context'?: 'https://w3id.org/did-resolution/v1' | string | (string | Record<string, any>)[];\n\n /**\n * A metadata structure consisting of values relating to the results of the DID resolution\n * process.\n *\n * This structure is REQUIRED, and in the case of an error in the resolution process,\n * this MUST NOT be empty. If the resolution is not successful, this structure MUST contain an\n * `error` property describing the error.\n *\n * @see {@link https://www.w3.org/TR/did-core/#dfn-didresolutionmetadata | DID Core Specification, \u00A7 DID Resolution Metadata}\n */\n didResolutionMetadata: DidResolutionMetadata;\n\n /**\n * The DID document resulting from the resolution process, if successful.\n *\n * If the `resolve` function was called and successful, this MUST contain a DID document\n * corresponding to the DID. If the resolution is unsuccessful, this value MUST be empty.\n *\n * @see {@link https://www.w3.org/TR/did-core/#dfn-diddocument | DID Core Specification, \u00A7 DID Document}\n */\n didDocument: DidDocument | null;\n\n /**\n * Metadata about the DID Document.\n *\n * This structure contains information about the DID Document like creation and update timestamps,\n * deactivation status, versioning information, and other details relevant to the DID Document.\n *\n * @see {@link https://www.w3.org/TR/did-core/#dfn-diddocumentmetadata | DID Core Specification, \u00A7 DID Document Metadata}\n */\n didDocumentMetadata: DidDocumentMetadata;\n};\n\n/**\n * A DID Resource is either a DID Document, a DID Verification method or a DID Service\n */\nexport type DidResource = DidDocument | DidService | DidVerificationMethod;\n\n/**\n * Services are used in DID documents to express ways of communicating with the DID subject or\n * associated entities. A service can be any type of service the DID subject wants to advertise.\n *\n * @see {@link https://www.w3.org/TR/did-core/#services}\n */\nexport type DidService = {\n /**\n * Identifier of the service.\n *\n * The `id` property is REQUIRED. It MUST be a URI conforming to\n * {@link https://datatracker.ietf.org/doc/html/rfc3986 | RFC3986} and MUST be unique within the\n * DID document.\n */\n id: string;\n\n /**\n * The type of service being described.\n *\n * The `type` property is REQUIRED. It MUST be a string. To maximize interoperability, the value\n * SHOULD be registered in the\n * {@link https://www.w3.org/TR/did-spec-registries/ | DID Specification Registries}. Examples of\n * service types can be found in\n * {@link https://www.w3.org/TR/did-spec-registries/#service-types | \u00A7 Service Types}.\n */\n type: string;\n\n /**\n * A URI that can be used to interact with the DID service.\n *\n * The value of the `serviceEndpoint` property MUST be a string, an object containing key/value\n * pairs, or an array composed of strings or objects. All string values MUST be valid URIs\n * conforming to {@link https://datatracker.ietf.org/doc/html/rfc3986 | RFC3986}.\n */\n serviceEndpoint: DidServiceEndpoint | DidServiceEndpoint[];\n\n // DID methods MAY include additional service properties.\n [key: string]: any;\n};\n\n/**\n * A service endpoint is a URI (Uniform Resource Identifier) that can be used to interact with the\n * DID service.\n *\n * The value of the `serviceEndpoint` property MUST be a string or an object containing key/value\n * pairs. All string values MUST be valid URIs conforming to\n * {@link https://datatracker.ietf.org/doc/html/rfc3986 | RFC3986}.\n *\n * @see {@link https://www.w3.org/TR/did-core/#dfn-serviceendpoint | RFC3986, \u00A7 5.4 Services}\n */\nexport type DidServiceEndpoint = string | Record<string, any>;\n\n/**\n * Represents a verification method in the context of a DID document.\n *\n * A verification method is a mechanism by which a DID controller can cryptographically assert proof\n * of ownership or control over a DID or DID document. This can include, but is not limited to,\n * cryptographic public keys or other data that can be used to authenticate or authorize actions.\n *\n * @see {@link https://www.w3.org/TR/did-core/#verification-methods | DID Core Specification, \u00A7 Verification Methods}\n */\nexport interface DidVerificationMethod {\n /**\n * The identifier of the verification method, which must be a URI.\n */\n id: string;\n\n /**\n * The type of the verification method.\n *\n * To maximize interoperability this value SHOULD be one of the valid verification method types\n * registered in the {@link https://www.w3.org/TR/did-spec-registries/#verification-method-types | DID Specification Registries}.\n */\n type: string;\n\n /**\n * The DID of the entity that controls this verification method.\n */\n controller: string;\n\n /**\n * (Optional) A public key in JWK format.\n *\n * A JSON Web Key (JWK) that conforms to {@link https://datatracker.ietf.org/doc/html/rfc7517 | RFC 7517}.\n */\n publicKeyJwk?: Jwk;\n\n /**\n * (Optional) A public key in Multibase format.\n *\n * A multibase key that conforms to the draft\n * {@link https://datatracker.ietf.org/doc/draft-multiformats-multibase/ | Multibase specification}.\n */\n publicKeyMultibase?: string;\n}\n\n/**\n * Represents the various verification relationships defined in a DID document.\n *\n * These verification relationships indicate the intended usage of verification methods within a DID\n * document. Each relationship signifies a different purpose or context in which a verification\n * method can be used, such as authentication, assertionMethod, keyAgreement, capabilityDelegation,\n * and capabilityInvocation. The array provides a standardized set of relationship names for\n * consistent referencing and implementation across different DID methods.\n *\n * @see {@link https://www.w3.org/TR/did-core/#verification-relationships | DID Core Specification, \u00A7 Verification Relationships}\n */\nexport enum DidVerificationRelationship {\n /**\n * Specifies how the DID subject is expected to be authenticated. This is commonly used for\n * purposes like logging into a website or participating in challenge-response protocols.\n *\n * @see {@link https://www.w3.org/TR/did-core/#authentication | DID Core Specification, \u00A7 Authentication}\n */\n authentication = 'authentication',\n\n /**\n * Specifies how the DID subject is expected to express claims, such as for issuing Verifiable\n * Credentials. This relationship is typically used when the DID subject is the issuer of a\n * credential.\n *\n * @see {@link https://www.w3.org/TR/did-core/#assertion | DID Core Specification, \u00A7 Assertion}\n */\n assertionMethod = 'assertionMethod',\n\n /**\n * Specifies how an entity can generate encryption material to communicate confidentially with the\n * DID subject. Often used in scenarios requiring secure communication channels.\n *\n * @see {@link https://www.w3.org/TR/did-core/#key-agreement | DID Core Specification, \u00A7 Key Agreement}\n */\n keyAgreement = 'keyAgreement',\n\n /**\n * Specifies a verification method used by the DID subject to invoke a cryptographic capability.\n * This is frequently associated with authorization actions, like updating the DID Document.\n *\n * @see {@link https://www.w3.org/TR/did-core/#capability-invocation | DID Core Specification, \u00A7 Capability Invocation}\n */\n capabilityInvocation = 'capabilityInvocation',\n\n /**\n * Specifies a mechanism used by the DID subject to delegate a cryptographic capability to another\n * party. This can include delegating access to a specific resource or API.\n *\n * @see {@link https://www.w3.org/TR/did-core/#capability-delegation | DID Core Specification, \u00A7 Capability Delegation}\n */\n capabilityDelegation = 'capabilityDelegation',\n}"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,oBAAoC;AACpC,oBAAqC;;;ACD/B,IAAO,WAAP,MAAO,kBAAiB,MAAK;;;;;;;EAOjC,YAAmB,MAAoB,SAAe;AACpD,UAAM,GAAG,IAAI,KAAK,OAAO,EAAE;AADV,SAAA,OAAA;AAEjB,SAAK,OAAO;AAIZ,WAAO,eAAe,MAAM,WAAW,SAAS;AAIhD,QAAI,MAAM,mBAAmB;AAC3B,YAAM,kBAAkB,MAAM,SAAQ;IACxC;EACF;;AAMF,IAAY;CAAZ,SAAYA,eAAY;A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