@credo-ts/indy-vdr 0.6.1-pr-2091-20241119140918 → 0.6.2-alpha-20251210145840
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/IndyVdrApi.d.mts +42 -0
- package/build/IndyVdrApi.d.mts.map +1 -0
- package/build/IndyVdrApi.mjs +72 -0
- package/build/IndyVdrApi.mjs.map +1 -0
- package/build/IndyVdrModule.d.mts +20 -0
- package/build/IndyVdrModule.d.mts.map +1 -0
- package/build/IndyVdrModule.mjs +30 -0
- package/build/IndyVdrModule.mjs.map +1 -0
- package/build/IndyVdrModuleConfig.d.mts +72 -0
- package/build/IndyVdrModuleConfig.d.mts.map +1 -0
- package/build/IndyVdrModuleConfig.mjs +18 -0
- package/build/IndyVdrModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
- package/build/anoncreds/IndyVdrAnonCredsRegistry.d.mts +125 -0
- package/build/anoncreds/IndyVdrAnonCredsRegistry.d.mts.map +1 -0
- package/build/anoncreds/IndyVdrAnonCredsRegistry.mjs +586 -0
- package/build/anoncreds/IndyVdrAnonCredsRegistry.mjs.map +1 -0
- package/build/anoncreds/index.d.mts +1 -0
- package/build/anoncreds/index.mjs +1 -0
- package/build/anoncreds/utils/identifiers.mjs +29 -0
- package/build/anoncreds/utils/identifiers.mjs.map +1 -0
- package/build/anoncreds/utils/transform.mjs +63 -0
- package/build/anoncreds/utils/transform.mjs.map +1 -0
- package/build/dids/IndyVdrIndyDidRegistrar.d.mts +92 -0
- package/build/dids/IndyVdrIndyDidRegistrar.d.mts.map +1 -0
- package/build/dids/IndyVdrIndyDidRegistrar.mjs +290 -0
- package/build/dids/IndyVdrIndyDidRegistrar.mjs.map +1 -0
- package/build/dids/IndyVdrIndyDidResolver.d.mts +12 -0
- package/build/dids/IndyVdrIndyDidResolver.d.mts.map +1 -0
- package/build/dids/IndyVdrIndyDidResolver.mjs +36 -0
- package/build/dids/IndyVdrIndyDidResolver.mjs.map +1 -0
- package/build/dids/IndyVdrSovDidResolver.d.mts +13 -0
- package/build/dids/IndyVdrSovDidResolver.d.mts.map +1 -0
- package/build/dids/IndyVdrSovDidResolver.mjs +70 -0
- package/build/dids/IndyVdrSovDidResolver.mjs.map +1 -0
- package/build/dids/didIndyUtil.mjs +147 -0
- package/build/dids/didIndyUtil.mjs.map +1 -0
- package/build/dids/didSovUtil.mjs +118 -0
- package/build/dids/didSovUtil.mjs.map +1 -0
- package/build/dids/index.d.mts +3 -0
- package/build/dids/index.mjs +3 -0
- package/build/error/IndyVdrError.mjs +12 -0
- package/build/error/IndyVdrError.mjs.map +1 -0
- package/build/error/IndyVdrNotConfiguredError.mjs +12 -0
- package/build/error/IndyVdrNotConfiguredError.mjs.map +1 -0
- package/build/error/IndyVdrNotFound.mjs +12 -0
- package/build/error/IndyVdrNotFound.mjs.map +1 -0
- package/build/error/index.mjs +3 -0
- package/build/index.d.mts +12 -0
- package/build/index.mjs +12 -0
- package/build/pool/IndyVdrPool.d.mts +61 -0
- package/build/pool/IndyVdrPool.d.mts.map +1 -0
- package/build/pool/IndyVdrPool.mjs +104 -0
- package/build/pool/IndyVdrPool.mjs.map +1 -0
- package/build/pool/IndyVdrPoolService.d.mts +54 -0
- package/build/pool/IndyVdrPoolService.d.mts.map +1 -0
- package/build/pool/IndyVdrPoolService.mjs +157 -0
- package/build/pool/IndyVdrPoolService.mjs.map +1 -0
- package/build/pool/index.d.mts +2 -0
- package/build/pool/index.mjs +2 -0
- package/build/utils/did.mjs +48 -0
- package/build/utils/did.mjs.map +1 -0
- package/build/utils/promises.mjs +20 -0
- package/build/utils/promises.mjs.map +1 -0
- package/build/utils/sign.mjs +24 -0
- package/build/utils/sign.mjs.map +1 -0
- package/package.json +19 -19
- package/build/IndyVdrApi.d.ts +0 -34
- package/build/IndyVdrApi.js +0 -82
- package/build/IndyVdrApi.js.map +0 -1
- package/build/IndyVdrModule.d.ts +0 -14
- package/build/IndyVdrModule.js +0 -31
- package/build/IndyVdrModule.js.map +0 -1
- package/build/IndyVdrModuleConfig.d.ts +0 -66
- package/build/IndyVdrModuleConfig.js +0 -18
- package/build/IndyVdrModuleConfig.js.map +0 -1
- package/build/anoncreds/IndyVdrAnonCredsRegistry.d.ts +0 -113
- package/build/anoncreds/IndyVdrAnonCredsRegistry.js +0 -682
- package/build/anoncreds/IndyVdrAnonCredsRegistry.js.map +0 -1
- package/build/anoncreds/index.d.ts +0 -1
- package/build/anoncreds/index.js +0 -18
- package/build/anoncreds/index.js.map +0 -1
- package/build/anoncreds/utils/identifiers.d.ts +0 -5
- package/build/anoncreds/utils/identifiers.js +0 -40
- package/build/anoncreds/utils/identifiers.js.map +0 -1
- package/build/anoncreds/utils/transform.d.ts +0 -32
- package/build/anoncreds/utils/transform.js +0 -91
- package/build/anoncreds/utils/transform.js.map +0 -1
- package/build/dids/IndyVdrIndyDidRegistrar.d.ts +0 -85
- package/build/dids/IndyVdrIndyDidRegistrar.js +0 -338
- package/build/dids/IndyVdrIndyDidRegistrar.js.map +0 -1
- package/build/dids/IndyVdrIndyDidResolver.d.ts +0 -7
- package/build/dids/IndyVdrIndyDidResolver.js +0 -39
- package/build/dids/IndyVdrIndyDidResolver.js.map +0 -1
- package/build/dids/IndyVdrSovDidResolver.d.ts +0 -8
- package/build/dids/IndyVdrSovDidResolver.js +0 -79
- package/build/dids/IndyVdrSovDidResolver.js.map +0 -1
- package/build/dids/didIndyUtil.d.ts +0 -47
- package/build/dids/didIndyUtil.js +0 -241
- package/build/dids/didIndyUtil.js.map +0 -1
- package/build/dids/didSovUtil.d.ts +0 -26
- package/build/dids/didSovUtil.js +0 -180
- package/build/dids/didSovUtil.js.map +0 -1
- package/build/dids/index.d.ts +0 -3
- package/build/dids/index.js +0 -10
- package/build/dids/index.js.map +0 -1
- package/build/error/IndyVdrError.d.ts +0 -6
- package/build/error/IndyVdrError.js +0 -11
- package/build/error/IndyVdrError.js.map +0 -1
- package/build/error/IndyVdrNotConfiguredError.d.ts +0 -6
- package/build/error/IndyVdrNotConfiguredError.js +0 -11
- package/build/error/IndyVdrNotConfiguredError.js.map +0 -1
- package/build/error/IndyVdrNotFound.d.ts +0 -6
- package/build/error/IndyVdrNotFound.js +0 -11
- package/build/error/IndyVdrNotFound.js.map +0 -1
- package/build/error/index.d.ts +0 -3
- package/build/error/index.js +0 -20
- package/build/error/index.js.map +0 -1
- package/build/index.d.ts +0 -5
- package/build/index.js +0 -27
- package/build/index.js.map +0 -1
- package/build/pool/IndyVdrPool.d.ts +0 -54
- package/build/pool/IndyVdrPool.js +0 -131
- package/build/pool/IndyVdrPool.js.map +0 -1
- package/build/pool/IndyVdrPoolService.d.ts +0 -55
- package/build/pool/IndyVdrPoolService.js +0 -175
- package/build/pool/IndyVdrPoolService.js.map +0 -1
- package/build/pool/index.d.ts +0 -2
- package/build/pool/index.js +0 -19
- package/build/pool/index.js.map +0 -1
- package/build/utils/did.d.ts +0 -32
- package/build/utils/did.js +0 -57
- package/build/utils/did.js.map +0 -1
- package/build/utils/promises.d.ts +0 -11
- package/build/utils/promises.js +0 -26
- package/build/utils/promises.js.map +0 -1
- package/build/utils/sign.d.ts +0 -5
- package/build/utils/sign.js +0 -23
- package/build/utils/sign.js.map +0 -1
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.indyDidDocumentFromDid = indyDidDocumentFromDid;
|
|
4
|
-
exports.createKeyAgreementKey = createKeyAgreementKey;
|
|
5
|
-
exports.combineDidDocumentWithJson = combineDidDocumentWithJson;
|
|
6
|
-
exports.didDocDiff = didDocDiff;
|
|
7
|
-
exports.isSelfCertifiedIndyDid = isSelfCertifiedIndyDid;
|
|
8
|
-
exports.indyDidFromNamespaceAndInitialKey = indyDidFromNamespaceAndInitialKey;
|
|
9
|
-
exports.verificationKeyForIndyDid = verificationKeyForIndyDid;
|
|
10
|
-
exports.getPublicDid = getPublicDid;
|
|
11
|
-
exports.getEndpointsForDid = getEndpointsForDid;
|
|
12
|
-
exports.buildDidDocument = buildDidDocument;
|
|
13
|
-
const anoncreds_1 = require("@credo-ts/anoncreds");
|
|
14
|
-
const core_1 = require("@credo-ts/core");
|
|
15
|
-
const indy_vdr_shared_1 = require("@hyperledger/indy-vdr-shared");
|
|
16
|
-
const error_1 = require("../error");
|
|
17
|
-
const didSovUtil_1 = require("./didSovUtil");
|
|
18
|
-
// Create a base DIDDoc template according to https://hyperledger.github.io/indy-did-method/#base-diddoc-template
|
|
19
|
-
function indyDidDocumentFromDid(did, verKeyBase58) {
|
|
20
|
-
const verificationMethodId = `${did}#verkey`;
|
|
21
|
-
const publicKeyBase58 = verKeyBase58;
|
|
22
|
-
const builder = new core_1.DidDocumentBuilder(did)
|
|
23
|
-
.addContext('https://w3id.org/security/suites/ed25519-2018/v1')
|
|
24
|
-
.addVerificationMethod({
|
|
25
|
-
controller: did,
|
|
26
|
-
id: verificationMethodId,
|
|
27
|
-
publicKeyBase58,
|
|
28
|
-
type: 'Ed25519VerificationKey2018',
|
|
29
|
-
})
|
|
30
|
-
.addAuthentication(verificationMethodId);
|
|
31
|
-
return builder;
|
|
32
|
-
}
|
|
33
|
-
function createKeyAgreementKey(verkey) {
|
|
34
|
-
return core_1.TypedArrayEncoder.toBase58((0, core_1.convertPublicKeyToX25519)(core_1.TypedArrayEncoder.fromBase58(verkey)));
|
|
35
|
-
}
|
|
36
|
-
const deepMerge = (a, b) => {
|
|
37
|
-
const output = {};
|
|
38
|
-
[...new Set([...Object.keys(a), ...Object.keys(b)])].forEach((key) => {
|
|
39
|
-
// Only an object includes a given key: just output it
|
|
40
|
-
if (a[key] && !b[key]) {
|
|
41
|
-
output[key] = a[key];
|
|
42
|
-
}
|
|
43
|
-
else if (!a[key] && b[key]) {
|
|
44
|
-
output[key] = b[key];
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
// Both objects do include the key
|
|
48
|
-
// Some or both are arrays
|
|
49
|
-
if (Array.isArray(a[key])) {
|
|
50
|
-
if (Array.isArray(b[key])) {
|
|
51
|
-
const element = new Set();
|
|
52
|
-
a[key].forEach((item) => element.add(item));
|
|
53
|
-
b[key].forEach((item) => element.add(item));
|
|
54
|
-
output[key] = Array.from(element);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
|
-
const arr = a[key];
|
|
59
|
-
output[key] = Array.from(new Set(...arr, b[key]));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else if (Array.isArray(b[key])) {
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
-
const arr = b[key];
|
|
65
|
-
output[key] = Array.from(new Set(...arr, a[key]));
|
|
66
|
-
// Both elements are objects: recursive merge
|
|
67
|
-
}
|
|
68
|
-
else if (typeof a[key] == 'object' && typeof b[key] == 'object') {
|
|
69
|
-
output[key] = deepMerge(a, b);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
return output;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Combine a JSON content with the contents of a DidDocument
|
|
77
|
-
* @param didDoc object containing original DIDDocument
|
|
78
|
-
* @param json object containing extra DIDDoc contents
|
|
79
|
-
*
|
|
80
|
-
* @returns a DidDocument object resulting from the combination of both
|
|
81
|
-
*/
|
|
82
|
-
function combineDidDocumentWithJson(didDoc, json) {
|
|
83
|
-
const didDocJson = didDoc.toJSON();
|
|
84
|
-
const combinedJson = deepMerge(didDocJson, json);
|
|
85
|
-
return core_1.JsonTransformer.fromJSON(combinedJson, core_1.DidDocument);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Processes the difference between a base DidDocument and a complete DidDocument
|
|
89
|
-
*
|
|
90
|
-
* Note: it does deep comparison based only on "id" field to determine whether is
|
|
91
|
-
* the same object or is a different one
|
|
92
|
-
*
|
|
93
|
-
* @param extra complete DidDocument
|
|
94
|
-
* @param base base DidDocument
|
|
95
|
-
* @returns diff object
|
|
96
|
-
*/
|
|
97
|
-
function didDocDiff(extra, base) {
|
|
98
|
-
const output = {};
|
|
99
|
-
for (const key in extra) {
|
|
100
|
-
if (!(key in base)) {
|
|
101
|
-
output[key] = extra[key];
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
// They are arrays: compare elements
|
|
105
|
-
if (Array.isArray(extra[key]) && Array.isArray(base[key])) {
|
|
106
|
-
// Different types: return the extra
|
|
107
|
-
output[key] = [];
|
|
108
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
-
const baseAsArray = base[key];
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
-
const extraAsArray = extra[key];
|
|
112
|
-
for (const element of extraAsArray) {
|
|
113
|
-
if (!baseAsArray.find((item) => item.id === element.id)) {
|
|
114
|
-
;
|
|
115
|
-
output[key].push(element);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
} // They are both objects: do recursive diff
|
|
119
|
-
else if (typeof extra[key] == 'object' && typeof base[key] == 'object') {
|
|
120
|
-
output[key] = didDocDiff(extra[key], base[key]);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
output[key] = extra[key];
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return output;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Check whether the did is a self certifying did. If the verkey is abbreviated this method
|
|
131
|
-
* will always return true. Make sure that the verkey you pass in this method belongs to the
|
|
132
|
-
* did passed in
|
|
133
|
-
*
|
|
134
|
-
* @return Boolean indicating whether the did is self certifying
|
|
135
|
-
*/
|
|
136
|
-
function isSelfCertifiedIndyDid(did, verkey) {
|
|
137
|
-
const { namespace } = (0, anoncreds_1.parseIndyDid)(did);
|
|
138
|
-
const { did: didFromVerkey } = indyDidFromNamespaceAndInitialKey(namespace, core_1.Key.fromPublicKeyBase58(verkey, core_1.KeyType.Ed25519));
|
|
139
|
-
if (didFromVerkey === did) {
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
function indyDidFromNamespaceAndInitialKey(namespace, initialKey) {
|
|
145
|
-
const buffer = core_1.Hasher.hash(initialKey.publicKey, 'sha-256');
|
|
146
|
-
const id = core_1.TypedArrayEncoder.toBase58(buffer.slice(0, 16));
|
|
147
|
-
const verkey = initialKey.publicKeyBase58;
|
|
148
|
-
const did = `did:indy:${namespace}:${id}`;
|
|
149
|
-
return { did, id, verkey };
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Fetches the verification key for a given did:indy did and returns the key as a {@link Key} object.
|
|
153
|
-
*
|
|
154
|
-
* @throws {@link CredoError} if the did could not be resolved or the key could not be extracted
|
|
155
|
-
*/
|
|
156
|
-
async function verificationKeyForIndyDid(agentContext, did) {
|
|
157
|
-
// FIXME: we should store the didDocument in the DidRecord so we don't have to fetch our own did
|
|
158
|
-
// from the ledger to know which key is associated with the did
|
|
159
|
-
const didsApi = agentContext.dependencyManager.resolve(core_1.DidsApi);
|
|
160
|
-
const didResult = await didsApi.resolve(did);
|
|
161
|
-
if (!didResult.didDocument) {
|
|
162
|
-
throw new core_1.CredoError(`Could not resolve did ${did}. ${didResult.didResolutionMetadata.error} ${didResult.didResolutionMetadata.message}`);
|
|
163
|
-
}
|
|
164
|
-
// did:indy dids MUST have a verificationMethod with #verkey
|
|
165
|
-
const verificationMethod = didResult.didDocument.dereferenceKey(`${did}#verkey`);
|
|
166
|
-
const key = (0, core_1.getKeyFromVerificationMethod)(verificationMethod);
|
|
167
|
-
return key;
|
|
168
|
-
}
|
|
169
|
-
async function getPublicDid(pool, unqualifiedDid) {
|
|
170
|
-
const request = new indy_vdr_shared_1.GetNymRequest({ dest: unqualifiedDid });
|
|
171
|
-
const didResponse = await pool.submitRequest(request);
|
|
172
|
-
if (!didResponse.result.data) {
|
|
173
|
-
throw new error_1.IndyVdrNotFoundError(`DID ${unqualifiedDid} not found in indy namespace ${pool.indyNamespace}`);
|
|
174
|
-
}
|
|
175
|
-
return JSON.parse(didResponse.result.data);
|
|
176
|
-
}
|
|
177
|
-
async function getEndpointsForDid(agentContext, pool, unqualifiedDid) {
|
|
178
|
-
var _a;
|
|
179
|
-
try {
|
|
180
|
-
agentContext.config.logger.debug(`Get endpoints for did '${unqualifiedDid}' from ledger '${pool.indyNamespace}'`);
|
|
181
|
-
const request = new indy_vdr_shared_1.GetAttribRequest({ targetDid: unqualifiedDid, raw: 'endpoint' });
|
|
182
|
-
agentContext.config.logger.debug(`Submitting get endpoint ATTRIB request for did '${unqualifiedDid}' to ledger '${pool.indyNamespace}'`);
|
|
183
|
-
const response = await pool.submitRequest(request);
|
|
184
|
-
if (!response.result.data) {
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
const endpoints = (_a = JSON.parse(response.result.data)) === null || _a === void 0 ? void 0 : _a.endpoint;
|
|
188
|
-
agentContext.config.logger.debug(`Got endpoints '${JSON.stringify(endpoints)}' for did '${unqualifiedDid}' from ledger '${pool.indyNamespace}'`, {
|
|
189
|
-
response,
|
|
190
|
-
endpoints,
|
|
191
|
-
});
|
|
192
|
-
return endpoints;
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
agentContext.config.logger.error(`Error retrieving endpoints for did '${unqualifiedDid}' from ledger '${pool.indyNamespace}'`, {
|
|
196
|
-
error,
|
|
197
|
-
});
|
|
198
|
-
throw new error_1.IndyVdrError(error);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
async function buildDidDocument(agentContext, pool, did) {
|
|
202
|
-
const { namespaceIdentifier } = (0, anoncreds_1.parseIndyDid)(did);
|
|
203
|
-
const nym = await getPublicDid(pool, namespaceIdentifier);
|
|
204
|
-
// Create base Did Document
|
|
205
|
-
// For modern did:indy DIDs, we assume that GET_NYM is always a full verkey in base58.
|
|
206
|
-
// For backwards compatibility, we accept a shortened verkey and convert it using previous convention
|
|
207
|
-
const verkey = (0, didSovUtil_1.getFullVerkey)(namespaceIdentifier, nym.verkey);
|
|
208
|
-
const builder = indyDidDocumentFromDid(did, verkey);
|
|
209
|
-
// If GET_NYM does not return any diddocContent, fallback to legacy GET_ATTRIB endpoint
|
|
210
|
-
if (!nym.diddocContent) {
|
|
211
|
-
const keyAgreementId = `${did}#key-agreement-1`;
|
|
212
|
-
const endpoints = await getEndpointsForDid(agentContext, pool, namespaceIdentifier);
|
|
213
|
-
if (endpoints) {
|
|
214
|
-
builder
|
|
215
|
-
.addContext('https://w3id.org/security/suites/x25519-2019/v1')
|
|
216
|
-
.addVerificationMethod({
|
|
217
|
-
controller: did,
|
|
218
|
-
id: keyAgreementId,
|
|
219
|
-
publicKeyBase58: createKeyAgreementKey(verkey),
|
|
220
|
-
type: 'X25519KeyAgreementKey2019',
|
|
221
|
-
})
|
|
222
|
-
.addKeyAgreement(keyAgreementId);
|
|
223
|
-
// Process endpoint attrib following the same rules as for did:sov
|
|
224
|
-
(0, didSovUtil_1.addServicesFromEndpointsAttrib)(builder, did, endpoints, keyAgreementId);
|
|
225
|
-
}
|
|
226
|
-
return builder.build();
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
// Combine it with didDoc
|
|
230
|
-
let diddocContent;
|
|
231
|
-
try {
|
|
232
|
-
diddocContent = JSON.parse(nym.diddocContent);
|
|
233
|
-
}
|
|
234
|
-
catch (error) {
|
|
235
|
-
agentContext.config.logger.error(`Nym diddocContent is not a valid json string: ${diddocContent}`);
|
|
236
|
-
throw new error_1.IndyVdrError(`Nym diddocContent failed to parse as JSON: ${error}`);
|
|
237
|
-
}
|
|
238
|
-
return combineDidDocumentWithJson(builder.build(), diddocContent);
|
|
239
|
-
}
|
|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B,CAAC,MAAM,CAAC;gBAC9C,IAAI,EAAE,2BAA2B;aAClC,CAAC;iBACD,eAAe,CAAC,cAAc,CAAC,CAAA;YAElC,kEAAkE;YAClE,IAAA,2CAA8B,EAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,cAAc,CAAC,CAAA;QACzE,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC;SAAM,CAAC;QACN,yBAAyB;QACzB,IAAI,aAAa,CAAA;QACjB,IAAI,CAAC;YACH,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAA4B,CAAA;QAC1E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iDAAiD,aAAa,EAAE,CAAC,CAAA;YAClG,MAAM,IAAI,oBAAY,CAAC,8CAA8C,KAAK,EAAE,CAAC,CAAA;QAC/E,CAAC;QACD,OAAO,0BAA0B,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,aAAa,CAAC,CAAA;IACnE,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DidDocumentService, DidDocumentBuilder } from '@credo-ts/core';
|
|
2
|
-
export type CommEndpointType = 'endpoint' | 'did-communication' | 'DIDComm' | 'DIDCommMessaging';
|
|
3
|
-
export interface IndyEndpointAttrib {
|
|
4
|
-
endpoint?: string;
|
|
5
|
-
types?: Array<CommEndpointType>;
|
|
6
|
-
routingKeys?: string[];
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
}
|
|
9
|
-
export interface GetNymResponseData {
|
|
10
|
-
did: string;
|
|
11
|
-
verkey: string;
|
|
12
|
-
role: string;
|
|
13
|
-
alias?: string;
|
|
14
|
-
diddocContent?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const FULL_VERKEY_REGEX: RegExp;
|
|
17
|
-
/**
|
|
18
|
-
* Check a base58 encoded string against a regex expression to determine if it is a full valid verkey
|
|
19
|
-
* @param verkey Base58 encoded string representation of a verkey
|
|
20
|
-
* @return Boolean indicating if the string is a valid verkey
|
|
21
|
-
*/
|
|
22
|
-
export declare function isFullVerkey(verkey: string): boolean;
|
|
23
|
-
export declare function getFullVerkey(did: string, verkey: string): string;
|
|
24
|
-
export declare function sovDidDocumentFromDid(fullDid: string, verkey: string): DidDocumentBuilder;
|
|
25
|
-
export declare function endpointsAttribFromServices(services: DidDocumentService[]): IndyEndpointAttrib;
|
|
26
|
-
export declare function addServicesFromEndpointsAttrib(builder: DidDocumentBuilder, did: string, endpoints: IndyEndpointAttrib, keyAgreementId: string): void;
|
package/build/dids/didSovUtil.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.FULL_VERKEY_REGEX = void 0;
|
|
15
|
-
exports.isFullVerkey = isFullVerkey;
|
|
16
|
-
exports.getFullVerkey = getFullVerkey;
|
|
17
|
-
exports.sovDidDocumentFromDid = sovDidDocumentFromDid;
|
|
18
|
-
exports.endpointsAttribFromServices = endpointsAttribFromServices;
|
|
19
|
-
exports.addServicesFromEndpointsAttrib = addServicesFromEndpointsAttrib;
|
|
20
|
-
const core_1 = require("@credo-ts/core");
|
|
21
|
-
exports.FULL_VERKEY_REGEX = /^[1-9A-HJ-NP-Za-km-z]{43,44}$/;
|
|
22
|
-
/**
|
|
23
|
-
* Check a base58 encoded string against a regex expression to determine if it is a full valid verkey
|
|
24
|
-
* @param verkey Base58 encoded string representation of a verkey
|
|
25
|
-
* @return Boolean indicating if the string is a valid verkey
|
|
26
|
-
*/
|
|
27
|
-
function isFullVerkey(verkey) {
|
|
28
|
-
return exports.FULL_VERKEY_REGEX.test(verkey);
|
|
29
|
-
}
|
|
30
|
-
function getFullVerkey(did, verkey) {
|
|
31
|
-
var _a;
|
|
32
|
-
if (isFullVerkey(verkey))
|
|
33
|
-
return verkey;
|
|
34
|
-
// Did could have did:xxx prefix, only take the last item after :
|
|
35
|
-
const id = (_a = did.split(':').pop()) !== null && _a !== void 0 ? _a : did;
|
|
36
|
-
// Verkey is prefixed with ~ if abbreviated
|
|
37
|
-
const verkeyWithoutTilde = verkey.slice(1);
|
|
38
|
-
// Create base58 encoded public key (32 bytes)
|
|
39
|
-
return core_1.TypedArrayEncoder.toBase58(core_1.Buffer.concat([
|
|
40
|
-
// Take did identifier (16 bytes)
|
|
41
|
-
core_1.TypedArrayEncoder.fromBase58(id),
|
|
42
|
-
// Concat the abbreviated verkey (16 bytes)
|
|
43
|
-
core_1.TypedArrayEncoder.fromBase58(verkeyWithoutTilde),
|
|
44
|
-
]));
|
|
45
|
-
}
|
|
46
|
-
function sovDidDocumentFromDid(fullDid, verkey) {
|
|
47
|
-
const verificationMethodId = `${fullDid}#key-1`;
|
|
48
|
-
const keyAgreementId = `${fullDid}#key-agreement-1`;
|
|
49
|
-
const publicKeyBase58 = getFullVerkey(fullDid, verkey);
|
|
50
|
-
const publicKeyX25519 = core_1.TypedArrayEncoder.toBase58((0, core_1.convertPublicKeyToX25519)(core_1.TypedArrayEncoder.fromBase58(publicKeyBase58)));
|
|
51
|
-
const builder = new core_1.DidDocumentBuilder(fullDid)
|
|
52
|
-
.addContext('https://w3id.org/security/suites/ed25519-2018/v1')
|
|
53
|
-
.addContext('https://w3id.org/security/suites/x25519-2019/v1')
|
|
54
|
-
.addVerificationMethod({
|
|
55
|
-
controller: fullDid,
|
|
56
|
-
id: verificationMethodId,
|
|
57
|
-
publicKeyBase58: publicKeyBase58,
|
|
58
|
-
type: 'Ed25519VerificationKey2018',
|
|
59
|
-
})
|
|
60
|
-
.addVerificationMethod({
|
|
61
|
-
controller: fullDid,
|
|
62
|
-
id: keyAgreementId,
|
|
63
|
-
publicKeyBase58: publicKeyX25519,
|
|
64
|
-
type: 'X25519KeyAgreementKey2019',
|
|
65
|
-
})
|
|
66
|
-
.addAuthentication(verificationMethodId)
|
|
67
|
-
.addAssertionMethod(verificationMethodId)
|
|
68
|
-
.addKeyAgreement(keyAgreementId);
|
|
69
|
-
return builder;
|
|
70
|
-
}
|
|
71
|
-
// Process Indy Attrib Endpoint Types according to: https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html > Read (Resolve) > DID Service Endpoint
|
|
72
|
-
function processEndpointTypes(types) {
|
|
73
|
-
const expectedTypes = ['endpoint', 'did-communication', 'DIDComm', 'DIDCommMessaging'];
|
|
74
|
-
const defaultTypes = ['endpoint', 'did-communication'];
|
|
75
|
-
// Return default types if types "is NOT present [or] empty"
|
|
76
|
-
if (!types || types.length <= 0) {
|
|
77
|
-
return defaultTypes;
|
|
78
|
-
}
|
|
79
|
-
// Return default types if types "contain any other values"
|
|
80
|
-
for (const type of types) {
|
|
81
|
-
if (!expectedTypes.includes(type)) {
|
|
82
|
-
return defaultTypes;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Return provided types
|
|
86
|
-
return types;
|
|
87
|
-
}
|
|
88
|
-
function endpointsAttribFromServices(services) {
|
|
89
|
-
var _a;
|
|
90
|
-
const commTypes = ['endpoint', 'did-communication', 'DIDComm', 'DIDCommMessaging'];
|
|
91
|
-
const commServices = services.filter((item) => commTypes.includes(item.type));
|
|
92
|
-
const endpoint = commServices[0] instanceof core_1.NewDidCommV2Service
|
|
93
|
-
? commServices[0].firstServiceEndpointUri
|
|
94
|
-
: commServices[0].serviceEndpoint;
|
|
95
|
-
if (typeof endpoint !== 'string') {
|
|
96
|
-
throw new core_1.CredoError(`For unknown service endpoint types (${commServices[0].type}) the 'serviceEndpoint' needs to be of type 'string'`);
|
|
97
|
-
}
|
|
98
|
-
// Check that all services use the same endpoint, as only one is accepted
|
|
99
|
-
if (!commServices.every((item) => (item instanceof core_1.NewDidCommV2Service ? item.firstServiceEndpointUri : item.serviceEndpoint) === endpoint)) {
|
|
100
|
-
throw new core_1.CredoError('serviceEndpoint for all services must match');
|
|
101
|
-
}
|
|
102
|
-
const types = [];
|
|
103
|
-
const routingKeys = new Set();
|
|
104
|
-
for (const commService of commServices) {
|
|
105
|
-
const commServiceType = commService.type;
|
|
106
|
-
if (types.includes(commServiceType)) {
|
|
107
|
-
throw new core_1.CredoError('Only a single communication service per type is supported');
|
|
108
|
-
}
|
|
109
|
-
types.push(commServiceType);
|
|
110
|
-
if ((commService instanceof core_1.DidCommV1Service || commService instanceof core_1.DidCommV2Service) &&
|
|
111
|
-
commService.routingKeys) {
|
|
112
|
-
commService.routingKeys.forEach((item) => routingKeys.add(item));
|
|
113
|
-
}
|
|
114
|
-
else if (commService instanceof core_1.NewDidCommV2Service) {
|
|
115
|
-
const firstServiceEndpoint = Array.isArray(commService.serviceEndpoint)
|
|
116
|
-
? commService.serviceEndpoint[0]
|
|
117
|
-
: commService.serviceEndpoint;
|
|
118
|
-
(_a = firstServiceEndpoint.routingKeys) === null || _a === void 0 ? void 0 : _a.forEach((item) => routingKeys.add(item));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return { endpoint, types, routingKeys: Array.from(routingKeys) };
|
|
122
|
-
}
|
|
123
|
-
function addServicesFromEndpointsAttrib(builder, did, endpoints, keyAgreementId) {
|
|
124
|
-
const { endpoint, routingKeys, types } = endpoints, otherEndpoints = __rest(endpoints, ["endpoint", "routingKeys", "types"]);
|
|
125
|
-
if (endpoint) {
|
|
126
|
-
const processedTypes = processEndpointTypes(types);
|
|
127
|
-
// If 'endpoint' included in types, add id to the services array
|
|
128
|
-
if (processedTypes.includes('endpoint')) {
|
|
129
|
-
builder.addService(new core_1.DidDocumentService({
|
|
130
|
-
id: `${did}#endpoint`,
|
|
131
|
-
serviceEndpoint: endpoint,
|
|
132
|
-
type: 'endpoint',
|
|
133
|
-
}));
|
|
134
|
-
}
|
|
135
|
-
// If 'did-communication' included in types, add DIDComm v1 entry
|
|
136
|
-
if (processedTypes.includes('did-communication')) {
|
|
137
|
-
builder.addService(new core_1.DidCommV1Service({
|
|
138
|
-
id: `${did}#did-communication`,
|
|
139
|
-
serviceEndpoint: endpoint,
|
|
140
|
-
priority: 0,
|
|
141
|
-
routingKeys: routingKeys !== null && routingKeys !== void 0 ? routingKeys : [],
|
|
142
|
-
recipientKeys: [keyAgreementId],
|
|
143
|
-
accept: ['didcomm/aip2;env=rfc19'],
|
|
144
|
-
}));
|
|
145
|
-
}
|
|
146
|
-
// If 'DIDCommMessaging' included in types, add DIDComm v2 entry
|
|
147
|
-
if (processedTypes.includes('DIDCommMessaging')) {
|
|
148
|
-
builder
|
|
149
|
-
.addService(new core_1.NewDidCommV2Service({
|
|
150
|
-
id: `${did}#didcomm-messaging-1`,
|
|
151
|
-
serviceEndpoint: new core_1.NewDidCommV2ServiceEndpoint({
|
|
152
|
-
uri: endpoint,
|
|
153
|
-
routingKeys: routingKeys,
|
|
154
|
-
accept: ['didcomm/v2'],
|
|
155
|
-
}),
|
|
156
|
-
}))
|
|
157
|
-
.addContext('https://didcomm.org/messaging/contexts/v2');
|
|
158
|
-
}
|
|
159
|
-
// If 'DIDComm' included in types, add legacy DIDComm v2 entry
|
|
160
|
-
if (processedTypes.includes('DIDComm')) {
|
|
161
|
-
builder
|
|
162
|
-
.addService(new core_1.DidCommV2Service({
|
|
163
|
-
id: `${did}#didcomm-1`,
|
|
164
|
-
routingKeys: routingKeys,
|
|
165
|
-
accept: ['didcomm/v2'],
|
|
166
|
-
serviceEndpoint: endpoint,
|
|
167
|
-
}))
|
|
168
|
-
.addContext('https://didcomm.org/messaging/contexts/v2');
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
// Add other endpoint types
|
|
172
|
-
for (const [type, endpoint] of Object.entries(otherEndpoints)) {
|
|
173
|
-
builder.addService(new core_1.DidDocumentService({
|
|
174
|
-
id: `${did}#${type}`,
|
|
175
|
-
serviceEndpoint: endpoint,
|
|
176
|
-
type,
|
|
177
|
-
}));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
//# sourceMappingURL=didSovUtil.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"didSovUtil.js","sourceRoot":"","sources":["../../src/dids/didSovUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAqCA,oCAEC;AAED,sCAiBC;AAED,sDA6BC;AAuBD,kEAkDC;AAED,wEA6EC;AAjPD,yCAWuB;AAmBV,QAAA,iBAAiB,GAAG,+BAA+B,CAAA;AAEhE;;;;GAIG;AACH,SAAgB,YAAY,CAAC,MAAc;IACzC,OAAO,yBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACvC,CAAC;AAED,SAAgB,aAAa,CAAC,GAAW,EAAE,MAAc;;IACvD,IAAI,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAA;IAEvC,iEAAiE;IACjE,MAAM,EAAE,GAAG,MAAA,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,mCAAI,GAAG,CAAA;IACtC,2CAA2C;IAC3C,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAE1C,8CAA8C;IAC9C,OAAO,wBAAiB,CAAC,QAAQ,CAC/B,aAAM,CAAC,MAAM,CAAC;QACZ,iCAAiC;QACjC,wBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,2CAA2C;QAC3C,wBAAiB,CAAC,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,EAAE,WAAW;gBACxB,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,eAAe,EAAE,QAAQ;aAC1B,CAAC,CACH;iBACA,UAAU,CAAC,2CAA2C,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QAC9D,OAAO,CAAC,UAAU,CAChB,IAAI,yBAAkB,CAAC;YACrB,EAAE,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE;YACpB,eAAe,EAAE,QAAkB;YACnC,IAAI;SACL,CAAC,CACH,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/build/dids/index.d.ts
DELETED
package/build/dids/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndyVdrSovDidResolver = exports.IndyVdrIndyDidResolver = exports.IndyVdrIndyDidRegistrar = void 0;
|
|
4
|
-
var IndyVdrIndyDidRegistrar_1 = require("./IndyVdrIndyDidRegistrar");
|
|
5
|
-
Object.defineProperty(exports, "IndyVdrIndyDidRegistrar", { enumerable: true, get: function () { return IndyVdrIndyDidRegistrar_1.IndyVdrIndyDidRegistrar; } });
|
|
6
|
-
var IndyVdrIndyDidResolver_1 = require("./IndyVdrIndyDidResolver");
|
|
7
|
-
Object.defineProperty(exports, "IndyVdrIndyDidResolver", { enumerable: true, get: function () { return IndyVdrIndyDidResolver_1.IndyVdrIndyDidResolver; } });
|
|
8
|
-
var IndyVdrSovDidResolver_1 = require("./IndyVdrSovDidResolver");
|
|
9
|
-
Object.defineProperty(exports, "IndyVdrSovDidResolver", { enumerable: true, get: function () { return IndyVdrSovDidResolver_1.IndyVdrSovDidResolver; } });
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
package/build/dids/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dids/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoH;AAA3G,kIAAA,uBAAuB,OAAA;AAChC,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAC/B,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndyVdrError = void 0;
|
|
4
|
-
const core_1 = require("@credo-ts/core");
|
|
5
|
-
class IndyVdrError extends core_1.CredoError {
|
|
6
|
-
constructor(message, { cause } = {}) {
|
|
7
|
-
super(message, { cause });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.IndyVdrError = IndyVdrError;
|
|
11
|
-
//# sourceMappingURL=IndyVdrError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IndyVdrError.js","sourceRoot":"","sources":["../../src/error/IndyVdrError.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAE3C,MAAa,YAAa,SAAQ,iBAAU;IAC1C,YAAmB,OAAe,EAAE,EAAE,KAAK,KAAwB,EAAE;QACnE,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3B,CAAC;CACF;AAJD,oCAIC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndyVdrNotConfiguredError = void 0;
|
|
4
|
-
const IndyVdrError_1 = require("./IndyVdrError");
|
|
5
|
-
class IndyVdrNotConfiguredError extends IndyVdrError_1.IndyVdrError {
|
|
6
|
-
constructor(message, { cause } = {}) {
|
|
7
|
-
super(message, { cause });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.IndyVdrNotConfiguredError = IndyVdrNotConfiguredError;
|
|
11
|
-
//# sourceMappingURL=IndyVdrNotConfiguredError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IndyVdrNotConfiguredError.js","sourceRoot":"","sources":["../../src/error/IndyVdrNotConfiguredError.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAE7C,MAAa,yBAA0B,SAAQ,2BAAY;IACzD,YAAmB,OAAe,EAAE,EAAE,KAAK,KAAwB,EAAE;QACnE,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3B,CAAC;CACF;AAJD,8DAIC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndyVdrNotFoundError = void 0;
|
|
4
|
-
const IndyVdrError_1 = require("./IndyVdrError");
|
|
5
|
-
class IndyVdrNotFoundError extends IndyVdrError_1.IndyVdrError {
|
|
6
|
-
constructor(message, { cause } = {}) {
|
|
7
|
-
super(message, { cause });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.IndyVdrNotFoundError = IndyVdrNotFoundError;
|
|
11
|
-
//# sourceMappingURL=IndyVdrNotFound.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IndyVdrNotFound.js","sourceRoot":"","sources":["../../src/error/IndyVdrNotFound.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAE7C,MAAa,oBAAqB,SAAQ,2BAAY;IACpD,YAAmB,OAAe,EAAE,EAAE,KAAK,KAAwB,EAAE;QACnE,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3B,CAAC;CACF;AAJD,oDAIC"}
|
package/build/error/index.d.ts
DELETED
package/build/error/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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("./IndyVdrError"), exports);
|
|
18
|
-
__exportStar(require("./IndyVdrNotFound"), exports);
|
|
19
|
-
__exportStar(require("./IndyVdrNotConfiguredError"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/build/error/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,oDAAiC;AACjC,8DAA2C"}
|
package/build/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { IndyVdrIndyDidRegistrar, IndyVdrIndyDidResolver, IndyVdrSovDidResolver, IndyVdrDidCreateResult, IndyVdrDidCreateOptions, } from './dids';
|
|
2
|
-
export { IndyVdrPoolConfig, IndyVdrPoolService } from './pool';
|
|
3
|
-
export * from './IndyVdrModule';
|
|
4
|
-
export * from './IndyVdrModuleConfig';
|
|
5
|
-
export * from './anoncreds';
|
package/build/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
exports.IndyVdrPoolService = exports.IndyVdrSovDidResolver = exports.IndyVdrIndyDidResolver = exports.IndyVdrIndyDidRegistrar = void 0;
|
|
18
|
-
var dids_1 = require("./dids");
|
|
19
|
-
Object.defineProperty(exports, "IndyVdrIndyDidRegistrar", { enumerable: true, get: function () { return dids_1.IndyVdrIndyDidRegistrar; } });
|
|
20
|
-
Object.defineProperty(exports, "IndyVdrIndyDidResolver", { enumerable: true, get: function () { return dids_1.IndyVdrIndyDidResolver; } });
|
|
21
|
-
Object.defineProperty(exports, "IndyVdrSovDidResolver", { enumerable: true, get: function () { return dids_1.IndyVdrSovDidResolver; } });
|
|
22
|
-
var pool_1 = require("./pool");
|
|
23
|
-
Object.defineProperty(exports, "IndyVdrPoolService", { enumerable: true, get: function () { return pool_1.IndyVdrPoolService; } });
|
|
24
|
-
__exportStar(require("./IndyVdrModule"), exports);
|
|
25
|
-
__exportStar(require("./IndyVdrModuleConfig"), exports);
|
|
26
|
-
__exportStar(require("./anoncreds"), exports);
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAMe;AALb,+GAAA,uBAAuB,OAAA;AACvB,8GAAA,sBAAsB,OAAA;AACtB,6GAAA,qBAAqB,OAAA;AAIvB,+BAA8D;AAAlC,0GAAA,kBAAkB,OAAA;AAC9C,kDAA+B;AAC/B,wDAAqC;AACrC,8CAA2B"}
|