diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index c5b562eb37..19c61439ab 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -17,7 +17,7 @@ export * from './storage/BaseRecord' export { InMemoryMessageRepository } from './storage/InMemoryMessageRepository' export { Repository } from './storage/Repository' export * from './storage/RepositoryEvents' -export { StorageService } from './storage/StorageService' +export { StorageService, Query } from './storage/StorageService' export { getDirFromFilePath } from './utils/path' export { InjectionSymbols } from './constants' export type { Wallet } from './wallet/Wallet' diff --git a/packages/core/src/modules/action-menu/services/ActionMenuService.ts b/packages/core/src/modules/action-menu/services/ActionMenuService.ts index f96387fa8e..f1c821c917 100644 --- a/packages/core/src/modules/action-menu/services/ActionMenuService.ts +++ b/packages/core/src/modules/action-menu/services/ActionMenuService.ts @@ -1,5 +1,6 @@ import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' import type { Logger } from '../../../logger' +import type { Query } from '../../../storage/StorageService' import type { ActionMenuStateChangedEvent } from '../ActionMenuEvents' import type { ActionMenuProblemReportMessage } from '../messages' import type { @@ -346,6 +347,10 @@ export class ActionMenuService { }) } + public async findAllByQuery(options: Query) { + return await this.actionMenuRepository.findByQuery(options) + } + private emitStateChangedEvent(actionMenuRecord: ActionMenuRecord, previousState: ActionMenuState | null) { const clonedRecord = JsonTransformer.clone(actionMenuRecord) diff --git a/packages/core/src/modules/basic-messages/BasicMessagesModule.ts b/packages/core/src/modules/basic-messages/BasicMessagesModule.ts index 26d958cc97..39b8cfc263 100644 --- a/packages/core/src/modules/basic-messages/BasicMessagesModule.ts +++ b/packages/core/src/modules/basic-messages/BasicMessagesModule.ts @@ -1,5 +1,6 @@ import type { DependencyManager } from '../../plugins' -import type { BasicMessageTags } from './repository/BasicMessageRecord' +import type { Query } from '../../storage/StorageService' +import type { BasicMessageRecord } from './repository/BasicMessageRecord' import { Dispatcher } from '../../agent/Dispatcher' import { MessageSender } from '../../agent/MessageSender' @@ -59,7 +60,7 @@ export class BasicMessagesModule { * @param query The query * @returns array containing all matching records */ - public async findAllByQuery(query: Partial) { + public async findAllByQuery(query: Query) { return this.basicMessageService.findAllByQuery(query) } diff --git a/packages/core/src/modules/basic-messages/services/BasicMessageService.ts b/packages/core/src/modules/basic-messages/services/BasicMessageService.ts index 7388e74e82..116376de25 100644 --- a/packages/core/src/modules/basic-messages/services/BasicMessageService.ts +++ b/packages/core/src/modules/basic-messages/services/BasicMessageService.ts @@ -1,7 +1,7 @@ import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { Query } from '../../../storage/StorageService' import type { ConnectionRecord } from '../../connections/repository/ConnectionRecord' import type { BasicMessageStateChangedEvent } from '../BasicMessageEvents' -import type { BasicMessageTags } from '../repository' import { EventEmitter } from '../../../agent/EventEmitter' import { injectable } from '../../../plugins' @@ -61,7 +61,7 @@ export class BasicMessageService { }) } - public async findAllByQuery(query: Partial) { + public async findAllByQuery(query: Query) { return this.basicMessageRepository.findByQuery(query) } diff --git a/packages/core/src/modules/connections/ConnectionsModule.ts b/packages/core/src/modules/connections/ConnectionsModule.ts index 476288a96b..7195d83ca3 100644 --- a/packages/core/src/modules/connections/ConnectionsModule.ts +++ b/packages/core/src/modules/connections/ConnectionsModule.ts @@ -1,4 +1,5 @@ import type { DependencyManager } from '../../plugins' +import type { Query } from '../../storage/StorageService' import type { Key } from '../dids' import type { OutOfBandRecord } from '../oob/repository' import type { ConnectionType } from './models' @@ -198,6 +199,15 @@ export class ConnectionsModule { return this.connectionService.getAll() } + /** + * Retrieve all connections records by specified query params + * + * @returns List containing all connection records matching specified query paramaters + */ + public findAllByQuery(query: Query) { + return this.connectionService.findAllByQuery(query) + } + /** * Allows for the addition of connectionType to the record. * Either updates or creates an array of string conection types diff --git a/packages/core/src/modules/connections/__tests__/ConnectionService.test.ts b/packages/core/src/modules/connections/__tests__/ConnectionService.test.ts index 97ef3fbd3d..c21e90e226 100644 --- a/packages/core/src/modules/connections/__tests__/ConnectionService.test.ts +++ b/packages/core/src/modules/connections/__tests__/ConnectionService.test.ts @@ -897,5 +897,15 @@ describe('ConnectionService', () => { expect(result).toEqual(expect.arrayContaining(expected)) }) + + it('findAllByQuery should return value from connectionRepository.findByQuery', async () => { + const expected = [getMockConnection(), getMockConnection()] + + mockFunction(connectionRepository.findByQuery).mockReturnValue(Promise.resolve(expected)) + const result = await connectionService.findAllByQuery({ state: DidExchangeState.InvitationReceived }) + expect(connectionRepository.findByQuery).toBeCalledWith({ state: DidExchangeState.InvitationReceived }) + + expect(result).toEqual(expect.arrayContaining(expected)) + }) }) }) diff --git a/packages/core/src/modules/connections/services/ConnectionService.ts b/packages/core/src/modules/connections/services/ConnectionService.ts index d7fc004881..5b7de49125 100644 --- a/packages/core/src/modules/connections/services/ConnectionService.ts +++ b/packages/core/src/modules/connections/services/ConnectionService.ts @@ -1,6 +1,7 @@ import type { AgentMessage } from '../../../agent/AgentMessage' import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' import type { Logger } from '../../../logger' +import type { Query } from '../../../storage/StorageService' import type { AckMessage } from '../../common' import type { OutOfBandDidCommService } from '../../oob/domain/OutOfBandDidCommService' import type { OutOfBandRecord } from '../../oob/repository' @@ -592,6 +593,10 @@ export class ConnectionService { return this.connectionRepository.findByQuery({ invitationDid }) } + public async findAllByQuery(query: Query): Promise { + return this.connectionRepository.findByQuery(query) + } + public async createConnection(options: ConnectionRecordProps): Promise { const connectionRecord = new ConnectionRecord(options) await this.connectionRepository.save(connectionRecord) diff --git a/packages/core/src/modules/credentials/CredentialsModule.ts b/packages/core/src/modules/credentials/CredentialsModule.ts index 6c74598b0b..f82018bf95 100644 --- a/packages/core/src/modules/credentials/CredentialsModule.ts +++ b/packages/core/src/modules/credentials/CredentialsModule.ts @@ -1,6 +1,7 @@ import type { AgentMessage } from '../../agent/AgentMessage' import type { Logger } from '../../logger' import type { DependencyManager } from '../../plugins' +import type { Query } from '../../storage/StorageService' import type { DeleteCredentialOptions } from './CredentialServiceOptions' import type { AcceptCredentialOptions, @@ -73,6 +74,7 @@ export interface CredentialsModule + findAllByQuery(query: Query): Promise getById(credentialRecordId: string): Promise findById(credentialRecordId: string): Promise deleteById(credentialRecordId: string, options?: DeleteCredentialOptions): Promise @@ -573,6 +575,15 @@ export class CredentialsModule< return this.credentialRepository.getAll() } + /** + * Retrieve all credential records by specified query params + * + * @returns List containing all credential records matching specified query paramaters + */ + public findAllByQuery(query: Query) { + return this.credentialRepository.findByQuery(query) + } + /** * Find a credential record by id * diff --git a/packages/core/src/modules/credentials/protocol/v1/__tests__/V1CredentialServiceCred.test.ts b/packages/core/src/modules/credentials/protocol/v1/__tests__/V1CredentialServiceCred.test.ts index e0188dd352..4dff8e928a 100644 --- a/packages/core/src/modules/credentials/protocol/v1/__tests__/V1CredentialServiceCred.test.ts +++ b/packages/core/src/modules/credentials/protocol/v1/__tests__/V1CredentialServiceCred.test.ts @@ -811,6 +811,16 @@ describe('V1CredentialService', () => { expect(result).toEqual(expect.arrayContaining(expected)) }) + + it('findAllByQuery should return value from credentialRepository.findByQuery', async () => { + const expected = [mockCredentialRecord(), mockCredentialRecord()] + + mockFunction(credentialRepository.findByQuery).mockReturnValue(Promise.resolve(expected)) + const result = await credentialService.findAllByQuery({ state: CredentialState.OfferSent }) + expect(credentialRepository.findByQuery).toBeCalledWith({ state: CredentialState.OfferSent }) + + expect(result).toEqual(expect.arrayContaining(expected)) + }) }) describe('deleteCredential', () => { diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialServiceCred.test.ts b/packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialServiceCred.test.ts index a3dbe65866..2ac5b3580c 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialServiceCred.test.ts +++ b/packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialServiceCred.test.ts @@ -755,6 +755,16 @@ describe('CredentialService', () => { expect(result).toEqual(expect.arrayContaining(expected)) }) + + it('findAllByQuery should return value from credentialRepository.findByQuery', async () => { + const expected = [mockCredentialRecord(), mockCredentialRecord()] + + mockFunction(credentialRepository.findByQuery).mockReturnValue(Promise.resolve(expected)) + const result = await credentialService.findAllByQuery({ state: CredentialState.OfferSent }) + expect(credentialRepository.findByQuery).toBeCalledWith({ state: CredentialState.OfferSent }) + + expect(result).toEqual(expect.arrayContaining(expected)) + }) }) describe('deleteCredential', () => { diff --git a/packages/core/src/modules/credentials/services/CredentialService.ts b/packages/core/src/modules/credentials/services/CredentialService.ts index 2e305864ef..a0be67c7bf 100644 --- a/packages/core/src/modules/credentials/services/CredentialService.ts +++ b/packages/core/src/modules/credentials/services/CredentialService.ts @@ -5,6 +5,7 @@ import type { EventEmitter } from '../../../agent/EventEmitter' import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' import type { Logger } from '../../../logger' import type { DidCommMessageRepository } from '../../../storage' +import type { Query } from '../../../storage/StorageService' import type { ProblemReportMessage } from '../../problem-reports' import type { CredentialStateChangedEvent } from '../CredentialEvents' import type { @@ -185,6 +186,10 @@ export abstract class CredentialService): Promise { + return this.credentialRepository.findByQuery(query) + } + /** * Find a credential record by id * diff --git a/packages/core/src/modules/generic-records/GenericRecordsModule.ts b/packages/core/src/modules/generic-records/GenericRecordsModule.ts index 579536848f..c52f9daf30 100644 --- a/packages/core/src/modules/generic-records/GenericRecordsModule.ts +++ b/packages/core/src/modules/generic-records/GenericRecordsModule.ts @@ -1,6 +1,7 @@ import type { Logger } from '../../logger' import type { DependencyManager } from '../../plugins' -import type { GenericRecord, GenericRecordTags, SaveGenericRecordOption } from './repository/GenericRecord' +import type { Query } from '../../storage/StorageService' +import type { GenericRecord, SaveGenericRecordOption } from './repository/GenericRecord' import { AgentConfig } from '../../agent/AgentConfig' import { injectable, module } from '../../plugins' @@ -74,7 +75,7 @@ export class GenericRecordsModule { return this.genericRecordsService.findById(id) } - public async findAllByQuery(query: Partial): Promise { + public async findAllByQuery(query: Query): Promise { return this.genericRecordsService.findAllByQuery(query) } diff --git a/packages/core/src/modules/generic-records/service/GenericRecordService.ts b/packages/core/src/modules/generic-records/service/GenericRecordService.ts index e27f818e86..397f0b44f0 100644 --- a/packages/core/src/modules/generic-records/service/GenericRecordService.ts +++ b/packages/core/src/modules/generic-records/service/GenericRecordService.ts @@ -1,4 +1,5 @@ -import type { GenericRecordTags, SaveGenericRecordOption } from '../repository/GenericRecord' +import type { Query } from '../../../storage/StorageService' +import type { SaveGenericRecordOption } from '../repository/GenericRecord' import { AriesFrameworkError } from '../../../error' import { injectable } from '../../../plugins' @@ -50,7 +51,7 @@ export class GenericRecordService { } } - public async findAllByQuery(query: Partial) { + public async findAllByQuery(query: Query) { return this.genericRecordsRepository.findByQuery(query) } diff --git a/packages/core/src/modules/oob/OutOfBandModule.ts b/packages/core/src/modules/oob/OutOfBandModule.ts index a513fea180..cdd722aefc 100644 --- a/packages/core/src/modules/oob/OutOfBandModule.ts +++ b/packages/core/src/modules/oob/OutOfBandModule.ts @@ -4,6 +4,7 @@ import type { Attachment } from '../../decorators/attachment/Attachment' import type { Logger } from '../../logger' import type { ConnectionRecord, Routing, ConnectionInvitationMessage } from '../../modules/connections' import type { DependencyManager } from '../../plugins' +import type { Query } from '../../storage/StorageService' import type { PlaintextMessage } from '../../types' import type { Key } from '../dids' import type { HandshakeReusedEvent } from './domain/OutOfBandEvents' @@ -533,6 +534,15 @@ export class OutOfBandModule { return this.outOfBandService.getAll() } + /** + * Retrieve all out of bands records by specified query param + * + * @returns List containing all out of band records matching specified query params + */ + public findAllByQuery(query: Query) { + return this.outOfBandService.findAllByQuery(query) + } + /** * Retrieve a out of band record by id * diff --git a/packages/core/src/modules/oob/OutOfBandService.ts b/packages/core/src/modules/oob/OutOfBandService.ts index b84d332e0f..85a2c64a49 100644 --- a/packages/core/src/modules/oob/OutOfBandService.ts +++ b/packages/core/src/modules/oob/OutOfBandService.ts @@ -1,4 +1,5 @@ import type { InboundMessageContext } from '../../agent/models/InboundMessageContext' +import type { Query } from '../../storage/StorageService' import type { ConnectionRecord } from '../connections' import type { Key } from '../dids/domain/Key' import type { HandshakeReusedEvent, OutOfBandStateChangedEvent } from './domain/OutOfBandEvents' @@ -167,6 +168,10 @@ export class OutOfBandService { return this.outOfBandRepository.getAll() } + public async findAllByQuery(query: Query) { + return this.outOfBandRepository.findByQuery(query) + } + public async deleteById(outOfBandId: string) { const outOfBandRecord = await this.getById(outOfBandId) return this.outOfBandRepository.delete(outOfBandRecord) diff --git a/packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts b/packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts index 9bfd317ddb..9f1dfca323 100644 --- a/packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts +++ b/packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts @@ -495,5 +495,15 @@ describe('OutOfBandService', () => { expect(result).toEqual(expect.arrayContaining(expected)) }) + + it('findAllByQuery should return value from outOfBandRepository.findByQuery', async () => { + const expected = [getMockOutOfBand(), getMockOutOfBand()] + + mockFunction(outOfBandRepository.findByQuery).mockReturnValue(Promise.resolve(expected)) + const result = await outOfBandService.findAllByQuery({ state: OutOfBandState.Initial }) + expect(outOfBandRepository.findByQuery).toBeCalledWith({ state: OutOfBandState.Initial }) + + expect(result).toEqual(expect.arrayContaining(expected)) + }) }) }) diff --git a/packages/core/src/modules/proofs/ProofsModule.ts b/packages/core/src/modules/proofs/ProofsModule.ts index 613a4928ca..bf14e6f2e9 100644 --- a/packages/core/src/modules/proofs/ProofsModule.ts +++ b/packages/core/src/modules/proofs/ProofsModule.ts @@ -1,4 +1,5 @@ import type { DependencyManager } from '../../plugins' +import type { Query } from '../../storage/StorageService' import type { AutoAcceptProof } from './ProofAutoAcceptType' import type { PresentationPreview, RequestPresentationMessage } from './messages' import type { RequestedCredentials, RetrievedCredentials } from './models' @@ -414,6 +415,15 @@ export class ProofsModule { return this.proofService.getAll() } + /** + * Retrieve all proof records by specified query params + * + * @returns List containing all proof records matching specified params + */ + public findAllByQuery(query: Query): Promise { + return this.proofService.findAllByQuery(query) + } + /** * Retrieve a proof record by id * diff --git a/packages/core/src/modules/proofs/services/ProofService.ts b/packages/core/src/modules/proofs/services/ProofService.ts index 0f1a721c6a..94b5b935ea 100644 --- a/packages/core/src/modules/proofs/services/ProofService.ts +++ b/packages/core/src/modules/proofs/services/ProofService.ts @@ -1,6 +1,7 @@ import type { AgentMessage } from '../../../agent/AgentMessage' import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' import type { Logger } from '../../../logger' +import type { Query } from '../../../storage/StorageService' import type { ConnectionRecord } from '../../connections' import type { AutoAcceptProof } from '../ProofAutoAcceptType' import type { ProofStateChangedEvent } from '../ProofEvents' @@ -938,6 +939,15 @@ export class ProofService { return this.proofRepository.getAll() } + /** + * Retrieve all proof records + * + * @returns List containing all proof records + */ + public async findAllByQuery(query: Query): Promise { + return this.proofRepository.findByQuery(query) + } + /** * Retrieve a proof record by id * diff --git a/packages/core/src/modules/question-answer/QuestionAnswerModule.ts b/packages/core/src/modules/question-answer/QuestionAnswerModule.ts index 59350a2334..103df18952 100644 --- a/packages/core/src/modules/question-answer/QuestionAnswerModule.ts +++ b/packages/core/src/modules/question-answer/QuestionAnswerModule.ts @@ -1,4 +1,6 @@ import type { DependencyManager } from '../../plugins' +import type { Query } from '../../storage/StorageService' +import type { QuestionAnswerRecord } from './repository' import { Dispatcher } from '../../agent/Dispatcher' import { MessageSender } from '../../agent/MessageSender' @@ -92,6 +94,15 @@ export class QuestionAnswerModule { return this.questionAnswerService.getAll() } + /** + * Get all QuestionAnswer records by specified query params + * + * @returns list containing all QuestionAnswer records matching specified query params + */ + public findAllByQuery(query: Query) { + return this.questionAnswerService.findAllByQuery(query) + } + /** * Retrieve a question answer record by id * diff --git a/packages/core/src/modules/question-answer/services/QuestionAnswerService.ts b/packages/core/src/modules/question-answer/services/QuestionAnswerService.ts index 15495a5c89..6217fe2faf 100644 --- a/packages/core/src/modules/question-answer/services/QuestionAnswerService.ts +++ b/packages/core/src/modules/question-answer/services/QuestionAnswerService.ts @@ -1,8 +1,8 @@ import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' import type { Logger } from '../../../logger' +import type { Query } from '../../../storage/StorageService' import type { QuestionAnswerStateChangedEvent } from '../QuestionAnswerEvents' import type { ValidResponse } from '../models' -import type { QuestionAnswerTags } from '../repository' import { AgentConfig } from '../../../agent/AgentConfig' import { EventEmitter } from '../../../agent/EventEmitter' @@ -269,7 +269,7 @@ export class QuestionAnswerService { return this.questionAnswerRepository.getAll() } - public async findAllByQuery(query: Partial) { + public async findAllByQuery(query: Query) { return this.questionAnswerRepository.findByQuery(query) } } diff --git a/packages/core/src/modules/routing/services/MediationRecipientService.ts b/packages/core/src/modules/routing/services/MediationRecipientService.ts index 715cee4e9e..0aed806a5e 100644 --- a/packages/core/src/modules/routing/services/MediationRecipientService.ts +++ b/packages/core/src/modules/routing/services/MediationRecipientService.ts @@ -1,6 +1,7 @@ import type { AgentMessage } from '../../../agent/AgentMessage' import type { AgentMessageReceivedEvent } from '../../../agent/Events' import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { Query } from '../../../storage/StorageService' import type { EncryptedMessage } from '../../../types' import type { ConnectionRecord } from '../../connections' import type { Routing } from '../../connections/services/ConnectionService' @@ -365,6 +366,10 @@ export class MediationRecipientService { return this.mediationRepository.getAll() } + public async findAllMediatorsByQuery(query: Query): Promise { + return await this.mediationRepository.findByQuery(query) + } + public async findDefaultMediator(): Promise { return this.mediationRepository.findSingleByQuery({ default: true }) } diff --git a/packages/core/src/modules/routing/services/MediatorService.ts b/packages/core/src/modules/routing/services/MediatorService.ts index 4633555081..e5e319304d 100644 --- a/packages/core/src/modules/routing/services/MediatorService.ts +++ b/packages/core/src/modules/routing/services/MediatorService.ts @@ -1,4 +1,5 @@ import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { Query } from '../../../storage/StorageService' import type { EncryptedMessage } from '../../../types' import type { ConnectionRecord } from '../../connections' import type { MediationStateChangedEvent } from '../RoutingEvents' @@ -201,6 +202,10 @@ export class MediatorService { return await this.mediationRepository.getAll() } + public async findAllByQuery(query: Query): Promise { + return await this.mediationRepository.findByQuery(query) + } + private async updateState(mediationRecord: MediationRecord, newState: MediationState) { const previousState = mediationRecord.state diff --git a/packages/core/src/storage/StorageService.ts b/packages/core/src/storage/StorageService.ts index 87360ab330..3e8b99a090 100644 --- a/packages/core/src/storage/StorageService.ts +++ b/packages/core/src/storage/StorageService.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type { Constructor } from '../utils/mixins' import type { BaseRecord, TagsBase } from './BaseRecord' @@ -10,13 +11,12 @@ interface AdvancedQuery { $not?: Query } -export type Query = AdvancedQuery | SimpleQuery +export type Query> = AdvancedQuery | SimpleQuery export interface BaseRecordConstructor extends Constructor { type: string } -// eslint-disable-next-line @typescript-eslint/no-explicit-any export interface StorageService> { /** * Save record in storage diff --git a/samples/extension-module/dummy/DummyApi.ts b/samples/extension-module/dummy/DummyApi.ts index b15735148a..93d716e130 100644 --- a/samples/extension-module/dummy/DummyApi.ts +++ b/samples/extension-module/dummy/DummyApi.ts @@ -1,4 +1,5 @@ import type { DummyRecord } from './repository/DummyRecord' +import type { Query } from '@aries-framework/core' import { injectable, ConnectionService, Dispatcher, MessageSender } from '@aries-framework/core' @@ -69,6 +70,15 @@ export class DummyApi { return this.dummyService.getAll() } + /** + * Retrieve all dummy records + * + * @returns List containing all records + */ + public findAllByQuery(query: Query): Promise { + return this.dummyService.findAllByQuery(query) + } + private registerHandlers(dispatcher: Dispatcher) { dispatcher.registerHandler(new DummyRequestHandler(this.dummyService)) dispatcher.registerHandler(new DummyResponseHandler(this.dummyService)) diff --git a/samples/extension-module/dummy/services/DummyService.ts b/samples/extension-module/dummy/services/DummyService.ts index 3cc73eba9f..96f0eb4edb 100644 --- a/samples/extension-module/dummy/services/DummyService.ts +++ b/samples/extension-module/dummy/services/DummyService.ts @@ -1,5 +1,5 @@ import type { DummyStateChangedEvent } from './DummyEvents' -import type { ConnectionRecord, InboundMessageContext } from '@aries-framework/core' +import type { Query, ConnectionRecord, InboundMessageContext } from '@aries-framework/core' import { injectable, JsonTransformer, EventEmitter } from '@aries-framework/core' @@ -119,6 +119,15 @@ export class DummyService { return this.dummyRepository.getAll() } + /** + * Retrieve dummy records by query + * + * @returns List containing all dummy records matching query + */ + public findAllByQuery(query: Query): Promise { + return this.dummyRepository.findByQuery(query) + } + /** * Retrieve a dummy record by id *