@verana-labs/vs-agent-sdk 2.0.0-dev.7 → 2.0.0-dev.70
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 +0 -2
- package/build/adminApi/AdminApiError.d.ts +27 -0
- package/build/adminApi/AdminApiError.js +59 -0
- package/build/adminApi/AdminApiError.js.map +1 -0
- package/build/adminApi/didcommModules.d.ts +2 -0
- package/build/adminApi/didcommModules.js +8 -0
- package/build/adminApi/didcommModules.js.map +1 -0
- package/build/adminApi/index.d.ts +4 -0
- package/build/adminApi/index.js +21 -0
- package/build/adminApi/index.js.map +1 -0
- package/build/adminApi/moduleEndpoint.d.ts +8 -0
- package/build/adminApi/moduleEndpoint.js +28 -0
- package/build/adminApi/moduleEndpoint.js.map +1 -0
- package/build/adminApi/pagination/PageDto.d.ts +7 -0
- package/build/adminApi/pagination/PageDto.js +50 -0
- package/build/adminApi/pagination/PageDto.js.map +1 -0
- package/build/adminApi/pagination/PaginationQueryDto.d.ts +11 -0
- package/build/adminApi/pagination/PaginationQueryDto.js +46 -0
- package/build/adminApi/pagination/PaginationQueryDto.js.map +1 -0
- package/build/adminApi/pagination/cursor.d.ts +28 -0
- package/build/adminApi/pagination/cursor.js +64 -0
- package/build/adminApi/pagination/cursor.js.map +1 -0
- package/build/adminApi/pagination/index.d.ts +4 -0
- package/build/adminApi/pagination/index.js +21 -0
- package/build/adminApi/pagination/index.js.map +1 -0
- package/build/adminApi/pagination/paginate.d.ts +27 -0
- package/build/adminApi/pagination/paginate.js +77 -0
- package/build/adminApi/pagination/paginate.js.map +1 -0
- package/build/agent/VsAgent.d.ts +17 -34
- package/build/agent/VsAgent.js +75 -205
- package/build/agent/VsAgent.js.map +1 -1
- package/build/agent/createVsAgent.d.ts +5 -6
- package/build/agent/createVsAgent.js +3 -5
- package/build/agent/createVsAgent.js.map +1 -1
- package/build/blockchain/AnonCredsTrustService.d.ts +62 -0
- package/build/blockchain/AnonCredsTrustService.js +256 -0
- package/build/blockchain/AnonCredsTrustService.js.map +1 -0
- package/build/blockchain/AuthorizationService.d.ts +5 -3
- package/build/blockchain/AuthorizationService.js +17 -29
- package/build/blockchain/AuthorizationService.js.map +1 -1
- package/build/blockchain/IndexerWebSocketService.d.ts +7 -1
- package/build/blockchain/IndexerWebSocketService.js +68 -36
- package/build/blockchain/IndexerWebSocketService.js.map +1 -1
- package/build/blockchain/VeranaChainService.d.ts +25 -14
- package/build/blockchain/VeranaChainService.js +123 -113
- package/build/blockchain/VeranaChainService.js.map +1 -1
- package/build/blockchain/VeranaIndexerService.d.ts +14 -1
- package/build/blockchain/VeranaIndexerService.js +122 -8
- package/build/blockchain/VeranaIndexerService.js.map +1 -1
- package/build/blockchain/handlers/authorizationHandlers.js +2 -2
- package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
- package/build/blockchain/handlers/defaultHandlers.js +2 -0
- package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
- package/build/blockchain/handlers/index.d.ts +1 -0
- package/build/blockchain/handlers/index.js +1 -0
- package/build/blockchain/handlers/index.js.map +1 -1
- package/build/blockchain/handlers/selfIssuanceHandlers.d.ts +13 -0
- package/build/blockchain/handlers/selfIssuanceHandlers.js +71 -0
- package/build/blockchain/handlers/selfIssuanceHandlers.js.map +1 -0
- package/build/blockchain/handlers/stateMutations.d.ts +21 -2
- package/build/blockchain/handlers/stateMutations.js +285 -37
- package/build/blockchain/handlers/stateMutations.js.map +1 -1
- package/build/blockchain/index.d.ts +2 -0
- package/build/blockchain/index.js +2 -0
- package/build/blockchain/index.js.map +1 -1
- package/build/blockchain/indexerMappers.d.ts +3 -0
- package/build/blockchain/indexerMappers.js +53 -0
- package/build/blockchain/indexerMappers.js.map +1 -0
- package/build/blockchain/types.d.ts +13 -58
- package/build/blockchain/types.js.map +1 -1
- package/build/bootstrap/EcsBootstrapService.d.ts +14 -3
- package/build/bootstrap/EcsBootstrapService.js +166 -76
- package/build/bootstrap/EcsBootstrapService.js.map +1 -1
- package/build/connections/ParentConnectionModule.d.ts +20 -0
- package/build/connections/ParentConnectionModule.js +56 -0
- package/build/connections/ParentConnectionModule.js.map +1 -0
- package/build/credentials/FullTailsFileService.d.ts +0 -1
- package/build/credentials/FullTailsFileService.js +0 -49
- package/build/credentials/FullTailsFileService.js.map +1 -1
- package/build/did/CachedDocumentLoader.d.ts +3 -0
- package/build/did/CachedDocumentLoader.js +7 -1
- package/build/did/CachedDocumentLoader.js.map +1 -1
- package/build/did/CachedWebDidResolver.d.ts +0 -4
- package/build/did/CachedWebDidResolver.js +1 -5
- package/build/did/CachedWebDidResolver.js.map +1 -1
- package/build/did/artifactServices.d.ts +12 -0
- package/build/did/artifactServices.js +48 -0
- package/build/did/artifactServices.js.map +1 -0
- package/build/did/legacyDidWeb.d.ts +6 -4
- package/build/did/legacyDidWeb.js +17 -14
- package/build/did/legacyDidWeb.js.map +1 -1
- package/build/did/publicDid.d.ts +4 -0
- package/build/did/publicDid.js +19 -0
- package/build/did/publicDid.js.map +1 -0
- package/build/events/BaseMessageEvents.js +139 -5
- package/build/events/BaseMessageEvents.js.map +1 -1
- package/build/events/ConnectionEvents.js +129 -82
- package/build/events/ConnectionEvents.js.map +1 -1
- package/build/events/VsAgentEvents.d.ts +11 -9
- package/build/events/VsAgentEvents.js +8 -1
- package/build/events/VsAgentEvents.js.map +1 -1
- package/build/events/VtFlowEvents.d.ts +1 -1
- package/build/events/VtFlowEvents.js +27 -18
- package/build/events/VtFlowEvents.js.map +1 -1
- package/build/index.d.ts +7 -1
- package/build/index.js +15 -2
- package/build/index.js.map +1 -1
- package/build/plugins/setupBaseDidComm.js +9 -12
- package/build/plugins/setupBaseDidComm.js.map +1 -1
- package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
- package/build/transports/VsAgentWsInboundTransport.js +20 -14
- package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
- package/build/types.d.ts +7 -0
- package/build/types.js.map +1 -1
- package/build/utils/agent.d.ts +29 -4
- package/build/utils/agent.js +91 -22
- package/build/utils/agent.js.map +1 -1
- package/build/utils/didReadiness.d.ts +9 -0
- package/build/utils/didReadiness.js +42 -0
- package/build/utils/didReadiness.js.map +1 -0
- package/build/utils/ecsClaims.d.ts +47 -0
- package/build/utils/ecsClaims.js +120 -0
- package/build/utils/ecsClaims.js.map +1 -0
- package/build/utils/ecsService.d.ts +8 -0
- package/build/utils/ecsService.js +23 -0
- package/build/utils/ecsService.js.map +1 -0
- package/build/utils/index.d.ts +4 -0
- package/build/utils/index.js +4 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
- package/build/utils/selfIssuedEcsCredential.js +151 -0
- package/build/utils/selfIssuedEcsCredential.js.map +1 -0
- package/build/utils/setupSelfTr.d.ts +34 -66
- package/build/utils/setupSelfTr.js +89 -295
- package/build/utils/setupSelfTr.js.map +1 -1
- package/build/utils/trustCredentialStore.d.ts +67 -9
- package/build/utils/trustCredentialStore.js +296 -111
- package/build/utils/trustCredentialStore.js.map +1 -1
- package/build/utils/util.d.ts +10 -0
- package/build/utils/util.js +16 -0
- package/build/utils/util.js.map +1 -1
- package/build/utils/vcdm2.d.ts +34 -0
- package/build/utils/vcdm2.js +62 -0
- package/build/utils/vcdm2.js.map +1 -0
- package/build/utils/vtjscResolver.d.ts +18 -0
- package/build/utils/vtjscResolver.js +54 -0
- package/build/utils/vtjscResolver.js.map +1 -0
- package/build/vtFlow/VtFlowOrchestrator.d.ts +84 -13
- package/build/vtFlow/VtFlowOrchestrator.js +505 -107
- package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
- package/build/vtFlow/assertVerifiableService.d.ts +1 -0
- package/build/vtFlow/assertVerifiableService.js +45 -5
- package/build/vtFlow/assertVerifiableService.js.map +1 -1
- package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
- package/build/vtFlow/ecsIssuanceExemption.js +84 -0
- package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
- package/build/vtFlow/index.d.ts +1 -0
- package/build/vtFlow/index.js +1 -0
- package/build/vtFlow/index.js.map +1 -1
- package/package.json +17 -12
- package/build/did/migrateWebVhLog.d.ts +0 -34
- package/build/did/migrateWebVhLog.js +0 -230
- package/build/did/migrateWebVhLog.js.map +0 -1
- package/build/did/migrateWebVhVersionTime.d.ts +0 -9
- package/build/did/migrateWebVhVersionTime.js +0 -191
- package/build/did/migrateWebVhVersionTime.js.map +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ParentConnectionModule = exports.ParentConnectionRepository = exports.PARENT_CONNECTION_TAG = void 0;
|
|
16
|
+
const core_1 = require("@credo-ts/core");
|
|
17
|
+
const didcomm_1 = require("@credo-ts/didcomm");
|
|
18
|
+
exports.PARENT_CONNECTION_TAG = 'parentConnectionId';
|
|
19
|
+
/**
|
|
20
|
+
* Copies the `parentConnectionId` tag from the out-of-band record before the first save.
|
|
21
|
+
* Credo emits the first state change after this save, so the first event has the tag.
|
|
22
|
+
*/
|
|
23
|
+
let ParentConnectionRepository = class ParentConnectionRepository extends didcomm_1.DidCommConnectionRepository {
|
|
24
|
+
constructor(storageService, eventEmitter, outOfBandRepository) {
|
|
25
|
+
super(storageService, eventEmitter);
|
|
26
|
+
this.outOfBandRepository = outOfBandRepository;
|
|
27
|
+
}
|
|
28
|
+
async save(agentContext, record) {
|
|
29
|
+
if (record.outOfBandId && !record.getTag(exports.PARENT_CONNECTION_TAG)) {
|
|
30
|
+
const outOfBandRecord = await this.outOfBandRepository.findById(agentContext, record.outOfBandId);
|
|
31
|
+
const parentConnectionId = outOfBandRecord === null || outOfBandRecord === void 0 ? void 0 : outOfBandRecord.getTag(exports.PARENT_CONNECTION_TAG);
|
|
32
|
+
if (typeof parentConnectionId === 'string')
|
|
33
|
+
record.setTag(exports.PARENT_CONNECTION_TAG, parentConnectionId);
|
|
34
|
+
}
|
|
35
|
+
await super.save(agentContext, record);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.ParentConnectionRepository = ParentConnectionRepository;
|
|
39
|
+
exports.ParentConnectionRepository = ParentConnectionRepository = __decorate([
|
|
40
|
+
(0, core_1.injectable)(),
|
|
41
|
+
__param(0, (0, core_1.inject)(core_1.InjectionSymbols.StorageService)),
|
|
42
|
+
__param(1, (0, core_1.inject)(core_1.EventEmitter)),
|
|
43
|
+
__param(2, (0, core_1.inject)(didcomm_1.DidCommOutOfBandRepository)),
|
|
44
|
+
__metadata("design:paramtypes", [Object, core_1.EventEmitter,
|
|
45
|
+
didcomm_1.DidCommOutOfBandRepository])
|
|
46
|
+
], ParentConnectionRepository);
|
|
47
|
+
/**
|
|
48
|
+
* Put this module after `didcomm` in the module map. The container uses the last registration.
|
|
49
|
+
*/
|
|
50
|
+
class ParentConnectionModule {
|
|
51
|
+
register(dependencyManager) {
|
|
52
|
+
dependencyManager.registerSingleton(didcomm_1.DidCommConnectionRepository, ParentConnectionRepository);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ParentConnectionModule = ParentConnectionModule;
|
|
56
|
+
//# sourceMappingURL=ParentConnectionModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParentConnectionModule.js","sourceRoot":"","sources":["../../src/connections/ParentConnectionModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,yCAAmF;AACnF,+CAA2F;AAE9E,QAAA,qBAAqB,GAAG,oBAAoB,CAAA;AAEzD;;;GAGG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,qCAA2B;IACzE,YAC2C,cAAuD,EAC1E,YAA0B,EACK,mBAA+C;QAEpG,KAAK,CAAC,cAAc,EAAE,YAAY,CAAC,CAAA;QAFkB,wBAAmB,GAAnB,mBAAmB,CAA4B;IAGtG,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,YAA0B,EAAE,MAA+B;QAC3E,IAAI,MAAM,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,6BAAqB,CAAC,EAAE,CAAC;YAChE,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;YACjG,MAAM,kBAAkB,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,6BAAqB,CAAC,CAAA;YACzE,IAAI,OAAO,kBAAkB,KAAK,QAAQ;gBAAE,MAAM,CAAC,MAAM,CAAC,6BAAqB,EAAE,kBAAkB,CAAC,CAAA;QACtG,CAAC;QACD,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;IACxC,CAAC;CACF,CAAA;AAjBY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,iBAAU,GAAE;IAGR,WAAA,IAAA,aAAM,EAAC,uBAAgB,CAAC,cAAc,CAAC,CAAA;IACvC,WAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,CAAA;IACpB,WAAA,IAAA,aAAM,EAAC,oCAA0B,CAAC,CAAA;6CADC,mBAAY;QAC0B,oCAA0B;GAJ3F,0BAA0B,CAiBtC;AAED;;GAEG;AACH,MAAa,sBAAsB;IAC1B,QAAQ,CAAC,iBAAoC;QAClD,iBAAiB,CAAC,iBAAiB,CAAC,qCAA2B,EAAE,0BAA0B,CAAC,CAAA;IAC9F,CAAC;CACF;AAJD,wDAIC"}
|
|
@@ -3,7 +3,6 @@ import type { AgentContext } from '@credo-ts/core';
|
|
|
3
3
|
import { BasicTailsFileService } from '@credo-ts/anoncreds';
|
|
4
4
|
export declare function isValidTailsFileName(name: string): boolean;
|
|
5
5
|
export declare function getTailsDirectoryPath(agentContext: AgentContext): string;
|
|
6
|
-
export declare function migrateLegacyTailsFiles(agentContext: AgentContext): void;
|
|
7
6
|
export declare class FullTailsFileService extends BasicTailsFileService {
|
|
8
7
|
private tailsServerBaseUrl;
|
|
9
8
|
constructor(options: {
|
|
@@ -6,13 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.FullTailsFileService = void 0;
|
|
7
7
|
exports.isValidTailsFileName = isValidTailsFileName;
|
|
8
8
|
exports.getTailsDirectoryPath = getTailsDirectoryPath;
|
|
9
|
-
exports.migrateLegacyTailsFiles = migrateLegacyTailsFiles;
|
|
10
9
|
exports.deleteTailsFile = deleteTailsFile;
|
|
11
10
|
const anoncreds_1 = require("@credo-ts/anoncreds");
|
|
12
11
|
const core_1 = require("@credo-ts/core");
|
|
13
|
-
const crypto_1 = require("crypto");
|
|
14
12
|
const fs_1 = __importDefault(require("fs"));
|
|
15
|
-
const os_1 = __importDefault(require("os"));
|
|
16
13
|
const path_1 = __importDefault(require("path"));
|
|
17
14
|
const tailsFileNamePattern = /^[A-Za-z0-9-]+$/;
|
|
18
15
|
function isValidTailsFileName(name) {
|
|
@@ -24,52 +21,6 @@ function getTailsDirectoryPath(agentContext) {
|
|
|
24
21
|
const fileSystem = agentContext.dependencyManager.resolve(core_1.InjectionSymbols.FileSystem);
|
|
25
22
|
return path_1.default.join(fileSystem.dataPath, 'tails');
|
|
26
23
|
}
|
|
27
|
-
// Copy uuid tails files from earlier locations (TAILS_DIRECTORY_PATH, ~/.afj/tails, the old cwd ./tails) into the current dir so URLs published before the hash-based change still resolve.
|
|
28
|
-
// TODO (last legacy version: v1.12.0-dev.8): Remove this once the last release using the legacy configuration is no longer supported.
|
|
29
|
-
function migrateLegacyTailsFiles(agentContext) {
|
|
30
|
-
const directory = getTailsDirectoryPath(agentContext);
|
|
31
|
-
const legacyDirectories = [
|
|
32
|
-
process.env.TAILS_DIRECTORY_PATH,
|
|
33
|
-
path_1.default.join(os_1.default.homedir(), '.afj', 'tails'),
|
|
34
|
-
path_1.default.resolve('tails'),
|
|
35
|
-
];
|
|
36
|
-
for (const legacyDirectory of new Set(legacyDirectories.filter((d) => Boolean(d)))) {
|
|
37
|
-
try {
|
|
38
|
-
const legacyIndexPath = path_1.default.join(legacyDirectory, 'index.json');
|
|
39
|
-
if (!fs_1.default.existsSync(legacyIndexPath))
|
|
40
|
-
continue;
|
|
41
|
-
const legacyIndex = JSON.parse(fs_1.default.readFileSync(legacyIndexPath, 'utf-8'));
|
|
42
|
-
fs_1.default.mkdirSync(directory, { recursive: true });
|
|
43
|
-
let migrated = 0;
|
|
44
|
-
for (const [tailsFileId, hash] of Object.entries(legacyIndex)) {
|
|
45
|
-
if (!isValidTailsFileName(tailsFileId) || !isValidTailsFileName(hash))
|
|
46
|
-
continue;
|
|
47
|
-
const source = path_1.default.join(legacyDirectory, hash);
|
|
48
|
-
const destination = path_1.default.join(directory, tailsFileId);
|
|
49
|
-
if (!fs_1.default.existsSync(source) || fs_1.default.existsSync(destination))
|
|
50
|
-
continue;
|
|
51
|
-
const tempPath = path_1.default.join(directory, `.${tailsFileId}.${process.pid}.${(0, crypto_1.randomBytes)(8).toString('hex')}.tmp`);
|
|
52
|
-
try {
|
|
53
|
-
fs_1.default.copyFileSync(source, tempPath);
|
|
54
|
-
fs_1.default.renameSync(tempPath, destination);
|
|
55
|
-
migrated++;
|
|
56
|
-
}
|
|
57
|
-
catch (fileError) {
|
|
58
|
-
try {
|
|
59
|
-
fs_1.default.unlinkSync(tempPath);
|
|
60
|
-
}
|
|
61
|
-
catch (_a) { }
|
|
62
|
-
agentContext.config.logger.warn(`Legacy tails file ${tailsFileId} skipped: ${fileError.message}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (migrated > 0)
|
|
66
|
-
agentContext.config.logger.info(`Migrated ${migrated} legacy tails file(s) from ${legacyDirectory}`);
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
agentContext.config.logger.warn(`Legacy tails migration skipped for ${legacyDirectory}: ${error.message}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
24
|
class FullTailsFileService extends anoncreds_1.BasicTailsFileService {
|
|
74
25
|
constructor(options) {
|
|
75
26
|
super();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullTailsFileService.js","sourceRoot":"","sources":["../../src/credentials/FullTailsFileService.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"FullTailsFileService.js","sourceRoot":"","sources":["../../src/credentials/FullTailsFileService.ts"],"names":[],"mappings":";;;;;;AAUA,oDAEC;AAED,sDAIC;AA2BD,0CAMC;AAhDD,mDAA2D;AAC3D,yCAAiD;AACjD,4CAAmB;AACnB,gDAAuB;AAEvB,MAAM,oBAAoB,GAAG,iBAAiB,CAAA;AAE9C,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxC,CAAC;AAED,SAAgB,qBAAqB,CAAC,YAA0B;IAC9D,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAA;IAC7E,MAAM,UAAU,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;IACzE,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;QAAE,OAAM;IAE5C,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,CAAA;IAC1E,IAAI,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -7,6 +7,9 @@ export declare const ED25519_2018_V1: any;
|
|
|
7
7
|
export declare const ED25519_2020_V1: any;
|
|
8
8
|
export declare const SECP256K1_2019_V1: any;
|
|
9
9
|
export declare const CREDENTIALS_V1: any;
|
|
10
|
+
export declare const CREDENTIALS_V2: any;
|
|
11
|
+
export declare const CREDENTIALS_EXAMPLE_V2: any;
|
|
12
|
+
export declare const CREDENTIALS_UNDEFINED_TERMS_V2: any;
|
|
10
13
|
export declare const CREDENTIALS_EXAMPLE_V1: any;
|
|
11
14
|
export declare const DID_V1: any;
|
|
12
15
|
export declare const ODRL: any;
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.LINKED_VP_V1 = exports.DATA_INTEGRITY_V2 = exports.VC_REVOCATION_LIST_2020 = exports.PURL_OB_V3P0 = exports.PRESENTATION_SUBMISSION = exports.SCHEMA_ORG = exports.ODRL = exports.DID_V1 = exports.CREDENTIALS_EXAMPLE_V1 = exports.CREDENTIALS_V1 = exports.SECP256K1_2019_V1 = exports.ED25519_2020_V1 = exports.ED25519_2018_V1 = exports.MULTIKEY_V1 = exports.X25519_V1 = exports.SECURITY_V2 = exports.SECURITY_V1 = void 0;
|
|
39
|
+
exports.LINKED_VP_V1 = exports.DATA_INTEGRITY_V2 = exports.VC_REVOCATION_LIST_2020 = exports.PURL_OB_V3P0 = exports.PRESENTATION_SUBMISSION = exports.SCHEMA_ORG = exports.ODRL = exports.DID_V1 = exports.CREDENTIALS_EXAMPLE_V1 = exports.CREDENTIALS_UNDEFINED_TERMS_V2 = exports.CREDENTIALS_EXAMPLE_V2 = exports.CREDENTIALS_V2 = exports.CREDENTIALS_V1 = exports.SECP256K1_2019_V1 = exports.ED25519_2020_V1 = exports.ED25519_2018_V1 = exports.MULTIKEY_V1 = exports.X25519_V1 = exports.SECURITY_V2 = exports.SECURITY_V1 = void 0;
|
|
40
40
|
exports.defaultDocumentLoader = defaultDocumentLoader;
|
|
41
41
|
/* eslint-disable import/order */
|
|
42
42
|
const core_1 = require("@credo-ts/core");
|
|
@@ -48,6 +48,9 @@ exports.ED25519_2018_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@p
|
|
|
48
48
|
exports.ED25519_2020_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@protected":true,"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"Ed25519VerificationKey2020":{"@id":"https://w3id.org/security#Ed25519VerificationKey2020","@context":{"@protected":true,"id":"@id","type":"@type","controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"revoked":{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"publicKeyMultibase":{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},"Ed25519Signature2020":{"@id":"https://w3id.org/security#Ed25519Signature2020","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"proofValue":{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}}');
|
|
49
49
|
exports.SECP256K1_2019_V1 = JSON.parse('{"@context":{"id":"@id","type":"@type","@protected":true,"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"EcdsaSecp256k1VerificationKey2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1VerificationKey2019","@context":{"@protected":true,"id":"@id","type":"@type","controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"revoked":{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"blockchainAccountId":{"@id":"https://w3id.org/security#blockchainAccountId"},"publicKeyJwk":{"@id":"https://w3id.org/security#publicKeyJwk","@type":"@json"},"publicKeyBase58":{"@id":"https://w3id.org/security#publicKeyBase58"},"publicKeyMultibase":{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},"EcdsaSecp256k1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"jws":{"@id":"https://w3id.org/security#jws"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}}');
|
|
50
50
|
exports.CREDENTIALS_V1 = JSON.parse('{"@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","VerifiableCredential":{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","credentialSchema":{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","JsonSchemaValidator2018":"cred:JsonSchemaValidator2018"}},"credentialStatus":{"@id":"cred:credentialStatus","@type":"@id"},"credentialSubject":{"@id":"cred:credentialSubject","@type":"@id"},"evidence":{"@id":"cred:evidence","@type":"@id"},"expirationDate":{"@id":"cred:expirationDate","@type":"xsd:dateTime"},"holder":{"@id":"cred:holder","@type":"@id"},"issued":{"@id":"cred:issued","@type":"xsd:dateTime"},"issuer":{"@id":"cred:issuer","@type":"@id"},"issuanceDate":{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},"proof":{"@id":"sec:proof","@type":"@id","@container":"@graph"},"refreshService":{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","ManualRefreshService2018":"cred:ManualRefreshService2018"}},"termsOfUse":{"@id":"cred:termsOfUse","@type":"@id"},"validFrom":{"@id":"cred:validFrom","@type":"xsd:dateTime"},"validUntil":{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},"VerifiablePresentation":{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","cred":"https://www.w3.org/2018/credentials#","sec":"https://w3id.org/security#","holder":{"@id":"cred:holder","@type":"@id"},"proof":{"@id":"sec:proof","@type":"@id","@container":"@graph"},"verifiableCredential":{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},"EcdsaSecp256k1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"EcdsaSecp256r1Signature2019":{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"Ed25519Signature2018":{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","xsd":"http://www.w3.org/2001/XMLSchema#","challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"RsaSignature2018":{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,"@protected":true,"challenge":"sec:challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},"domain":"sec:domain","expires":{"@id":"sec:expiration","@type":"xsd:dateTime"},"jws":"sec:jws","nonce":"sec:nonce","proofPurpose":{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,"@protected":true,"id":"@id","type":"@type","sec":"https://w3id.org/security#","assertionMethod":{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},"proofValue":"sec:proofValue","verificationMethod":{"@id":"sec:verificationMethod","@type":"@id"}}},"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}}');
|
|
51
|
+
exports.CREDENTIALS_V2 = JSON.parse('{"@context":{"@protected":true,"id":"@id","type":"@type","description":"https://schema.org/description","digestMultibase":{"@id":"https://w3id.org/security#digestMultibase","@type":"https://w3id.org/security#multibase"},"digestSRI":{"@id":"https://www.w3.org/2018/credentials#digestSRI","@type":"https://www.w3.org/2018/credentials#sriString"},"mediaType":{"@id":"https://schema.org/encodingFormat"},"name":"https://schema.org/name","VerifiableCredential":{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@protected":true,"id":"@id","type":"@type","confidenceMethod":{"@id":"https://www.w3.org/2018/credentials#confidenceMethod","@type":"@id"},"credentialSchema":{"@id":"https://www.w3.org/2018/credentials#credentialSchema","@type":"@id"},"credentialStatus":{"@id":"https://www.w3.org/2018/credentials#credentialStatus","@type":"@id"},"credentialSubject":{"@id":"https://www.w3.org/2018/credentials#credentialSubject","@type":"@id"},"description":"https://schema.org/description","evidence":{"@id":"https://www.w3.org/2018/credentials#evidence","@type":"@id"},"issuer":{"@id":"https://www.w3.org/2018/credentials#issuer","@type":"@id"},"name":"https://schema.org/name","proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"refreshService":{"@id":"https://www.w3.org/2018/credentials#refreshService","@type":"@id"},"relatedResource":{"@id":"https://www.w3.org/2018/credentials#relatedResource","@type":"@id"},"renderMethod":{"@id":"https://www.w3.org/2018/credentials#renderMethod","@type":"@id"},"termsOfUse":{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},"validFrom":{"@id":"https://www.w3.org/2018/credentials#validFrom","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"validUntil":{"@id":"https://www.w3.org/2018/credentials#validUntil","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}},"EnvelopedVerifiableCredential":"https://www.w3.org/2018/credentials#EnvelopedVerifiableCredential","VerifiablePresentation":{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@protected":true,"id":"@id","type":"@type","holder":{"@id":"https://www.w3.org/2018/credentials#holder","@type":"@id"},"proof":{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},"termsOfUse":{"@id":"https://www.w3.org/2018/credentials#termsOfUse","@type":"@id"},"verifiableCredential":{"@id":"https://www.w3.org/2018/credentials#verifiableCredential","@type":"@id","@container":"@graph","@context":null}}},"EnvelopedVerifiablePresentation":"https://www.w3.org/2018/credentials#EnvelopedVerifiablePresentation","JsonSchemaCredential":"https://www.w3.org/2018/credentials#JsonSchemaCredential","JsonSchema":{"@id":"https://www.w3.org/2018/credentials#JsonSchema","@context":{"@protected":true,"id":"@id","type":"@type","jsonSchema":{"@id":"https://www.w3.org/2018/credentials#jsonSchema","@type":"@json"}}},"BitstringStatusListCredential":"https://www.w3.org/ns/credentials/status#BitstringStatusListCredential","BitstringStatusList":{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusList","@context":{"@protected":true,"id":"@id","type":"@type","encodedList":{"@id":"https://www.w3.org/ns/credentials/status#encodedList","@type":"https://w3id.org/security#multibase"},"statusPurpose":"https://www.w3.org/ns/credentials/status#statusPurpose","ttl":"https://www.w3.org/ns/credentials/status#ttl"}},"BitstringStatusListEntry":{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusListEntry","@context":{"@protected":true,"id":"@id","type":"@type","statusListCredential":{"@id":"https://www.w3.org/ns/credentials/status#statusListCredential","@type":"@id"},"statusListIndex":"https://www.w3.org/ns/credentials/status#statusListIndex","statusPurpose":"https://www.w3.org/ns/credentials/status#statusPurpose","statusMessage":{"@id":"https://www.w3.org/ns/credentials/status#statusMessage","@context":{"@protected":true,"id":"@id","type":"@type","message":"https://www.w3.org/ns/credentials/status#message","status":"https://www.w3.org/ns/credentials/status#status"}},"statusReference":{"@id":"https://www.w3.org/ns/credentials/status#statusReference","@type":"@id"},"statusSize":{"@id":"https://www.w3.org/ns/credentials/status#statusSize","@type":"https://www.w3.org/2001/XMLSchema#integer"}}},"DataIntegrityProof":{"@id":"https://w3id.org/security#DataIntegrityProof","@context":{"@protected":true,"id":"@id","type":"@type","challenge":"https://w3id.org/security#challenge","created":{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"cryptosuite":{"@id":"https://w3id.org/security#cryptosuite","@type":"https://w3id.org/security#cryptosuiteString"},"domain":"https://w3id.org/security#domain","expires":{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"nonce":"https://w3id.org/security#nonce","previousProof":{"@id":"https://w3id.org/security#previousProof","@type":"@id"},"proofPurpose":{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":true,"id":"@id","type":"@type","assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},"proofValue":{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}},"...":{"@id":"https://www.iana.org/assignments/jwt#..."},"_sd":{"@id":"https://www.iana.org/assignments/jwt#_sd","@type":"@json"},"_sd_alg":{"@id":"https://www.iana.org/assignments/jwt#_sd_alg"},"aud":{"@id":"https://www.iana.org/assignments/jwt#aud","@type":"@id"},"cnf":{"@id":"https://www.iana.org/assignments/jwt#cnf","@context":{"@protected":true,"kid":{"@id":"https://www.iana.org/assignments/jwt#kid","@type":"@id"},"jwk":{"@id":"https://www.iana.org/assignments/jwt#jwk","@type":"@json"}}},"exp":{"@id":"https://www.iana.org/assignments/jwt#exp","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"iat":{"@id":"https://www.iana.org/assignments/jwt#iat","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"iss":{"@id":"https://www.iana.org/assignments/jose#iss","@type":"@id"},"jku":{"@id":"https://www.iana.org/assignments/jose#jku","@type":"@id"},"kid":{"@id":"https://www.iana.org/assignments/jose#kid","@type":"@id"},"nbf":{"@id":"https://www.iana.org/assignments/jwt#nbf","@type":"https://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"sub":{"@id":"https://www.iana.org/assignments/jose#sub","@type":"@id"},"x5u":{"@id":"https://www.iana.org/assignments/jose#x5u","@type":"@id"}}}');
|
|
52
|
+
exports.CREDENTIALS_EXAMPLE_V2 = JSON.parse('{"@context":{"@vocab":"https://www.w3.org/ns/credentials/examples#"}}');
|
|
53
|
+
exports.CREDENTIALS_UNDEFINED_TERMS_V2 = JSON.parse('{"@context":{"@vocab":"https://www.w3.org/ns/credentials/undefined-term#"}}');
|
|
51
54
|
exports.CREDENTIALS_EXAMPLE_V1 = JSON.parse('{"@context":[{"@version":1.1},"https://www.w3.org/ns/odrl.jsonld",{"ex":"https://example.org/examples#","schema":"http://schema.org/","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","3rdPartyCorrelation":"ex:3rdPartyCorrelation","AllVerifiers":"ex:AllVerifiers","Archival":"ex:Archival","BachelorDegree":"ex:BachelorDegree","Child":"ex:Child","CLCredentialDefinition2019":"ex:CLCredentialDefinition2019","CLSignature2019":"ex:CLSignature2019","IssuerPolicy":"ex:IssuerPolicy","HolderPolicy":"ex:HolderPolicy","Mother":"ex:Mother","RelationshipCredential":"ex:RelationshipCredential","UniversityDegreeCredential":"ex:UniversityDegreeCredential","AlumniCredential":"ex:AlumniCredential","DisputeCredential":"ex:DisputeCredential","PrescriptionCredential":"ex:PrescriptionCredential","ZkpExampleSchema2018":"ex:ZkpExampleSchema2018","issuerData":"ex:issuerData","attributes":"ex:attributes","signature":"ex:signature","signatureCorrectnessProof":"ex:signatureCorrectnessProof","primaryProof":"ex:primaryProof","nonRevocationProof":"ex:nonRevocationProof","alumniOf":{"@id":"schema:alumniOf","@type":"rdf:HTML"},"child":{"@id":"ex:child","@type":"@id"},"degree":"ex:degree","degreeType":"ex:degreeType","degreeSchool":"ex:degreeSchool","college":"ex:college","name":{"@id":"schema:name","@type":"rdf:HTML"},"givenName":"schema:givenName","familyName":"schema:familyName","parent":{"@id":"ex:parent","@type":"@id"},"referenceId":"ex:referenceId","documentPresence":"ex:documentPresence","evidenceDocument":"ex:evidenceDocument","spouse":"schema:spouse","subjectPresence":"ex:subjectPresence","verifier":{"@id":"ex:verifier","@type":"@id"},"currentStatus":"ex:currentStatus","statusReason":"ex:statusReason","prescription":"ex:prescription"}]}');
|
|
52
55
|
exports.DID_V1 = JSON.parse('{"@context":{"@protected":true,"id":"@id","type":"@type","alsoKnownAs":{"@id":"https://www.w3.org/ns/activitystreams#alsoKnownAs","@type":"@id"},"assertionMethod":{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},"authentication":{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},"capabilityDelegation":{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},"capabilityInvocation":{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},"controller":{"@id":"https://w3id.org/security#controller","@type":"@id"},"keyAgreement":{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"},"service":{"@id":"https://www.w3.org/ns/did#service","@type":"@id","@context":{"@protected":true,"id":"@id","type":"@type","serviceEndpoint":{"@id":"https://www.w3.org/ns/did#serviceEndpoint","@type":"@id"}}},"verificationMethod":{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}');
|
|
53
56
|
exports.ODRL = JSON.parse('{"@context":{"odrl":"http://www.w3.org/ns/odrl/2/","rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdfs":"http://www.w3.org/2000/01/rdf-schema#","owl":"http://www.w3.org/2002/07/owl#","skos":"http://www.w3.org/2004/02/skos/core#","dct":"http://purl.org/dc/terms/","xsd":"http://www.w3.org/2001/XMLSchema#","vcard":"http://www.w3.org/2006/vcard/ns#","foaf":"http://xmlns.com/foaf/0.1/","schema":"http://schema.org/","cc":"http://creativecommons.org/ns#","uid":"@id","type":"@type","Policy":"odrl:Policy","Rule":"odrl:Rule","profile":{"@type":"@id","@id":"odrl:profile"},"inheritFrom":{"@type":"@id","@id":"odrl:inheritFrom"},"ConflictTerm":"odrl:ConflictTerm","conflict":{"@type":"@vocab","@id":"odrl:conflict"},"perm":"odrl:perm","prohibit":"odrl:prohibit","invalid":"odrl:invalid","Agreement":"odrl:Agreement","Assertion":"odrl:Assertion","Offer":"odrl:Offer","Privacy":"odrl:Privacy","Request":"odrl:Request","Set":"odrl:Set","Ticket":"odrl:Ticket","Asset":"odrl:Asset","AssetCollection":"odrl:AssetCollection","relation":{"@type":"@id","@id":"odrl:relation"},"hasPolicy":{"@type":"@id","@id":"odrl:hasPolicy"},"target":{"@type":"@id","@id":"odrl:target"},"output":{"@type":"@id","@id":"odrl:output"},"partOf":{"@type":"@id","@id":"odrl:partOf"},"source":{"@type":"@id","@id":"odrl:source"},"Party":"odrl:Party","PartyCollection":"odrl:PartyCollection","function":{"@type":"@vocab","@id":"odrl:function"},"PartyScope":"odrl:PartyScope","assignee":{"@type":"@id","@id":"odrl:assignee"},"assigner":{"@type":"@id","@id":"odrl:assigner"},"assigneeOf":{"@type":"@id","@id":"odrl:assigneeOf"},"assignerOf":{"@type":"@id","@id":"odrl:assignerOf"},"attributedParty":{"@type":"@id","@id":"odrl:attributedParty"},"attributingParty":{"@type":"@id","@id":"odrl:attributingParty"},"compensatedParty":{"@type":"@id","@id":"odrl:compensatedParty"},"compensatingParty":{"@type":"@id","@id":"odrl:compensatingParty"},"consentingParty":{"@type":"@id","@id":"odrl:consentingParty"},"consentedParty":{"@type":"@id","@id":"odrl:consentedParty"},"informedParty":{"@type":"@id","@id":"odrl:informedParty"},"informingParty":{"@type":"@id","@id":"odrl:informingParty"},"trackingParty":{"@type":"@id","@id":"odrl:trackingParty"},"trackedParty":{"@type":"@id","@id":"odrl:trackedParty"},"contractingParty":{"@type":"@id","@id":"odrl:contractingParty"},"contractedParty":{"@type":"@id","@id":"odrl:contractedParty"},"Action":"odrl:Action","action":{"@type":"@vocab","@id":"odrl:action"},"includedIn":{"@type":"@id","@id":"odrl:includedIn"},"implies":{"@type":"@id","@id":"odrl:implies"},"Permission":"odrl:Permission","permission":{"@type":"@id","@id":"odrl:permission"},"Prohibition":"odrl:Prohibition","prohibition":{"@type":"@id","@id":"odrl:prohibition"},"obligation":{"@type":"@id","@id":"odrl:obligation"},"use":"odrl:use","grantUse":"odrl:grantUse","aggregate":"odrl:aggregate","annotate":"odrl:annotate","anonymize":"odrl:anonymize","archive":"odrl:archive","concurrentUse":"odrl:concurrentUse","derive":"odrl:derive","digitize":"odrl:digitize","display":"odrl:display","distribute":"odrl:distribute","execute":"odrl:execute","extract":"odrl:extract","give":"odrl:give","index":"odrl:index","install":"odrl:install","modify":"odrl:modify","move":"odrl:move","play":"odrl:play","present":"odrl:present","print":"odrl:print","read":"odrl:read","reproduce":"odrl:reproduce","sell":"odrl:sell","stream":"odrl:stream","textToSpeech":"odrl:textToSpeech","transfer":"odrl:transfer","transform":"odrl:transform","translate":"odrl:translate","Duty":"odrl:Duty","duty":{"@type":"@id","@id":"odrl:duty"},"consequence":{"@type":"@id","@id":"odrl:consequence"},"remedy":{"@type":"@id","@id":"odrl:remedy"},"acceptTracking":"odrl:acceptTracking","attribute":"odrl:attribute","compensate":"odrl:compensate","delete":"odrl:delete","ensureExclusivity":"odrl:ensureExclusivity","include":"odrl:include","inform":"odrl:inform","nextPolicy":"odrl:nextPolicy","obtainConsent":"odrl:obtainConsent","reviewPolicy":"odrl:reviewPolicy","uninstall":"odrl:uninstall","watermark":"odrl:watermark","Constraint":"odrl:Constraint","LogicalConstraint":"odrl:LogicalConstraint","constraint":{"@type":"@id","@id":"odrl:constraint"},"refinement":{"@type":"@id","@id":"odrl:refinement"},"Operator":"odrl:Operator","operator":{"@type":"@vocab","@id":"odrl:operator"},"RightOperand":"odrl:RightOperand","rightOperand":"odrl:rightOperand","rightOperandReference":{"@type":"xsd:anyURI","@id":"odrl:rightOperandReference"},"LeftOperand":"odrl:LeftOperand","leftOperand":{"@type":"@vocab","@id":"odrl:leftOperand"},"unit":"odrl:unit","dataType":{"@type":"xsd:anyType","@id":"odrl:datatype"},"status":"odrl:status","absolutePosition":"odrl:absolutePosition","absoluteSpatialPosition":"odrl:absoluteSpatialPosition","absoluteTemporalPosition":"odrl:absoluteTemporalPosition","absoluteSize":"odrl:absoluteSize","count":"odrl:count","dateTime":"odrl:dateTime","delayPeriod":"odrl:delayPeriod","deliveryChannel":"odrl:deliveryChannel","elapsedTime":"odrl:elapsedTime","event":"odrl:event","fileFormat":"odrl:fileFormat","industry":"odrl:industry:","language":"odrl:language","media":"odrl:media","meteredTime":"odrl:meteredTime","payAmount":"odrl:payAmount","percentage":"odrl:percentage","product":"odrl:product","purpose":"odrl:purpose","recipient":"odrl:recipient","relativePosition":"odrl:relativePosition","relativeSpatialPosition":"odrl:relativeSpatialPosition","relativeTemporalPosition":"odrl:relativeTemporalPosition","relativeSize":"odrl:relativeSize","resolution":"odrl:resolution","spatial":"odrl:spatial","spatialCoordinates":"odrl:spatialCoordinates","systemDevice":"odrl:systemDevice","timeInterval":"odrl:timeInterval","unitOfCount":"odrl:unitOfCount","version":"odrl:version","virtualLocation":"odrl:virtualLocation","eq":"odrl:eq","gt":"odrl:gt","gteq":"odrl:gteq","lt":"odrl:lt","lteq":"odrl:lteq","neq":"odrl:neq","isA":"odrl:isA","hasPart":"odrl:hasPart","isPartOf":"odrl:isPartOf","isAllOf":"odrl:isAllOf","isAnyOf":"odrl:isAnyOf","isNoneOf":"odrl:isNoneOf","or":"odrl:or","xone":"odrl:xone","and":"odrl:and","andSequence":"odrl:andSequence","policyUsage":"odrl:policyUsage"}}');
|
|
@@ -66,7 +69,10 @@ const DEFAULT_CONTEXTS = {
|
|
|
66
69
|
'https://w3id.org/security/suites/ed25519-2020/v1': exports.ED25519_2020_V1,
|
|
67
70
|
'https://w3id.org/security/suites/secp256k1-2019/v1': exports.SECP256K1_2019_V1,
|
|
68
71
|
'https://www.w3.org/2018/credentials/v1': exports.CREDENTIALS_V1,
|
|
72
|
+
'https://www.w3.org/ns/credentials/v2': exports.CREDENTIALS_V2,
|
|
69
73
|
'https://www.w3.org/2018/credentials/examples/v1': exports.CREDENTIALS_EXAMPLE_V1,
|
|
74
|
+
'https://www.w3.org/ns/credentials/examples/v2': exports.CREDENTIALS_EXAMPLE_V2,
|
|
75
|
+
'https://www.w3.org/ns/credentials/undefined-terms/v2': exports.CREDENTIALS_UNDEFINED_TERMS_V2,
|
|
70
76
|
'https://w3id.org/did/v1': exports.DID_V1,
|
|
71
77
|
'https://www.w3.org/ns/did/v1': exports.DID_V1,
|
|
72
78
|
'https://w3.org/ns/did/v1': exports.DID_V1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CachedDocumentLoader.js","sourceRoot":"","sources":["../../src/did/CachedDocumentLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CachedDocumentLoader.js","sourceRoot":"","sources":["../../src/did/CachedDocumentLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,sDAuDC;AAjJD,iCAAiC;AACjC,yCAAoG;AAEvF,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,ouDAAouD,CACruD,CAAA;AACY,QAAA,WAAW,GAAG,IAAI,CAAC,KAAK,CACnC,4wFAA4wF,CAC7wF,CAAA;AACY,QAAA,SAAS,GAAG,IAAI,CAAC,KAAK,CACjC,ycAAyc,CAC1c,CAAA;AACY,QAAA,WAAW,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OAAO,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC,OAAO,CAAA;IAE7F,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;AACnG,CAAC;AAED,iEAAiE;AACjE,wEAA+C;AAyB/C,kBAAe,gBAA2B,CAAA"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { AgentContext, DidResolutionOptions, DidResolutionResult, WebDidResolver } from '@credo-ts/core';
|
|
2
2
|
import { ParsedDID } from 'did-resolver';
|
|
3
3
|
export declare class CachedWebDidResolver extends WebDidResolver {
|
|
4
|
-
private publicApiBaseUrl;
|
|
5
|
-
constructor(options: {
|
|
6
|
-
publicApiBaseUrl: string;
|
|
7
|
-
});
|
|
8
4
|
resolve(agentContext: AgentContext, did: string, parsed: ParsedDID, didResolutionOptions: DidResolutionOptions): Promise<DidResolutionResult>;
|
|
9
5
|
}
|
|
@@ -4,10 +4,6 @@ exports.CachedWebDidResolver = void 0;
|
|
|
4
4
|
const core_1 = require("@credo-ts/core");
|
|
5
5
|
const legacyDidWeb_1 = require("./legacyDidWeb");
|
|
6
6
|
class CachedWebDidResolver extends core_1.WebDidResolver {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
super();
|
|
9
|
-
this.publicApiBaseUrl = options.publicApiBaseUrl;
|
|
10
|
-
}
|
|
11
7
|
async resolve(agentContext, did, parsed, didResolutionOptions) {
|
|
12
8
|
// First check within our own public dids, as there is no need to resolve it through HTTPS
|
|
13
9
|
const didRepository = agentContext.dependencyManager.resolve(core_1.DidRepository);
|
|
@@ -28,7 +24,7 @@ class CachedWebDidResolver extends core_1.WebDidResolver {
|
|
|
28
24
|
method: 'webvh',
|
|
29
25
|
});
|
|
30
26
|
if (webVhdDidRecord === null || webVhdDidRecord === void 0 ? void 0 : webVhdDidRecord.didDocument) {
|
|
31
|
-
const legacyDidDocument = (0, legacyDidWeb_1.getLegacyDidDocument)(webVhdDidRecord.didDocument
|
|
27
|
+
const legacyDidDocument = (0, legacyDidWeb_1.getLegacyDidDocument)(webVhdDidRecord.didDocument);
|
|
32
28
|
if (legacyDidDocument) {
|
|
33
29
|
return {
|
|
34
30
|
didDocument: legacyDidDocument,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CachedWebDidResolver.js","sourceRoot":"","sources":["../../src/did/CachedWebDidResolver.ts"],"names":[],"mappings":";;;AAAA,yCAMuB;AAGvB,iDAAqD;AAErD,MAAa,oBAAqB,SAAQ,qBAAc;
|
|
1
|
+
{"version":3,"file":"CachedWebDidResolver.js","sourceRoot":"","sources":["../../src/did/CachedWebDidResolver.ts"],"names":[],"mappings":";;;AAAA,yCAMuB;AAGvB,iDAAqD;AAErD,MAAa,oBAAqB,SAAQ,qBAAc;IAC/C,KAAK,CAAC,OAAO,CAClB,YAA0B,EAC1B,GAAW,EACX,MAAiB,EACjB,oBAA0C;QAE1C,0FAA0F;QAC1F,MAAM,aAAa,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,oBAAa,CAAC,CAAA;QAC3E,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,YAAY,EAAE;YACpE,GAAG;YACH,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,EAAE,CAAC;YAC3B,OAAO;gBACL,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,mBAAmB,EAAE,EAAE;gBACvB,qBAAqB,EAAE,EAAE;aAC1B,CAAA;QACH,CAAC;QAED,gEAAgE;QAChE,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,YAAY,EAAE;YAC1E,MAAM,EAAE,MAAM,CAAC,EAAE;YACjB,MAAM,EAAE,OAAO;SAChB,CAAC,CAAA;QAEF,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,EAAE,CAAC;YACjC,MAAM,iBAAiB,GAAG,IAAA,mCAAoB,EAAC,eAAe,CAAC,WAAW,CAAC,CAAA;YAC3E,IAAI,iBAAiB,EAAE,CAAC;gBACtB,OAAO;oBACL,WAAW,EAAE,iBAAiB;oBAC9B,mBAAmB,EAAE,EAAE;oBACvB,qBAAqB,EAAE,EAAE;iBAC1B,CAAA;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACvE,CAAC;CACF;AAzCD,oDAyCC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DidDocument } from '@credo-ts/core';
|
|
2
|
+
import type { SupportedPublicDidMethod } from './publicDid';
|
|
3
|
+
export type ArtifactServiceMethod = SupportedPublicDidMethod;
|
|
4
|
+
export interface ArtifactServiceOptions {
|
|
5
|
+
method: ArtifactServiceMethod;
|
|
6
|
+
publicApiBaseUrl: string;
|
|
7
|
+
}
|
|
8
|
+
/** Declares the artifact service of the given method, and only that one. */
|
|
9
|
+
export declare function applyArtifactServices(didDocument: DidDocument, options: ArtifactServiceOptions): void;
|
|
10
|
+
/** Strips every artifact service: the parallel did:web document advertises none. */
|
|
11
|
+
export declare function removeArtifactServices(didDocument: DidDocument): void;
|
|
12
|
+
export declare function artifactServicesMatch(didDocument: DidDocument, options: ArtifactServiceOptions): boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyArtifactServices = applyArtifactServices;
|
|
4
|
+
exports.removeArtifactServices = removeArtifactServices;
|
|
5
|
+
exports.artifactServicesMatch = artifactServicesMatch;
|
|
6
|
+
const core_1 = require("@credo-ts/core");
|
|
7
|
+
const ANONCREDS_REGISTRY_SERVICE_TYPE = 'AnonCredsRegistry';
|
|
8
|
+
const RELATIVE_REF_SERVICE_TYPE = 'relativeRef';
|
|
9
|
+
const ARTIFACT_SERVICE_TYPES = [ANONCREDS_REGISTRY_SERVICE_TYPE, RELATIVE_REF_SERVICE_TYPE];
|
|
10
|
+
/** Declares the artifact service of the given method, and only that one. */
|
|
11
|
+
function applyArtifactServices(didDocument, options) {
|
|
12
|
+
var _a;
|
|
13
|
+
removeArtifactServices(didDocument);
|
|
14
|
+
didDocument.service = [...((_a = didDocument.service) !== null && _a !== void 0 ? _a : []), ...expectedArtifactServices(didDocument.id, options)];
|
|
15
|
+
}
|
|
16
|
+
/** Strips every artifact service: the parallel did:web document advertises none. */
|
|
17
|
+
function removeArtifactServices(didDocument) {
|
|
18
|
+
var _a;
|
|
19
|
+
didDocument.service = ((_a = didDocument.service) !== null && _a !== void 0 ? _a : []).filter(service => !ARTIFACT_SERVICE_TYPES.includes(service.type));
|
|
20
|
+
}
|
|
21
|
+
function artifactServicesMatch(didDocument, options) {
|
|
22
|
+
var _a;
|
|
23
|
+
const current = ((_a = didDocument.service) !== null && _a !== void 0 ? _a : []).filter(service => ARTIFACT_SERVICE_TYPES.includes(service.type));
|
|
24
|
+
const expected = expectedArtifactServices(didDocument.id, options);
|
|
25
|
+
return (current.length === expected.length &&
|
|
26
|
+
expected.every(service => current.some(entry => entry.id === service.id &&
|
|
27
|
+
entry.type === service.type &&
|
|
28
|
+
entry.serviceEndpoint === service.serviceEndpoint)));
|
|
29
|
+
}
|
|
30
|
+
function expectedArtifactServices(did, options) {
|
|
31
|
+
const { method, publicApiBaseUrl } = options;
|
|
32
|
+
return method === 'web'
|
|
33
|
+
? [
|
|
34
|
+
new core_1.DidDocumentService({
|
|
35
|
+
id: `${did}#anoncreds`,
|
|
36
|
+
serviceEndpoint: `${publicApiBaseUrl}/anoncreds/v1`,
|
|
37
|
+
type: ANONCREDS_REGISTRY_SERVICE_TYPE,
|
|
38
|
+
}),
|
|
39
|
+
]
|
|
40
|
+
: [
|
|
41
|
+
new core_1.DidDocumentService({
|
|
42
|
+
id: `${did}#files`,
|
|
43
|
+
serviceEndpoint: publicApiBaseUrl,
|
|
44
|
+
type: RELATIVE_REF_SERVICE_TYPE,
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=artifactServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifactServices.js","sourceRoot":"","sources":["../../src/did/artifactServices.ts"],"names":[],"mappings":";;AAiBA,sDAGC;AAGD,wDAIC;AAED,sDAeC;AA5CD,yCAAgE;AAIhE,MAAM,+BAA+B,GAAG,mBAAmB,CAAA;AAC3D,MAAM,yBAAyB,GAAG,aAAa,CAAA;AAE/C,MAAM,sBAAsB,GAAsB,CAAC,+BAA+B,EAAE,yBAAyB,CAAC,CAAA;AAS9G,4EAA4E;AAC5E,SAAgB,qBAAqB,CAAC,WAAwB,EAAE,OAA+B;;IAC7F,sBAAsB,CAAC,WAAW,CAAC,CAAA;IACnC,WAAW,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,EAAE,GAAG,wBAAwB,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;AAC9G,CAAC;AAED,oFAAoF;AACpF,SAAgB,sBAAsB,CAAC,WAAwB;;IAC7D,WAAW,CAAC,OAAO,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,MAAM,CACtD,OAAO,CAAC,EAAE,CAAC,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAC1D,CAAA;AACH,CAAC;AAED,SAAgB,qBAAqB,CAAC,WAAwB,EAAE,OAA+B;;IAC7F,MAAM,OAAO,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5G,MAAM,QAAQ,GAAG,wBAAwB,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAElE,OAAO,CACL,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QAClC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CACvB,OAAO,CAAC,IAAI,CACV,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE;YACvB,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI;YAC3B,KAAK,CAAC,eAAe,KAAK,OAAO,CAAC,eAAe,CACpD,CACF,CACF,CAAA;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,GAAW,EAAE,OAA+B;IAC5E,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAA;IAE5C,OAAO,MAAM,KAAK,KAAK;QACrB,CAAC,CAAC;YACE,IAAI,yBAAkB,CAAC;gBACrB,EAAE,EAAE,GAAG,GAAG,YAAY;gBACtB,eAAe,EAAE,GAAG,gBAAgB,eAAe;gBACnD,IAAI,EAAE,+BAA+B;aACtC,CAAC;SACH;QACH,CAAC,CAAC;YACE,IAAI,yBAAkB,CAAC;gBACrB,EAAE,EAAE,GAAG,GAAG,QAAQ;gBAClB,eAAe,EAAE,gBAAgB;gBACjC,IAAI,EAAE,yBAAyB;aAChC,CAAC;SACH,CAAA;AACP,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { DidDocument } from '@credo-ts/core';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the legacy did:web form of a DID: the DID itself when it is already a did:web, and the
|
|
4
|
+
* SCID-less did:web of a did:webvh. Returns undefined for any other method.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getLegacyDidWeb(did: string): string | undefined;
|
|
2
7
|
/**
|
|
3
8
|
* Returns a Legacy did:web document, based on an input document. If it is already a did:web,
|
|
4
9
|
* it returns the same document.
|
|
5
10
|
* If it isn't supported (i.e. it is not a did:webvh DID Document), it returns undefined
|
|
6
|
-
* @param didDocument
|
|
7
|
-
* @param publicApiBaseUrl
|
|
8
|
-
* @returns
|
|
9
11
|
*/
|
|
10
|
-
export declare function getLegacyDidDocument(didDocument: DidDocument
|
|
12
|
+
export declare function getLegacyDidDocument(didDocument: DidDocument): DidDocument | undefined;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLegacyDidWeb = getLegacyDidWeb;
|
|
3
4
|
exports.getLegacyDidDocument = getLegacyDidDocument;
|
|
4
5
|
const core_1 = require("@credo-ts/core");
|
|
6
|
+
const artifactServices_1 = require("./artifactServices");
|
|
7
|
+
/**
|
|
8
|
+
* Returns the legacy did:web form of a DID: the DID itself when it is already a did:web, and the
|
|
9
|
+
* SCID-less did:web of a did:webvh. Returns undefined for any other method.
|
|
10
|
+
*/
|
|
11
|
+
function getLegacyDidWeb(did) {
|
|
12
|
+
const parsedDid = (0, core_1.parseDid)(did);
|
|
13
|
+
if (parsedDid.method === 'web')
|
|
14
|
+
return did;
|
|
15
|
+
if (parsedDid.method === 'webvh' && parsedDid.id.includes(':')) {
|
|
16
|
+
return `did:web:${parsedDid.id.split(':').slice(1).join(':')}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
5
19
|
/**
|
|
6
20
|
* Returns a Legacy did:web document, based on an input document. If it is already a did:web,
|
|
7
21
|
* it returns the same document.
|
|
8
22
|
* If it isn't supported (i.e. it is not a did:webvh DID Document), it returns undefined
|
|
9
|
-
* @param didDocument
|
|
10
|
-
* @param publicApiBaseUrl
|
|
11
|
-
* @returns
|
|
12
23
|
*/
|
|
13
|
-
function getLegacyDidDocument(didDocument
|
|
14
|
-
var _a;
|
|
24
|
+
function getLegacyDidDocument(didDocument) {
|
|
15
25
|
const parsedDid = (0, core_1.parseDid)(didDocument.id);
|
|
16
26
|
if (parsedDid.method === 'web')
|
|
17
27
|
return didDocument;
|
|
@@ -21,15 +31,8 @@ function getLegacyDidDocument(didDocument, publicApiBaseUrl) {
|
|
|
21
31
|
const scid = parsedDid.id.split(':')[0];
|
|
22
32
|
// Start with resolved version of the DIDDoc from did:webvh
|
|
23
33
|
const legacyDidDocument = new core_1.DidDocument(didDocument);
|
|
24
|
-
//
|
|
25
|
-
legacyDidDocument
|
|
26
|
-
...((_a = legacyDidDocument.service) !== null && _a !== void 0 ? _a : []),
|
|
27
|
-
new core_1.DidDocumentService({
|
|
28
|
-
id: `${didDocument.id}#anoncreds`,
|
|
29
|
-
serviceEndpoint: `${publicApiBaseUrl}/anoncreds/v1`,
|
|
30
|
-
type: 'AnonCredsRegistry',
|
|
31
|
-
}),
|
|
32
|
-
];
|
|
34
|
+
// The parallel document is for DIDComm only: it advertises no artifact service
|
|
35
|
+
(0, artifactServices_1.removeArtifactServices)(legacyDidDocument);
|
|
33
36
|
// Execute text replacement: did:webvh:<scid> by did:web
|
|
34
37
|
const stringified = JSON.stringify(legacyDidDocument.toJSON());
|
|
35
38
|
const replaced = stringified.replace(new RegExp(`did:webvh:${scid}`, 'g'), 'did:web');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacyDidWeb.js","sourceRoot":"","sources":["../../src/did/legacyDidWeb.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"legacyDidWeb.js","sourceRoot":"","sources":["../../src/did/legacyDidWeb.ts"],"names":[],"mappings":";;AAQA,0CAOC;AAOD,oDA0BC;AAhDD,yCAAuE;AAEvE,yDAA2D;AAE3D;;;GAGG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAA;IAE/B,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,GAAG,CAAA;IAC1C,IAAI,SAAS,CAAC,MAAM,KAAK,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/D,OAAO,WAAW,SAAS,C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["web", "webvh"];
|
|
2
|
+
export type SupportedPublicDidMethod = (typeof SUPPORTED_PUBLIC_DID_METHODS)[number];
|
|
3
|
+
export declare function isSupportedPublicDidMethod(method: string): method is SupportedPublicDidMethod;
|
|
4
|
+
export declare function isSupportedPublicDid(did: string): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUPPORTED_PUBLIC_DID_METHODS = void 0;
|
|
4
|
+
exports.isSupportedPublicDidMethod = isSupportedPublicDidMethod;
|
|
5
|
+
exports.isSupportedPublicDid = isSupportedPublicDid;
|
|
6
|
+
const core_1 = require("@credo-ts/core");
|
|
7
|
+
exports.SUPPORTED_PUBLIC_DID_METHODS = ['web', 'webvh'];
|
|
8
|
+
function isSupportedPublicDidMethod(method) {
|
|
9
|
+
return exports.SUPPORTED_PUBLIC_DID_METHODS.includes(method);
|
|
10
|
+
}
|
|
11
|
+
function isSupportedPublicDid(did) {
|
|
12
|
+
try {
|
|
13
|
+
return isSupportedPublicDidMethod((0, core_1.parseDid)(did).method);
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=publicDid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicDid.js","sourceRoot":"","sources":["../../src/did/publicDid.ts"],"names":[],"mappings":";;;AAKA,gEAEC;AAED,oDAMC;AAfD,yCAAyC;AAE5B,QAAA,4BAA4B,GAAG,CAAC,KAAK,EAAE,OAAO,CAAU,CAAA;AAGrE,SAAgB,0BAA0B,CAAC,MAAc;IACvD,OAAQ,oCAAkD,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAC7E,CAAC;AAED,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,IAAI,CAAC;QACH,OAAO,0BAA0B,CAAC,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;IACzD,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|