@credo-ts/didcomm 0.6.0-pr-2195-20250322195244 → 0.6.0-pr-2324-20250625125237
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/DidCommModule.js +0 -1
- package/build/DidCommModule.js.map +1 -1
- package/build/DidCommModuleConfig.d.ts +8 -0
- package/build/DidCommModuleConfig.js +9 -0
- package/build/DidCommModuleConfig.js.map +1 -1
- package/build/EnvelopeService.d.ts +13 -8
- package/build/EnvelopeService.js +281 -21
- package/build/EnvelopeService.js.map +1 -1
- package/build/MessageSender.d.ts +4 -6
- package/build/MessageSender.js +60 -70
- package/build/MessageSender.js.map +1 -1
- package/build/decorators/service/ServiceDecorator.js +4 -4
- package/build/decorators/service/ServiceDecorator.js.map +1 -1
- package/build/decorators/signature/SignatureDecoratorUtils.d.ts +5 -4
- package/build/decorators/signature/SignatureDecoratorUtils.js +22 -12
- package/build/decorators/signature/SignatureDecoratorUtils.js.map +1 -1
- package/build/getOutboundMessageContext.js +30 -5
- package/build/getOutboundMessageContext.js.map +1 -1
- package/build/models/InboundMessageContext.d.ts +5 -5
- package/build/models/OutboundMessageContext.d.ts +2 -2
- package/build/models/Routing.d.ts +3 -3
- package/build/modules/connections/ConnectionsApi.js +6 -5
- package/build/modules/connections/ConnectionsApi.js.map +1 -1
- package/build/modules/connections/DidExchangeProtocol.d.ts +3 -1
- package/build/modules/connections/DidExchangeProtocol.js +95 -57
- package/build/modules/connections/DidExchangeProtocol.js.map +1 -1
- package/build/modules/connections/handlers/ConnectionRequestHandler.js +7 -0
- package/build/modules/connections/handlers/ConnectionRequestHandler.js.map +1 -1
- package/build/modules/connections/handlers/ConnectionResponseHandler.js +4 -0
- package/build/modules/connections/handlers/ConnectionResponseHandler.js.map +1 -1
- package/build/modules/connections/handlers/DidExchangeCompleteHandler.js +0 -4
- package/build/modules/connections/handlers/DidExchangeCompleteHandler.js.map +1 -1
- package/build/modules/connections/handlers/DidExchangeRequestHandler.js +3 -0
- package/build/modules/connections/handlers/DidExchangeRequestHandler.js.map +1 -1
- package/build/modules/connections/handlers/DidExchangeResponseHandler.js +3 -3
- package/build/modules/connections/handlers/DidExchangeResponseHandler.js.map +1 -1
- package/build/modules/connections/messages/ConnectionInvitationMessage.d.ts +2 -1
- package/build/modules/connections/messages/ConnectionInvitationMessage.js.map +1 -1
- package/build/modules/connections/models/did/DidDoc.js +2 -2
- package/build/modules/connections/models/did/DidDoc.js.map +1 -1
- package/build/modules/connections/repository/ConnectionRecord.d.ts +2 -0
- package/build/modules/connections/repository/ConnectionRecord.js +2 -0
- package/build/modules/connections/repository/ConnectionRecord.js.map +1 -1
- package/build/modules/connections/repository/ConnectionRepository.d.ts +1 -1
- package/build/modules/connections/repository/ConnectionRepository.js +2 -0
- package/build/modules/connections/repository/ConnectionRepository.js.map +1 -1
- package/build/modules/connections/services/ConnectionService.d.ts +4 -4
- package/build/modules/connections/services/ConnectionService.js +92 -41
- package/build/modules/connections/services/ConnectionService.js.map +1 -1
- package/build/modules/connections/services/DidRotateService.js +9 -10
- package/build/modules/connections/services/DidRotateService.js.map +1 -1
- package/build/modules/connections/services/helpers.d.ts +20 -6
- package/build/modules/connections/services/helpers.js +46 -29
- package/build/modules/connections/services/helpers.js.map +1 -1
- package/build/modules/credentials/models/RevocationNotification.js +14 -0
- package/build/modules/credentials/models/RevocationNotification.js.map +1 -1
- package/build/modules/credentials/protocol/index.js +17 -7
- package/build/modules/credentials/protocol/index.js.map +1 -1
- package/build/modules/credentials/repository/CredentialExchangeRecord.d.ts +1 -1
- package/build/modules/credentials/repository/CredentialExchangeRecord.js +5 -0
- package/build/modules/credentials/repository/CredentialExchangeRecord.js.map +1 -1
- package/build/modules/message-pickup/MessagePickupApi.js +7 -2
- package/build/modules/message-pickup/MessagePickupApi.js.map +1 -1
- package/build/modules/message-pickup/MessagePickupApiOptions.d.ts +1 -1
- package/build/modules/message-pickup/MessagePickupModule.d.ts +1 -0
- package/build/modules/message-pickup/MessagePickupModule.js +6 -11
- package/build/modules/message-pickup/MessagePickupModule.js.map +1 -1
- package/build/modules/message-pickup/MessagePickupModuleConfig.d.ts +0 -8
- package/build/modules/message-pickup/MessagePickupModuleConfig.js +0 -4
- package/build/modules/message-pickup/MessagePickupModuleConfig.js.map +1 -1
- package/build/modules/message-pickup/index.d.ts +0 -1
- package/build/modules/message-pickup/index.js +0 -1
- package/build/modules/message-pickup/index.js.map +1 -1
- package/build/modules/message-pickup/protocol/MessagePickupProtocolOptions.d.ts +1 -1
- package/build/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.js +6 -5
- package/build/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.js.map +1 -1
- package/build/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.js +22 -13
- package/build/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.js.map +1 -1
- package/build/modules/oob/OutOfBandApi.js +21 -8
- package/build/modules/oob/OutOfBandApi.js.map +1 -1
- package/build/modules/oob/OutOfBandService.d.ts +9 -5
- package/build/modules/oob/OutOfBandService.js +7 -2
- package/build/modules/oob/OutOfBandService.js.map +1 -1
- package/build/modules/oob/converters.js +2 -4
- package/build/modules/oob/converters.js.map +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.js +14 -2
- package/build/modules/oob/domain/OutOfBandDidCommService.js.map +1 -1
- package/build/modules/oob/helpers.js +6 -6
- package/build/modules/oob/helpers.js.map +1 -1
- package/build/modules/oob/messages/OutOfBandInvitation.js.map +1 -1
- package/build/modules/oob/repository/OutOfBandRecord.d.ts +34 -0
- package/build/modules/oob/repository/OutOfBandRecord.js +1 -0
- package/build/modules/oob/repository/OutOfBandRecord.js.map +1 -1
- package/build/modules/oob/repository/outOfBandRecordMetadataTypes.d.ts +4 -0
- package/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js +7 -4
- package/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js.map +1 -1
- package/build/modules/proofs/formats/index.js +17 -7
- package/build/modules/proofs/formats/index.js.map +1 -1
- package/build/modules/proofs/protocol/index.js +17 -7
- package/build/modules/proofs/protocol/index.js.map +1 -1
- package/build/modules/routing/MediationRecipientApi.d.ts +0 -2
- package/build/modules/routing/MediationRecipientApi.js +1 -46
- package/build/modules/routing/MediationRecipientApi.js.map +1 -1
- package/build/modules/routing/MediationRecipientModule.d.ts +3 -0
- package/build/modules/routing/MediationRecipientModule.js +60 -0
- package/build/modules/routing/MediationRecipientModule.js.map +1 -1
- package/build/modules/routing/MediatorModule.d.ts +1 -0
- package/build/modules/routing/MediatorModule.js +5 -0
- package/build/modules/routing/MediatorModule.js.map +1 -1
- package/build/modules/routing/MediatorModuleConfig.d.ts +2 -2
- package/build/modules/routing/MessageForwardingStrategy.js +2 -2
- package/build/modules/routing/MessageForwardingStrategy.js.map +1 -1
- package/build/modules/routing/repository/MediationRecord.d.ts +8 -0
- package/build/modules/routing/repository/MediationRecord.js +2 -0
- package/build/modules/routing/repository/MediationRecord.js.map +1 -1
- package/build/modules/routing/repository/MediatorRoutingRecord.d.ts +23 -5
- package/build/modules/routing/repository/MediatorRoutingRecord.js +33 -1
- package/build/modules/routing/repository/MediatorRoutingRecord.js.map +1 -1
- package/build/modules/routing/services/MediationRecipientService.d.ts +3 -3
- package/build/modules/routing/services/MediationRecipientService.js +15 -12
- package/build/modules/routing/services/MediationRecipientService.js.map +1 -1
- package/build/modules/routing/services/MediatorService.js +17 -9
- package/build/modules/routing/services/MediatorService.js.map +1 -1
- package/build/modules/routing/services/RoutingService.d.ts +3 -3
- package/build/modules/routing/services/RoutingService.js +4 -3
- package/build/modules/routing/services/RoutingService.js.map +1 -1
- package/build/modules/routing/services/helpers.d.ts +1 -1
- package/build/modules/routing/services/helpers.js +3 -4
- package/build/modules/routing/services/helpers.js.map +1 -1
- package/build/services/DidCommDocumentService.d.ts +8 -3
- package/build/services/DidCommDocumentService.js +46 -15
- package/build/services/DidCommDocumentService.js.map +1 -1
- package/build/transport/HttpOutboundTransport.js +2 -4
- package/build/transport/HttpOutboundTransport.js.map +1 -1
- package/build/transport/index.d.ts +1 -0
- package/build/transport/index.js +1 -0
- package/build/transport/index.js.map +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.d.ts +12 -0
- package/build/{modules/message-pickup/storage/InMemoryMessagePickupRepository.js → transport/queue/InMemoryQueueTransportRepository.js} +15 -19
- package/build/transport/queue/InMemoryQueueTransportRepository.js.map +1 -0
- package/build/transport/queue/QueueTransportRepository.d.ts +9 -0
- package/build/{modules/message-pickup/storage/MessagePickupRepository.js → transport/queue/QueueTransportRepository.js} +1 -1
- package/build/transport/queue/QueueTransportRepository.js.map +1 -0
- package/build/{modules/message-pickup/storage/MessagePickupRepositoryOptions.d.ts → transport/queue/QueueTransportRepositoryOptions.d.ts} +2 -1
- package/build/{modules/message-pickup/storage/MessagePickupRepositoryOptions.js → transport/queue/QueueTransportRepositoryOptions.js} +1 -1
- package/build/transport/queue/QueueTransportRepositoryOptions.js.map +1 -0
- package/build/{modules/message-pickup/storage → transport/queue}/QueuedMessage.d.ts +2 -2
- package/build/transport/queue/QueuedMessage.js.map +1 -0
- package/build/transport/queue/index.d.ts +4 -0
- package/build/{modules/message-pickup/storage → transport/queue}/index.js +3 -3
- package/build/transport/queue/index.js.map +1 -0
- package/build/updates/0.1-0.2/connection.js +3 -3
- package/build/updates/0.1-0.2/connection.js.map +1 -1
- package/build/util/modules.d.ts +1 -1
- package/build/util/modules.js +3 -1
- package/build/util/modules.js.map +1 -1
- package/build/util/parseInvitation.js +0 -2
- package/build/util/parseInvitation.js.map +1 -1
- package/package.json +7 -7
- package/build/modules/message-pickup/storage/InMemoryMessagePickupRepository.d.ts +0 -13
- package/build/modules/message-pickup/storage/InMemoryMessagePickupRepository.js.map +0 -1
- package/build/modules/message-pickup/storage/MessagePickupRepository.d.ts +0 -8
- package/build/modules/message-pickup/storage/MessagePickupRepository.js.map +0 -1
- package/build/modules/message-pickup/storage/MessagePickupRepositoryOptions.js.map +0 -1
- package/build/modules/message-pickup/storage/QueuedMessage.js.map +0 -1
- package/build/modules/message-pickup/storage/index.d.ts +0 -4
- package/build/modules/message-pickup/storage/index.js.map +0 -1
- package/build/util/matchingEd25519Key.d.ts +0 -9
- package/build/util/matchingEd25519Key.js +0 -30
- package/build/util/matchingEd25519Key.js.map +0 -1
- /package/build/{modules/message-pickup/storage → transport/queue}/QueuedMessage.js +0 -0
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToNewDidDocument = convertToNewDidDocument;
|
|
4
4
|
exports.routingToServices = routingToServices;
|
|
5
|
-
exports.getDidDocumentForCreatedDid = getDidDocumentForCreatedDid;
|
|
6
5
|
exports.assertNoCreatedDidExistsForKeys = assertNoCreatedDidExistsForKeys;
|
|
7
6
|
exports.createPeerDidFromServices = createPeerDidFromServices;
|
|
7
|
+
exports.getResolvedDidcommServiceWithSigningKeyId = getResolvedDidcommServiceWithSigningKeyId;
|
|
8
8
|
const core_1 = require("@credo-ts/core");
|
|
9
|
+
const core_2 = require("@credo-ts/core");
|
|
9
10
|
const models_1 = require("../models");
|
|
10
|
-
function convertToNewDidDocument(didDoc) {
|
|
11
|
-
const didDocumentBuilder = new
|
|
11
|
+
function convertToNewDidDocument(didDoc, keys) {
|
|
12
|
+
const didDocumentBuilder = new core_2.DidDocumentBuilder('');
|
|
12
13
|
const oldIdNewIdMapping = {};
|
|
13
14
|
for (const auth of didDoc.authentication) {
|
|
14
15
|
const { publicKey: pk } = auth;
|
|
@@ -40,12 +41,12 @@ function convertToNewDidDocument(didDoc) {
|
|
|
40
41
|
for (let service of didDoc.didCommServices.reverse()) {
|
|
41
42
|
const serviceId = normalizeId(service.id);
|
|
42
43
|
// For didcommv1, we need to replace the old id with the new ones
|
|
43
|
-
if (service instanceof
|
|
44
|
+
if (service instanceof core_2.DidCommV1Service) {
|
|
44
45
|
const recipientKeys = service.recipientKeys.map((keyId) => {
|
|
45
46
|
const oldKeyId = normalizeId(keyId);
|
|
46
47
|
return oldIdNewIdMapping[oldKeyId];
|
|
47
48
|
});
|
|
48
|
-
service = new
|
|
49
|
+
service = new core_2.DidCommV1Service({
|
|
49
50
|
id: serviceId,
|
|
50
51
|
recipientKeys,
|
|
51
52
|
serviceEndpoint: service.serviceEndpoint,
|
|
@@ -54,8 +55,8 @@ function convertToNewDidDocument(didDoc) {
|
|
|
54
55
|
priority: service.priority,
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
else if (service instanceof
|
|
58
|
-
service = new
|
|
58
|
+
else if (service instanceof core_2.IndyAgentService) {
|
|
59
|
+
service = new core_2.IndyAgentService({
|
|
59
60
|
id: serviceId,
|
|
60
61
|
recipientKeys: service.recipientKeys,
|
|
61
62
|
serviceEndpoint: service.serviceEndpoint,
|
|
@@ -66,9 +67,15 @@ function convertToNewDidDocument(didDoc) {
|
|
|
66
67
|
didDocumentBuilder.addService(service);
|
|
67
68
|
}
|
|
68
69
|
const didDocument = didDocumentBuilder.build();
|
|
69
|
-
const peerDid = (0,
|
|
70
|
+
const peerDid = (0, core_2.didDocumentJsonToNumAlgo1Did)(didDocument.toJSON());
|
|
70
71
|
didDocument.id = peerDid;
|
|
71
|
-
return
|
|
72
|
+
return {
|
|
73
|
+
didDocument,
|
|
74
|
+
keys: keys?.map((key) => ({
|
|
75
|
+
...key,
|
|
76
|
+
didDocumentRelativeKeyId: oldIdNewIdMapping[key.didDocumentRelativeKeyId],
|
|
77
|
+
})),
|
|
78
|
+
};
|
|
72
79
|
}
|
|
73
80
|
function normalizeId(fullId) {
|
|
74
81
|
// Some old dids use `;` as the delimiter for the id. If we can't find a `#`
|
|
@@ -82,13 +89,17 @@ function normalizeId(fullId) {
|
|
|
82
89
|
}
|
|
83
90
|
function convertPublicKeyToVerificationMethod(publicKey) {
|
|
84
91
|
if (!publicKey.value) {
|
|
85
|
-
throw new
|
|
92
|
+
throw new core_2.CredoError(`Public key ${publicKey.id} does not have value property`);
|
|
86
93
|
}
|
|
87
94
|
const publicKeyBase58 = publicKey.value;
|
|
88
|
-
const ed25519Key = core_1.
|
|
89
|
-
|
|
95
|
+
const ed25519Key = core_1.Kms.PublicJwk.fromPublicKey({
|
|
96
|
+
kty: 'OKP',
|
|
97
|
+
crv: 'Ed25519',
|
|
98
|
+
publicKey: core_2.TypedArrayEncoder.fromBase58(publicKeyBase58),
|
|
99
|
+
});
|
|
100
|
+
return (0, core_2.getEd25519VerificationKey2018)({
|
|
90
101
|
id: `#${publicKeyBase58.slice(0, 8)}`,
|
|
91
|
-
|
|
102
|
+
publicJwk: ed25519Key,
|
|
92
103
|
controller: '#id',
|
|
93
104
|
});
|
|
94
105
|
}
|
|
@@ -100,25 +111,16 @@ function routingToServices(routing) {
|
|
|
100
111
|
routingKeys: routing.routingKeys,
|
|
101
112
|
}));
|
|
102
113
|
}
|
|
103
|
-
async function getDidDocumentForCreatedDid(agentContext, did) {
|
|
104
|
-
// Ensure that the DID has been created by us
|
|
105
|
-
const didRecord = await agentContext.dependencyManager.resolve(core_1.DidRepository).findCreatedDid(agentContext, did);
|
|
106
|
-
if (!didRecord) {
|
|
107
|
-
throw new core_1.CredoError(`Could not find created did ${did}`);
|
|
108
|
-
}
|
|
109
|
-
const didsApi = agentContext.dependencyManager.resolve(core_1.DidsApi);
|
|
110
|
-
return await didsApi.resolveDidDocument(did);
|
|
111
|
-
}
|
|
112
114
|
/**
|
|
113
115
|
* Asserts that the keys we are going to use for creating a did document haven't already been used in another did document
|
|
114
116
|
* Due to how DIDComm v1 works (only reference the key not the did in encrypted message) we can't have multiple dids containing
|
|
115
117
|
* the same key as we won't know which did (and thus which connection) a message is intended for.
|
|
116
118
|
*/
|
|
117
119
|
async function assertNoCreatedDidExistsForKeys(agentContext, recipientKeys) {
|
|
118
|
-
const didRepository = agentContext.dependencyManager.resolve(
|
|
120
|
+
const didRepository = agentContext.dependencyManager.resolve(core_2.DidRepository);
|
|
119
121
|
const recipientKeyFingerprints = recipientKeys.map((key) => key.fingerprint);
|
|
120
122
|
const didsForServices = await didRepository.findByQuery(agentContext, {
|
|
121
|
-
role:
|
|
123
|
+
role: core_2.DidDocumentRole.Created,
|
|
122
124
|
// We want an $or query so we query for each key individually, not one did document
|
|
123
125
|
// containing exactly the same keys as the did document we are trying to create
|
|
124
126
|
$or: recipientKeyFingerprints.map((fingerprint) => ({
|
|
@@ -128,13 +130,13 @@ async function assertNoCreatedDidExistsForKeys(agentContext, recipientKeys) {
|
|
|
128
130
|
if (didsForServices.length > 0) {
|
|
129
131
|
const allDidRecipientKeys = didsForServices.flatMap((did) => did.getTags().recipientKeyFingerprints ?? []);
|
|
130
132
|
const matchingFingerprints = allDidRecipientKeys.filter((f) => recipientKeyFingerprints.includes(f));
|
|
131
|
-
throw new
|
|
133
|
+
throw new core_2.CredoError(`A did already exists for some of the keys in the provided services. DIDComm v1 uses key based routing, and therefore it is not allowed to re-use the same key in multiple did documents for DIDComm. If you use the same 'routing' object for multiple invitations, instead provide an 'invitationDid' to the create invitation method. The following fingerprints are already in use: ${matchingFingerprints.join(',')}`);
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
async function createPeerDidFromServices(agentContext, services, numAlgo) {
|
|
135
|
-
const didsApi = agentContext.dependencyManager.resolve(
|
|
137
|
+
const didsApi = agentContext.dependencyManager.resolve(core_2.DidsApi);
|
|
136
138
|
// Create did document without the id property
|
|
137
|
-
const didDocument = (0,
|
|
139
|
+
const { didDocument, keys } = (0, core_2.createPeerDidDocumentFromServices)(services, true);
|
|
138
140
|
// Assert that the keys we are going to use for creating a did document haven't already been used in another did document
|
|
139
141
|
await assertNoCreatedDidExistsForKeys(agentContext, didDocument.recipientKeys);
|
|
140
142
|
// Register did:peer document. This will generate the id property and save it to a did record
|
|
@@ -143,11 +145,26 @@ async function createPeerDidFromServices(agentContext, services, numAlgo) {
|
|
|
143
145
|
didDocument,
|
|
144
146
|
options: {
|
|
145
147
|
numAlgo,
|
|
148
|
+
keys,
|
|
146
149
|
},
|
|
147
150
|
});
|
|
148
151
|
if (result.didState?.state !== 'finished') {
|
|
149
|
-
throw new
|
|
152
|
+
throw new core_2.CredoError(`Did document creation failed: ${JSON.stringify(result.didState)}`);
|
|
153
|
+
}
|
|
154
|
+
// FIXME: didApi.create should return the did document
|
|
155
|
+
return didsApi.resolveCreatedDidDocumentWithKeys(result.didState.did);
|
|
156
|
+
}
|
|
157
|
+
function getResolvedDidcommServiceWithSigningKeyId(outOfBandDidcommService,
|
|
158
|
+
/**
|
|
159
|
+
* Optional keys for the inline services
|
|
160
|
+
*/
|
|
161
|
+
inlineServiceKeys) {
|
|
162
|
+
const resolvedService = outOfBandDidcommService.resolvedDidCommService;
|
|
163
|
+
// Make sure the key id is set for service keys
|
|
164
|
+
for (const recipientKey of resolvedService.recipientKeys) {
|
|
165
|
+
const kmsKeyId = inlineServiceKeys?.find(({ recipientKeyFingerprint }) => recipientKeyFingerprint === recipientKey.fingerprint)?.kmsKeyId;
|
|
166
|
+
recipientKey.keyId = kmsKeyId ?? recipientKey.legacyKeyId;
|
|
150
167
|
}
|
|
151
|
-
return
|
|
168
|
+
return resolvedService;
|
|
152
169
|
}
|
|
153
170
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/modules/connections/services/helpers.ts"],"names":[],"mappings":";;AAqBA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/modules/connections/services/helpers.ts"],"names":[],"mappings":";;AAqBA,0DAkFC;AAgCD,8CAOC;AAOD,0EAuBC;AAED,8DA6BC;AAED,8FAmBC;AAhOD,yCAA0G;AAI1G,yCAYuB;AAGvB,sCAAkD;AAElD,SAAgB,uBAAuB,CAAC,MAAc,EAAE,IAAuB;IAC7E,MAAM,kBAAkB,GAAG,IAAI,yBAAkB,CAAC,EAAE,CAAC,CAAA;IAErD,MAAM,iBAAiB,GAA8B,EAAE,CAAA;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,QAAQ,CAAA;QAEX,YAAY,CAAC,KAAK,GAAG,QAAQ,IAAI,YAAY,CAAC,WAAW,CAAA;IAC3D,CAAC;IAED,OAAO,eAAe,CAAA;AACxB,CAAC"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.RevocationNotification = void 0;
|
|
13
|
+
const core_1 = require("@credo-ts/core");
|
|
4
14
|
class RevocationNotification {
|
|
5
15
|
constructor(comment, revocationDate = new Date()) {
|
|
6
16
|
this.revocationDate = revocationDate;
|
|
@@ -8,4 +18,8 @@ class RevocationNotification {
|
|
|
8
18
|
}
|
|
9
19
|
}
|
|
10
20
|
exports.RevocationNotification = RevocationNotification;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, core_1.DateTransformer)(),
|
|
23
|
+
__metadata("design:type", Date)
|
|
24
|
+
], RevocationNotification.prototype, "revocationDate", void 0);
|
|
11
25
|
//# sourceMappingURL=RevocationNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevocationNotification.js","sourceRoot":"","sources":["../../../../src/modules/credentials/models/RevocationNotification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RevocationNotification.js","sourceRoot":"","sources":["../../../../src/modules/credentials/models/RevocationNotification.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAgD;AAEhD,MAAa,sBAAsB;IAMjC,YAAmB,OAAgB,EAAE,iBAAuB,IAAI,IAAI,EAAE;QACpE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF;AAVD,wDAUC;AARQ;IADN,IAAA,sBAAe,GAAE;8BACK,IAAI;8DAAA"}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
20
|
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.CredentialProtocolOptions = exports.BaseCredentialProtocol = void 0;
|
|
30
40
|
__exportStar(require("./v2"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/credentials/protocol/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/credentials/protocol/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAoB;AACpB,4DAAyC;AACzC,uFAAwE;AAQ/D,8DAAyB;AALlC,8GAA8G;AAC9G,yHAAyH;AACzH,0HAA0H;AAC1H,0BAA0B;AAC1B,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA"}
|
|
@@ -2,7 +2,7 @@ import type { TagsBase } from '@credo-ts/core';
|
|
|
2
2
|
import type { CredentialRole } from '../models';
|
|
3
3
|
import type { AutoAcceptCredential } from '../models/CredentialAutoAcceptType';
|
|
4
4
|
import type { CredentialState } from '../models/CredentialState';
|
|
5
|
-
import
|
|
5
|
+
import { RevocationNotification } from '../models/RevocationNotification';
|
|
6
6
|
import { BaseRecord } from '@credo-ts/core';
|
|
7
7
|
import { Attachment } from '../../../decorators/attachment/Attachment';
|
|
8
8
|
import { CredentialPreviewAttribute } from '../models/CredentialPreviewAttribute';
|
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CredentialExchangeRecord = void 0;
|
|
13
|
+
const RevocationNotification_1 = require("../models/RevocationNotification");
|
|
13
14
|
const core_1 = require("@credo-ts/core");
|
|
14
15
|
const class_transformer_1 = require("class-transformer");
|
|
15
16
|
const Attachment_1 = require("../../../decorators/attachment/Attachment");
|
|
@@ -75,6 +76,10 @@ class CredentialExchangeRecord extends core_1.BaseRecord {
|
|
|
75
76
|
exports.CredentialExchangeRecord = CredentialExchangeRecord;
|
|
76
77
|
// Type is CredentialRecord on purpose (without Exchange) as this is how the record was initially called.
|
|
77
78
|
CredentialExchangeRecord.type = 'CredentialRecord';
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_transformer_1.Type)(() => RevocationNotification_1.RevocationNotification),
|
|
81
|
+
__metadata("design:type", RevocationNotification_1.RevocationNotification)
|
|
82
|
+
], CredentialExchangeRecord.prototype, "revocationNotification", void 0);
|
|
78
83
|
__decorate([
|
|
79
84
|
(0, class_transformer_1.Type)(() => CredentialPreviewAttribute_1.CredentialPreviewAttribute),
|
|
80
85
|
__metadata("design:type", Array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialExchangeRecord.js","sourceRoot":"","sources":["../../../../src/modules/credentials/repository/CredentialExchangeRecord.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CredentialExchangeRecord.js","sourceRoot":"","sources":["../../../../src/modules/credentials/repository/CredentialExchangeRecord.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,6EAAyE;AAEzE,yCAA8D;AAC9D,yDAAwC;AAExC,0EAAsE;AACtE,qFAAiF;AAoCjF,MAAa,wBAAyB,SAAQ,iBAAuD;IAwBnG,YAAmB,KAAoC;QACrD,KAAK,EAAE,CAAA;QAbF,gBAAW,GAA8B,EAAE,CAAA;QAUlC,SAAI,GAAG,wBAAwB,CAAC,IAAI,CAAA;QAIlD,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,YAAK,CAAC,IAAI,EAAE,CAAA;YAClC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;YAC9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;YACxB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;Y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AE,CACtG,CAAA;QACH,CAAC;IACH,CAAC;IAEM,WAAW,CAAC,cAAmD;QACpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YACnC,2DAA2D;YAC3D,cAAc,GAAG,CAAC,cAAc,CAAC,CAAA;QACnC,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,iBAAU,CAClB,yCAAyC,IAAI,CAAC,KAAK,uBAAuB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvG,CAAA;QACH,CAAC;IACH,CAAC;IAEM,gBAAgB,CAAC,mBAA2B;QACjD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,iBAAU,CAClB,0HAA0H,CAC3H,CAAA;QACH,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,KAAK,mBAAmB,EAAE,CAAC;YAC9C,MAAM,IAAI,iBAAU,CAClB,oDAAoD,IAAI,CAAC,YAAY,6BAA6B,mBAAmB,GAAG,CACzH,CAAA;QACH,CAAC;IACH,CAAC;;AA5FH,4DA6FC;AAzEC,yGAAyG;AAClF,6BAAI,GAAG,kBAAkB,AAArB,CAAqB;AAZzC;IADN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,+CAAsB,CAAC;8BACH,+CAAsB;wEAAA;AAM/C;IADN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uDAA0B,CAAC;;sEACmB;AAGnD;IADN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uBAAU,CAAC;;mEACgB"}
|
|
@@ -18,6 +18,7 @@ const rxjs_1 = require("rxjs");
|
|
|
18
18
|
const MessageSender_1 = require("../../MessageSender");
|
|
19
19
|
const models_1 = require("../../models");
|
|
20
20
|
const services_1 = require("../connections/services");
|
|
21
|
+
const DidCommModuleConfig_1 = require("../../DidCommModuleConfig");
|
|
21
22
|
const MessagePickupEvents_1 = require("./MessagePickupEvents");
|
|
22
23
|
const MessagePickupModuleConfig_1 = require("./MessagePickupModuleConfig");
|
|
23
24
|
const MessagePickupSessionService_1 = require("./services/MessagePickupSessionService");
|
|
@@ -48,8 +49,12 @@ let MessagePickupApi = class MessagePickupApi {
|
|
|
48
49
|
this.logger.debug('Queuing message...');
|
|
49
50
|
const { connectionId, message, recipientDids } = options;
|
|
50
51
|
const connectionRecord = await this.connectionService.getById(this.agentContext, connectionId);
|
|
51
|
-
const
|
|
52
|
-
await
|
|
52
|
+
const queueTransportRepository = this.agentContext.dependencyManager.resolve(DidCommModuleConfig_1.DidCommModuleConfig).queueTransportRepository;
|
|
53
|
+
await queueTransportRepository.addMessage(this.agentContext, {
|
|
54
|
+
connectionId: connectionRecord.id,
|
|
55
|
+
recipientDids,
|
|
56
|
+
payload: message,
|
|
57
|
+
});
|
|
53
58
|
}
|
|
54
59
|
/**
|
|
55
60
|
* Get current active live mode message pickup session for a given connection. Undefined if no active session found
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagePickupApi.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/MessagePickupApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MessagePickupApi.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/MessagePickupApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBA,yCAAqH;AACrH,+BAAgG;AAEhG,uDAAmD;AACnD,yCAAqD;AACrD,sDAA2D;AAE3D,mEAA+D;AAC/D,+DAA+D;AAC/D,2EAAuE;AACvE,wFAAoF;AAgB7E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAa3B,YACE,aAA4B,EAC5B,YAA0B,EAC1B,iBAAoC,EACpC,YAA0B,EAC1B,2BAAwD,EACxD,MAAuC,EACP,KAAuB,EACtB,MAAc;QAE/C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAA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AK,CAAC,mBAAmB,CAAC,OAAmC;QAClE,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;QACtG,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAC1D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,YAAY,EAAE;YACxE,gBAAgB;YAChB,YAAY,EAAE,OAAO,CAAC,YAAY;SACnC,CAAC,CAAA;QAEF,sGAAsG;QACtG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAClC,IAAI,+BAAsB,CAAC,OAAO,EAAE;YAClC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,UAAU,EAAE,gBAAgB;SAC7B,CAAC,EACF,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,YAAY,EAAE,EAAE,CACrF,CAAA;IACH,CAAC;CACF,CAAA;AAlOY,4CAAgB;2BAAhB,gBAAgB;IAF5B,IAAA,iBAAU,GAAE;IACb,yEAAyE;;IAqBpE,WAAA,IAAA,aAAM,EAAC,uBAAgB,CAAC,KAAK,CAAC,CAAA;IAC9B,WAAA,IAAA,aAAM,EAAC,uBAAgB,CAAC,MAAM,CAAC,CAAA;qCAPjB,6BAAa;QACd,mBAAY;QACP,4BAAiB;QACtB,mBAAY;QACG,yDAA2B;QAChD,qDAAyB;QACM,cAAO;GApBrC,gBAAgB,CAkO5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EncryptedMessage } from '../../types';
|
|
2
|
+
import type { QueuedMessage } from './../../transport/queue';
|
|
2
3
|
import type { MessagePickupProtocol } from './protocol/MessagePickupProtocol';
|
|
3
|
-
import type { QueuedMessage } from './storage';
|
|
4
4
|
/**
|
|
5
5
|
* Get the supported protocol versions based on the provided message pickup protocols
|
|
6
6
|
*/
|
|
@@ -18,4 +18,5 @@ export declare class MessagePickupModule<MessagePickupProtocols extends MessageP
|
|
|
18
18
|
*/
|
|
19
19
|
register(dependencyManager: DependencyManager): void;
|
|
20
20
|
initialize(agentContext: AgentContext): Promise<void>;
|
|
21
|
+
onInitializeContext(agentContext: AgentContext): Promise<void>;
|
|
21
22
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MessagePickupModule = void 0;
|
|
4
|
-
const core_1 = require("@credo-ts/core");
|
|
5
4
|
const FeatureRegistry_1 = require("../../FeatureRegistry");
|
|
6
5
|
const MessageHandlerRegistry_1 = require("../../MessageHandlerRegistry");
|
|
7
6
|
const MessagePickupApi_1 = require("./MessagePickupApi");
|
|
8
7
|
const MessagePickupModuleConfig_1 = require("./MessagePickupModuleConfig");
|
|
9
8
|
const protocol_1 = require("./protocol");
|
|
10
9
|
const services_1 = require("./services");
|
|
11
|
-
const storage_1 = require("./storage");
|
|
12
10
|
class MessagePickupModule {
|
|
13
11
|
constructor(config) {
|
|
14
12
|
// Infer Api type from the config
|
|
@@ -26,15 +24,6 @@ class MessagePickupModule {
|
|
|
26
24
|
dependencyManager.registerInstance(MessagePickupModuleConfig_1.MessagePickupModuleConfig, this.config);
|
|
27
25
|
// Services
|
|
28
26
|
dependencyManager.registerSingleton(services_1.MessagePickupSessionService);
|
|
29
|
-
// Message Pickup queue: use provided one or in-memory one if no injection symbol is yet defined
|
|
30
|
-
if (this.config.messagePickupRepository) {
|
|
31
|
-
dependencyManager.registerInstance(core_1.InjectionSymbols.MessagePickupRepository, this.config.messagePickupRepository);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
if (!dependencyManager.isRegistered(core_1.InjectionSymbols.MessagePickupRepository)) {
|
|
35
|
-
dependencyManager.registerSingleton(core_1.InjectionSymbols.MessagePickupRepository, storage_1.InMemoryMessagePickupRepository);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
27
|
}
|
|
39
28
|
async initialize(agentContext) {
|
|
40
29
|
// Protocol needs to register feature registry items and handlers
|
|
@@ -43,6 +32,12 @@ class MessagePickupModule {
|
|
|
43
32
|
for (const protocol of this.config.protocols) {
|
|
44
33
|
protocol.register(messageHandlerRegistry, featureRegistry);
|
|
45
34
|
}
|
|
35
|
+
}
|
|
36
|
+
async onInitializeContext(agentContext) {
|
|
37
|
+
// We only support initialization of message pickup for the root agent
|
|
38
|
+
if (!agentContext.isRootAgentContext)
|
|
39
|
+
return;
|
|
40
|
+
// FIXME: this does not take into account multi-tenant agents, need to think how to separate based on context
|
|
46
41
|
const messagePickupSessionService = agentContext.dependencyManager.resolve(services_1.MessagePickupSessionService);
|
|
47
42
|
messagePickupSessionService.start(agentContext);
|
|
48
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagePickupModule.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/MessagePickupModule.ts"],"names":[],"mappings":";;;AAIA,
|
|
1
|
+
{"version":3,"file":"MessagePickupModule.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/MessagePickupModule.ts"],"names":[],"mappings":";;;AAIA,2DAAuD;AACvD,yEAAqE;AAErE,yDAAqD;AACrD,2EAAuE;AACvE,yCAA6E;AAC7E,yCAAwD;AAaxD,MAAa,mBAAmB;IAQ9B,YAAmB,MAA2D;QAH9E,iCAAiC;QACjB,QAAG,GAA0D,mCAAgB,CAAA;QAG3F,IAAI,CAAC,MAAM,GAAG,IAAI,qDAAyB,CAAC;YAC1C,GAAG,MAAM;YACT,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,IAAI,kCAAuB,EAAE,EAAE,IAAI,kCAAuB,EAAE,CAAC;SAC/F,CAAsD,CAAA;IACzD,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,iBAAoC;QAClD,SAAS;QACT,iBAAiB,CAAC,gBAAgB,CAAC,qDAAyB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAE1E,WAAW;QACX,iBAAiB,CAAC,iBAAiB,CAAC,sCAA2B,CAAC,CAAA;IAClE,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,YAA0B;QAChD,iEAAiE;QACjE,MAAM,sBAAsB,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,+CAAsB,CAAC,CAAA;QAC7F,MAAM,eAAe,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,iCAAe,CAAC,CAAA;QAE/E,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAC7C,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,YAA0B;QACzD,sEAAsE;QACtE,IAAI,CAAC,YAAY,CAAC,kBAAkB;YAAE,OAAM;QAE5C,6GAA6G;QAC7G,MAAM,2BAA2B,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,sCAA2B,CAAC,CAAA;QACvG,2BAA2B,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACjD,CAAC;CACF;AA5CD,kDA4CC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MessagePickupProtocol } from './protocol/MessagePickupProtocol';
|
|
2
|
-
import type { MessagePickupRepository } from './storage/MessagePickupRepository';
|
|
3
2
|
/**
|
|
4
3
|
* MessagePickupModuleConfigOptions defines the interface for the options of the MessagePickupModuleConfig class.
|
|
5
4
|
* This can contain optional parameters that have default values in the config class itself.
|
|
@@ -23,11 +22,6 @@ export interface MessagePickupModuleConfigOptions<MessagePickupProtocols extends
|
|
|
23
22
|
* ```
|
|
24
23
|
*/
|
|
25
24
|
protocols: MessagePickupProtocols;
|
|
26
|
-
/**
|
|
27
|
-
* Allows to specify a custom pickup message queue. It defaults to an in-memory queue
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
messagePickupRepository?: MessagePickupRepository;
|
|
31
25
|
}
|
|
32
26
|
export declare class MessagePickupModuleConfig<MessagePickupProtocols extends MessagePickupProtocol[]> {
|
|
33
27
|
private options;
|
|
@@ -36,6 +30,4 @@ export declare class MessagePickupModuleConfig<MessagePickupProtocols extends Me
|
|
|
36
30
|
get maximumBatchSize(): number;
|
|
37
31
|
/** See {@link MessagePickupModuleConfig.protocols} */
|
|
38
32
|
get protocols(): MessagePickupProtocols;
|
|
39
|
-
/** See {@link MessagePickupModuleConfig.messagePickupRepository} */
|
|
40
|
-
get messagePickupRepository(): MessagePickupRepository | undefined;
|
|
41
33
|
}
|
|
@@ -13,10 +13,6 @@ class MessagePickupModuleConfig {
|
|
|
13
13
|
get protocols() {
|
|
14
14
|
return this.options.protocols;
|
|
15
15
|
}
|
|
16
|
-
/** See {@link MessagePickupModuleConfig.messagePickupRepository} */
|
|
17
|
-
get messagePickupRepository() {
|
|
18
|
-
return this.options.messagePickupRepository;
|
|
19
|
-
}
|
|
20
16
|
}
|
|
21
17
|
exports.MessagePickupModuleConfig = MessagePickupModuleConfig;
|
|
22
18
|
//# sourceMappingURL=MessagePickupModuleConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagePickupModuleConfig.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/MessagePickupModuleConfig.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MessagePickupModuleConfig.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/MessagePickupModuleConfig.ts"],"names":[],"mappings":";;;AA4BA,MAAa,yBAAyB;IAGpC,YAAmB,OAAiE;QAClF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,6DAA6D;IAC7D,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAA;IAC5C,CAAC;IAED,sDAAsD;IACtD,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAA;IAC/B,CAAC;CACF;AAhBD,8DAgBC"}
|
|
@@ -21,7 +21,6 @@ __exportStar(require("./MessagePickupEvents"), exports);
|
|
|
21
21
|
__exportStar(require("./MessagePickupModule"), exports);
|
|
22
22
|
__exportStar(require("./MessagePickupModuleConfig"), exports);
|
|
23
23
|
__exportStar(require("./protocol"), exports);
|
|
24
|
-
__exportStar(require("./storage"), exports);
|
|
25
24
|
var services_1 = require("./services");
|
|
26
25
|
Object.defineProperty(exports, "MessagePickupSessionService", { enumerable: true, get: function () { return services_1.MessagePickupSessionService; } });
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,4DAAyC;AACzC,wDAAqC;AACrC,wDAAqC;AACrC,8DAA2C;AAC3C,6CAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/message-pickup/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,4DAAyC;AACzC,wDAAqC;AACrC,wDAAqC;AACrC,8DAA2C;AAC3C,6CAA0B;AAC1B,uCAAwD;AAA/C,uHAAA,2BAA2B,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentMessage } from '../../../AgentMessage';
|
|
2
|
+
import type { QueuedMessage } from '../../../transport/queue';
|
|
2
3
|
import type { ConnectionRecord } from '../../connections/repository';
|
|
3
|
-
import type { QueuedMessage } from '../storage';
|
|
4
4
|
export interface PickupMessagesProtocolOptions {
|
|
5
5
|
connectionRecord: ConnectionRecord;
|
|
6
6
|
recipientDid?: string;
|
|
@@ -13,6 +13,7 @@ const models_1 = require("../../../../models");
|
|
|
13
13
|
const MessagePickupEvents_1 = require("../../MessagePickupEvents");
|
|
14
14
|
const MessagePickupModuleConfig_1 = require("../../MessagePickupModuleConfig");
|
|
15
15
|
const BaseMessagePickupProtocol_1 = require("../BaseMessagePickupProtocol");
|
|
16
|
+
const DidCommModuleConfig_1 = require("../../../../DidCommModuleConfig");
|
|
16
17
|
const handlers_1 = require("./handlers");
|
|
17
18
|
const messages_1 = require("./messages");
|
|
18
19
|
let V1MessagePickupProtocol = class V1MessagePickupProtocol extends BaseMessagePickupProtocol_1.BaseMessagePickupProtocol {
|
|
@@ -45,9 +46,9 @@ let V1MessagePickupProtocol = class V1MessagePickupProtocol extends BaseMessageP
|
|
|
45
46
|
async createDeliveryMessage(agentContext, options) {
|
|
46
47
|
const { connectionRecord, batchSize, messages } = options;
|
|
47
48
|
connectionRecord.assertReady();
|
|
48
|
-
const
|
|
49
|
+
const queueTransportRepository = agentContext.dependencyManager.resolve(DidCommModuleConfig_1.DidCommModuleConfig).queueTransportRepository;
|
|
49
50
|
const messagesToDeliver = messages ??
|
|
50
|
-
(await
|
|
51
|
+
(await queueTransportRepository.takeFromQueue(agentContext, {
|
|
51
52
|
connectionId: connectionRecord.id,
|
|
52
53
|
limit: batchSize, // TODO: Define as config parameter for message holder side
|
|
53
54
|
deleteMessages: true,
|
|
@@ -69,9 +70,9 @@ let V1MessagePickupProtocol = class V1MessagePickupProtocol extends BaseMessageP
|
|
|
69
70
|
async processBatchPickup(messageContext) {
|
|
70
71
|
// Assert ready connection
|
|
71
72
|
const connection = messageContext.assertReadyConnection();
|
|
72
|
-
const { message } = messageContext;
|
|
73
|
-
const
|
|
74
|
-
const messages = await
|
|
73
|
+
const { message, agentContext } = messageContext;
|
|
74
|
+
const queueTransportRepository = agentContext.dependencyManager.resolve(DidCommModuleConfig_1.DidCommModuleConfig).queueTransportRepository;
|
|
75
|
+
const messages = await queueTransportRepository.takeFromQueue(agentContext, {
|
|
75
76
|
connectionId: connection.id,
|
|
76
77
|
limit: message.batchSize,
|
|
77
78
|
deleteMessages: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1MessagePickupProtocol.js","sourceRoot":"","sources":["../../../../../src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"V1MessagePickupProtocol.js","sourceRoot":"","sources":["../../../../../src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts"],"names":[],"mappings":";;;;;;;;;AAeA,yCAAqE;AAErE,+CAAoD;AACpD,+CAAqE;AACrE,mEAAmE;AACnE,+EAA2E;AAC3E,4EAAwE;AAExE,yEAAqE;AACrE,yCAAiE;AACjE,yCAAsF;AAG/E,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,qDAAyB;IAA/D;;QACL;;WAEG;QACa,YAAO,GAAG,IAAa,CAAA;IAwIzC,CAAC;IAtIC;;OAEG;IACI,QAAQ,CAAC,sBAA8C,EAAE,eAAgC;QAC9F,sBAAsB,CAAC,uBAAuB,CAAC,CAAC,IAAI,+BAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,yBAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAE1G,eAAe,CAAC,QAAQ,CACtB,IAAI,iBAAQ,CAAC;YACX,EAAE,EAAE,uCAAuC;YAC3C,KAAK,EAAE,CAAC,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,CAAC;SAC1E,CAAC,CACH,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,YAA0B,EAC1B,OAAsC;QAEtC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;QAC/C,gBAAgB,CAAC,WAAW,EAAE,CAAA;QAE9B,MAAM,MAAM,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,qDAAyB,CAAC,CAAA;QAChF,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