From 897c834357c0af7b8ef55c023d3e358111e572c0 Mon Sep 17 00:00:00 2001 From: Ariel Gentile Date: Tue, 28 Jan 2025 13:28:49 -0300 Subject: [PATCH] refactor!: didcomm module (#2127) Signed-off-by: Ariel Gentile --- .changeset/purple-donkeys-camp.md | 67 + demo-openid/src/BaseAgent.ts | 27 +- demo-openid/src/Holder.ts | 4 +- demo-openid/src/Issuer.ts | 4 +- demo-openid/src/Verifier.ts | 4 +- demo/package.json | 1 + demo/src/Alice.ts | 16 +- demo/src/AliceInquirer.ts | 6 +- demo/src/BaseAgent.ts | 17 +- demo/src/Faber.ts | 19 +- demo/src/Listener.ts | 6 +- packages/action-menu/package.json | 1 + packages/action-menu/src/ActionMenuApi.ts | 24 +- packages/action-menu/src/ActionMenuModule.ts | 10 +- .../src/__tests__/ActionMenuModule.test.ts | 22 +- .../errors/ActionMenuProblemReportError.ts | 4 +- .../ActionMenuProblemReportHandler.ts | 2 +- .../src/handlers/MenuMessageHandler.ts | 2 +- .../src/handlers/MenuRequestMessageHandler.ts | 2 +- .../src/handlers/PerformMessageHandler.ts | 2 +- .../ActionMenuProblemReportMessage.ts | 4 +- .../action-menu/src/messages/MenuMessage.ts | 2 +- .../src/messages/MenuRequestMessage.ts | 2 +- .../src/messages/PerformMessage.ts | 2 +- .../src/services/ActionMenuService.ts | 3 +- .../src/services/ActionMenuServiceOptions.ts | 2 +- .../__tests__/ActionMenuService.test.ts | 3 +- .../action-menu/tests/action-menu.test.ts | 8 +- packages/anoncreds/package.json | 1 + .../src/formats/AnonCredsCredentialFormat.ts | 2 +- .../AnonCredsCredentialFormatService.ts | 17 +- .../src/formats/AnonCredsProofFormat.ts | 2 +- .../formats/AnonCredsProofFormatService.ts | 7 +- .../DataIntegrityCredentialFormatService.ts | 36 +- .../src/formats/LegacyIndyCredentialFormat.ts | 2 +- .../LegacyIndyCredentialFormatService.ts | 16 +- .../src/formats/LegacyIndyProofFormat.ts | 2 +- .../formats/LegacyIndyProofFormatService.ts | 7 +- .../legacy-indy-format-services.test.ts | 14 +- .../credentials/v1/V1CredentialProtocol.ts | 18 +- .../V1CredentialProtocolCred.test.ts | 28 +- .../V1CredentialProtocolProposeOffer.test.ts | 19 +- .../v1-connectionless-credentials.e2e.test.ts | 25 +- .../v1-credentials-auto-accept.e2e.test.ts | 37 +- .../v1/__tests__/v1-credentials.e2e.test.ts | 29 +- .../errors/V1CredentialProblemReportError.ts | 4 +- .../v1/handlers/V1CredentialAckHandler.ts | 2 +- .../V1CredentialProblemReportHandler.ts | 2 +- .../v1/handlers/V1IssueCredentialHandler.ts | 5 +- .../v1/handlers/V1OfferCredentialHandler.ts | 4 +- .../v1/handlers/V1ProposeCredentialHandler.ts | 4 +- .../v1/handlers/V1RequestCredentialHandler.ts | 5 +- .../v1/messages/V1CredentialAckMessage.ts | 4 +- .../v1/messages/V1CredentialPreview.ts | 6 +- .../V1CredentialProblemReportMessage.ts | 4 +- .../v1/messages/V1IssueCredentialMessage.ts | 2 +- .../v1/messages/V1OfferCredentialMessage.ts | 2 +- .../v1/messages/V1ProposeCredentialMessage.ts | 4 +- .../v1/messages/V1RequestCredentialMessage.ts | 2 +- .../protocols/proofs/v1/V1ProofProtocol.ts | 20 +- .../v1/__tests__/V1ProofProtocol.test.ts | 21 +- .../v1-connectionless-proofs.e2e.test.ts | 89 +- .../v1-indy-proof-negotiation.e2e.test.ts | 24 +- .../v1-indy-proof-presentation.e2e.test.ts | 18 +- .../v1-indy-proof-proposal.e2e.test.ts | 6 +- .../v1-indy-proof-request.e2e.test.ts | 10 +- .../v1/__tests__/v1-indy-proofs.e2e.test.ts | 46 +- .../v1-proofs-auto-accept.e2e.test.ts | 16 +- .../V1PresentationProblemReportError.ts | 4 +- .../v1/handlers/V1PresentationAckHandler.ts | 2 +- .../v1/handlers/V1PresentationHandler.ts | 5 +- .../V1PresentationProblemReportHandler.ts | 2 +- .../handlers/V1ProposePresentationHandler.ts | 4 +- .../handlers/V1RequestPresentationHandler.ts | 4 +- .../v1/messages/V1PresentationAckMessage.ts | 4 +- .../v1/messages/V1PresentationMessage.ts | 2 +- .../V1PresentationProblemReportMessage.ts | 4 +- .../messages/V1ProposePresentationMessage.ts | 2 +- .../messages/V1RequestPresentationMessage.ts | 2 +- .../proofs/v1/models/V1PresentationPreview.ts | 3 +- .../credentialExchangeRecord.test.ts | 9 +- .../0.3.1-0.4/credentialExchangeRecord.ts | 5 +- .../w3cCredentialRecordMigration.test.ts | 5 +- .../0.4-0.5/anonCredsCredentialRecord.ts | 9 +- .../src/utils/__tests__/credential.test.ts | 2 +- .../anoncreds/src/utils/composeAutoAccept.ts | 2 +- packages/anoncreds/src/utils/credential.ts | 5 +- .../src/utils/credentialPreviewAttributes.ts | 2 +- .../anoncreds/tests/anoncreds-flow.test.ts | 14 +- packages/anoncreds/tests/anoncreds.test.ts | 1 + packages/anoncreds/tests/anoncredsSetup.ts | 31 +- .../data-integrity-flow-anoncreds-pex.test.ts | 29 +- .../data-integrity-flow-anoncreds.test.ts | 19 +- .../tests/data-integrity-flow-w3c.test.ts | 10 +- .../tests/data-integrity-flow.test.ts | 10 +- packages/anoncreds/tests/indy-flow.test.ts | 14 +- .../anoncreds/tests/legacyAnonCredsSetup.ts | 34 +- .../tests/v2-credential-revocation.test.ts | 16 +- .../anoncreds/tests/v2-credentials.test.ts | 68 +- packages/anoncreds/tests/v2-proofs.test.ts | 64 +- .../__tests__/migration-postgres.e2e.test.ts | 2 +- .../src/wallet/__tests__/packing.test.ts | 3 +- packages/askar/tests/askar-inmemory.test.ts | 10 +- .../askar/tests/askar-postgres.e2e.test.ts | 26 +- packages/askar/tests/askar-sqlite.test.ts | 5 +- packages/askar/tests/helpers.ts | 27 +- ...proof.credentials.propose-offerBbs.test.ts | 19 +- packages/cheqd/package.json | 2 +- .../tests/cheqd-data-integrity.e2e.test.ts | 31 +- .../tests/cheqd-did-registrar.e2e.test.ts | 2 +- .../tests/cheqd-did-resolver.e2e.test.ts | 2 +- .../cheqd-sdk-anoncreds-registry.e2e.test.ts | 2 +- packages/core/package.json | 23 +- packages/core/src/agent/Agent.ts | 143 +- packages/core/src/agent/AgentConfig.ts | 47 - packages/core/src/agent/AgentModules.ts | 30 +- packages/core/src/agent/BaseAgent.ts | 74 +- packages/core/src/agent/Events.ts | 40 - .../core/src/agent/__tests__/Agent.test.ts | 63 +- .../src/agent/__tests__/AgentConfig.test.ts | 40 +- .../src/agent/__tests__/AgentModules.test.ts | 41 +- packages/core/src/constants.ts | 4 +- packages/core/src/crypto/WalletKeyPair.ts | 3 +- packages/core/src/crypto/index.ts | 2 +- packages/core/src/error/index.ts | 1 - packages/core/src/index.ts | 81 +- .../__tests__/BasicMessagesModule.test.ts | 25 - packages/core/src/modules/common/index.ts | 1 - .../__tests__/ConnectionsModule.test.ts | 35 - packages/core/src/modules/didcomm/index.ts | 2 - packages/core/src/modules/didcomm/types.ts | 8 - .../modules/dids/__tests__/DidsApi.test.ts | 2 +- .../peer/__tests__/peerDidNumAlgo2.test.ts | 13 +- .../peer/__tests__/peerDidNumAlgo4.test.ts | 5 +- .../peer/createPeerDidDocumentFromServices.ts | 2 +- .../dids/methods/peer/peerDidNumAlgo2.ts | 50 +- .../dids/methods/peer/peerDidNumAlgo4.ts | 31 +- .../__tests__/DiscoverFeaturesModule.test.ts | 36 - .../mdoc/__tests__/mdocDeviceResponse.test.ts | 4 +- .../mdocOpenId4VcDeviceResponse.test.ts | 3 +- .../modules/mdoc/__tests__/mdocServer.test.ts | 5 +- .../__tests__/MessagePickupModule.test.ts | 47 - .../core/src/modules/problem-reports/index.ts | 3 - .../__tests__/SdJwtVcService.test.ts | 1 + .../vc/__tests__/W3cCredentialsApi.test.ts | 1 + .../src/modules/vc/data-integrity/index.ts | 1 + .../modules/vc/models/presentation/index.ts | 1 + .../x509/__tests__/X509ServiceModule.test.ts | 2 +- .../core/src/plugins/DependencyManager.ts | 48 +- packages/core/src/plugins/Module.ts | 4 +- .../__tests__/DependencyManager.test.ts | 7 +- packages/core/src/storage/index.ts | 1 - .../src/storage/migration/UpdateAssistant.ts | 2 +- .../storage/migration/__tests__/0.1.test.ts | 16 +- .../storage/migration/__tests__/0.2.test.ts | 7 +- .../storage/migration/__tests__/0.4.test.ts | 17 +- .../__tests__/__snapshots__/0.1.test.ts.snap | 2 +- .../migration/__tests__/backup-askar.test.ts | 3 +- .../migration/__tests__/backup.test.ts | 3 +- .../storage/migration/__tests__/updates.ts | 10 +- .../core/src/storage/migration/updates.ts | 15 +- .../migration/updates/0.4-0.5/index.ts | 4 - packages/core/src/types.ts | 86 +- .../utils/__tests__/JsonTransformer.test.ts | 2 +- .../utils/__tests__/MessageValidator.test.ts | 2 +- packages/core/src/utils/index.ts | 2 +- packages/core/src/utils/transformers.ts | 18 - packages/core/tests/TestMessage.ts | 2 +- packages/core/tests/agents.test.ts | 19 +- packages/core/tests/connections.test.ts | 210 +- packages/core/tests/helpers.ts | 102 +- packages/core/tests/jsonld.ts | 15 +- packages/core/tests/middleware.test.ts | 41 +- packages/core/tests/migration.test.ts | 2 +- .../core/tests/multi-protocol-version.test.ts | 25 +- .../tests/oob-mediation-provision.test.ts | 44 +- packages/core/tests/oob-mediation.test.ts | 84 +- packages/core/tests/oob.test.ts | 432 +- .../tests/proofs-sub-protocol.e2e.test.ts | 46 +- packages/core/tests/setup.ts | 2 +- packages/core/tests/transport.ts | 6 +- packages/core/types/jest.d.ts | 3 +- packages/didcomm/README.md | 84 + packages/didcomm/jest.config.ts | 13 + packages/didcomm/package.json | 44 + .../src/agent => didcomm/src}/AgentMessage.ts | 25 +- .../src/agent => didcomm/src}/BaseMessage.ts | 9 +- packages/didcomm/src/DidCommApi.ts | 90 + packages/didcomm/src/DidCommModule.ts | 122 + packages/didcomm/src/DidCommModuleConfig.ts | 68 + .../src/agent => didcomm/src}/Dispatcher.ts | 27 +- .../agent => didcomm/src}/EnvelopeService.ts | 19 +- packages/didcomm/src/Events.ts | 41 + .../agent => didcomm/src}/FeatureRegistry.ts | 2 +- .../src}/MessageHandlerRegistry.ts | 16 +- .../agent => didcomm/src}/MessageReceiver.ts | 34 +- .../agent => didcomm/src}/MessageSender.ts | 59 +- .../agent => didcomm/src}/TransportService.ts | 15 +- .../src}/__tests__/AgentMessage.test.ts | 12 +- .../src/__tests__/DidCommConfig.test.ts | 29 + .../src}/__tests__/Dispatcher.test.ts | 29 +- .../src}/__tests__/EventEmitter.test.ts | 4 +- .../__tests__/MessageHandlerRegistry.test.ts | 4 +- .../src}/__tests__/MessageSender.test.ts | 40 +- .../src}/__tests__/TransportService.test.ts | 6 +- .../agent => didcomm/src}/__tests__/stubs.ts | 0 packages/didcomm/src/constants.ts | 1 + .../src/decorators/ack/AckDecorator.test.ts | 10 +- .../src/decorators/ack/AckDecorator.ts | 0 .../decorators/ack/AckDecoratorExtension.ts | 2 +- .../src/decorators/attachment/Attachment.ts | 10 +- .../attachment/AttachmentExtension.ts | 2 +- .../attachment/__tests__/Attachment.test.ts | 8 +- .../src/decorators/l10n/L10nDecorator.test.ts | 2 +- .../src/decorators/l10n/L10nDecorator.ts | 0 .../decorators/l10n/L10nDecoratorExtension.ts | 2 +- .../service/ServiceDecorator.test.ts | 6 +- .../decorators/service/ServiceDecorator.ts | 8 +- .../service/ServiceDecoratorExtension.ts | 2 +- .../signature/SignatureDecorator.ts | 4 +- .../signature/SignatureDecoratorUtils.test.ts | 9 +- .../signature/SignatureDecoratorUtils.ts | 11 +- .../decorators/thread/ThreadDecorator.test.ts | 2 +- .../src/decorators/thread/ThreadDecorator.ts | 2 +- .../thread/ThreadDecoratorExtension.ts | 2 +- .../decorators/timing/TimingDecorator.test.ts | 2 +- .../src/decorators/timing/TimingDecorator.ts | 0 .../timing/TimingDecoratorExtension.ts | 2 +- .../transport/TransportDecorator.test.ts | 4 +- .../transport/TransportDecorator.ts | 2 +- .../transport/TransportDecoratorExtension.ts | 2 +- .../src/errors}/MessageSendingError.ts | 4 +- packages/didcomm/src/errors/index.ts | 2 + .../problem-reports}/ProblemReportError.ts | 5 +- .../src/errors/problem-reports}/index.ts | 0 .../src}/getOutboundMessageContext.ts | 27 +- .../src/handlers}/MessageHandler.ts | 4 +- .../src/handlers}/MessageHandlerMiddleware.ts | 2 +- packages/didcomm/src/handlers/index.ts | 2 + packages/didcomm/src/index.ts | 44 + .../src/messages/common}/AckMessage.ts | 4 +- packages/didcomm/src/messages/common/index.ts | 1 + packages/didcomm/src/messages/index.ts | 2 + .../problem-reports}/ProblemReportMessage.ts | 4 +- .../src/messages/problem-reports}/index.ts | 0 .../src}/models/InboundMessageContext.ts | 11 +- .../src}/models/OutboundMessageContext.ts | 11 +- .../src}/models/OutboundMessageSendStatus.ts | 0 packages/didcomm/src/models/Routing.ts | 8 + .../src}/models/features/Feature.ts | 4 +- .../src}/models/features/FeatureQuery.ts | 0 .../src}/models/features/GoalCode.ts | 0 .../models/features/GovernanceFramework.ts | 0 .../src}/models/features/Protocol.ts | 0 .../src}/models/features/index.ts | 0 .../src/agent => didcomm/src}/models/index.ts | 2 + .../problem-reports}/ProblemReportReason.ts | 0 .../src/models/problem-reports}/index.ts | 0 .../basic-messages/BasicMessageEvents.ts | 2 +- .../basic-messages/BasicMessageRole.ts | 0 .../basic-messages/BasicMessagesApi.ts | 14 +- .../basic-messages/BasicMessagesModule.ts | 13 +- .../__tests__/BasicMessageService.test.ts | 8 +- .../__tests__/BasicMessagesModule.test.ts | 27 + .../__tests__/basic-messages.test.ts | 56 +- .../handlers/BasicMessageHandler.ts | 2 +- .../modules/basic-messages/handlers/index.ts | 0 .../src/modules/basic-messages/index.ts | 0 .../basic-messages/messages/BasicMessage.ts | 6 +- .../modules/basic-messages/messages/index.ts | 0 .../repository/BasicMessageRecord.ts | 7 +- .../repository/BasicMessageRepository.ts | 6 +- .../basic-messages/repository/index.ts | 0 .../services/BasicMessageService.ts | 11 +- .../modules/basic-messages/services/index.ts | 0 .../modules/connections/ConnectionEvents.ts | 4 +- .../src/modules/connections/ConnectionsApi.ts | 23 +- .../modules/connections/ConnectionsModule.ts | 12 +- .../connections/ConnectionsModuleConfig.ts | 2 +- .../connections/DidExchangeProtocol.ts | 50 +- .../connections/DidExchangeStateMachine.ts | 7 +- .../modules/connections/TrustPingEvents.ts | 4 +- .../ConnectionInvitationMessage.test.ts | 6 +- .../ConnectionRequestMessage.test.ts | 4 +- .../__tests__/ConnectionService.test.ts | 49 +- .../__tests__/ConnectionsModule.test.ts | 56 + .../__tests__/ConnectionsModuleConfig.test.ts | 0 .../__tests__/InMemoryDidRegistry.ts | 6 +- .../__tests__/connection-manual.test.ts | 39 +- .../connections/__tests__/did-rotate.test.ts | 111 +- .../__tests__/didexchange-numalgo.test.ts | 31 +- .../connections/__tests__/helpers.test.ts | 2 +- .../errors/ConnectionProblemReportError.ts | 4 +- .../errors/ConnectionProblemReportReason.ts | 0 .../errors/DidExchangeProblemReportError.ts | 4 +- .../errors/DidExchangeProblemReportReason.ts | 0 .../src/modules/connections/errors/index.ts | 0 .../connections/handlers/AckMessageHandler.ts | 6 +- .../ConnectionProblemReportHandler.ts | 2 +- .../handlers/ConnectionRequestHandler.ts | 14 +- .../handlers/ConnectionResponseHandler.ts | 11 +- .../handlers/DidExchangeCompleteHandler.ts | 6 +- .../handlers/DidExchangeRequestHandler.ts | 12 +- .../handlers/DidExchangeResponseHandler.ts | 12 +- .../handlers/DidRotateAckHandler.ts | 2 +- .../connections/handlers/DidRotateHandler.ts | 8 +- .../handlers/DidRotateProblemReportHandler.ts | 2 +- .../connections/handlers/HangupHandler.ts | 2 +- .../handlers/TrustPingMessageHandler.ts | 8 +- .../TrustPingResponseMessageHandler.ts | 4 +- .../src/modules/connections/handlers/index.ts | 0 .../src/modules/connections/index.ts | 4 +- .../messages/ConnectionInvitationMessage.ts | 8 +- .../ConnectionProblemReportMessage.ts | 6 +- .../messages/ConnectionRequestMessage.ts | 4 +- .../messages/ConnectionResponseMessage.ts | 4 +- .../messages/DidExchangeCompleteMessage.ts | 4 +- .../DidExchangeProblemReportMessage.ts | 6 +- .../messages/DidExchangeRequestMessage.ts | 4 +- .../messages/DidExchangeResponseMessage.ts | 4 +- .../messages/DidRotateAckMessage.ts | 6 +- .../connections/messages/DidRotateMessage.ts | 4 +- .../messages/DidRotateProblemReportMessage.ts | 6 +- .../connections/messages/HangupMessage.ts | 4 +- .../connections/messages/TrustPingMessage.ts | 4 +- .../messages/TrustPingResponseMessage.ts | 4 +- .../src/modules/connections/messages/index.ts | 0 .../modules/connections/models/Connection.ts | 0 .../connections/models/ConnectionRole.ts | 0 .../connections/models/ConnectionState.ts | 0 .../connections/models/ConnectionType.ts | 0 .../connections/models/DidExchangeRole.ts | 0 .../connections/models/DidExchangeState.ts | 0 .../connections/models/DidRotateRole.ts | 0 .../connections/models/HandshakeProtocol.ts | 0 .../connections/models/InvitationDetails.ts | 0 .../models/__tests__/ConnectionState.test.ts | 0 .../modules/connections/models/did/DidDoc.ts | 5 +- .../did/__tests__/Authentication.test.ts | 0 .../models/did/__tests__/DidDoc.test.ts | 2 +- .../models/did/__tests__/PublicKey.test.ts | 0 .../models/did/__tests__/diddoc.json | 0 .../did/authentication/Authentication.ts | 0 .../authentication/EmbeddedAuthentication.ts | 0 .../ReferencedAuthentication.ts | 0 .../models/did/authentication/index.ts | 2 +- .../modules/connections/models/did/index.ts | 0 .../models/did/publicKey/Ed25119Sig2018.ts | 0 .../did/publicKey/EddsaSaSigSecp256k1.ts | 0 .../models/did/publicKey/PublicKey.ts | 0 .../models/did/publicKey/RsaSig2018.ts | 0 .../connections/models/did/publicKey/index.ts | 0 .../src/modules/connections/models/index.ts | 0 .../repository/ConnectionMetadataTypes.ts | 0 .../repository/ConnectionRecord.ts | 10 +- .../repository/ConnectionRepository.ts | 8 +- .../__tests__/ConnectionRecord.test.ts | 2 +- .../modules/connections/repository/index.ts | 0 .../connections/services/ConnectionService.ts | 66 +- .../connections/services/DidRotateService.ts | 27 +- .../connections/services/TrustPingService.ts | 10 +- .../modules/connections/services/helpers.ts | 16 +- .../src/modules/connections/services/index.ts | 0 .../modules/credentials/CredentialEvents.ts | 2 +- .../src/modules/credentials/CredentialsApi.ts | 21 +- .../credentials/CredentialsApiOptions.ts | 0 .../modules/credentials/CredentialsModule.ts | 19 +- .../credentials/CredentialsModuleConfig.ts | 0 .../__tests__/CredentialsModule.test.ts | 64 +- .../__tests__/CredentialsModuleConfig.test.ts | 0 .../modules/credentials/__tests__/fixtures.ts | 0 .../credentials/formats/CredentialFormat.ts | 0 .../formats/CredentialFormatService.ts | 2 +- .../formats/CredentialFormatServiceOptions.ts | 0 .../DataIntegrityCredentialFormat.ts | 4 +- .../dataIntegrity/dataIntegrityExchange.ts | 5 +- .../formats/dataIntegrity/index.ts | 0 .../src/modules/credentials/formats/index.ts | 0 .../formats/jsonld/JsonLdCredentialDetail.ts | 3 +- .../jsonld/JsonLdCredentialDetailOptions.ts | 0 .../formats/jsonld/JsonLdCredentialFormat.ts | 4 +- .../jsonld/JsonLdCredentialFormatService.ts | 27 +- .../JsonLdCredentialFormatService.test.ts | 28 +- .../credentials/formats/jsonld/index.ts | 0 .../src/modules/credentials/index.ts | 0 .../models/CredentialAutoAcceptType.ts | 0 .../models/CredentialFormatSpec.ts | 5 +- .../models/CredentialPreviewAttribute.ts | 3 +- .../models/CredentialProblemReportReason.ts | 0 .../credentials/models/CredentialRole.ts | 0 .../credentials/models/CredentialState.ts | 0 .../models/RevocationNotification.ts | 0 .../models/__tests__/CredentialState.test.ts | 0 .../src/modules/credentials/models/index.ts | 0 .../protocol/BaseCredentialProtocol.ts | 20 +- .../protocol/CredentialProtocol.ts | 15 +- .../protocol/CredentialProtocolOptions.ts | 4 +- .../src/modules/credentials/protocol/index.ts | 0 .../V1RevocationNotificationHandler.ts | 2 +- .../V2RevocationNotificationHandler.ts | 2 +- .../revocation-notification/handlers/index.ts | 0 .../protocol/revocation-notification/index.ts | 0 .../V1RevocationNotificationMessage.ts | 7 +- .../V2RevocationNotificationMessage.ts | 7 +- .../revocation-notification/messages/index.ts | 0 .../services/RevocationNotificationService.ts | 15 +- .../RevocationNotificationServiceOptions.ts | 0 .../RevocationNotificationService.test.ts | 21 +- .../revocation-notification/services/index.ts | 0 .../__tests__/revocationIdentifier.test.ts | 0 .../util/revocationIdentifier.ts | 0 .../v2/CredentialFormatCoordinator.ts | 7 +- .../protocol/v2/V2CredentialProtocol.ts | 34 +- .../V2CredentialProtocolCred.test.ts | 33 +- .../V2CredentialProtocolOffer.test.ts | 26 +- .../v2-connectionless-credentials.test.ts | 37 +- .../v2-credentials-auto-accept.test.ts | 26 +- .../v2/__tests__/v2-credentials.e2e.test.ts | 70 +- ...ldproof.connectionless-credentials.test.ts | 27 +- ...v2.ldproof.credentials-auto-accept.test.ts | 76 +- ...edentials.propose-offerED25519.e2e.test.ts | 53 +- .../errors/V2CredentialProblemReportError.ts | 4 +- .../credentials/protocol/v2/errors/index.ts | 0 .../v2/handlers/V2CredentialAckHandler.ts | 2 +- .../V2CredentialProblemReportHandler.ts | 2 +- .../v2/handlers/V2IssueCredentialHandler.ts | 9 +- .../v2/handlers/V2OfferCredentialHandler.ts | 6 +- .../v2/handlers/V2ProposeCredentialHandler.ts | 6 +- .../v2/handlers/V2RequestCredentialHandler.ts | 9 +- .../credentials/protocol/v2/handlers/index.ts | 0 .../modules/credentials/protocol/v2/index.ts | 0 .../v2/messages/V2CredentialAckMessage.ts | 6 +- .../v2/messages/V2CredentialPreview.ts | 4 +- .../V2CredentialProblemReportMessage.ts | 6 +- .../v2/messages/V2IssueCredentialMessage.ts | 4 +- .../v2/messages/V2OfferCredentialMessage.ts | 4 +- .../v2/messages/V2ProposeCredentialMessage.ts | 4 +- .../v2/messages/V2RequestCredentialMessage.ts | 4 +- .../credentials/protocol/v2/messages/index.ts | 0 .../repository/CredentialExchangeRecord.ts | 8 +- .../repository/CredentialRepository.ts | 6 +- .../modules/credentials/repository/index.ts | 0 .../util/__tests__/previewAttributes.test.ts | 0 .../credentials/util/composeAutoAccept.ts | 0 .../credentials/util/previewAttributes.ts | 0 .../discover-features/DiscoverFeaturesApi.ts | 14 +- .../DiscoverFeaturesApiOptions.ts | 2 +- .../DiscoverFeaturesEvents.ts | 6 +- .../DiscoverFeaturesModule.ts | 12 +- .../DiscoverFeaturesModuleConfig.ts | 0 .../DiscoverFeaturesServiceOptions.ts | 4 +- .../__tests__/DiscoverFeaturesModule.test.ts | 41 + .../__tests__/FeatureRegistry.test.ts | 6 +- .../discover-features/__tests__/helpers.ts | 0 .../__tests__/v1-discover-features.test.ts | 10 +- .../__tests__/v2-discover-features.test.ts | 31 +- .../src/modules/discover-features/index.ts | 0 .../discover-features/protocol/index.ts | 0 .../protocol/v1/V1DiscoverFeaturesService.ts | 17 +- .../V1DiscoverFeaturesService.test.ts | 19 +- .../v1/handlers/V1DiscloseMessageHandler.ts | 2 +- .../v1/handlers/V1QueryMessageHandler.ts | 4 +- .../protocol/v1/handlers/index.ts | 0 .../discover-features/protocol/v1/index.ts | 0 .../protocol/v1/messages/DiscloseMessage.ts | 4 +- .../protocol/v1/messages/QueryMessage.ts | 4 +- .../protocol/v1/messages/index.ts | 0 .../protocol/v2/V2DiscoverFeaturesService.ts | 12 +- .../V2DiscoverFeaturesService.test.ts | 16 +- .../handlers/V2DisclosuresMessageHandler.ts | 2 +- .../v2/handlers/V2QueriesMessageHandler.ts | 4 +- .../protocol/v2/handlers/index.ts | 0 .../discover-features/protocol/v2/index.ts | 0 .../v2/messages/V2DisclosuresMessage.ts | 6 +- .../protocol/v2/messages/V2QueriesMessage.ts | 8 +- .../protocol/v2/messages/index.ts | 0 .../services/DiscoverFeaturesService.ts | 9 +- .../discover-features/services/index.ts | 0 packages/didcomm/src/modules/index.ts | 8 + .../message-pickup/MessagePickupApi.ts | 15 +- .../message-pickup/MessagePickupApiOptions.ts | 0 .../message-pickup/MessagePickupEvents.ts | 4 +- .../message-pickup/MessagePickupModule.ts | 23 +- .../MessagePickupModuleConfig.ts | 0 .../message-pickup/MessagePickupSession.ts | 0 .../__tests__/MessagePickupModule.test.ts | 71 + .../message-pickup/__tests__/pickup.test.ts | 103 +- .../src/modules/message-pickup/index.ts | 0 .../protocol/BaseMessagePickupProtocol.ts | 10 +- .../protocol/MessagePickupProtocol.ts | 10 +- .../protocol/MessagePickupProtocolOptions.ts | 4 +- .../modules/message-pickup/protocol/index.ts | 0 .../protocol/v1/V1MessagePickupProtocol.ts | 26 +- .../protocol/v1/handlers/V1BatchHandler.ts | 4 +- .../v1/handlers/V1BatchPickupHandler.ts | 2 +- .../protocol/v1/handlers/index.ts | 0 .../message-pickup/protocol/v1/index.ts | 0 .../protocol/v1/messages/V1BatchMessage.ts | 10 +- .../v1/messages/V1BatchPickupMessage.ts | 4 +- .../protocol/v1/messages/index.ts | 0 .../protocol/v2/V2MessagePickupProtocol.ts | 28 +- .../__tests__/V2MessagePickupProtocol.test.ts | 25 +- .../v2/handlers/V2DeliveryRequestHandler.ts | 4 +- .../handlers/V2LiveDeliveryChangeHandler.ts | 4 +- .../v2/handlers/V2MessageDeliveryHandler.ts | 6 +- .../v2/handlers/V2MessagesReceivedHandler.ts | 4 +- .../protocol/v2/handlers/V2StatusHandler.ts | 6 +- .../v2/handlers/V2StatusRequestHandler.ts | 4 +- .../protocol/v2/handlers/index.ts | 0 .../message-pickup/protocol/v2/index.ts | 0 .../v2/messages/V2DeliveryRequestMessage.ts | 4 +- .../messages/V2LiveDeliveryChangeMessage.ts | 4 +- .../v2/messages/V2MessageDeliveryMessage.ts | 4 +- .../v2/messages/V2MessagesReceivedMessage.ts | 4 +- .../protocol/v2/messages/V2StatusMessage.ts | 6 +- .../v2/messages/V2StatusRequestMessage.ts | 4 +- .../protocol/v2/messages/index.ts | 0 .../services/MessagePickupSessionService.ts | 9 +- .../modules/message-pickup/services/index.ts | 0 .../InMemoryMessagePickupRepository.ts | 7 +- .../storage/MessagePickupRepository.ts | 0 .../storage/MessagePickupRepositoryOptions.ts | 0 .../message-pickup/storage/QueuedMessage.ts | 0 .../modules/message-pickup/storage/index.ts | 0 .../src/modules/oob/OutOfBandApi.ts | 60 +- .../src/modules/oob/OutOfBandModule.ts | 12 +- .../src/modules/oob/OutOfBandService.ts | 20 +- .../oob/__tests__/OutOfBandInvitation.test.ts | 8 +- .../oob/__tests__/OutOfBandModule.test.ts | 11 +- .../oob/__tests__/OutOfBandService.test.ts | 14 +- .../oob/__tests__/connect-to-self.test.ts | 45 +- .../src/modules/oob/__tests__/helpers.test.ts | 4 +- .../modules/oob/__tests__/implicit.test.ts | 70 +- .../src/modules/oob/converters.ts} | 39 +- .../oob/domain/OutOfBandDidCommService.ts | 6 +- .../src/modules/oob/domain/OutOfBandEvents.ts | 2 +- .../src/modules/oob/domain/OutOfBandRole.ts | 0 .../src/modules/oob/domain/OutOfBandState.ts | 0 .../src/modules/oob/domain/index.ts | 0 .../handlers/HandshakeReuseAcceptedHandler.ts | 4 +- .../oob/handlers/HandshakeReuseHandler.ts | 6 +- .../src/modules/oob/handlers/index.ts | 0 packages/didcomm/src/modules/oob/helpers.ts | 53 + .../src/modules/oob/index.ts | 0 .../messages/HandshakeReuseAcceptedMessage.ts | 4 +- .../oob/messages/HandshakeReuseMessage.ts | 4 +- .../oob/messages/OutOfBandInvitation.ts | 11 +- .../src/modules/oob/messages/index.ts | 1 + .../modules/oob/repository/OutOfBandRecord.ts | 10 +- .../oob/repository/OutOfBandRepository.ts | 6 +- .../__tests__/OutOfBandRecord.test.ts | 2 +- .../src/modules/oob/repository/index.ts | 0 .../outOfBandRecordMetadataTypes.ts | 0 .../src/modules/proofs/ProofEvents.ts | 2 +- .../src/modules/proofs/ProofsApi.ts | 14 +- .../src/modules/proofs/ProofsApiOptions.ts | 0 .../src/modules/proofs/ProofsModule.ts | 16 +- .../src/modules/proofs/ProofsModuleConfig.ts | 0 .../proofs/__tests__/ProofsModule.test.ts | 34 +- .../__tests__/ProofsModuleConfig.test.ts | 0 .../errors/PresentationProblemReportReason.ts | 0 .../src/modules/proofs/errors/index.ts | 0 .../src/modules/proofs/formats/ProofFormat.ts | 0 .../proofs/formats/ProofFormatService.ts | 2 +- .../formats/ProofFormatServiceOptions.ts | 0 .../DifPresentationExchangeProofFormat.ts | 6 +- ...fPresentationExchangeProofFormatService.ts | 39 +- ...entationExchangeProofFormatService.test.ts | 14 +- .../dif-presentation-exchange/index.ts | 0 .../src/modules/proofs/formats/index.ts | 0 .../src/modules/proofs/index.ts | 0 .../proofs/models/ProofAutoAcceptType.ts | 0 .../modules/proofs/models/ProofFormatSpec.ts | 5 +- .../src/modules/proofs/models/ProofRole.ts | 0 .../src/modules/proofs/models/ProofState.ts | 0 .../models/__tests__/ProofState.test.ts | 0 .../src/modules/proofs/models/index.ts | 0 .../proofs/protocol/BaseProofProtocol.ts | 20 +- .../modules/proofs/protocol/ProofProtocol.ts | 15 +- .../proofs/protocol/ProofProtocolOptions.ts | 2 +- .../src/modules/proofs/protocol/index.ts | 0 .../protocol/v2/ProofFormatCoordinator.ts | 7 +- .../proofs/protocol/v2/V2ProofProtocol.ts | 30 +- .../v2/__tests__/V2ProofProtocol.test.ts | 20 +- .../proofs/protocol/v2/__tests__/fixtures.ts | 0 ...2-anoncreds-unqualified-proofs.e2e.test.ts | 63 +- .../v2-indy-connectionless-proofs.e2e.test.ts | 97 +- .../v2-indy-proof-negotiation.e2e.test.ts | 26 +- .../v2-indy-proof-presentation.e2e.test.ts | 20 +- .../v2-indy-proof-request.e2e.test.ts | 14 +- .../v2-indy-proofs-auto-accept.e2e.test.ts | 16 +- .../v2/__tests__/v2-indy-proofs.e2e.test.ts | 55 +- ...presentation-exchange-presentation.test.ts | 38 +- .../V2PresentationProblemReportError.ts | 4 +- .../proofs/protocol/v2/errors/index.ts | 0 .../v2/handlers/V2PresentationAckHandler.ts | 2 +- .../v2/handlers/V2PresentationHandler.ts | 6 +- .../V2PresentationProblemReportHandler.ts | 2 +- .../handlers/V2ProposePresentationHandler.ts | 4 +- .../handlers/V2RequestPresentationHandler.ts | 4 +- .../src/modules/proofs/protocol/v2/index.ts | 0 .../v2/messages/V2PresentationAckMessage.ts | 4 +- .../v2/messages/V2PresentationMessage.ts | 8 +- .../V2PresentationProblemReportMessage.ts | 4 +- .../messages/V2ProposePresentationMessage.ts | 8 +- .../messages/V2RequestPresentationMessage.ts | 8 +- .../proofs/protocol/v2/messages/index.ts | 0 .../proofs/repository/ProofExchangeRecord.ts | 8 +- .../proofs/repository/ProofRepository.ts | 8 +- .../src/modules/proofs/repository/index.ts | 0 .../modules/proofs/utils/composeAutoAccept.ts | 0 .../src/modules/proofs/utils/index.ts | 0 .../modules/routing/MediationRecipientApi.ts | 83 +- .../routing/MediationRecipientModule.ts | 13 +- .../routing/MediationRecipientModuleConfig.ts | 0 .../src/modules/routing/MediatorApi.ts | 25 +- .../src/modules/routing/MediatorModule.ts | 23 +- .../modules/routing/MediatorModuleConfig.ts | 0 .../modules/routing/MediatorPickupStrategy.ts | 0 .../routing/MessageForwardingStrategy.ts | 0 .../src/modules/routing/RoutingEvents.ts | 4 +- .../MediationRecipientModule.test.ts | 12 +- .../routing/__tests__/MediatorModule.test.ts | 11 +- .../routing/__tests__/mediation.test.ts | 143 +- .../error/RoutingProblemReportReason.ts | 0 .../src/modules/routing/error/index.ts | 0 .../routing/handlers/ForwardHandler.ts | 2 +- .../routing/handlers/KeylistUpdateHandler.ts | 4 +- .../handlers/KeylistUpdateResponseHandler.ts | 2 +- .../routing/handlers/MediationDenyHandler.ts | 2 +- .../routing/handlers/MediationGrantHandler.ts | 2 +- .../handlers/MediationRequestHandler.ts | 4 +- .../src/modules/routing/handlers/index.ts | 0 .../src/modules/routing/index.ts | 1 + .../routing/messages/ForwardMessage.ts | 4 +- .../routing/messages/KeylistMessage.ts | 4 +- .../routing/messages/KeylistUpdateMessage.ts | 4 +- .../messages/KeylistUpdateResponseMessage.ts | 4 +- .../routing/messages/MediationDenyMessage.ts | 4 +- .../routing/messages/MediationGrantMessage.ts | 4 +- .../messages/MediationRequestMessage.ts | 4 +- .../src/modules/routing/messages/index.ts | 0 .../modules/routing/models/MediationRole.ts | 0 .../modules/routing/models/MediationState.ts | 0 .../src/modules/routing/models/index.ts | 0 .../routing/repository/MediationRecord.ts | 6 +- .../routing/repository/MediationRepository.ts | 8 +- .../repository/MediatorRoutingRecord.ts | 7 +- .../repository/MediatorRoutingRepository.ts | 6 +- .../src/modules/routing/repository/index.ts | 0 .../services/MediationRecipientService.ts | 37 +- .../routing/services/MediatorService.ts | 41 +- .../routing/services/RoutingService.ts | 14 +- .../MediationRecipientService.test.ts | 26 +- .../__tests__/MediatorService.test.ts | 11 +- .../services/__tests__/RoutingService.test.ts | 10 +- .../src/modules/routing/services/helpers.ts | 3 +- .../src/modules/routing/services/index.ts | 0 .../src/repository}/DidCommMessageRecord.ts | 15 +- .../repository}/DidCommMessageRepository.ts | 13 +- .../src/repository}/DidCommMessageRole.ts | 0 .../__tests__/DidCommMessageRecord.test.ts | 5 +- .../DidCommMessageRepository.test.ts | 13 +- .../src/repository}/index.ts | 2 +- .../src}/services/DidCommDocumentService.ts | 20 +- .../__tests__/DidCommDocumentService.test.ts | 18 +- .../didcomm => didcomm/src}/services/index.ts | 0 .../src/transport/HttpOutboundTransport.ts | 40 +- .../src/transport/InboundTransport.ts | 4 +- .../src/transport/OutboundTransport.ts | 4 +- .../src/transport/TransportEventTypes.ts | 4 +- .../src/transport/WsOutboundTransport.ts | 32 +- .../{core => didcomm}/src/transport/index.ts | 0 packages/didcomm/src/types.ts | 52 + .../didPeer4kgVt6CidfKgo1MoWMqsQX.json | 0 .../didPeerR1xKJw17sUoXhejEpugMYJ.json | 0 .../legacyDidPeer4kgVt6CidfKgo1MoWMqsQX.json | 0 .../legacyDidPeerR1xKJw17sUoXhejEpugMYJ.json | 0 .../0.1-0.2/__tests__/connection.test.ts | 32 +- .../0.1-0.2/__tests__/credential.test.ts | 24 +- .../0.1-0.2/__tests__/mediation.test.ts | 14 +- .../src}/updates/0.1-0.2/connection.ts | 34 +- .../src}/updates/0.1-0.2/credential.ts | 17 +- .../src}/updates/0.1-0.2/index.ts | 9 +- .../src}/updates/0.1-0.2/mediation.ts | 7 +- .../0.2-0.3/__tests__/connection.test.ts | 30 +- .../updates/0.2-0.3/__tests__/proof.test.ts | 20 +- .../src}/updates/0.2-0.3/connection.ts | 8 +- .../src}/updates/0.2-0.3/index.ts | 2 +- .../src}/updates/0.2-0.3/proof.ts | 10 +- .../credentialExchangeRecord.test.ts | 24 +- .../__tests__/proofExchangeRecord.test.ts | 17 +- .../0.4-0.5/credentialExchangeRecord.ts | 13 +- packages/didcomm/src/updates/0.4-0.5/index.ts | 9 + .../updates/0.4-0.5/proofExchangeRecord.ts | 17 +- .../src/utils => didcomm/src/util}/JWE.ts | 0 .../src/util}/LinkedAttachment.ts | 0 .../src/util}/__tests__/JWE.test.ts | 0 .../util/__tests__/matchingEd25519Key.test.ts | 6 +- .../src/util}/__tests__/messageType.test.ts | 2 +- .../util}/__tests__/parseInvitation.test.ts | 9 +- .../utils => didcomm/src/util}/attachment.ts | 8 +- .../src}/util/matchingEd25519Key.ts | 6 +- .../utils => didcomm/src/util}/messageType.ts | 0 packages/didcomm/src/util/modules.ts | 60 + .../src/util}/parseInvitation.ts | 13 +- .../src/utils => didcomm/src/util}/thread.ts | 0 packages/didcomm/src/util/transformers.ts | 18 + packages/didcomm/tests/setup.ts | 25 + packages/didcomm/tsconfig.build.json | 7 + packages/didcomm/tsconfig.json | 6 + packages/didcomm/types/jest.d.ts | 9 + packages/drpc/package.json | 1 + packages/drpc/src/DrpcApi.ts | 12 +- packages/drpc/src/DrpcModule.ts | 12 +- .../src/__tests__/DrpcMessageService.test.ts | 3 +- .../src/__tests__/DrpcMessagesModule.test.ts | 42 +- .../drpc/src/handlers/DrpcRequestHandler.ts | 2 +- .../drpc/src/handlers/DrpcResponseHandler.ts | 2 +- .../drpc/src/messages/DrpcRequestMessage.ts | 2 +- .../drpc/src/messages/DrpcResponseMessage.ts | 2 +- packages/drpc/src/services/DrpcService.ts | 3 +- packages/drpc/tests/drpc-messages.e2e.test.ts | 4 +- .../indy-vdr-anoncreds-registry.e2e.test.ts | 2 + .../tests/indy-vdr-did-registrar.e2e.test.ts | 2 + .../indy-vdr-indy-did-resolver.e2e.test.ts | 1 + .../indy-vdr-sov-did-resolver.e2e.test.ts | 1 + packages/node/package.json | 1 + .../src/transport/HttpInboundTransport.ts | 24 +- .../node/src/transport/WsInboundTransport.ts | 32 +- packages/question-answer/package.json | 1 + .../question-answer/src/QuestionAnswerApi.ts | 13 +- .../src/QuestionAnswerModule.ts | 9 +- .../__tests__/QuestionAnswerModule.test.ts | 23 +- .../__tests__/QuestionAnswerService.test.ts | 3 +- .../src/handlers/AnswerMessageHandler.ts | 2 +- .../src/handlers/QuestionMessageHandler.ts | 2 +- .../src/messages/AnswerMessage.ts | 2 +- .../src/messages/QuestionMessage.ts | 2 +- .../src/services/QuestionAnswerService.ts | 3 +- .../tests/question-answer.test.ts | 8 +- packages/tenants/package.json | 1 + .../src/context/TenantAgentContextProvider.ts | 11 +- packages/tenants/src/models/TenantConfig.ts | 3 +- .../services/__tests__/TenantService.test.ts | 6 +- .../tenants/src/updates/__tests__/0.4.test.ts | 10 +- .../tenants/tests/tenant-sessions.test.ts | 6 +- .../tests/tenants-storage-update.test.ts | 12 +- packages/tenants/tests/tenants.test.ts | 112 +- pnpm-lock.yaml | 5771 +++++++---------- samples/extension-module/dummy/DummyApi.ts | 9 +- samples/extension-module/dummy/DummyModule.ts | 22 +- .../dummy/handlers/DummyRequestHandler.ts | 4 +- .../dummy/handlers/DummyResponseHandler.ts | 2 +- .../dummy/messages/DummyRequestMessage.ts | 2 +- .../dummy/messages/DummyResponseMessage.ts | 2 +- .../dummy/services/DummyService.ts | 3 +- samples/extension-module/package.json | 1 + samples/extension-module/requester.ts | 24 +- samples/extension-module/responder.ts | 16 +- samples/extension-module/tests/dummy.test.ts | 16 +- samples/mediator.ts | 26 +- ...2e-askar-indy-vdr-anoncreds-rs.e2e.test.ts | 17 +- tests/e2e-http.e2e.test.ts | 17 +- tests/e2e-subject.e2e.test.ts | 17 +- tests/e2e-test.ts | 16 +- tests/e2e-ws-pickup-v2.e2e.test.ts | 36 +- tests/e2e-ws.e2e.test.ts | 17 +- tests/transport/SubjectInboundTransport.ts | 22 +- tests/transport/SubjectOutboundTransport.ts | 18 +- 770 files changed, 7538 insertions(+), 7920 deletions(-) create mode 100644 .changeset/purple-donkeys-camp.md delete mode 100644 packages/core/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts delete mode 100644 packages/core/src/modules/common/index.ts delete mode 100644 packages/core/src/modules/connections/__tests__/ConnectionsModule.test.ts delete mode 100644 packages/core/src/modules/didcomm/index.ts delete mode 100644 packages/core/src/modules/didcomm/types.ts delete mode 100644 packages/core/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts delete mode 100644 packages/core/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts delete mode 100644 packages/core/src/modules/problem-reports/index.ts create mode 100644 packages/didcomm/README.md create mode 100644 packages/didcomm/jest.config.ts create mode 100644 packages/didcomm/package.json rename packages/{core/src/agent => didcomm/src}/AgentMessage.ts (71%) rename packages/{core/src/agent => didcomm/src}/BaseMessage.ts (76%) create mode 100644 packages/didcomm/src/DidCommApi.ts create mode 100644 packages/didcomm/src/DidCommModule.ts create mode 100644 packages/didcomm/src/DidCommModuleConfig.ts rename packages/{core/src/agent => didcomm/src}/Dispatcher.ts (83%) rename packages/{core/src/agent => didcomm/src}/EnvelopeService.ts (81%) create mode 100644 packages/didcomm/src/Events.ts rename packages/{core/src/agent => didcomm/src}/FeatureRegistry.ts (97%) rename packages/{core/src/agent => didcomm/src}/MessageHandlerRegistry.ts (86%) rename packages/{core/src/agent => didcomm/src}/MessageReceiver.ts (92%) rename packages/{core/src/agent => didcomm/src}/MessageSender.ts (92%) rename packages/{core/src/agent => didcomm/src}/TransportService.ts (90%) rename packages/{core/src/agent => didcomm/src}/__tests__/AgentMessage.test.ts (93%) create mode 100644 packages/didcomm/src/__tests__/DidCommConfig.test.ts rename packages/{core/src/agent => didcomm/src}/__tests__/Dispatcher.test.ts (88%) rename packages/{core/src/agent => didcomm/src}/__tests__/EventEmitter.test.ts (91%) rename packages/{core/src/agent => didcomm/src}/__tests__/MessageHandlerRegistry.test.ts (97%) rename packages/{core/src/agent => didcomm/src}/__tests__/MessageSender.test.ts (94%) rename packages/{core/src/agent => didcomm/src}/__tests__/TransportService.test.ts (87%) rename packages/{core/src/agent => didcomm/src}/__tests__/stubs.ts (100%) create mode 100644 packages/didcomm/src/constants.ts rename packages/{core => didcomm}/src/decorators/ack/AckDecorator.test.ts (91%) rename packages/{core => didcomm}/src/decorators/ack/AckDecorator.ts (100%) rename packages/{core => didcomm}/src/decorators/ack/AckDecoratorExtension.ts (92%) rename packages/{core => didcomm}/src/decorators/attachment/Attachment.ts (94%) rename packages/{core => didcomm}/src/decorators/attachment/AttachmentExtension.ts (93%) rename packages/{core => didcomm}/src/decorators/attachment/__tests__/Attachment.test.ts (91%) rename packages/{core => didcomm}/src/decorators/l10n/L10nDecorator.test.ts (88%) rename packages/{core => didcomm}/src/decorators/l10n/L10nDecorator.ts (100%) rename packages/{core => didcomm}/src/decorators/l10n/L10nDecoratorExtension.ts (91%) rename packages/{core => didcomm}/src/decorators/service/ServiceDecorator.test.ts (84%) rename packages/{core => didcomm}/src/decorators/service/ServiceDecorator.ts (88%) rename packages/{core => didcomm}/src/decorators/service/ServiceDecoratorExtension.ts (90%) rename packages/{core => didcomm}/src/decorators/signature/SignatureDecorator.ts (88%) rename packages/{core => didcomm}/src/decorators/signature/SignatureDecoratorUtils.test.ts (92%) rename packages/{core => didcomm}/src/decorators/signature/SignatureDecoratorUtils.ts (81%) rename packages/{core => didcomm}/src/decorators/thread/ThreadDecorator.test.ts (95%) rename packages/{core => didcomm}/src/decorators/thread/ThreadDecorator.ts (96%) rename packages/{core => didcomm}/src/decorators/thread/ThreadDecoratorExtension.ts (92%) rename packages/{core => didcomm}/src/decorators/timing/TimingDecorator.test.ts (96%) rename packages/{core => didcomm}/src/decorators/timing/TimingDecorator.ts (100%) rename packages/{core => didcomm}/src/decorators/timing/TimingDecoratorExtension.ts (91%) rename packages/{core => didcomm}/src/decorators/transport/TransportDecorator.test.ts (91%) rename packages/{core => didcomm}/src/decorators/transport/TransportDecorator.ts (95%) rename packages/{core => didcomm}/src/decorators/transport/TransportDecoratorExtension.ts (95%) rename packages/{core/src/error => didcomm/src/errors}/MessageSendingError.ts (77%) create mode 100644 packages/didcomm/src/errors/index.ts rename packages/{core/src/modules/problem-reports/errors => didcomm/src/errors/problem-reports}/ProblemReportError.ts (75%) rename packages/{core/src/modules/problem-reports/errors => didcomm/src/errors/problem-reports}/index.ts (100%) rename packages/{core/src/agent => didcomm/src}/getOutboundMessageContext.ts (93%) rename packages/{core/src/agent => didcomm/src/handlers}/MessageHandler.ts (89%) rename packages/{core/src/agent => didcomm/src/handlers}/MessageHandlerMiddleware.ts (92%) create mode 100644 packages/didcomm/src/handlers/index.ts create mode 100644 packages/didcomm/src/index.ts rename packages/{core/src/modules/common/messages => didcomm/src/messages/common}/AckMessage.ts (87%) create mode 100644 packages/didcomm/src/messages/common/index.ts create mode 100644 packages/didcomm/src/messages/index.ts rename packages/{core/src/modules/problem-reports/messages => didcomm/src/messages/problem-reports}/ProblemReportMessage.ts (95%) rename packages/{core/src/modules/problem-reports/messages => didcomm/src/messages/problem-reports}/index.ts (100%) rename packages/{core/src/agent => didcomm/src}/models/InboundMessageContext.ts (87%) rename packages/{core/src/agent => didcomm/src}/models/OutboundMessageContext.ts (85%) rename packages/{core/src/agent => didcomm/src}/models/OutboundMessageSendStatus.ts (100%) create mode 100644 packages/didcomm/src/models/Routing.ts rename packages/{core/src/agent => didcomm/src}/models/features/Feature.ts (92%) rename packages/{core/src/agent => didcomm/src}/models/features/FeatureQuery.ts (100%) rename packages/{core/src/agent => didcomm/src}/models/features/GoalCode.ts (100%) rename packages/{core/src/agent => didcomm/src}/models/features/GovernanceFramework.ts (100%) rename packages/{core/src/agent => didcomm/src}/models/features/Protocol.ts (100%) rename packages/{core/src/agent => didcomm/src}/models/features/index.ts (100%) rename packages/{core/src/agent => didcomm/src}/models/index.ts (71%) rename packages/{core/src/modules/problem-reports/models => didcomm/src/models/problem-reports}/ProblemReportReason.ts (100%) rename packages/{core/src/modules/problem-reports/models => didcomm/src/models/problem-reports}/index.ts (100%) rename packages/{core => didcomm}/src/modules/basic-messages/BasicMessageEvents.ts (88%) rename packages/{core => didcomm}/src/modules/basic-messages/BasicMessageRole.ts (100%) rename packages/{core => didcomm}/src/modules/basic-messages/BasicMessagesApi.ts (89%) rename packages/{core => didcomm}/src/modules/basic-messages/BasicMessagesModule.ts (66%) rename packages/{core => didcomm}/src/modules/basic-messages/__tests__/BasicMessageService.test.ts (93%) create mode 100644 packages/didcomm/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts rename packages/{core => didcomm}/src/modules/basic-messages/__tests__/basic-messages.test.ts (68%) rename packages/{core => didcomm}/src/modules/basic-messages/handlers/BasicMessageHandler.ts (95%) rename packages/{core => didcomm}/src/modules/basic-messages/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/basic-messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/basic-messages/messages/BasicMessage.ts (89%) rename packages/{core => didcomm}/src/modules/basic-messages/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/basic-messages/repository/BasicMessageRecord.ts (88%) rename packages/{core => didcomm}/src/modules/basic-messages/repository/BasicMessageRepository.ts (56%) rename packages/{core => didcomm}/src/modules/basic-messages/repository/index.ts (100%) rename packages/{core => didcomm}/src/modules/basic-messages/services/BasicMessageService.ts (89%) rename packages/{core => didcomm}/src/modules/basic-messages/services/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/ConnectionEvents.ts (85%) rename packages/{core => didcomm}/src/modules/connections/ConnectionsApi.ts (96%) rename packages/{core => didcomm}/src/modules/connections/ConnectionsModule.ts (81%) rename packages/{core => didcomm}/src/modules/connections/ConnectionsModuleConfig.ts (98%) rename packages/{core => didcomm}/src/modules/connections/DidExchangeProtocol.ts (95%) rename packages/{core => didcomm}/src/modules/connections/DidExchangeStateMachine.ts (94%) rename packages/{core => didcomm}/src/modules/connections/TrustPingEvents.ts (84%) rename packages/{core => didcomm}/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts (96%) rename packages/{core => didcomm}/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts (78%) rename packages/{core => didcomm}/src/modules/connections/__tests__/ConnectionService.test.ts (95%) create mode 100644 packages/didcomm/src/modules/connections/__tests__/ConnectionsModule.test.ts rename packages/{core => didcomm}/src/modules/connections/__tests__/ConnectionsModuleConfig.test.ts (100%) rename packages/{core => didcomm}/src/modules/connections/__tests__/InMemoryDidRegistry.ts (94%) rename packages/{core => didcomm}/src/modules/connections/__tests__/connection-manual.test.ts (78%) rename packages/{core => didcomm}/src/modules/connections/__tests__/did-rotate.test.ts (76%) rename packages/{core => didcomm}/src/modules/connections/__tests__/didexchange-numalgo.test.ts (86%) rename packages/{core => didcomm}/src/modules/connections/__tests__/helpers.test.ts (99%) rename packages/{core => didcomm}/src/modules/connections/errors/ConnectionProblemReportError.ts (84%) rename packages/{core => didcomm}/src/modules/connections/errors/ConnectionProblemReportReason.ts (100%) rename packages/{core => didcomm}/src/modules/connections/errors/DidExchangeProblemReportError.ts (84%) rename packages/{core => didcomm}/src/modules/connections/errors/DidExchangeProblemReportReason.ts (100%) rename packages/{core => didcomm}/src/modules/connections/errors/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/handlers/AckMessageHandler.ts (76%) rename packages/{core => didcomm}/src/modules/connections/handlers/ConnectionProblemReportHandler.ts (95%) rename packages/{core => didcomm}/src/modules/connections/handlers/ConnectionRequestHandler.ts (91%) rename packages/{core => didcomm}/src/modules/connections/handlers/ConnectionResponseHandler.ts (93%) rename packages/{core => didcomm}/src/modules/connections/handlers/DidExchangeCompleteHandler.ts (94%) rename packages/{core => didcomm}/src/modules/connections/handlers/DidExchangeRequestHandler.ts (93%) rename packages/{core => didcomm}/src/modules/connections/handlers/DidExchangeResponseHandler.ts (93%) rename packages/{core => didcomm}/src/modules/connections/handlers/DidRotateAckHandler.ts (94%) rename packages/{core => didcomm}/src/modules/connections/handlers/DidRotateHandler.ts (80%) rename packages/{core => didcomm}/src/modules/connections/handlers/DidRotateProblemReportHandler.ts (94%) rename packages/{core => didcomm}/src/modules/connections/handlers/HangupHandler.ts (94%) rename packages/{core => didcomm}/src/modules/connections/handlers/TrustPingMessageHandler.ts (85%) rename packages/{core => didcomm}/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts (84%) rename packages/{core => didcomm}/src/modules/connections/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/index.ts (86%) rename packages/{core => didcomm}/src/modules/connections/messages/ConnectionInvitationMessage.ts (94%) rename packages/{core => didcomm}/src/modules/connections/messages/ConnectionProblemReportMessage.ts (78%) rename packages/{core => didcomm}/src/modules/connections/messages/ConnectionRequestMessage.ts (95%) rename packages/{core => didcomm}/src/modules/connections/messages/ConnectionResponseMessage.ts (94%) rename packages/{core => didcomm}/src/modules/connections/messages/DidExchangeCompleteMessage.ts (91%) rename packages/{core => didcomm}/src/modules/connections/messages/DidExchangeProblemReportMessage.ts (75%) rename packages/{core => didcomm}/src/modules/connections/messages/DidExchangeRequestMessage.ts (95%) rename packages/{core => didcomm}/src/modules/connections/messages/DidExchangeResponseMessage.ts (95%) rename packages/{core => didcomm}/src/modules/connections/messages/DidRotateAckMessage.ts (78%) rename packages/{core => didcomm}/src/modules/connections/messages/DidRotateMessage.ts (92%) rename packages/{core => didcomm}/src/modules/connections/messages/DidRotateProblemReportMessage.ts (75%) rename packages/{core => didcomm}/src/modules/connections/messages/HangupMessage.ts (91%) rename packages/{core => didcomm}/src/modules/connections/messages/TrustPingMessage.ts (95%) rename packages/{core => didcomm}/src/modules/connections/messages/TrustPingResponseMessage.ts (95%) rename packages/{core => didcomm}/src/modules/connections/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/Connection.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/ConnectionRole.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/ConnectionState.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/ConnectionType.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/DidExchangeRole.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/DidExchangeState.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/DidRotateRole.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/HandshakeProtocol.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/InvitationDetails.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/__tests__/ConnectionState.test.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/DidDoc.ts (96%) rename packages/{core => didcomm}/src/modules/connections/models/did/__tests__/Authentication.test.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/__tests__/DidDoc.test.ts (99%) rename packages/{core => didcomm}/src/modules/connections/models/did/__tests__/PublicKey.test.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/__tests__/diddoc.json (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/authentication/Authentication.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/authentication/EmbeddedAuthentication.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/authentication/ReferencedAuthentication.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/authentication/index.ts (98%) rename packages/{core => didcomm}/src/modules/connections/models/did/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/publicKey/Ed25119Sig2018.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/publicKey/PublicKey.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/publicKey/RsaSig2018.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/did/publicKey/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/models/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/repository/ConnectionMetadataTypes.ts (100%) rename packages/{core => didcomm}/src/modules/connections/repository/ConnectionRecord.ts (94%) rename packages/{core => didcomm}/src/modules/connections/repository/ConnectionRepository.ts (77%) rename packages/{core => didcomm}/src/modules/connections/repository/__tests__/ConnectionRecord.test.ts (96%) rename packages/{core => didcomm}/src/modules/connections/repository/index.ts (100%) rename packages/{core => didcomm}/src/modules/connections/services/ConnectionService.ts (95%) rename packages/{core => didcomm}/src/modules/connections/services/DidRotateService.ts (94%) rename packages/{core => didcomm}/src/modules/connections/services/TrustPingService.ts (81%) rename packages/{core => didcomm}/src/modules/connections/services/helpers.ts (94%) rename packages/{core => didcomm}/src/modules/connections/services/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/CredentialEvents.ts (93%) rename packages/{core => didcomm}/src/modules/credentials/CredentialsApi.ts (97%) rename packages/{core => didcomm}/src/modules/credentials/CredentialsApiOptions.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/CredentialsModule.ts (79%) rename packages/{core => didcomm}/src/modules/credentials/CredentialsModuleConfig.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/__tests__/CredentialsModule.test.ts (64%) rename packages/{core => didcomm}/src/modules/credentials/__tests__/CredentialsModuleConfig.test.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/__tests__/fixtures.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/formats/CredentialFormat.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/formats/CredentialFormatService.ts (98%) rename packages/{core => didcomm}/src/modules/credentials/formats/CredentialFormatServiceOptions.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts (97%) rename packages/{core => didcomm}/src/modules/credentials/formats/dataIntegrity/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/formats/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts (91%) rename packages/{core => didcomm}/src/modules/credentials/formats/jsonld/JsonLdCredentialDetailOptions.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts (93%) rename packages/{core => didcomm}/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts (95%) rename packages/{core => didcomm}/src/modules/credentials/formats/jsonld/__tests__/JsonLdCredentialFormatService.test.ts (95%) rename packages/{core => didcomm}/src/modules/credentials/formats/jsonld/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/CredentialAutoAcceptType.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/CredentialFormatSpec.ts (81%) rename packages/{core => didcomm}/src/modules/credentials/models/CredentialPreviewAttribute.ts (92%) rename packages/{core => didcomm}/src/modules/credentials/models/CredentialProblemReportReason.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/CredentialRole.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/CredentialState.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/RevocationNotification.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/__tests__/CredentialState.test.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/models/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/BaseCredentialProtocol.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/protocol/CredentialProtocol.ts (90%) rename packages/{core => didcomm}/src/modules/credentials/protocol/CredentialProtocolOptions.ts (97%) rename packages/{core => didcomm}/src/modules/credentials/protocol/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts (86%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts (87%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts (92%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationServiceOptions.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts (93%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/services/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/util/__tests__/revocationIdentifier.test.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/revocation-notification/util/revocationIdentifier.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts (99%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts (98%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolCred.test.ts (96%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts (91%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts (85%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts (87%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts (84%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts (85%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts (89%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts (81%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/errors/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts (88%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts (88%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts (90%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts (86%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts (83%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts (91%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts (76%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts (95%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts (96%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts (96%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts (96%) rename packages/{core => didcomm}/src/modules/credentials/protocol/v2/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/repository/CredentialExchangeRecord.ts (94%) rename packages/{core => didcomm}/src/modules/credentials/repository/CredentialRepository.ts (58%) rename packages/{core => didcomm}/src/modules/credentials/repository/index.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/util/__tests__/previewAttributes.test.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/util/composeAutoAccept.ts (100%) rename packages/{core => didcomm}/src/modules/credentials/util/previewAttributes.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/DiscoverFeaturesApi.ts (93%) rename packages/{core => didcomm}/src/modules/discover-features/DiscoverFeaturesApiOptions.ts (95%) rename packages/{core => didcomm}/src/modules/discover-features/DiscoverFeaturesEvents.ts (80%) rename packages/{core => didcomm}/src/modules/discover-features/DiscoverFeaturesModule.ts (76%) rename packages/{core => didcomm}/src/modules/discover-features/DiscoverFeaturesModuleConfig.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts (72%) create mode 100644 packages/didcomm/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts rename packages/{core => didcomm}/src/modules/discover-features/__tests__/FeatureRegistry.test.ts (90%) rename packages/{core => didcomm}/src/modules/discover-features/__tests__/helpers.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/__tests__/v1-discover-features.test.ts (91%) rename packages/{core => didcomm}/src/modules/discover-features/__tests__/v2-discover-features.test.ts (89%) rename packages/{core => didcomm}/src/modules/discover-features/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts (87%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts (94%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts (94%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts (89%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts (94%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts (90%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v1/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts (88%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts (95%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts (94%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts (89%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts (86%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts (80%) rename packages/{core => didcomm}/src/modules/discover-features/protocol/v2/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/discover-features/services/DiscoverFeaturesService.ts (80%) rename packages/{core => didcomm}/src/modules/discover-features/services/index.ts (100%) create mode 100644 packages/didcomm/src/modules/index.ts rename packages/{core => didcomm}/src/modules/message-pickup/MessagePickupApi.ts (95%) rename packages/{core => didcomm}/src/modules/message-pickup/MessagePickupApiOptions.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/MessagePickupEvents.ts (87%) rename packages/{core => didcomm}/src/modules/message-pickup/MessagePickupModule.ts (75%) rename packages/{core => didcomm}/src/modules/message-pickup/MessagePickupModuleConfig.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/MessagePickupSession.ts (100%) create mode 100644 packages/didcomm/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts rename packages/{core => didcomm}/src/modules/message-pickup/__tests__/pickup.test.ts (68%) rename packages/{core => didcomm}/src/modules/message-pickup/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts (76%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/MessagePickupProtocol.ts (70%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts (86%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts (84%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts (89%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts (94%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts (86%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts (92%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v1/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts (91%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts (94%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts (79%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts (79%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts (79%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts (79%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts (78%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts (79%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts (92%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts (92%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts (93%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts (91%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts (93%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts (90%) rename packages/{core => didcomm}/src/modules/message-pickup/protocol/v2/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/services/MessagePickupSessionService.ts (92%) rename packages/{core => didcomm}/src/modules/message-pickup/services/index.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts (92%) rename packages/{core => didcomm}/src/modules/message-pickup/storage/MessagePickupRepository.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/storage/MessagePickupRepositoryOptions.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/storage/QueuedMessage.ts (100%) rename packages/{core => didcomm}/src/modules/message-pickup/storage/index.ts (100%) rename packages/{core => didcomm}/src/modules/oob/OutOfBandApi.ts (96%) rename packages/{core => didcomm}/src/modules/oob/OutOfBandModule.ts (63%) rename packages/{core => didcomm}/src/modules/oob/OutOfBandService.ts (93%) rename packages/{core => didcomm}/src/modules/oob/__tests__/OutOfBandInvitation.test.ts (97%) rename packages/{core => didcomm}/src/modules/oob/__tests__/OutOfBandModule.test.ts (61%) rename packages/{core => didcomm}/src/modules/oob/__tests__/OutOfBandService.test.ts (97%) rename packages/{core => didcomm}/src/modules/oob/__tests__/connect-to-self.test.ts (67%) rename packages/{core => didcomm}/src/modules/oob/__tests__/helpers.test.ts (98%) rename packages/{core => didcomm}/src/modules/oob/__tests__/implicit.test.ts (77%) rename packages/{core/src/modules/oob/helpers.ts => didcomm/src/modules/oob/converters.ts} (66%) rename packages/{core => didcomm}/src/modules/oob/domain/OutOfBandDidCommService.ts (92%) rename packages/{core => didcomm}/src/modules/oob/domain/OutOfBandEvents.ts (93%) rename packages/{core => didcomm}/src/modules/oob/domain/OutOfBandRole.ts (100%) rename packages/{core => didcomm}/src/modules/oob/domain/OutOfBandState.ts (100%) rename packages/{core => didcomm}/src/modules/oob/domain/index.ts (100%) rename packages/{core => didcomm}/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts (80%) rename packages/{core => didcomm}/src/modules/oob/handlers/HandshakeReuseHandler.ts (79%) rename packages/{core => didcomm}/src/modules/oob/handlers/index.ts (100%) create mode 100644 packages/didcomm/src/modules/oob/helpers.ts rename packages/{core => didcomm}/src/modules/oob/index.ts (100%) rename packages/{core => didcomm}/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts (90%) rename packages/{core => didcomm}/src/modules/oob/messages/HandshakeReuseMessage.ts (89%) rename packages/{core => didcomm}/src/modules/oob/messages/OutOfBandInvitation.ts (92%) rename packages/{core => didcomm}/src/modules/oob/messages/index.ts (61%) rename packages/{core => didcomm}/src/modules/oob/repository/OutOfBandRecord.ts (90%) rename packages/{core => didcomm}/src/modules/oob/repository/OutOfBandRepository.ts (55%) rename packages/{core => didcomm}/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts (97%) rename packages/{core => didcomm}/src/modules/oob/repository/index.ts (100%) rename packages/{core => didcomm}/src/modules/oob/repository/outOfBandRecordMetadataTypes.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/ProofEvents.ts (88%) rename packages/{core => didcomm}/src/modules/proofs/ProofsApi.ts (97%) rename packages/{core => didcomm}/src/modules/proofs/ProofsApiOptions.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/ProofsModule.ts (74%) rename packages/{core => didcomm}/src/modules/proofs/ProofsModuleConfig.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/__tests__/ProofsModule.test.ts (58%) rename packages/{core => didcomm}/src/modules/proofs/__tests__/ProofsModuleConfig.test.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/errors/PresentationProblemReportReason.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/errors/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/formats/ProofFormat.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/formats/ProofFormatService.ts (98%) rename packages/{core => didcomm}/src/modules/proofs/formats/ProofFormatServiceOptions.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts (93%) rename packages/{core => didcomm}/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts (96%) rename packages/{core => didcomm}/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts (94%) rename packages/{core => didcomm}/src/modules/proofs/formats/dif-presentation-exchange/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/formats/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/models/ProofAutoAcceptType.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/models/ProofFormatSpec.ts (81%) rename packages/{core => didcomm}/src/modules/proofs/models/ProofRole.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/models/ProofState.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/models/__tests__/ProofState.test.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/models/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/protocol/BaseProofProtocol.ts (93%) rename packages/{core => didcomm}/src/modules/proofs/protocol/ProofProtocol.ts (88%) rename packages/{core => didcomm}/src/modules/proofs/protocol/ProofProtocolOptions.ts (98%) rename packages/{core => didcomm}/src/modules/proofs/protocol/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts (99%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/V2ProofProtocol.ts (98%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/V2ProofProtocol.test.ts (93%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/fixtures.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts (91%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts (83%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts (90%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts (89%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts (89%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts (95%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts (90%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts (92%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts (81%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/errors/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts (93%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts (92%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts (94%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts (94%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts (93%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts (78%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts (92%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts (80%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts (91%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts (93%) rename packages/{core => didcomm}/src/modules/proofs/protocol/v2/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/repository/ProofExchangeRecord.ts (92%) rename packages/{core => didcomm}/src/modules/proofs/repository/ProofRepository.ts (80%) rename packages/{core => didcomm}/src/modules/proofs/repository/index.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/utils/composeAutoAccept.ts (100%) rename packages/{core => didcomm}/src/modules/proofs/utils/index.ts (100%) rename packages/{core => didcomm}/src/modules/routing/MediationRecipientApi.ts (88%) rename packages/{core => didcomm}/src/modules/routing/MediationRecipientModule.ts (76%) rename packages/{core => didcomm}/src/modules/routing/MediationRecipientModuleConfig.ts (100%) rename packages/{core => didcomm}/src/modules/routing/MediatorApi.ts (70%) rename packages/{core => didcomm}/src/modules/routing/MediatorModule.ts (55%) rename packages/{core => didcomm}/src/modules/routing/MediatorModuleConfig.ts (100%) rename packages/{core => didcomm}/src/modules/routing/MediatorPickupStrategy.ts (100%) rename packages/{core => didcomm}/src/modules/routing/MessageForwardingStrategy.ts (100%) rename packages/{core => didcomm}/src/modules/routing/RoutingEvents.ts (90%) rename packages/{core => didcomm}/src/modules/routing/__tests__/MediationRecipientModule.test.ts (64%) rename packages/{core => didcomm}/src/modules/routing/__tests__/MediatorModule.test.ts (64%) rename packages/{core => didcomm}/src/modules/routing/__tests__/mediation.test.ts (62%) rename packages/{core => didcomm}/src/modules/routing/error/RoutingProblemReportReason.ts (100%) rename packages/{core => didcomm}/src/modules/routing/error/index.ts (100%) rename packages/{core => didcomm}/src/modules/routing/handlers/ForwardHandler.ts (94%) rename packages/{core => didcomm}/src/modules/routing/handlers/KeylistUpdateHandler.ts (89%) rename packages/{core => didcomm}/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts (95%) rename packages/{core => didcomm}/src/modules/routing/handlers/MediationDenyHandler.ts (95%) rename packages/{core => didcomm}/src/modules/routing/handlers/MediationGrantHandler.ts (95%) rename packages/{core => didcomm}/src/modules/routing/handlers/MediationRequestHandler.ts (93%) rename packages/{core => didcomm}/src/modules/routing/handlers/index.ts (100%) rename packages/{core => didcomm}/src/modules/routing/index.ts (88%) rename packages/{core => didcomm}/src/modules/routing/messages/ForwardMessage.ts (93%) rename packages/{core => didcomm}/src/modules/routing/messages/KeylistMessage.ts (92%) rename packages/{core => didcomm}/src/modules/routing/messages/KeylistUpdateMessage.ts (95%) rename packages/{core => didcomm}/src/modules/routing/messages/KeylistUpdateResponseMessage.ts (96%) rename packages/{core => didcomm}/src/modules/routing/messages/MediationDenyMessage.ts (90%) rename packages/{core => didcomm}/src/modules/routing/messages/MediationGrantMessage.ts (94%) rename packages/{core => didcomm}/src/modules/routing/messages/MediationRequestMessage.ts (93%) rename packages/{core => didcomm}/src/modules/routing/messages/index.ts (100%) rename packages/{core => didcomm}/src/modules/routing/models/MediationRole.ts (100%) rename packages/{core => didcomm}/src/modules/routing/models/MediationState.ts (100%) rename packages/{core => didcomm}/src/modules/routing/models/index.ts (100%) rename packages/{core => didcomm}/src/modules/routing/repository/MediationRecord.ts (94%) rename packages/{core => didcomm}/src/modules/routing/repository/MediationRepository.ts (67%) rename packages/{core => didcomm}/src/modules/routing/repository/MediatorRoutingRecord.ts (75%) rename packages/{core => didcomm}/src/modules/routing/repository/MediatorRoutingRepository.ts (61%) rename packages/{core => didcomm}/src/modules/routing/repository/index.ts (100%) rename packages/{core => didcomm}/src/modules/routing/services/MediationRecipientService.ts (93%) rename packages/{core => didcomm}/src/modules/routing/services/MediatorService.ts (92%) rename packages/{core => didcomm}/src/modules/routing/services/RoutingService.ts (84%) rename packages/{core => didcomm}/src/modules/routing/services/__tests__/MediationRecipientService.test.ts (91%) rename packages/{core => didcomm}/src/modules/routing/services/__tests__/MediatorService.test.ts (93%) rename packages/{core => didcomm}/src/modules/routing/services/__tests__/RoutingService.test.ts (85%) rename packages/{core => didcomm}/src/modules/routing/services/helpers.ts (82%) rename packages/{core => didcomm}/src/modules/routing/services/index.ts (100%) rename packages/{core/src/storage/didcomm => didcomm/src/repository}/DidCommMessageRecord.ts (84%) rename packages/{core/src/storage/didcomm => didcomm/src/repository}/DidCommMessageRepository.ts (88%) rename packages/{core/src/storage/didcomm => didcomm/src/repository}/DidCommMessageRole.ts (100%) rename packages/{core/src/storage => didcomm/src/repository}/__tests__/DidCommMessageRecord.test.ts (91%) rename packages/{core/src/storage => didcomm/src/repository}/__tests__/DidCommMessageRepository.test.ts (94%) rename packages/{core/src/storage/didcomm => didcomm/src/repository}/index.ts (100%) rename packages/{core/src/modules/didcomm => didcomm/src}/services/DidCommDocumentService.ts (88%) rename packages/{core/src/modules/didcomm => didcomm/src}/services/__tests__/DidCommDocumentService.test.ts (93%) rename packages/{core/src/modules/didcomm => didcomm/src}/services/index.ts (100%) rename packages/{core => didcomm}/src/transport/HttpOutboundTransport.ts (77%) rename packages/{core => didcomm}/src/transport/InboundTransport.ts (57%) rename packages/{core => didcomm}/src/transport/OutboundTransport.ts (72%) rename packages/{core => didcomm}/src/transport/TransportEventTypes.ts (89%) rename packages/{core => didcomm}/src/transport/WsOutboundTransport.ts (85%) rename packages/{core => didcomm}/src/transport/index.ts (100%) create mode 100644 packages/didcomm/src/types.ts rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/__fixtures__/didPeer4kgVt6CidfKgo1MoWMqsQX.json (100%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/__fixtures__/didPeerR1xKJw17sUoXhejEpugMYJ.json (100%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeer4kgVt6CidfKgo1MoWMqsQX.json (100%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeerR1xKJw17sUoXhejEpugMYJ.json (100%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/connection.test.ts (96%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/credential.test.ts (95%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/__tests__/mediation.test.ts (92%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/connection.ts (94%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/credential.ts (94%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/index.ts (63%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.1-0.2/mediation.ts (93%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.2-0.3/__tests__/connection.test.ts (87%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.2-0.3/__tests__/proof.test.ts (93%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.2-0.3/connection.ts (89%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.2-0.3/index.ts (83%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.2-0.3/proof.ts (92%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts (90%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts (90%) rename packages/{core/src/storage/migration => didcomm/src}/updates/0.4-0.5/credentialExchangeRecord.ts (94%) create mode 100644 packages/didcomm/src/updates/0.4-0.5/index.ts rename packages/{core/src/storage/migration => didcomm/src}/updates/0.4-0.5/proofExchangeRecord.ts (93%) rename packages/{core/src/utils => didcomm/src/util}/JWE.ts (100%) rename packages/{core/src/utils => didcomm/src/util}/LinkedAttachment.ts (100%) rename packages/{core/src/utils => didcomm/src/util}/__tests__/JWE.test.ts (100%) rename packages/{core/src/modules/didcomm => didcomm/src}/util/__tests__/matchingEd25519Key.test.ts (95%) rename packages/{core/src/utils => didcomm/src/util}/__tests__/messageType.test.ts (99%) rename packages/{core/src/utils => didcomm/src/util}/__tests__/parseInvitation.test.ts (97%) rename packages/{core/src/utils => didcomm/src/util}/attachment.ts (84%) rename packages/{core/src/modules/didcomm => didcomm/src}/util/matchingEd25519Key.ts (83%) rename packages/{core/src/utils => didcomm/src/util}/messageType.ts (100%) create mode 100644 packages/didcomm/src/util/modules.ts rename packages/{core/src/utils => didcomm/src/util}/parseInvitation.ts (94%) rename packages/{core/src/utils => didcomm/src/util}/thread.ts (100%) create mode 100644 packages/didcomm/src/util/transformers.ts create mode 100644 packages/didcomm/tests/setup.ts create mode 100644 packages/didcomm/tsconfig.build.json create mode 100644 packages/didcomm/tsconfig.json create mode 100644 packages/didcomm/types/jest.d.ts diff --git a/.changeset/purple-donkeys-camp.md b/.changeset/purple-donkeys-camp.md new file mode 100644 index 0000000000..75ff1ea2c5 --- /dev/null +++ b/.changeset/purple-donkeys-camp.md @@ -0,0 +1,67 @@ +--- +'@credo-ts/question-answer': minor +'@credo-ts/bbs-signatures': minor +'@credo-ts/action-menu': minor +'@credo-ts/anoncreds': minor +'@credo-ts/indy-vdr': minor +'@credo-ts/didcomm': minor +'@credo-ts/tenants': minor +'@credo-ts/askar': minor +'@credo-ts/cheqd': minor +'@credo-ts/core': minor +'@credo-ts/drpc': minor +'@credo-ts/node': minor +--- + +DIDComm has been extracted out of the Core. This means that now all DIDComm related modules (e.g. proofs, credentials) must be explicitly added when creating an `Agent` instance. Therefore, their API will be accesable under `agent.modules.[moduleAPI]` instead of `agent.[moduleAPI]`. Some `Agent` DIDComm-related properties and methods where also moved to the API of a new DIDComm module (e.g. `agent.registerInboundTransport` turned into `agent.modules.didcomm.registerInboundTransport`). + +**Example of DIDComm Agent** + +Previously: + +```ts + const config = { + label: name, + endpoints: ['https://myendpoint'], + walletConfig: { + id: name, + key: name, + }, + } satisfies InitConfig + + const agent = new Agent({ + config, + dependencies: agentDependencies, + modules: { + connections: new ConnectionsModule({ + autoAcceptConnections: true, + }) + }) + this.agent.registerInboundTransport(new HttpInboundTransport({ port })) + this.agent.registerOutboundTransport(new HttpOutboundTransport()) + +``` + +Now: + +```ts + const config = { + label: name, + walletConfig: { + id: name, + key: name, + }, + } satisfies InitConfig + + const agent = new Agent({ + config, + dependencies: agentDependencies, + modules: { + ...getDefaultDidcommModules({ endpoints: ['https://myendpoint'] }), + connections: new ConnectionsModule({ + autoAcceptConnections: true, + }) + }) + agent.modules.didcomm.registerInboundTransport(new HttpInboundTransport({ port })) + agent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) +``` diff --git a/demo-openid/src/BaseAgent.ts b/demo-openid/src/BaseAgent.ts index 891afc8e34..50acb4150a 100644 --- a/demo-openid/src/BaseAgent.ts +++ b/demo-openid/src/BaseAgent.ts @@ -1,16 +1,9 @@ import type { InitConfig, KeyDidCreateOptions, ModulesMap, VerificationMethod } from '@credo-ts/core' import type { Express } from 'express' +import type { Server } from 'http' -import { - Agent, - ConsoleLogger, - DidKey, - HttpOutboundTransport, - KeyType, - LogLevel, - TypedArrayEncoder, -} from '@credo-ts/core' -import { HttpInboundTransport, agentDependencies } from '@credo-ts/node' +import { Agent, ConsoleLogger, DidKey, KeyType, LogLevel, TypedArrayEncoder } from '@credo-ts/core' +import { agentDependencies } from '@credo-ts/node' import express from 'express' import { greenText } from './OutputClass' @@ -21,6 +14,7 @@ export class BaseAgent { public name: string public config: InitConfig public agent: Agent + public server?: Server public did!: string public didKey!: DidKey public kid!: string @@ -41,17 +35,13 @@ export class BaseAgent { this.config = config this.agent = new Agent({ config, dependencies: agentDependencies, modules }) - - const httpInboundTransport = new HttpInboundTransport({ app: this.app, port: this.port }) - const httpOutboundTransport = new HttpOutboundTransport() - - this.agent.registerInboundTransport(httpInboundTransport) - this.agent.registerOutboundTransport(httpOutboundTransport) } public async initializeAgent(secretPrivateKey: string) { await this.agent.initialize() + this.server = this.app.listen(this.port) + const didCreateResult = await this.agent.dids.create({ method: 'key', options: { keyType: KeyType.Ed25519 }, @@ -68,4 +58,9 @@ export class BaseAgent { console.log(greenText(`\nAgent ${this.name} created!\n`)) } + + public async shutdown() { + this.server?.close() + await this.agent.shutdown() + } } diff --git a/demo-openid/src/Holder.ts b/demo-openid/src/Holder.ts index 453825ec68..703e641771 100644 --- a/demo-openid/src/Holder.ts +++ b/demo-openid/src/Holder.ts @@ -212,11 +212,11 @@ export class Holder extends BaseAgent> public async exit() { console.log(Output.Exit) - await this.agent.shutdown() + await this.shutdown() process.exit(0) } public async restart() { - await this.agent.shutdown() + await this.shutdown() } } diff --git a/demo-openid/src/Issuer.ts b/demo-openid/src/Issuer.ts index 87d3d13df0..37750dfb1b 100644 --- a/demo-openid/src/Issuer.ts +++ b/demo-openid/src/Issuer.ts @@ -345,12 +345,12 @@ export class Issuer extends BaseAgent<{ public async exit() { console.log(Output.Exit) - await this.agent.shutdown() + await this.shutdown() process.exit(0) } public async restart() { - await this.agent.shutdown() + await this.shutdown() } } diff --git a/demo-openid/src/Verifier.ts b/demo-openid/src/Verifier.ts index d7d31f0f34..83dcd146ef 100644 --- a/demo-openid/src/Verifier.ts +++ b/demo-openid/src/Verifier.ts @@ -107,11 +107,11 @@ export class Verifier extends BaseAgent<{ askar: AskarModule; openId4VcVerifier: public async exit() { console.log(Output.Exit) - await this.agent.shutdown() + await this.shutdown() process.exit(0) } public async restart() { - await this.agent.shutdown() + await this.shutdown() } } diff --git a/demo/package.json b/demo/package.json index fa654da196..dcb637d1fb 100644 --- a/demo/package.json +++ b/demo/package.json @@ -22,6 +22,7 @@ "@credo-ts/anoncreds": "workspace:*", "@credo-ts/askar": "workspace:*", "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "@credo-ts/indy-vdr": "workspace:*", "@credo-ts/cheqd": "workspace:*", "@credo-ts/node": "workspace:*", diff --git a/demo/src/Alice.ts b/demo/src/Alice.ts index ca50a0f50a..24ebbcc9ea 100644 --- a/demo/src/Alice.ts +++ b/demo/src/Alice.ts @@ -1,4 +1,4 @@ -import type { ConnectionRecord, CredentialExchangeRecord, ProofExchangeRecord } from '@credo-ts/core' +import type { ConnectionRecord, CredentialExchangeRecord, ProofExchangeRecord } from '@credo-ts/didcomm' import { BaseAgent } from './BaseAgent' import { greenText, Output, redText } from './OutputClass' @@ -22,11 +22,11 @@ export class Alice extends BaseAgent { if (!this.connectionRecordFaberId) { throw Error(redText(Output.MissingConnectionRecord)) } - return await this.agent.connections.getById(this.connectionRecordFaberId) + return await this.agent.modules.connections.getById(this.connectionRecordFaberId) } private async receiveConnectionRequest(invitationUrl: string) { - const { connectionRecord } = await this.agent.oob.receiveInvitationFromUrl(invitationUrl) + const { connectionRecord } = await this.agent.modules.oob.receiveInvitationFromUrl(invitationUrl) if (!connectionRecord) { throw new Error(redText(Output.NoConnectionRecordFromOutOfBand)) } @@ -34,7 +34,7 @@ export class Alice extends BaseAgent { } private async waitForConnection(connectionRecord: ConnectionRecord) { - connectionRecord = await this.agent.connections.returnWhenIsConnected(connectionRecord.id) + connectionRecord = await this.agent.modules.connections.returnWhenIsConnected(connectionRecord.id) this.connected = true console.log(greenText(Output.ConnectionEstablished)) return connectionRecord.id @@ -46,17 +46,17 @@ export class Alice extends BaseAgent { } public async acceptCredentialOffer(credentialRecord: CredentialExchangeRecord) { - await this.agent.credentials.acceptOffer({ + await this.agent.modules.credentials.acceptOffer({ credentialRecordId: credentialRecord.id, }) } public async acceptProofRequest(proofRecord: ProofExchangeRecord) { - const requestedCredentials = await this.agent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await this.agent.modules.proofs.selectCredentialsForRequest({ proofRecordId: proofRecord.id, }) - await this.agent.proofs.acceptRequest({ + await this.agent.modules.proofs.acceptRequest({ proofRecordId: proofRecord.id, proofFormats: requestedCredentials.proofFormats, }) @@ -65,7 +65,7 @@ export class Alice extends BaseAgent { public async sendMessage(message: string) { const connectionRecord = await this.getConnectionRecord() - await this.agent.basicMessages.sendMessage(connectionRecord.id, message) + await this.agent.modules.basicMessages.sendMessage(connectionRecord.id, message) } public async exit() { diff --git a/demo/src/AliceInquirer.ts b/demo/src/AliceInquirer.ts index 9e1674bdfb..abecb06e41 100644 --- a/demo/src/AliceInquirer.ts +++ b/demo/src/AliceInquirer.ts @@ -1,4 +1,4 @@ -import type { CredentialExchangeRecord, ProofExchangeRecord } from '@credo-ts/core' +import type { CredentialExchangeRecord, ProofExchangeRecord } from '@credo-ts/didcomm' import { clear } from 'console' import { textSync } from 'figlet' @@ -72,7 +72,7 @@ export class AliceInquirer extends BaseInquirer { public async acceptCredentialOffer(credentialRecord: CredentialExchangeRecord) { const confirm = await prompt([this.inquireConfirmation(Title.CredentialOfferTitle)]) if (confirm.options === ConfirmOptions.No) { - await this.alice.agent.credentials.declineOffer(credentialRecord.id) + await this.alice.agent.modules.credentials.declineOffer(credentialRecord.id) } else if (confirm.options === ConfirmOptions.Yes) { await this.alice.acceptCredentialOffer(credentialRecord) } @@ -81,7 +81,7 @@ export class AliceInquirer extends BaseInquirer { public async acceptProofRequest(proofRecord: ProofExchangeRecord) { const confirm = await prompt([this.inquireConfirmation(Title.ProofRequestTitle)]) if (confirm.options === ConfirmOptions.No) { - await this.alice.agent.proofs.declineRequest({ proofRecordId: proofRecord.id }) + await this.alice.agent.modules.proofs.declineRequest({ proofRecordId: proofRecord.id }) } else if (confirm.options === ConfirmOptions.Yes) { await this.alice.acceptProofRequest(proofRecord) } diff --git a/demo/src/BaseAgent.ts b/demo/src/BaseAgent.ts index c0acab7e88..9617ed2641 100644 --- a/demo/src/BaseAgent.ts +++ b/demo/src/BaseAgent.ts @@ -1,4 +1,5 @@ import type { InitConfig } from '@credo-ts/core' +import type { DidCommModuleConfigOptions } from '@credo-ts/didcomm' import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr' import { @@ -18,18 +19,18 @@ import { CheqdModule, CheqdModuleConfig, } from '@credo-ts/cheqd' +import { DidsModule, Agent } from '@credo-ts/core' import { ConnectionsModule, - DidsModule, V2ProofProtocol, V2CredentialProtocol, ProofsModule, AutoAcceptProof, AutoAcceptCredential, CredentialsModule, - Agent, HttpOutboundTransport, -} from '@credo-ts/core' + getDefaultDidcommModules, +} from '@credo-ts/didcomm' import { IndyVdrIndyDidResolver, IndyVdrAnonCredsRegistry, IndyVdrModule } from '@credo-ts/indy-vdr' import { agentDependencies, HttpInboundTransport } from '@credo-ts/node' import { anoncreds } from '@hyperledger/anoncreds-nodejs' @@ -68,7 +69,6 @@ export class BaseAgent { id: name, key: name, }, - endpoints: [`http://localhost:${this.port}`], } satisfies InitConfig this.config = config @@ -76,10 +76,10 @@ export class BaseAgent { this.agent = new Agent({ config, dependencies: agentDependencies, - modules: getAskarAnonCredsIndyModules(), + modules: getAskarAnonCredsIndyModules({ endpoints: [`http://localhost:${this.port}`] }), }) - this.agent.registerInboundTransport(new HttpInboundTransport({ port })) - this.agent.registerOutboundTransport(new HttpOutboundTransport()) + this.agent.modules.didcomm.registerInboundTransport(new HttpInboundTransport({ port })) + this.agent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) } public async initializeAgent() { @@ -89,11 +89,12 @@ export class BaseAgent { } } -function getAskarAnonCredsIndyModules() { +function getAskarAnonCredsIndyModules(didcommConfig: DidCommModuleConfigOptions) { const legacyIndyCredentialFormatService = new LegacyIndyCredentialFormatService() const legacyIndyProofFormatService = new LegacyIndyProofFormatService() return { + ...getDefaultDidcommModules(didcommConfig), connections: new ConnectionsModule({ autoAcceptConnections: true, }), diff --git a/demo/src/Faber.ts b/demo/src/Faber.ts index 5f3542b803..7e4d519b99 100644 --- a/demo/src/Faber.ts +++ b/demo/src/Faber.ts @@ -1,9 +1,10 @@ import type { RegisterCredentialDefinitionReturnStateFinished } from '@credo-ts/anoncreds' -import type { ConnectionRecord, ConnectionStateChangedEvent } from '@credo-ts/core' +import type { ConnectionRecord, ConnectionStateChangedEvent } from '@credo-ts/didcomm' import type { IndyVdrRegisterSchemaOptions, IndyVdrRegisterCredentialDefinitionOptions } from '@credo-ts/indy-vdr' import type BottomBar from 'inquirer/lib/ui/bottom-bar' -import { ConnectionEventTypes, KeyType, TypedArrayEncoder, utils } from '@credo-ts/core' +import { KeyType, TypedArrayEncoder, utils } from '@credo-ts/core' +import { ConnectionEventTypes } from '@credo-ts/didcomm' import { ui } from 'inquirer' import { BaseAgent, indyNetworkConfig } from './BaseAgent' @@ -58,7 +59,7 @@ export class Faber extends BaseAgent { throw Error(redText(Output.MissingConnectionRecord)) } - const [connection] = await this.agent.connections.findAllByOutOfBandId(this.outOfBandId) + const [connection] = await this.agent.modules.connections.findAllByOutOfBandId(this.outOfBandId) if (!connection) { throw Error(redText(Output.MissingConnectionRecord)) @@ -68,7 +69,7 @@ export class Faber extends BaseAgent { } private async printConnectionInvite() { - const outOfBand = await this.agent.oob.createInvitation() + const outOfBand = await this.agent.modules.oob.createInvitation() this.outOfBandId = outOfBand.id console.log( @@ -99,7 +100,7 @@ export class Faber extends BaseAgent { }) // Also retrieve the connection record by invitation if the event has already fired - void this.agent.connections.findAllByOutOfBandId(outOfBandId).then(([connectionRecord]) => { + void this.agent.modules.connections.findAllByOutOfBandId(outOfBandId).then(([connectionRecord]) => { if (connectionRecord) { clearTimeout(timeoutId) resolve(connectionRecord) @@ -110,7 +111,7 @@ export class Faber extends BaseAgent { const connectionRecord = await getConnectionRecord(this.outOfBandId) try { - await this.agent.connections.returnWhenIsConnected(connectionRecord.id) + await this.agent.modules.connections.returnWhenIsConnected(connectionRecord.id) } catch (e) { console.log(redText(`\nTimeout of 20 seconds reached.. Returning to home screen.\n`)) return @@ -200,7 +201,7 @@ export class Faber extends BaseAgent { this.ui.updateBottomBar('\nSending credential offer...\n') - await this.agent.credentials.offerCredential({ + await this.agent.modules.credentials.offerCredential({ connectionId: connectionRecord.id, protocolVersion: 'v2', credentialFormats: { @@ -254,7 +255,7 @@ export class Faber extends BaseAgent { const proofAttribute = await this.newProofAttribute() await this.printProofFlow(greenText('\nRequesting proof...\n', false)) - await this.agent.proofs.requestProof({ + await this.agent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: connectionRecord.id, proofFormats: { @@ -272,7 +273,7 @@ export class Faber extends BaseAgent { public async sendMessage(message: string) { const connectionRecord = await this.getConnectionRecord() - await this.agent.basicMessages.sendMessage(connectionRecord.id, message) + await this.agent.modules.basicMessages.sendMessage(connectionRecord.id, message) } public async exit() { diff --git a/demo/src/Listener.ts b/demo/src/Listener.ts index 8410537043..4c33672d63 100644 --- a/demo/src/Listener.ts +++ b/demo/src/Listener.ts @@ -2,14 +2,14 @@ import type { Alice } from './Alice' import type { AliceInquirer } from './AliceInquirer' import type { Faber } from './Faber' import type { FaberInquirer } from './FaberInquirer' +import type { Agent } from '@credo-ts/core' import type { - Agent, BasicMessageStateChangedEvent, CredentialExchangeRecord, CredentialStateChangedEvent, ProofExchangeRecord, ProofStateChangedEvent, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import type BottomBar from 'inquirer/lib/ui/bottom-bar' import { @@ -19,7 +19,7 @@ import { CredentialState, ProofEventTypes, ProofState, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { ui } from 'inquirer' import { Color, purpleText } from './OutputClass' diff --git a/packages/action-menu/package.json b/packages/action-menu/package.json index 215749d9ed..0a6d5f8733 100644 --- a/packages/action-menu/package.json +++ b/packages/action-menu/package.json @@ -27,6 +27,7 @@ }, "dependencies": { "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "class-transformer": "0.5.1", "class-validator": "0.14.1", "rxjs": "^7.8.0" diff --git a/packages/action-menu/src/ActionMenuApi.ts b/packages/action-menu/src/ActionMenuApi.ts index 0024aab32c..e55e433a03 100644 --- a/packages/action-menu/src/ActionMenuApi.ts +++ b/packages/action-menu/src/ActionMenuApi.ts @@ -6,14 +6,8 @@ import type { SendMenuOptions, } from './ActionMenuApiOptions' -import { - AgentContext, - CredoError, - ConnectionService, - MessageSender, - injectable, - getOutboundMessageContext, -} from '@credo-ts/core' +import { AgentContext, CredoError, injectable } from '@credo-ts/core' +import { ConnectionService, MessageSender, getOutboundMessageContext, MessageHandlerRegistry } from '@credo-ts/didcomm' import { ActionMenuRole } from './ActionMenuRole' import { @@ -45,12 +39,14 @@ export class ActionMenuApi { this.actionMenuService = actionMenuService this.agentContext = agentContext - this.agentContext.dependencyManager.registerMessageHandlers([ - new ActionMenuProblemReportHandler(this.actionMenuService), - new MenuMessageHandler(this.actionMenuService), - new MenuRequestMessageHandler(this.actionMenuService), - new PerformMessageHandler(this.actionMenuService), - ]) + this.agentContext.dependencyManager + .resolve(MessageHandlerRegistry) + .registerMessageHandlers([ + new ActionMenuProblemReportHandler(this.actionMenuService), + new MenuMessageHandler(this.actionMenuService), + new MenuRequestMessageHandler(this.actionMenuService), + new PerformMessageHandler(this.actionMenuService), + ]) } /** diff --git a/packages/action-menu/src/ActionMenuModule.ts b/packages/action-menu/src/ActionMenuModule.ts index 21beecf751..355bd0673d 100644 --- a/packages/action-menu/src/ActionMenuModule.ts +++ b/packages/action-menu/src/ActionMenuModule.ts @@ -1,6 +1,6 @@ -import type { DependencyManager, FeatureRegistry, Module } from '@credo-ts/core' +import type { AgentContext, DependencyManager, Module } from '@credo-ts/core' -import { Protocol } from '@credo-ts/core' +import { FeatureRegistry, Protocol } from '@credo-ts/didcomm' import { ActionMenuApi } from './ActionMenuApi' import { ActionMenuRole } from './ActionMenuRole' @@ -16,14 +16,18 @@ export class ActionMenuModule implements Module { /** * Registers the dependencies of the question answer module on the dependency manager. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Services dependencyManager.registerSingleton(ActionMenuService) // Repositories dependencyManager.registerSingleton(ActionMenuRepository) + } + public async initialize(agentContext: AgentContext): Promise { // Feature Registry + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) + featureRegistry.register( new Protocol({ id: 'https://didcomm.org/action-menu/1.0', diff --git a/packages/action-menu/src/__tests__/ActionMenuModule.test.ts b/packages/action-menu/src/__tests__/ActionMenuModule.test.ts index c37554a827..3ca65477f7 100644 --- a/packages/action-menu/src/__tests__/ActionMenuModule.test.ts +++ b/packages/action-menu/src/__tests__/ActionMenuModule.test.ts @@ -1,30 +1,36 @@ -import type { DependencyManager, FeatureRegistry } from '@credo-ts/core' +import type { DependencyManager } from '@credo-ts/core' +import type { FeatureRegistry } from '@credo-ts/didcomm' -import { Protocol } from '@credo-ts/core' +import { Protocol } from '@credo-ts/didcomm' +import { getAgentContext } from '../../../core/tests' import { ActionMenuModule } from '../ActionMenuModule' import { ActionMenuRole } from '../ActionMenuRole' import { ActionMenuRepository } from '../repository' import { ActionMenuService } from '../services' +const featureRegistry = { + register: jest.fn(), +} as unknown as FeatureRegistry + const dependencyManager = { registerInstance: jest.fn(), registerSingleton: jest.fn(), registerContextScoped: jest.fn(), + resolve: () => featureRegistry, } as unknown as DependencyManager -const featureRegistry = { - register: jest.fn(), -} as unknown as FeatureRegistry - describe('ActionMenuModule', () => { - test('registers dependencies on the dependency manager', () => { + test('registers dependencies on the dependency manager', async () => { const actionMenuModule = new ActionMenuModule() - actionMenuModule.register(dependencyManager, featureRegistry) + actionMenuModule.register(dependencyManager) expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(ActionMenuService) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(ActionMenuRepository) + expect(featureRegistry.register).toHaveBeenCalledTimes(0) + + await actionMenuModule.initialize(getAgentContext({ dependencyManager })) expect(featureRegistry.register).toHaveBeenCalledTimes(1) expect(featureRegistry.register).toHaveBeenCalledWith( diff --git a/packages/action-menu/src/errors/ActionMenuProblemReportError.ts b/packages/action-menu/src/errors/ActionMenuProblemReportError.ts index f44d3d3c76..20944861aa 100644 --- a/packages/action-menu/src/errors/ActionMenuProblemReportError.ts +++ b/packages/action-menu/src/errors/ActionMenuProblemReportError.ts @@ -1,7 +1,7 @@ import type { ActionMenuProblemReportReason } from './ActionMenuProblemReportReason' -import type { ProblemReportErrorOptions } from '@credo-ts/core' +import type { ProblemReportErrorOptions } from '@credo-ts/didcomm' -import { ProblemReportError } from '@credo-ts/core' +import { ProblemReportError } from '@credo-ts/didcomm' import { ActionMenuProblemReportMessage } from '../messages' diff --git a/packages/action-menu/src/handlers/ActionMenuProblemReportHandler.ts b/packages/action-menu/src/handlers/ActionMenuProblemReportHandler.ts index a49b665098..127d15489f 100644 --- a/packages/action-menu/src/handlers/ActionMenuProblemReportHandler.ts +++ b/packages/action-menu/src/handlers/ActionMenuProblemReportHandler.ts @@ -1,5 +1,5 @@ import type { ActionMenuService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { ActionMenuProblemReportMessage } from '../messages' diff --git a/packages/action-menu/src/handlers/MenuMessageHandler.ts b/packages/action-menu/src/handlers/MenuMessageHandler.ts index 377bd07603..f7ef5f487a 100644 --- a/packages/action-menu/src/handlers/MenuMessageHandler.ts +++ b/packages/action-menu/src/handlers/MenuMessageHandler.ts @@ -1,5 +1,5 @@ import type { ActionMenuService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { MenuMessage } from '../messages' diff --git a/packages/action-menu/src/handlers/MenuRequestMessageHandler.ts b/packages/action-menu/src/handlers/MenuRequestMessageHandler.ts index c214a9fc0e..5657f07d13 100644 --- a/packages/action-menu/src/handlers/MenuRequestMessageHandler.ts +++ b/packages/action-menu/src/handlers/MenuRequestMessageHandler.ts @@ -1,5 +1,5 @@ import type { ActionMenuService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { MenuRequestMessage } from '../messages' diff --git a/packages/action-menu/src/handlers/PerformMessageHandler.ts b/packages/action-menu/src/handlers/PerformMessageHandler.ts index dd25103242..d0243ba830 100644 --- a/packages/action-menu/src/handlers/PerformMessageHandler.ts +++ b/packages/action-menu/src/handlers/PerformMessageHandler.ts @@ -1,5 +1,5 @@ import type { ActionMenuService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { PerformMessage } from '../messages' diff --git a/packages/action-menu/src/messages/ActionMenuProblemReportMessage.ts b/packages/action-menu/src/messages/ActionMenuProblemReportMessage.ts index c62acbc17c..2f63ccb170 100644 --- a/packages/action-menu/src/messages/ActionMenuProblemReportMessage.ts +++ b/packages/action-menu/src/messages/ActionMenuProblemReportMessage.ts @@ -1,6 +1,6 @@ -import type { ProblemReportMessageOptions } from '@credo-ts/core' +import type { ProblemReportMessageOptions } from '@credo-ts/didcomm' -import { IsValidMessageType, parseMessageType, ProblemReportMessage } from '@credo-ts/core' +import { IsValidMessageType, parseMessageType, ProblemReportMessage } from '@credo-ts/didcomm' export type ActionMenuProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/action-menu/src/messages/MenuMessage.ts b/packages/action-menu/src/messages/MenuMessage.ts index 808b6ba465..aa3436b08b 100644 --- a/packages/action-menu/src/messages/MenuMessage.ts +++ b/packages/action-menu/src/messages/MenuMessage.ts @@ -1,6 +1,6 @@ import type { ActionMenuOptionOptions } from '../models' -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, IsString } from 'class-validator' diff --git a/packages/action-menu/src/messages/MenuRequestMessage.ts b/packages/action-menu/src/messages/MenuRequestMessage.ts index 6fb97857c5..fba6be84a6 100644 --- a/packages/action-menu/src/messages/MenuRequestMessage.ts +++ b/packages/action-menu/src/messages/MenuRequestMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' /** * @internal diff --git a/packages/action-menu/src/messages/PerformMessage.ts b/packages/action-menu/src/messages/PerformMessage.ts index a62331aa15..45654234d3 100644 --- a/packages/action-menu/src/messages/PerformMessage.ts +++ b/packages/action-menu/src/messages/PerformMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { IsOptional, IsString } from 'class-validator' /** diff --git a/packages/action-menu/src/services/ActionMenuService.ts b/packages/action-menu/src/services/ActionMenuService.ts index 1bbf2b41b0..5687e6b6ca 100644 --- a/packages/action-menu/src/services/ActionMenuService.ts +++ b/packages/action-menu/src/services/ActionMenuService.ts @@ -7,7 +7,8 @@ import type { } from './ActionMenuServiceOptions' import type { ActionMenuStateChangedEvent } from '../ActionMenuEvents' import type { ActionMenuProblemReportMessage } from '../messages' -import type { AgentContext, InboundMessageContext, Logger, Query, QueryOptions } from '@credo-ts/core' +import type { AgentContext, Logger, Query, QueryOptions } from '@credo-ts/core' +import type { InboundMessageContext } from '@credo-ts/didcomm' import { AgentConfig, EventEmitter, CredoError, injectable } from '@credo-ts/core' diff --git a/packages/action-menu/src/services/ActionMenuServiceOptions.ts b/packages/action-menu/src/services/ActionMenuServiceOptions.ts index dc2d85c0ad..f4be019a58 100644 --- a/packages/action-menu/src/services/ActionMenuServiceOptions.ts +++ b/packages/action-menu/src/services/ActionMenuServiceOptions.ts @@ -2,7 +2,7 @@ import type { ActionMenuRole } from '../ActionMenuRole' import type { ActionMenuSelection } from '../models' import type { ActionMenu } from '../models/ActionMenu' import type { ActionMenuRecord } from '../repository' -import type { ConnectionRecord } from '@credo-ts/core' +import type { ConnectionRecord } from '@credo-ts/didcomm' /** * @internal diff --git a/packages/action-menu/src/services/__tests__/ActionMenuService.test.ts b/packages/action-menu/src/services/__tests__/ActionMenuService.test.ts index a186108661..dc92823331 100644 --- a/packages/action-menu/src/services/__tests__/ActionMenuService.test.ts +++ b/packages/action-menu/src/services/__tests__/ActionMenuService.test.ts @@ -2,7 +2,8 @@ import type { ActionMenuStateChangedEvent } from '../../ActionMenuEvents' import type { ActionMenuSelection } from '../../models' import type { AgentContext, AgentConfig, Repository } from '@credo-ts/core' -import { DidExchangeState, EventEmitter, InboundMessageContext } from '@credo-ts/core' +import { EventEmitter } from '@credo-ts/core' +import { DidExchangeState, InboundMessageContext } from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { diff --git a/packages/action-menu/tests/action-menu.test.ts b/packages/action-menu/tests/action-menu.test.ts index 134887830c..7cc8866960 100644 --- a/packages/action-menu/tests/action-menu.test.ts +++ b/packages/action-menu/tests/action-menu.test.ts @@ -1,4 +1,4 @@ -import type { ConnectionRecord } from '@credo-ts/core' +import type { ConnectionRecord } from '@credo-ts/didcomm' import { Agent } from '@credo-ts/core' @@ -17,6 +17,7 @@ const faberAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:faber'], }, + {}, modules ) @@ -25,12 +26,13 @@ const aliceAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, modules ) describe('Action Menu', () => { - let faberAgent: Agent - let aliceAgent: Agent + let faberAgent: Agent + let aliceAgent: Agent let faberConnection: ConnectionRecord let aliceConnection: ConnectionRecord diff --git a/packages/anoncreds/package.json b/packages/anoncreds/package.json index 8152e45a3a..7bee830493 100644 --- a/packages/anoncreds/package.json +++ b/packages/anoncreds/package.json @@ -28,6 +28,7 @@ "dependencies": { "@astronautlabs/jsonpath": "^1.1.2", "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "@sphereon/pex-models": "^2.3.1", "big-integer": "^1.6.51", "bn.js": "^5.2.1", diff --git a/packages/anoncreds/src/formats/AnonCredsCredentialFormat.ts b/packages/anoncreds/src/formats/AnonCredsCredentialFormat.ts index 869acd44a1..b5bd095770 100644 --- a/packages/anoncreds/src/formats/AnonCredsCredentialFormat.ts +++ b/packages/anoncreds/src/formats/AnonCredsCredentialFormat.ts @@ -1,5 +1,5 @@ import type { AnonCredsCredential, AnonCredsCredentialOffer, AnonCredsCredentialRequest } from '../models' -import type { CredentialPreviewAttributeOptions, CredentialFormat, LinkedAttachment } from '@credo-ts/core' +import type { CredentialPreviewAttributeOptions, CredentialFormat, LinkedAttachment } from '@credo-ts/didcomm' export interface AnonCredsCredentialProposalFormat { schema_issuer_id?: string diff --git a/packages/anoncreds/src/formats/AnonCredsCredentialFormatService.ts b/packages/anoncreds/src/formats/AnonCredsCredentialFormatService.ts index 2d176d895b..e97e240f56 100644 --- a/packages/anoncreds/src/formats/AnonCredsCredentialFormatService.ts +++ b/packages/anoncreds/src/formats/AnonCredsCredentialFormatService.ts @@ -2,9 +2,9 @@ import type { AnonCredsCredentialFormat, AnonCredsCredentialProposalFormat } fro import type { AnonCredsCredential, AnonCredsCredentialOffer, AnonCredsCredentialRequest } from '../models' import type { AnonCredsIssuerService, AnonCredsHolderService } from '../services' import type { AnonCredsCredentialMetadata, AnonCredsCredentialRequestMetadata } from '../utils/metadata' +import type { AgentContext } from '@credo-ts/core' import type { CredentialFormatService, - AgentContext, CredentialFormatCreateProposalOptions, CredentialFormatCreateProposalReturn, CredentialFormatProcessOptions, @@ -22,19 +22,10 @@ import type { CredentialExchangeRecord, CredentialPreviewAttributeOptions, LinkedAttachment, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' -import { - ProblemReportError, - MessageValidator, - CredentialFormatSpec, - CredoError, - Attachment, - JsonEncoder, - utils, - CredentialProblemReportReason, - JsonTransformer, -} from '@credo-ts/core' +import { MessageValidator, CredoError, JsonEncoder, utils, JsonTransformer } from '@credo-ts/core' +import { ProblemReportError, CredentialFormatSpec, Attachment, CredentialProblemReportReason } from '@credo-ts/didcomm' import { AnonCredsCredentialProposal } from '../models/AnonCredsCredentialProposal' import { diff --git a/packages/anoncreds/src/formats/AnonCredsProofFormat.ts b/packages/anoncreds/src/formats/AnonCredsProofFormat.ts index 2ed36dcaba..b7e6696810 100644 --- a/packages/anoncreds/src/formats/AnonCredsProofFormat.ts +++ b/packages/anoncreds/src/formats/AnonCredsProofFormat.ts @@ -9,7 +9,7 @@ import type { AnonCredsRequestedPredicateMatch, AnonCredsSelectedCredentials, } from '../models' -import type { ProofFormat } from '@credo-ts/core' +import type { ProofFormat } from '@credo-ts/didcomm' export interface AnonCredsPresentationPreviewAttribute { name: string diff --git a/packages/anoncreds/src/formats/AnonCredsProofFormatService.ts b/packages/anoncreds/src/formats/AnonCredsProofFormatService.ts index 09a6526970..27e77c1568 100644 --- a/packages/anoncreds/src/formats/AnonCredsProofFormatService.ts +++ b/packages/anoncreds/src/formats/AnonCredsProofFormatService.ts @@ -7,9 +7,9 @@ import type { AnonCredsProofRequest, } from '../models' import type { AnonCredsHolderService, AnonCredsVerifierService } from '../services' +import type { AgentContext } from '@credo-ts/core' import type { ProofFormatService, - AgentContext, ProofFormatCreateReturn, FormatCreateRequestOptions, ProofFormatCreateProposalOptions, @@ -24,9 +24,10 @@ import type { ProofFormatAutoRespondProposalOptions, ProofFormatAutoRespondRequestOptions, ProofFormatAutoRespondPresentationOptions, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' -import { CredoError, Attachment, AttachmentData, JsonEncoder, ProofFormatSpec, JsonTransformer } from '@credo-ts/core' +import { CredoError, JsonEncoder, JsonTransformer } from '@credo-ts/core' +import { Attachment, AttachmentData, ProofFormatSpec } from '@credo-ts/didcomm' import { AnonCredsProofRequest as AnonCredsProofRequestClass } from '../models/AnonCredsProofRequest' import { AnonCredsVerifierServiceSymbol, AnonCredsHolderServiceSymbol } from '../services' diff --git a/packages/anoncreds/src/formats/DataIntegrityCredentialFormatService.ts b/packages/anoncreds/src/formats/DataIntegrityCredentialFormatService.ts index ce365aea0b..1d84f57397 100644 --- a/packages/anoncreds/src/formats/DataIntegrityCredentialFormatService.ts +++ b/packages/anoncreds/src/formats/DataIntegrityCredentialFormatService.ts @@ -3,18 +3,25 @@ import type { AnonCredsIssuerService, AnonCredsHolderService } from '../services import type { AnonCredsClaimRecord } from '../utils/credential' import type { AnonCredsCredentialMetadata, AnonCredsCredentialRequestMetadata } from '../utils/metadata' import type { + AgentContext, + JsonObject, + JwaSignatureAlgorithm, + JwsDetachedFormat, + VerificationMethod, + W3cCredentialRecord, +} from '@credo-ts/core' +import type { + W3C_VC_DATA_MODEL_VERSION, + DataIntegrityCredential, DataIntegrityCredentialRequest, AnonCredsLinkSecretBindingMethod, DidCommSignedAttachmentBindingMethod, DataIntegrityCredentialRequestBindingProof, - W3C_VC_DATA_MODEL_VERSION, - DataIntegrityCredential, AnonCredsLinkSecretDataIntegrityBindingProof, DidCommSignedAttachmentDataIntegrityBindingProof, DataIntegrityOfferCredentialFormat, DataIntegrityCredentialFormat, CredentialFormatService, - AgentContext, CredentialFormatCreateProposalOptions, CredentialFormatCreateProposalReturn, CredentialFormatProcessOptions, @@ -31,38 +38,35 @@ import type { CredentialFormatAutoRespondCredentialOptions, CredentialExchangeRecord, CredentialPreviewAttributeOptions, - JsonObject, - JwaSignatureAlgorithm, - JwsDetachedFormat, - VerificationMethod, - W3cCredentialRecord, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { - ProblemReportError, - CredentialFormatSpec, - Attachment, JsonEncoder, - CredentialProblemReportReason, JsonTransformer, W3cCredential, DidsApi, W3cCredentialService, W3cJsonLdVerifiableCredential, getJwkClassFromKeyType, - AttachmentData, JwsService, getKeyFromVerificationMethod, getJwkFromKey, ClaimFormat, JwtPayload, SignatureSuiteRegistry, - CredentialPreviewAttribute, CredoError, deepEquality, - DataIntegrityCredentialOffer, W3cCredentialSubject, } from '@credo-ts/core' +import { + ProblemReportError, + CredentialFormatSpec, + Attachment, + CredentialProblemReportReason, + AttachmentData, + CredentialPreviewAttribute, + DataIntegrityCredentialOffer, +} from '@credo-ts/didcomm' import { AnonCredsCredentialDefinitionRepository, diff --git a/packages/anoncreds/src/formats/LegacyIndyCredentialFormat.ts b/packages/anoncreds/src/formats/LegacyIndyCredentialFormat.ts index 5e7ec57ae3..341c2e3f72 100644 --- a/packages/anoncreds/src/formats/LegacyIndyCredentialFormat.ts +++ b/packages/anoncreds/src/formats/LegacyIndyCredentialFormat.ts @@ -7,7 +7,7 @@ import type { AnonCredsProposeCredentialFormat, } from './AnonCredsCredentialFormat' import type { AnonCredsCredential, AnonCredsCredentialOffer, AnonCredsCredentialRequest } from '../models' -import type { CredentialFormat } from '@credo-ts/core' +import type { CredentialFormat } from '@credo-ts/didcomm' // Legacy indy credential proposal doesn't support _id properties export type LegacyIndyCredentialProposalFormat = Omit< diff --git a/packages/anoncreds/src/formats/LegacyIndyCredentialFormatService.ts b/packages/anoncreds/src/formats/LegacyIndyCredentialFormatService.ts index 07ead68328..5f1e92c46e 100644 --- a/packages/anoncreds/src/formats/LegacyIndyCredentialFormatService.ts +++ b/packages/anoncreds/src/formats/LegacyIndyCredentialFormatService.ts @@ -2,9 +2,9 @@ import type { LegacyIndyCredentialFormat, LegacyIndyCredentialProposalFormat } f import type { AnonCredsCredential, AnonCredsCredentialOffer, AnonCredsCredentialRequest } from '../models' import type { AnonCredsIssuerService, AnonCredsHolderService } from '../services' import type { AnonCredsCredentialMetadata, AnonCredsCredentialRequestMetadata } from '../utils/metadata' +import type { AgentContext } from '@credo-ts/core' import type { CredentialFormatService, - AgentContext, CredentialFormatCreateProposalOptions, CredentialFormatCreateProposalReturn, CredentialFormatProcessOptions, @@ -22,18 +22,10 @@ import type { CredentialExchangeRecord, CredentialPreviewAttributeOptions, LinkedAttachment, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' -import { - ProblemReportError, - MessageValidator, - CredentialFormatSpec, - CredoError, - Attachment, - JsonEncoder, - CredentialProblemReportReason, - JsonTransformer, -} from '@credo-ts/core' +import { MessageValidator, CredoError, JsonEncoder, JsonTransformer } from '@credo-ts/core' +import { ProblemReportError, CredentialFormatSpec, Attachment, CredentialProblemReportReason } from '@credo-ts/didcomm' import { AnonCredsCredentialProposal } from '../models/AnonCredsCredentialProposal' import { AnonCredsIssuerServiceSymbol, AnonCredsHolderServiceSymbol } from '../services' diff --git a/packages/anoncreds/src/formats/LegacyIndyProofFormat.ts b/packages/anoncreds/src/formats/LegacyIndyProofFormat.ts index 448ba49a87..214c00193f 100644 --- a/packages/anoncreds/src/formats/LegacyIndyProofFormat.ts +++ b/packages/anoncreds/src/formats/LegacyIndyProofFormat.ts @@ -5,7 +5,7 @@ import type { AnonCredsCredentialsForProofRequest, } from './AnonCredsProofFormat' import type { AnonCredsProof, AnonCredsProofRequest, AnonCredsSelectedCredentials } from '../models' -import type { ProofFormat } from '@credo-ts/core' +import type { ProofFormat } from '@credo-ts/didcomm' // TODO: Custom restrictions to remove `_id` from restrictions? export type LegacyIndyProofRequest = AnonCredsProofRequest diff --git a/packages/anoncreds/src/formats/LegacyIndyProofFormatService.ts b/packages/anoncreds/src/formats/LegacyIndyProofFormatService.ts index e9fc51f452..fd22791a79 100644 --- a/packages/anoncreds/src/formats/LegacyIndyProofFormatService.ts +++ b/packages/anoncreds/src/formats/LegacyIndyProofFormatService.ts @@ -16,9 +16,9 @@ import type { AnonCredsProofRequest, } from '../models' import type { AnonCredsHolderService, AnonCredsVerifierService, GetCredentialsForProofRequestReturn } from '../services' +import type { AgentContext } from '@credo-ts/core' import type { ProofFormatService, - AgentContext, ProofFormatCreateReturn, FormatCreateRequestOptions, ProofFormatCreateProposalOptions, @@ -33,9 +33,10 @@ import type { ProofFormatAutoRespondProposalOptions, ProofFormatAutoRespondRequestOptions, ProofFormatAutoRespondPresentationOptions, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' -import { CredoError, Attachment, AttachmentData, JsonEncoder, ProofFormatSpec, JsonTransformer } from '@credo-ts/core' +import { CredoError, JsonEncoder, JsonTransformer } from '@credo-ts/core' +import { Attachment, AttachmentData, ProofFormatSpec } from '@credo-ts/didcomm' import { AnonCredsProofRequest as AnonCredsProofRequestClass } from '../models/AnonCredsProofRequest' import { AnonCredsVerifierServiceSymbol, AnonCredsHolderServiceSymbol } from '../services' diff --git a/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts b/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts index 6c2187f106..d28b1e6913 100644 --- a/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts +++ b/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts @@ -2,21 +2,23 @@ import type { AnonCredsCredentialRequest } from '../../models' import type { DidRepository } from '@credo-ts/core' import { - CredentialState, - CredentialExchangeRecord, KeyType, - CredentialPreviewAttribute, - ProofExchangeRecord, - ProofState, EventEmitter, InjectionSymbols, SignatureSuiteToken, W3cCredentialsModuleConfig, DidResolverService, DidsModuleConfig, +} from '@credo-ts/core' +import { + CredentialState, + CredentialExchangeRecord, + CredentialPreviewAttribute, + ProofExchangeRecord, + ProofState, ProofRole, CredentialRole, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/src/protocols/credentials/v1/V1CredentialProtocol.ts b/packages/anoncreds/src/protocols/credentials/v1/V1CredentialProtocol.ts index 1937a7c20c..b9535ce191 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/V1CredentialProtocol.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/V1CredentialProtocol.ts @@ -1,24 +1,23 @@ import type { LegacyIndyCredentialFormatService } from '../../../formats' +import type { AgentContext } from '@credo-ts/core' import type { - AgentContext, AgentMessage, - DependencyManager, - FeatureRegistry, CredentialProtocolOptions, InboundMessageContext, ProblemReportMessage, ExtractCredentialFormats, CredentialProtocol, -} from '@credo-ts/core' + FeatureRegistry, + MessageHandlerRegistry, +} from '@credo-ts/didcomm' +import { CredoError, JsonTransformer, utils } from '@credo-ts/core' import { CredentialRole, Protocol, CredentialRepository, - CredoError, CredentialExchangeRecord, CredentialState, - JsonTransformer, ConnectionService, Attachment, AttachmentData, @@ -26,12 +25,11 @@ import { CredentialProblemReportReason, CredentialsModuleConfig, AutoAcceptCredential, - utils, DidCommMessageRepository, DidCommMessageRole, BaseCredentialProtocol, isLinkedAttachment, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { AnonCredsCredentialProposal } from '../../../models/AnonCredsCredentialProposal' import { composeCredentialAutoAccept, areCredentialPreviewAttributesEqual } from '../../../utils' @@ -82,9 +80,9 @@ export class V1CredentialProtocol /** * Registers the protocol implementation (handlers, feature registry) on the agent. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry) { // Register message handlers for the Issue Credential V1 Protocol - dependencyManager.registerMessageHandlers([ + messageHandlerRegistry.registerMessageHandlers([ new V1ProposeCredentialHandler(this), new V1OfferCredentialHandler(this), new V1RequestCredentialHandler(this), diff --git a/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolCred.test.ts b/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolCred.test.ts index a138d43163..092d50ee65 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolCred.test.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolCred.test.ts @@ -1,37 +1,29 @@ -import type { - AgentContext, - CustomCredentialTags, - CredentialPreviewAttribute, - AgentConfig, - CredentialStateChangedEvent, -} from '@credo-ts/core' +import type { AgentContext, AgentConfig } from '@credo-ts/core' +import type { CustomCredentialTags, CredentialPreviewAttribute, CredentialStateChangedEvent } from '@credo-ts/didcomm' +import { EventEmitter, JsonEncoder, CredoError, JsonTransformer } from '@credo-ts/core' import { - EventEmitter, DidExchangeState, Attachment, AttachmentData, - JsonEncoder, DidCommMessageRecord, DidCommMessageRole, - CredoError, CredentialState, CredentialExchangeRecord, CredentialFormatSpec, AutoAcceptCredential, - JsonTransformer, InboundMessageContext, CredentialEventTypes, AckStatus, CredentialProblemReportReason, CredentialRole, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' -import { ConnectionService } from '../../../../../../core/src/modules/connections/services/ConnectionService' -import { CredentialRepository } from '../../../../../../core/src/modules/credentials/repository/CredentialRepository' -import { DidCommMessageRepository } from '../../../../../../core/src/storage/didcomm/DidCommMessageRepository' import { getMockConnection, getAgentConfig, getAgentContext, mockFunction } from '../../../../../../core/tests/helpers' +import { ConnectionService } from '../../../../../../didcomm/src/modules/connections/services/ConnectionService' +import { CredentialRepository } from '../../../../../../didcomm/src/modules/credentials/repository/CredentialRepository' +import { DidCommMessageRepository } from '../../../../../../didcomm/src/repository/DidCommMessageRepository' import { LegacyIndyCredentialFormatService } from '../../../../formats/LegacyIndyCredentialFormatService' import { convertAttributesToCredentialValues } from '../../../../utils/credential' import { V1CredentialProtocol } from '../V1CredentialProtocol' @@ -49,10 +41,10 @@ import { } from '../messages' // Mock classes -jest.mock('../../../../../../core/src/modules/credentials/repository/CredentialRepository') +jest.mock('../../../../../../didcomm/src/modules/credentials/repository/CredentialRepository') jest.mock('../../../../formats/LegacyIndyCredentialFormatService') -jest.mock('../../../../../../core/src/storage/didcomm/DidCommMessageRepository') -jest.mock('../../../../../../core/src/modules/connections/services/ConnectionService') +jest.mock('../../../../../../didcomm/src/repository/DidCommMessageRepository') +jest.mock('../../../../../../didcomm/src/modules/connections/services/ConnectionService') // Mock typed object const CredentialRepositoryMock = CredentialRepository as jest.Mock diff --git a/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolProposeOffer.test.ts b/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolProposeOffer.test.ts index fb5f973652..3eb29e955a 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolProposeOffer.test.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolProposeOffer.test.ts @@ -1,7 +1,7 @@ -import type { CredentialProtocolOptions, CredentialStateChangedEvent } from '@credo-ts/core' +import type { CredentialProtocolOptions, CredentialStateChangedEvent } from '@credo-ts/didcomm' +import { EventEmitter, JsonTransformer } from '@credo-ts/core' import { - EventEmitter, DidExchangeState, Attachment, AttachmentData, @@ -9,24 +9,23 @@ import { CredentialFormatSpec, CredentialExchangeRecord, CredentialEventTypes, - JsonTransformer, InboundMessageContext, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' -import { ConnectionService } from '../../../../../../core/src/modules/connections/services/ConnectionService' -import { CredentialRepository } from '../../../../../../core/src/modules/credentials/repository/CredentialRepository' -import { DidCommMessageRepository } from '../../../../../../core/src/storage/didcomm/DidCommMessageRepository' import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../../core/tests/helpers' +import { ConnectionService } from '../../../../../../didcomm/src/modules/connections/services/ConnectionService' +import { CredentialRepository } from '../../../../../../didcomm/src/modules/credentials/repository/CredentialRepository' +import { DidCommMessageRepository } from '../../../../../../didcomm/src/repository/DidCommMessageRepository' import { LegacyIndyCredentialFormatService } from '../../../../formats/LegacyIndyCredentialFormatService' import { V1CredentialProtocol } from '../V1CredentialProtocol' import { V1CredentialPreview, INDY_CREDENTIAL_OFFER_ATTACHMENT_ID, V1OfferCredentialMessage } from '../messages' // Mock classes -jest.mock('../../../../../../core/src/modules/credentials/repository/CredentialRepository') +jest.mock('../../../../../../didcomm/src/modules/credentials/repository/CredentialRepository') jest.mock('../../../../formats/LegacyIndyCredentialFormatService') -jest.mock('../../../../../../core/src/storage/didcomm/DidCommMessageRepository') -jest.mock('../../../../../../core/src/modules/connections/services/ConnectionService') +jest.mock('../../../../../../didcomm/src/repository/DidCommMessageRepository') +jest.mock('../../../../../../didcomm/src/modules/connections/services/ConnectionService') // Mock typed object const CredentialRepositoryMock = CredentialRepository as jest.Mock diff --git a/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-connectionless-credentials.e2e.test.ts b/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-connectionless-credentials.e2e.test.ts index 3b4a66d16f..dc349c1a02 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-connectionless-credentials.e2e.test.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-connectionless-credentials.e2e.test.ts @@ -1,8 +1,8 @@ import type { EventReplaySubject } from '../../../../../../core/tests' import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import type { AcceptCredentialOfferOptions, AcceptCredentialRequestOptions } from '@credo-ts/core' +import type { AcceptCredentialOfferOptions, AcceptCredentialRequestOptions } from '@credo-ts/didcomm' -import { AutoAcceptCredential, CredentialExchangeRecord, CredentialState } from '@credo-ts/core' +import { AutoAcceptCredential, CredentialExchangeRecord, CredentialState, MessageReceiver } from '@credo-ts/didcomm' import { waitForCredentialRecordSubject, testLogger } from '../../../../../../core/tests' import { setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' @@ -48,7 +48,7 @@ describe('V1 Connectionless Credentials', () => { testLogger.test('Faber sends credential offer to Alice') // eslint-disable-next-line prefer-const - let { message, credentialRecord: faberCredentialRecord } = await faberAgent.credentials.createOffer({ + let { message, credentialRecord: faberCredentialRecord } = await faberAgent.modules.credentials.createOffer({ comment: 'V1 Out of Band offer', credentialFormats: { indy: { @@ -59,13 +59,13 @@ describe('V1 Connectionless Credentials', () => { protocolVersion: 'v1', }) - const { invitationUrl } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { invitationUrl } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberCredentialRecord.id, message, domain: 'https://a-domain.com', }) - await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) + await aliceAgent.modules.oob.receiveInvitationFromUrl(invitationUrl) let aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { threadId: faberCredentialRecord.threadId, @@ -76,7 +76,7 @@ describe('V1 Connectionless Credentials', () => { const acceptOfferOptions: AcceptCredentialOfferOptions = { credentialRecordId: aliceCredentialRecord.id, } - const credentialRecord = await aliceAgent.credentials.acceptOffer(acceptOfferOptions) + const credentialRecord = await aliceAgent.modules.credentials.acceptOffer(acceptOfferOptions) testLogger.test('Faber waits for credential request from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -89,7 +89,7 @@ describe('V1 Connectionless Credentials', () => { credentialRecordId: faberCredentialRecord.id, comment: 'V1 Indy Credential', } - faberCredentialRecord = await faberAgent.credentials.acceptRequest(options) + faberCredentialRecord = await faberAgent.modules.credentials.acceptRequest(options) testLogger.test('Alice waits for credential from Faber') aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { @@ -98,7 +98,7 @@ describe('V1 Connectionless Credentials', () => { }) testLogger.test('Alice sends credential ack to Faber') - aliceCredentialRecord = await aliceAgent.credentials.acceptCredential({ + aliceCredentialRecord = await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) @@ -149,7 +149,7 @@ describe('V1 Connectionless Credentials', () => { test('Faber starts with connection-less credential offer to Alice with auto-accept enabled', async () => { // eslint-disable-next-line prefer-const - let { message, credentialRecord: faberCredentialRecord } = await faberAgent.credentials.createOffer({ + let { message, credentialRecord: faberCredentialRecord } = await faberAgent.modules.credentials.createOffer({ comment: 'V1 Out of Band offer', credentialFormats: { indy: { @@ -161,13 +161,14 @@ describe('V1 Connectionless Credentials', () => { autoAcceptCredential: AutoAcceptCredential.ContentApproved, }) - const { message: offerMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: offerMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ message, domain: 'https://a-domain.com', }) // Receive Message - await aliceAgent.receiveMessage(offerMessage.toJSON()) + const messageReceiver = aliceAgent.context.dependencyManager.resolve(MessageReceiver) + await messageReceiver.receiveMessage(offerMessage.toJSON()) // Wait for it to be processed let aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { @@ -175,7 +176,7 @@ describe('V1 Connectionless Credentials', () => { state: CredentialState.OfferReceived, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, autoAcceptCredential: AutoAcceptCredential.ContentApproved, }) diff --git a/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials-auto-accept.e2e.test.ts b/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials-auto-accept.e2e.test.ts index 274595a299..e28ac0c53a 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials-auto-accept.e2e.test.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials-auto-accept.e2e.test.ts @@ -1,13 +1,8 @@ import type { EventReplaySubject } from '../../../../../../core/tests' import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { - AutoAcceptCredential, - CredentialState, - CredentialExchangeRecord, - JsonTransformer, - CredentialRole, -} from '@credo-ts/core' +import { JsonTransformer } from '@credo-ts/core' +import { AutoAcceptCredential, CredentialState, CredentialExchangeRecord, CredentialRole } from '@credo-ts/didcomm' import { waitForCredentialRecord, waitForCredentialRecordSubject, testLogger } from '../../../../../../core/tests' import { setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' @@ -65,7 +60,7 @@ describe('V1 Credentials Auto Accept', () => { test("Alice starts with V1 credential proposal to Faber, both with autoAcceptCredential on 'always'", async () => { testLogger.test('Alice sends credential proposal to Faber') - const aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v1', credentialFormats: { @@ -107,7 +102,7 @@ describe('V1 Credentials Auto Accept', () => { test("Faber starts with V1 credential offer to Alice, both with autoAcceptCredential on 'always'", async () => { testLogger.test('Faber sends credential offer to Alice') - const faberCredentialExchangeRecord = await faberAgent.credentials.offerCredential({ + const faberCredentialExchangeRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -189,7 +184,7 @@ describe('V1 Credentials Auto Accept', () => { // ========================== test("Alice starts with V1 credential proposal to Faber, both with autoAcceptCredential on 'contentApproved'", async () => { testLogger.test('Alice sends credential proposal to Faber') - let aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + let aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v1', credentialFormats: { @@ -207,7 +202,7 @@ describe('V1 Credentials Auto Accept', () => { }) testLogger.test('Faber sends credential offer to Alice') - faberCredentialExchangeRecord = await faberAgent.credentials.acceptProposal({ + faberCredentialExchangeRecord = await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialExchangeRecord.id, comment: 'V1 Indy Offer', credentialFormats: { @@ -270,7 +265,7 @@ describe('V1 Credentials Auto Accept', () => { test("Faber starts with V1 credential offer to Alice, both with autoAcceptCredential on 'contentApproved'", async () => { testLogger.test('Faber sends credential offer to Alice') - let faberCredentialExchangeRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialExchangeRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -304,7 +299,7 @@ describe('V1 Credentials Auto Accept', () => { }) testLogger.test('alice sends credential request to faber') - faberCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + faberCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialExchangeRecord.id, }) @@ -352,7 +347,7 @@ describe('V1 Credentials Auto Accept', () => { test("Faber starts with V1 credential offer to Alice, both have autoAcceptCredential on 'contentApproved' and attributes did change", async () => { testLogger.test('Faber sends credential offer to Alice') - let faberCredentialExchangeRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialExchangeRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -382,7 +377,7 @@ describe('V1 Credentials Auto Accept', () => { }) testLogger.test('Alice sends credential request to Faber') - const aliceExchangeCredentialRecord = await aliceAgent.credentials.negotiateOffer({ + const aliceExchangeCredentialRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialExchangeRecord.id, credentialFormats: { indy: { @@ -400,16 +395,16 @@ describe('V1 Credentials Auto Accept', () => { }) // Check if the state of fabers credential record did not change - const faberRecord = await faberAgent.credentials.getById(faberCredentialExchangeRecord.id) + const faberRecord = await faberAgent.modules.credentials.getById(faberCredentialExchangeRecord.id) faberRecord.assertState(CredentialState.ProposalReceived) - aliceCredentialExchangeRecord = await aliceAgent.credentials.getById(aliceCredentialExchangeRecord.id) + aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.getById(aliceCredentialExchangeRecord.id) aliceCredentialExchangeRecord.assertState(CredentialState.ProposalSent) }) test("Alice starts with V1 credential proposal to Faber, both have autoAcceptCredential on 'contentApproved' and attributes did change", async () => { testLogger.test('Alice sends credential proposal to Faber') - const aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v1', credentialFormats: { @@ -427,7 +422,7 @@ describe('V1 Credentials Auto Accept', () => { state: CredentialState.ProposalReceived, }) - await faberAgent.credentials.negotiateProposal({ + await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialExchangeRecord.id, credentialFormats: { indy: { @@ -456,10 +451,10 @@ describe('V1 Credentials Auto Accept', () => { }) // Check if the state of the credential records did not change - faberCredentialExchangeRecord = await faberAgent.credentials.getById(faberCredentialExchangeRecord.id) + faberCredentialExchangeRecord = await faberAgent.modules.credentials.getById(faberCredentialExchangeRecord.id) faberCredentialExchangeRecord.assertState(CredentialState.OfferSent) - const aliceRecord = await aliceAgent.credentials.getById(record.id) + const aliceRecord = await aliceAgent.modules.credentials.getById(record.id) aliceRecord.assertState(CredentialState.OfferReceived) }) }) diff --git a/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials.e2e.test.ts b/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials.e2e.test.ts index 62de0baa28..411f32ead5 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials.e2e.test.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/__tests__/v1-credentials.e2e.test.ts @@ -1,12 +1,7 @@ import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { - CredentialExchangeRecord, - CredentialRole, - CredentialState, - DidCommMessageRepository, - JsonTransformer, -} from '@credo-ts/core' +import { JsonTransformer } from '@credo-ts/core' +import { CredentialExchangeRecord, CredentialRole, CredentialState, DidCommMessageRepository } from '@credo-ts/didcomm' import { waitForCredentialRecord } from '../../../../../../core/tests/helpers' import testLogger from '../../../../../../core/tests/logger' @@ -55,7 +50,7 @@ describe('V1 Credentials', () => { testLogger.test('Alice sends (v1) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v1', credentialFormats: { @@ -86,7 +81,7 @@ describe('V1 Credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V1 Indy Proposal', credentialFormats: { @@ -157,7 +152,7 @@ describe('V1 Credentials', () => { credentialIds: [], }) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -175,7 +170,7 @@ describe('V1 Credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V1 Indy Credential', }) @@ -186,7 +181,7 @@ describe('V1 Credentials', () => { state: CredentialState.CredentialReceived, }) - await aliceAgent.credentials.acceptCredential({ + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) @@ -196,17 +191,17 @@ describe('V1 Credentials', () => { state: CredentialState.Done, }) - const proposalMessage = await aliceAgent.credentials.findProposalMessage(aliceCredentialRecord.id) - const offerMessage = await aliceAgent.credentials.findOfferMessage(aliceCredentialRecord.id) - const requestMessage = await aliceAgent.credentials.findRequestMessage(aliceCredentialRecord.id) - const credentialMessage = await aliceAgent.credentials.findCredentialMessage(aliceCredentialRecord.id) + const proposalMessage = await aliceAgent.modules.credentials.findProposalMessage(aliceCredentialRecord.id) + const offerMessage = await aliceAgent.modules.credentials.findOfferMessage(aliceCredentialRecord.id) + const requestMessage = await aliceAgent.modules.credentials.findRequestMessage(aliceCredentialRecord.id) + const credentialMessage = await aliceAgent.modules.credentials.findCredentialMessage(aliceCredentialRecord.id) expect(proposalMessage).toBeInstanceOf(V1ProposeCredentialMessage) expect(offerMessage).toBeInstanceOf(V1OfferCredentialMessage) expect(requestMessage).toBeInstanceOf(V1RequestCredentialMessage) expect(credentialMessage).toBeInstanceOf(V1IssueCredentialMessage) - const formatData = await aliceAgent.credentials.getFormatData(aliceCredentialRecord.id) + const formatData = await aliceAgent.modules.credentials.getFormatData(aliceCredentialRecord.id) expect(formatData).toMatchObject({ proposalAttributes: [ { diff --git a/packages/anoncreds/src/protocols/credentials/v1/errors/V1CredentialProblemReportError.ts b/packages/anoncreds/src/protocols/credentials/v1/errors/V1CredentialProblemReportError.ts index 2870a2d46b..71c86e0772 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/errors/V1CredentialProblemReportError.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/errors/V1CredentialProblemReportError.ts @@ -1,6 +1,6 @@ -import type { ProblemReportErrorOptions, CredentialProblemReportReason } from '@credo-ts/core' +import type { ProblemReportErrorOptions, CredentialProblemReportReason } from '@credo-ts/didcomm' -import { ProblemReportError } from '@credo-ts/core' +import { ProblemReportError } from '@credo-ts/didcomm' import { V1CredentialProblemReportMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialAckHandler.ts b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialAckHandler.ts index 157c838c55..d0a2bbd16f 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialAckHandler.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialAckHandler.ts @@ -1,5 +1,5 @@ import type { V1CredentialProtocol } from '../V1CredentialProtocol' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { V1CredentialAckMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.ts b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.ts index d715fe5e0d..264f60664a 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1CredentialProblemReportHandler.ts @@ -1,5 +1,5 @@ import type { V1CredentialProtocol } from '../V1CredentialProtocol' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { V1CredentialProblemReportMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1IssueCredentialHandler.ts b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1IssueCredentialHandler.ts index 9f674b6841..9f2b87eb1f 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1IssueCredentialHandler.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1IssueCredentialHandler.ts @@ -1,7 +1,8 @@ import type { V1CredentialProtocol } from '../V1CredentialProtocol' -import type { MessageHandler, MessageHandlerInboundMessage, CredentialExchangeRecord } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage, CredentialExchangeRecord } from '@credo-ts/didcomm' -import { CredoError, getOutboundMessageContext } from '@credo-ts/core' +import { CredoError } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { V1IssueCredentialMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1OfferCredentialHandler.ts b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1OfferCredentialHandler.ts index 25ba57e784..24aa09c08e 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1OfferCredentialHandler.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1OfferCredentialHandler.ts @@ -1,7 +1,7 @@ import type { V1CredentialProtocol } from '../V1CredentialProtocol' -import type { MessageHandler, MessageHandlerInboundMessage, CredentialExchangeRecord } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage, CredentialExchangeRecord } from '@credo-ts/didcomm' -import { getOutboundMessageContext } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { V1OfferCredentialMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.ts b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.ts index e57e4445e2..29d381c898 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1ProposeCredentialHandler.ts @@ -1,7 +1,7 @@ import type { V1CredentialProtocol } from '../V1CredentialProtocol' -import type { CredentialExchangeRecord, MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { CredentialExchangeRecord, MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' -import { getOutboundMessageContext } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { V1ProposeCredentialMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1RequestCredentialHandler.ts b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1RequestCredentialHandler.ts index 807438438a..737deb564e 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/handlers/V1RequestCredentialHandler.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/handlers/V1RequestCredentialHandler.ts @@ -1,7 +1,8 @@ import type { V1CredentialProtocol } from '../V1CredentialProtocol' -import type { CredentialExchangeRecord, MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { CredentialExchangeRecord, MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' -import { CredoError, getOutboundMessageContext } from '@credo-ts/core' +import { CredoError } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { V1RequestCredentialMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts index 107962e531..7ffa36d909 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts @@ -1,6 +1,6 @@ -import type { AckMessageOptions } from '@credo-ts/core' +import type { AckMessageOptions } from '@credo-ts/didcomm' -import { AckMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AckMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' export type V1CredentialAckMessageOptions = AckMessageOptions diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialPreview.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialPreview.ts index ed1fcfc4d6..917b185c1c 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialPreview.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialPreview.ts @@ -1,12 +1,12 @@ -import type { CredentialPreviewOptions } from '@credo-ts/core' +import type { CredentialPreviewOptions } from '@credo-ts/didcomm' +import { JsonTransformer } from '@credo-ts/core' import { CredentialPreviewAttribute, IsValidMessageType, parseMessageType, - JsonTransformer, replaceLegacyDidSovPrefix, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { Expose, Transform, Type } from 'class-transformer' import { ValidateNested, IsInstance } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts index 520fb474c6..bc30ccc52a 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts @@ -1,6 +1,6 @@ -import type { ProblemReportMessageOptions } from '@credo-ts/core' +import type { ProblemReportMessageOptions } from '@credo-ts/didcomm' -import { ProblemReportMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { ProblemReportMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' export type V1CredentialProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts index 5985f51b11..4b1a07226c 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts @@ -1,6 +1,6 @@ import type { AnonCredsCredential } from '../../../../models' -import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsString, IsOptional, IsArray, ValidateNested, IsInstance } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts index 3697d011ec..611d5a7b04 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts @@ -1,6 +1,6 @@ import type { AnonCredsCredentialOffer } from '../../../../models' -import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsString, IsOptional, ValidateNested, IsInstance, IsArray } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts index 4c4f1c05fa..a826d5c055 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts @@ -1,6 +1,6 @@ -import type { Attachment } from '@credo-ts/core' +import type { Attachment } from '@credo-ts/didcomm' -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, IsString, Matches, ValidateNested } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts index 794b485bfd..eda3341876 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts @@ -1,6 +1,6 @@ import type { LegacyIndyCredentialRequest } from '../../../../formats' -import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/proofs/v1/V1ProofProtocol.ts b/packages/anoncreds/src/protocols/proofs/v1/V1ProofProtocol.ts index df5c931712..8401e64d3f 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/V1ProofProtocol.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/V1ProofProtocol.ts @@ -1,38 +1,34 @@ import type { LegacyIndyProofFormatService } from '../../../formats' +import type { AgentContext } from '@credo-ts/core' import type { ProofProtocol, - DependencyManager, - FeatureRegistry, - AgentContext, ProofProtocolOptions, InboundMessageContext, AgentMessage, ProblemReportMessage, GetProofFormatDataReturn, ProofFormat, -} from '@credo-ts/core' + FeatureRegistry, + MessageHandlerRegistry, +} from '@credo-ts/didcomm' +import { CredoError, JsonEncoder, JsonTransformer, MessageValidator, utils } from '@credo-ts/core' import { ProofRole, BaseProofProtocol, Protocol, ProofRepository, DidCommMessageRepository, - CredoError, - MessageValidator, ProofExchangeRecord, ProofState, DidCommMessageRole, ConnectionService, Attachment, - JsonTransformer, PresentationProblemReportReason, AckStatus, ProofsModuleConfig, AutoAcceptProof, - JsonEncoder, - utils, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { composeProofAutoAccept, createRequestFromPreview } from '../../../utils' @@ -77,9 +73,9 @@ export class V1ProofProtocol extends BaseProofProtocol implements ProofProtocol< /** * Registers the protocol implementation (handlers, feature registry) on the agent. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry) { // Register message handlers for the Issue Credential V1 Protocol - dependencyManager.registerMessageHandlers([ + messageHandlerRegistry.registerMessageHandlers([ new V1ProposePresentationHandler(this), new V1RequestPresentationHandler(this), new V1PresentationHandler(this), diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/V1ProofProtocol.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/V1ProofProtocol.test.ts index 5d7a2cde62..ceee13c58e 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/V1ProofProtocol.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/V1ProofProtocol.test.ts @@ -1,7 +1,10 @@ -import type { CustomProofTags, AgentConfig, AgentContext, ProofStateChangedEvent } from '../../../../../../core/src' +import type { AgentConfig, AgentContext } from '../../../../../../core/src' +import type { CustomProofTags, ProofStateChangedEvent } from '../../../../../../didcomm/src' import { Subject } from 'rxjs' +import { EventEmitter } from '../../../../../../core/src' +import { getMockConnection, getAgentConfig, getAgentContext, mockFunction } from '../../../../../../core/tests' import { ProofRole, DidExchangeState, @@ -12,22 +15,20 @@ import { InboundMessageContext, ProofEventTypes, PresentationProblemReportReason, - EventEmitter, -} from '../../../../../../core/src' -import { ConnectionService } from '../../../../../../core/src/modules/connections/services/ConnectionService' -import { ProofRepository } from '../../../../../../core/src/modules/proofs/repository/ProofRepository' -import { DidCommMessageRepository } from '../../../../../../core/src/storage/didcomm/DidCommMessageRepository' -import { getMockConnection, getAgentConfig, getAgentContext, mockFunction } from '../../../../../../core/tests' +} from '../../../../../../didcomm/src' +import { ConnectionService } from '../../../../../../didcomm/src/modules/connections/services/ConnectionService' +import { ProofRepository } from '../../../../../../didcomm/src/modules/proofs/repository/ProofRepository' +import { DidCommMessageRepository } from '../../../../../../didcomm/src/repository/DidCommMessageRepository' import { LegacyIndyProofFormatService } from '../../../../formats/LegacyIndyProofFormatService' import { V1ProofProtocol } from '../V1ProofProtocol' import { INDY_PROOF_REQUEST_ATTACHMENT_ID, V1RequestPresentationMessage } from '../messages' import { V1PresentationProblemReportMessage } from '../messages/V1PresentationProblemReportMessage' // Mock classes -jest.mock('../../../../../../core/src/modules/proofs/repository/ProofRepository') +jest.mock('../../../../../../didcomm/src/modules/proofs/repository/ProofRepository') jest.mock('../../../../formats/LegacyIndyProofFormatService') -jest.mock('../../../../../../core/src/storage/didcomm/DidCommMessageRepository') -jest.mock('../../../../../../core/src/modules/connections/services/ConnectionService') +jest.mock('../../../../../../didcomm/src/repository/DidCommMessageRepository') +jest.mock('../../../../../../didcomm/src/modules/connections/services/ConnectionService') // Mock typed object const ProofRepositoryMock = ProofRepository as jest.Mock diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-connectionless-proofs.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-connectionless-proofs.e2e.test.ts index 9b7c86c770..50d956d716 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-connectionless-proofs.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-connectionless-proofs.e2e.test.ts @@ -5,9 +5,17 @@ import { Subject } from 'rxjs' import { SubjectInboundTransport } from '../../../../../../../tests/transport/SubjectInboundTransport' import { SubjectOutboundTransport } from '../../../../../../../tests/transport/SubjectOutboundTransport' +import { Agent } from '../../../../../../core/src' +import { uuid } from '../../../../../../core/src/utils/uuid' +import { + testLogger, + waitForProofExchangeRecordSubject, + makeConnection, + setupEventReplaySubjects, + getInMemoryAgentOptions, +} from '../../../../../../core/tests' import { CredentialEventTypes, - Agent, AutoAcceptProof, ProofState, HandshakeProtocol, @@ -18,15 +26,8 @@ import { ProofEventTypes, MediatorModule, MediationRecipientModule, -} from '../../../../../../core/src' -import { uuid } from '../../../../../../core/src/utils/uuid' -import { - testLogger, - waitForProofExchangeRecordSubject, - makeConnection, - setupEventReplaySubjects, - getInMemoryAgentOptions, -} from '../../../../../../core/tests' + MessageReceiver, +} from '../../../../../../didcomm/src' import { getAnonCredsIndyModules, issueLegacyAnonCredsCredential, @@ -87,7 +88,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { testLogger.test('Faber sends presentation request to Alice') // eslint-disable-next-line prefer-const - let { proofRecord: faberProofExchangeRecord, message } = await faberAgent.proofs.createRequest({ + let { proofRecord: faberProofExchangeRecord, message } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v1', proofFormats: { indy: { @@ -119,11 +120,11 @@ describe('V1 Proofs - Connectionless - Indy', () => { }, }) - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ messages: [message], handshake: false, }) - await aliceAgent.oob.receiveInvitation(outOfBandRecord.outOfBandInvitation) + await aliceAgent.modules.oob.receiveInvitation(outOfBandRecord.outOfBandInvitation) testLogger.test('Alice waits for presentation request from Faber') let aliceProofExchangeRecord = await waitForProofExchangeRecordSubject(aliceReplay, { @@ -131,11 +132,11 @@ describe('V1 Proofs - Connectionless - Indy', () => { }) testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, useReturnRoute: returnRoute, proofFormats: { indy: requestedCredentials.proofFormats.indy }, @@ -147,12 +148,12 @@ describe('V1 Proofs - Connectionless - Indy', () => { state: ProofState.PresentationReceived, }) - const sentPresentationMessage = aliceAgent.proofs.findPresentationMessage(aliceProofExchangeRecord.id) + const sentPresentationMessage = aliceAgent.modules.proofs.findPresentationMessage(aliceProofExchangeRecord.id) // assert presentation is valid expect(faberProofExchangeRecord.isVerified).toBe(true) // Faber accepts presentation - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits till it receives presentation ack aliceProofExchangeRecord = await waitForProofExchangeRecordSubject(aliceReplay, { @@ -204,7 +205,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { agents = [aliceAgent, faberAgent] - const { message, proofRecord: faberProofExchangeRecord } = await faberAgent.proofs.createRequest({ + const { message, proofRecord: faberProofExchangeRecord } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v1', proofFormats: { indy: { @@ -237,13 +238,13 @@ describe('V1 Proofs - Connectionless - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'https://a-domain.com', }) - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.context.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Done, @@ -294,7 +295,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { agents = [aliceAgent, faberAgent] - const { message } = await faberAgent.proofs.createRequest({ + const { message } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v1', proofFormats: { indy: { @@ -327,16 +328,17 @@ describe('V1 Proofs - Connectionless - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { invitationUrl, message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ - message, - domain: 'https://a-domain.com', - }) + const { invitationUrl, message: requestMessage } = + await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ + message, + domain: 'https://a-domain.com', + }) - for (const transport of faberAgent.outboundTransports) { - await faberAgent.unregisterOutboundTransport(transport) + for (const transport of faberAgent.modules.didcomm.outboundTransports) { + await faberAgent.modules.didcomm.unregisterOutboundTransport(transport) } - await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) + await aliceAgent.modules.oob.receiveInvitationFromUrl(invitationUrl) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Done, @@ -364,6 +366,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { { endpoints: ['rxjs:mediator'], }, + {}, { mediator: new MediatorModule({ autoAcceptMediationRequests: true, @@ -376,16 +379,16 @@ describe('V1 Proofs - Connectionless - Indy', () => { // Initialize mediator const mediatorAgent = new Agent(mediatorAgentOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() - const faberMediationOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const faberMediationOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'faber invitation', handshakeProtocols: [HandshakeProtocol.Connections], }) - const aliceMediationOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const aliceMediationOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'alice invitation', handshakeProtocols: [HandshakeProtocol.Connections], }) @@ -393,6 +396,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { const faberAgentOptions = getInMemoryAgentOptions( `Connectionless proofs with mediator Faber-${unique}`, {}, + {}, { ...getAnonCredsIndyModules({ autoAcceptProofs: AutoAcceptProof.Always, @@ -409,6 +413,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { const aliceAgentOptions = getInMemoryAgentOptions( `Connectionless proofs with mediator Alice-${unique}`, {}, + {}, { ...getAnonCredsIndyModules({ autoAcceptProofs: AutoAcceptProof.Always, @@ -423,12 +428,16 @@ describe('V1 Proofs - Connectionless - Indy', () => { ) const faberAgent = new Agent(faberAgentOptions) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + // FIXME: This should be done automatically when agent initializes await faberAgent.initialize() + await faberAgent.modules.mediationRecipient.initialize() const aliceAgent = new Agent(aliceAgentOptions) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() + // FIXME: This should be done automatically when agent initializes + await aliceAgent.modules.mediationRecipient.initialize() const [faberReplay, aliceReplay] = setupEventReplaySubjects( [faberAgent, aliceAgent], @@ -474,7 +483,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { }) // eslint-disable-next-line prefer-const - let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.proofs.createRequest({ + let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v1', proofFormats: { indy: { @@ -507,13 +516,13 @@ describe('V1 Proofs - Connectionless - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'https://a-domain.com', }) - const mediationRecord = await faberAgent.mediationRecipient.findDefaultMediator() + const mediationRecord = await faberAgent.modules.mediationRecipient.findDefaultMediator() if (!mediationRecord) { throw new Error('Faber agent has no default mediator') } @@ -526,7 +535,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { }, }) - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.context.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Done, @@ -538,7 +547,7 @@ describe('V1 Proofs - Connectionless - Indy', () => { threadId: requestMessage.threadId, }) - await aliceAgent.mediationRecipient.stopMessagePickup() - await faberAgent.mediationRecipient.stopMessagePickup() + await aliceAgent.modules.mediationRecipient.stopMessagePickup() + await faberAgent.modules.mediationRecipient.stopMessagePickup() }) }) diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-negotiation.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-negotiation.e2e.test.ts index 917f5c805d..8083383c1e 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-negotiation.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-negotiation.e2e.test.ts @@ -1,9 +1,9 @@ -import type { AcceptProofProposalOptions } from '../../../../../../core/src' +import type { AcceptProofProposalOptions } from '../../../../../../didcomm/src' import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' import type { V1RequestPresentationMessage } from '../messages' -import { ProofState } from '../../../../../../core/src' import { testLogger, waitForProofExchangeRecord } from '../../../../../../core/tests' +import { ProofState } from '../../../../../../didcomm/src' import { setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' describe('Present Proof', () => { @@ -41,7 +41,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -65,7 +65,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') let faberProofExchangeRecord = await faberProofExchangeRecordPromise - let proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + let proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/propose-presentation', id: expect.any(String), @@ -96,7 +96,7 @@ describe('Present Proof', () => { }) testLogger.test('Faber sends new proof request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.negotiateProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.negotiateProposal({ proofRecordId: faberProofExchangeRecord.id, proofFormats: { indy: { @@ -131,7 +131,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for proof request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - let request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + let request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), @@ -161,7 +161,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - aliceProofExchangeRecord = await aliceAgent.proofs.negotiateRequest({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.negotiateRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: { @@ -184,7 +184,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/propose-presentation', id: expect.any(String), @@ -220,12 +220,12 @@ describe('Present Proof', () => { }) testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal(acceptProposalOptions) + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal(acceptProposalOptions) testLogger.test('Alice waits for proof request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), @@ -249,7 +249,7 @@ describe('Present Proof', () => { protocolVersion: 'v1', }) - const proposalMessage = await aliceAgent.proofs.findProposalMessage(aliceProofExchangeRecord.id) + const proposalMessage = await aliceAgent.modules.proofs.findProposalMessage(aliceProofExchangeRecord.id) expect(proposalMessage).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/propose-presentation', id: expect.any(String), @@ -268,7 +268,7 @@ describe('Present Proof', () => { }, }) - const proofRequestMessage = (await aliceAgent.proofs.findRequestMessage( + const proofRequestMessage = (await aliceAgent.modules.proofs.findRequestMessage( aliceProofExchangeRecord.id )) as V1RequestPresentationMessage diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-presentation.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-presentation.e2e.test.ts index 5b4c358a2f..fbd1d852cc 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-presentation.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-presentation.e2e.test.ts @@ -1,8 +1,8 @@ import type { EventReplaySubject } from '../../../../../../core/tests' import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { ProofState, ProofExchangeRecord } from '../../../../../../core/src' import { testLogger, waitForProofExchangeRecord } from '../../../../../../core/tests' +import { ProofState, ProofExchangeRecord } from '../../../../../../didcomm/src' import { issueLegacyAnonCredsCredential, setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' describe('Present Proof', () => { @@ -67,7 +67,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -99,7 +99,7 @@ describe('Present Proof', () => { let faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/propose-presentation', id: expect.any(String), @@ -138,14 +138,14 @@ describe('Present Proof', () => { }) testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) testLogger.test('Alice waits for proof request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), @@ -169,7 +169,7 @@ describe('Present Proof', () => { protocolVersion: 'v1', }) - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -178,7 +178,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: requestedCredentials.proofFormats.indy }, }) @@ -187,7 +187,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/presentation', id: expect.any(String), @@ -218,7 +218,7 @@ describe('Present Proof', () => { }) // Faber accepts the presentation provided by Alice - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-proposal.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-proposal.e2e.test.ts index 14e9e72145..ad90e8042a 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-proposal.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-proposal.e2e.test.ts @@ -1,7 +1,7 @@ import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { ProofState } from '../../../../../../core/src' import { testLogger, waitForProofExchangeRecord } from '../../../../../../core/tests' +import { ProofState } from '../../../../../../didcomm/src' import { setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' describe('Present Proof', () => { @@ -39,7 +39,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - await aliceAgent.proofs.proposeProof({ + await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -70,7 +70,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') const faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/propose-presentation', id: expect.any(String), diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-request.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-request.e2e.test.ts index 36e9203b0d..be9f94ee6d 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-request.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proof-request.e2e.test.ts @@ -1,7 +1,7 @@ import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { ProofState } from '../../../../../../core/src' import { testLogger, waitForProofExchangeRecord } from '../../../../../../core/tests' +import { ProofState } from '../../../../../../didcomm/src' import { setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' describe('Present Proof | V1ProofProtocol', () => { @@ -39,7 +39,7 @@ describe('Present Proof | V1ProofProtocol', () => { state: ProofState.ProposalReceived, }) - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -70,7 +70,7 @@ describe('Present Proof | V1ProofProtocol', () => { testLogger.test('Faber waits for presentation from Alice') let faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal?.toJSON()).toMatchObject({ '@type': 'https://didcomm.org/present-proof/1.0/propose-presentation', '@id': expect.any(String), @@ -109,14 +109,14 @@ describe('Present Proof | V1ProofProtocol', () => { // Accept Proposal testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) testLogger.test('Alice waits for proof request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proofs.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proofs.e2e.test.ts index ff71996463..fdaaf2fdb0 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proofs.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-indy-proofs.e2e.test.ts @@ -1,8 +1,8 @@ import type { EventReplaySubject } from '../../../../../../core/tests' import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { ProofState, ProofExchangeRecord } from '../../../../../../core/src' import { testLogger, waitForProofExchangeRecord } from '../../../../../../core/tests' +import { ProofState, ProofExchangeRecord } from '../../../../../../didcomm/src' import { issueLegacyAnonCredsCredential, setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' import { V1ProposePresentationMessage, V1RequestPresentationMessage, V1PresentationMessage } from '../messages' @@ -63,7 +63,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -91,7 +91,7 @@ describe('Present Proof', () => { // Faber waits for a presentation proposal from Alice testLogger.test('Faber waits for a presentation proposal from Alice') let faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/propose-presentation', id: expect.any(String), @@ -129,7 +129,7 @@ describe('Present Proof', () => { // Faber accepts the presentation proposal from Alice testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -137,7 +137,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), @@ -158,7 +158,7 @@ describe('Present Proof', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -167,7 +167,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: requestedCredentials.proofFormats.indy }, }) @@ -176,7 +176,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/presentation', id: expect.any(String), @@ -208,7 +208,7 @@ describe('Present Proof', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') @@ -233,15 +233,15 @@ describe('Present Proof', () => { state: ProofState.Done, }) - const proposalMessage = await aliceAgent.proofs.findProposalMessage(aliceProofExchangeRecord.id) - const requestMessage = await aliceAgent.proofs.findRequestMessage(aliceProofExchangeRecord.id) - const presentationMessage = await aliceAgent.proofs.findPresentationMessage(aliceProofExchangeRecord.id) + const proposalMessage = await aliceAgent.modules.proofs.findProposalMessage(aliceProofExchangeRecord.id) + const requestMessage = await aliceAgent.modules.proofs.findRequestMessage(aliceProofExchangeRecord.id) + const presentationMessage = await aliceAgent.modules.proofs.findPresentationMessage(aliceProofExchangeRecord.id) expect(proposalMessage).toBeInstanceOf(V1ProposePresentationMessage) expect(requestMessage).toBeInstanceOf(V1RequestPresentationMessage) expect(presentationMessage).toBeInstanceOf(V1PresentationMessage) - const formatData = await aliceAgent.proofs.getFormatData(aliceProofExchangeRecord.id) + const formatData = await aliceAgent.modules.proofs.getFormatData(aliceProofExchangeRecord.id) const proposalPredicateKey = Object.keys(formatData.proposal?.indy?.requested_predicates || {})[0] const requestPredicateKey = Object.keys(formatData.request?.indy?.requested_predicates || {})[0] @@ -312,7 +312,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - let faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + let faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v1', connectionId: faberConnectionId, proofFormats: { @@ -349,7 +349,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') let aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), @@ -374,7 +374,7 @@ describe('Present Proof', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -383,7 +383,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: requestedCredentials.proofFormats.indy }, }) @@ -392,7 +392,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/presentation', id: expect.any(String), @@ -424,7 +424,7 @@ describe('Present Proof', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') @@ -452,7 +452,7 @@ describe('Present Proof', () => { test('an attribute group name matches with a predicate group name so an error is thrown', async () => { await expect( - faberAgent.proofs.requestProof({ + faberAgent.modules.proofs.requestProof({ protocolVersion: 'v1', connectionId: faberConnectionId, proofFormats: { @@ -494,7 +494,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - let faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + let faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v1', connectionId: faberConnectionId, proofFormats: { @@ -531,7 +531,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') let aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: expect.any(String), @@ -558,7 +558,7 @@ describe('Present Proof', () => { state: ProofState.Abandoned, }) - aliceProofExchangeRecord = await aliceAgent.proofs.sendProblemReport({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.sendProblemReport({ proofRecordId: aliceProofExchangeRecord.id, description: 'Problem inside proof request', }) diff --git a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-proofs-auto-accept.e2e.test.ts b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-proofs-auto-accept.e2e.test.ts index 407e975271..dcb4025b31 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-proofs-auto-accept.e2e.test.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/__tests__/v1-proofs-auto-accept.e2e.test.ts @@ -1,8 +1,8 @@ import type { EventReplaySubject } from '../../../../../../core/tests' import type { AnonCredsTestsAgent } from '../../../../../tests/legacyAnonCredsSetup' -import { AutoAcceptProof, ProofState } from '../../../../../../core/src' import { testLogger, waitForProofExchangeRecord } from '../../../../../../core/tests' +import { AutoAcceptProof, ProofState } from '../../../../../../didcomm/src' import { issueLegacyAnonCredsCredential, setupAnonCredsTests } from '../../../../../tests/legacyAnonCredsSetup' describe('Auto accept present proof', () => { @@ -56,7 +56,7 @@ describe('Auto accept present proof', () => { test("Alice starts with proof proposal to Faber, both with autoAcceptProof on 'always'", async () => { testLogger.test('Alice sends presentation proposal to Faber') - await aliceAgent.proofs.proposeProof({ + await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -93,7 +93,7 @@ describe('Auto accept present proof', () => { test("Faber starts with proof requests to Alice, both with autoAcceptProof on 'always'", async () => { testLogger.test('Faber sends presentation request to Alice') - await faberAgent.proofs.requestProof({ + await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v1', connectionId: faberConnectionId, proofFormats: { @@ -178,7 +178,7 @@ describe('Auto accept present proof', () => { test("Alice starts with proof proposal to Faber, both with autoAcceptProof on 'contentApproved'", async () => { testLogger.test('Alice sends presentation proposal to Faber') - const aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + const aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', proofFormats: { @@ -211,7 +211,7 @@ describe('Auto accept present proof', () => { }) testLogger.test('Faber accepts presentation proposal from Alice') - await faberAgent.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id }) await Promise.all([ waitForProofExchangeRecord(aliceAgent, { state: ProofState.Done }), @@ -222,7 +222,7 @@ describe('Auto accept present proof', () => { test("Faber starts with proof requests to Alice, both with autoAcceptProof on 'contentApproved'", async () => { testLogger.test('Faber sends presentation request to Alice') - await faberAgent.proofs.requestProof({ + await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v1', connectionId: faberConnectionId, proofFormats: { @@ -260,8 +260,8 @@ describe('Auto accept present proof', () => { state: ProofState.RequestReceived, }) - const { proofFormats } = await aliceAgent.proofs.selectCredentialsForRequest({ proofRecordId }) - await aliceAgent.proofs.acceptRequest({ proofRecordId, proofFormats }) + const { proofFormats } = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId }) + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId, proofFormats }) await Promise.all([ waitForProofExchangeRecord(aliceAgent, { state: ProofState.Done }), diff --git a/packages/anoncreds/src/protocols/proofs/v1/errors/V1PresentationProblemReportError.ts b/packages/anoncreds/src/protocols/proofs/v1/errors/V1PresentationProblemReportError.ts index 67558537bd..3ff6cf3b08 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/errors/V1PresentationProblemReportError.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/errors/V1PresentationProblemReportError.ts @@ -1,6 +1,6 @@ -import type { ProblemReportErrorOptions, PresentationProblemReportReason } from '@credo-ts/core' +import type { ProblemReportErrorOptions, PresentationProblemReportReason } from '@credo-ts/didcomm' -import { ProblemReportError } from '@credo-ts/core' +import { ProblemReportError } from '@credo-ts/didcomm' import { V1PresentationProblemReportMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationAckHandler.ts b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationAckHandler.ts index dca810be6e..72fdb6175c 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationAckHandler.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationAckHandler.ts @@ -1,5 +1,5 @@ import type { V1ProofProtocol } from '../V1ProofProtocol' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { V1PresentationAckMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationHandler.ts b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationHandler.ts index 33c270f76c..17e86abb64 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationHandler.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationHandler.ts @@ -1,7 +1,8 @@ import type { V1ProofProtocol } from '../V1ProofProtocol' -import type { MessageHandler, MessageHandlerInboundMessage, ProofExchangeRecord } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage, ProofExchangeRecord } from '@credo-ts/didcomm' -import { CredoError, getOutboundMessageContext } from '@credo-ts/core' +import { CredoError } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { V1PresentationMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.ts b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.ts index f0239f4088..16be48546a 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1PresentationProblemReportHandler.ts @@ -1,5 +1,5 @@ import type { V1ProofProtocol } from '../V1ProofProtocol' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { V1PresentationProblemReportMessage } from '../messages/V1PresentationProblemReportMessage' diff --git a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1ProposePresentationHandler.ts b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1ProposePresentationHandler.ts index 79237132df..bb033c132c 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1ProposePresentationHandler.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1ProposePresentationHandler.ts @@ -1,7 +1,7 @@ import type { V1ProofProtocol } from '../V1ProofProtocol' -import type { MessageHandler, MessageHandlerInboundMessage, ProofExchangeRecord } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage, ProofExchangeRecord } from '@credo-ts/didcomm' -import { OutboundMessageContext } from '@credo-ts/core' +import { OutboundMessageContext } from '@credo-ts/didcomm' import { V1ProposePresentationMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1RequestPresentationHandler.ts b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1RequestPresentationHandler.ts index 4bef0b7682..53a7663bb7 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/handlers/V1RequestPresentationHandler.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/handlers/V1RequestPresentationHandler.ts @@ -1,7 +1,7 @@ import type { V1ProofProtocol } from '../V1ProofProtocol' -import type { MessageHandler, MessageHandlerInboundMessage, ProofExchangeRecord } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage, ProofExchangeRecord } from '@credo-ts/didcomm' -import { getOutboundMessageContext } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { V1RequestPresentationMessage } from '../messages' diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts index 1fb511065f..a4138ee687 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts @@ -1,6 +1,6 @@ -import type { AckMessageOptions } from '@credo-ts/core' +import type { AckMessageOptions } from '@credo-ts/didcomm' -import { AckMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AckMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' export class V1PresentationAckMessage extends AckMessage { public readonly allowDidSovPrefix = true diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts index c862708eef..677ca7baf0 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts @@ -1,6 +1,6 @@ import type { AnonCredsProof } from '../../../../models' -import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsArray, IsString, ValidateNested, IsOptional, IsInstance } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts index ef603cc082..615d790aa8 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts @@ -1,6 +1,6 @@ -import type { ProblemReportMessageOptions } from '@credo-ts/core' +import type { ProblemReportMessageOptions } from '@credo-ts/didcomm' -import { ProblemReportMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { ProblemReportMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' export type V1PresentationProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts index 107e2f5ed4..5e61c703aa 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts index b5caecd945..b40249b76a 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts @@ -1,6 +1,6 @@ import type { LegacyIndyProofRequest } from '../../../../formats' -import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { Attachment, AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsArray, IsString, ValidateNested, IsOptional, IsInstance } from 'class-validator' diff --git a/packages/anoncreds/src/protocols/proofs/v1/models/V1PresentationPreview.ts b/packages/anoncreds/src/protocols/proofs/v1/models/V1PresentationPreview.ts index 3d23e55bc8..c363c91c8d 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/models/V1PresentationPreview.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/models/V1PresentationPreview.ts @@ -1,4 +1,5 @@ -import { JsonTransformer, IsValidMessageType, replaceLegacyDidSovPrefix, parseMessageType } from '@credo-ts/core' +import { JsonTransformer } from '@credo-ts/core' +import { IsValidMessageType, replaceLegacyDidSovPrefix, parseMessageType } from '@credo-ts/didcomm' import { Expose, Transform, Type } from 'class-transformer' import { IsIn, diff --git a/packages/anoncreds/src/updates/0.3.1-0.4/__tests__/credentialExchangeRecord.test.ts b/packages/anoncreds/src/updates/0.3.1-0.4/__tests__/credentialExchangeRecord.test.ts index 58f116efdb..14de98b060 100644 --- a/packages/anoncreds/src/updates/0.3.1-0.4/__tests__/credentialExchangeRecord.test.ts +++ b/packages/anoncreds/src/updates/0.3.1-0.4/__tests__/credentialExchangeRecord.test.ts @@ -1,9 +1,10 @@ -import type { CredentialRecordBinding, CredentialState } from '../../../../../core/src' +import type { CredentialRecordBinding, CredentialState } from '../../../../../didcomm/src' -import { CredentialExchangeRecord, JsonTransformer } from '../../../../../core/src' +import { JsonTransformer } from '../../../../../core/src' import { Agent } from '../../../../../core/src/agent/Agent' -import { CredentialRepository } from '../../../../../core/src/modules/credentials/repository/CredentialRepository' import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests' +import { CredentialExchangeRecord } from '../../../../../didcomm/src' +import { CredentialRepository } from '../../../../../didcomm/src/modules/credentials/repository/CredentialRepository' import { migrateIndyCredentialMetadataToAnonCredsMetadata, migrateIndyCredentialTypeToAnonCredsCredential, @@ -13,7 +14,7 @@ import * as testModule from '../credentialExchangeRecord' const agentConfig = getAgentConfig('AnonCreds Migration - Credential Exchange Record - 0.3.1-0.4.0') const agentContext = getAgentContext() -jest.mock('../../../../../core/src/modules/credentials/repository/CredentialRepository') +jest.mock('../../../../../didcomm/src/modules/credentials/repository/CredentialRepository') const CredentialRepositoryMock = CredentialRepository as jest.Mock const credentialRepository = new CredentialRepositoryMock() diff --git a/packages/anoncreds/src/updates/0.3.1-0.4/credentialExchangeRecord.ts b/packages/anoncreds/src/updates/0.3.1-0.4/credentialExchangeRecord.ts index 224a5d5ea3..9c050155c5 100644 --- a/packages/anoncreds/src/updates/0.3.1-0.4/credentialExchangeRecord.ts +++ b/packages/anoncreds/src/updates/0.3.1-0.4/credentialExchangeRecord.ts @@ -1,6 +1,7 @@ -import type { BaseAgent, CredentialExchangeRecord } from '@credo-ts/core' +import type { BaseAgent } from '@credo-ts/core' +import type { CredentialExchangeRecord } from '@credo-ts/didcomm' -import { CredentialRepository } from '@credo-ts/core' +import { CredentialRepository } from '@credo-ts/didcomm' /** * Migrates the {@link CredentialExchangeRecord} to 0.4 compatible format. It fetches all credential exchange records from diff --git a/packages/anoncreds/src/updates/0.4-0.5/__tests__/w3cCredentialRecordMigration.test.ts b/packages/anoncreds/src/updates/0.4-0.5/__tests__/w3cCredentialRecordMigration.test.ts index 1a8afa526d..a6259b9dba 100644 --- a/packages/anoncreds/src/updates/0.4-0.5/__tests__/w3cCredentialRecordMigration.test.ts +++ b/packages/anoncreds/src/updates/0.4-0.5/__tests__/w3cCredentialRecordMigration.test.ts @@ -1,11 +1,8 @@ import type { DidRepository, Wallet } from '@credo-ts/core' import { - CredentialState, Agent, CacheModuleConfig, - CredentialExchangeRecord, - CredentialRole, CredoError, DidResolverService, DidsModuleConfig, @@ -14,8 +11,8 @@ import { SignatureSuiteToken, W3cCredentialRepository, W3cCredentialsModuleConfig, - CredentialRepository, } from '@credo-ts/core' +import { CredentialState, CredentialExchangeRecord, CredentialRole, CredentialRepository } from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/src/updates/0.4-0.5/anonCredsCredentialRecord.ts b/packages/anoncreds/src/updates/0.4-0.5/anonCredsCredentialRecord.ts index 53073483a7..2be6038bcc 100644 --- a/packages/anoncreds/src/updates/0.4-0.5/anonCredsCredentialRecord.ts +++ b/packages/anoncreds/src/updates/0.4-0.5/anonCredsCredentialRecord.ts @@ -2,13 +2,8 @@ import type { AnonCredsHolderService } from '../../services' import type { W3cAnonCredsCredentialMetadata } from '../../utils/metadata' import type { AgentContext, BaseAgent } from '@credo-ts/core' -import { - CacheModuleConfig, - CredentialRepository, - CredoError, - W3cCredentialRepository, - W3cCredentialService, -} from '@credo-ts/core' +import { CacheModuleConfig, CredoError, W3cCredentialRepository, W3cCredentialService } from '@credo-ts/core' +import { CredentialRepository } from '@credo-ts/didcomm' import { AnonCredsCredentialRepository, type AnonCredsCredentialRecord } from '../../repository' import { AnonCredsHolderServiceSymbol } from '../../services' diff --git a/packages/anoncreds/src/utils/__tests__/credential.test.ts b/packages/anoncreds/src/utils/__tests__/credential.test.ts index 6da7283dd3..57ee5b5af6 100644 --- a/packages/anoncreds/src/utils/__tests__/credential.test.ts +++ b/packages/anoncreds/src/utils/__tests__/credential.test.ts @@ -1,4 +1,4 @@ -import { CredentialPreviewAttribute } from '@credo-ts/core' +import { CredentialPreviewAttribute } from '@credo-ts/didcomm' import { assertCredentialValuesMatch, diff --git a/packages/anoncreds/src/utils/composeAutoAccept.ts b/packages/anoncreds/src/utils/composeAutoAccept.ts index c93a2cbe49..b9c32bc21d 100644 --- a/packages/anoncreds/src/utils/composeAutoAccept.ts +++ b/packages/anoncreds/src/utils/composeAutoAccept.ts @@ -1,4 +1,4 @@ -import { AutoAcceptCredential, AutoAcceptProof } from '@credo-ts/core' +import { AutoAcceptCredential, AutoAcceptProof } from '@credo-ts/didcomm' /** * Returns the credential auto accept config based on priority: diff --git a/packages/anoncreds/src/utils/credential.ts b/packages/anoncreds/src/utils/credential.ts index 93f520ee75..e015ec26aa 100644 --- a/packages/anoncreds/src/utils/credential.ts +++ b/packages/anoncreds/src/utils/credential.ts @@ -1,7 +1,8 @@ import type { AnonCredsSchema, AnonCredsCredentialValues } from '../models' -import type { CredentialPreviewAttributeOptions, LinkedAttachment } from '@credo-ts/core' +import type { CredentialPreviewAttributeOptions, LinkedAttachment } from '@credo-ts/didcomm' -import { Buffer, CredoError, Hasher, TypedArrayEncoder, encodeAttachment } from '@credo-ts/core' +import { Buffer, CredoError, Hasher, TypedArrayEncoder } from '@credo-ts/core' +import { encodeAttachment } from '@credo-ts/didcomm' import bigInt from 'big-integer' export type AnonCredsClaimRecord = Record diff --git a/packages/anoncreds/src/utils/credentialPreviewAttributes.ts b/packages/anoncreds/src/utils/credentialPreviewAttributes.ts index 99d72819d0..0070b5fd1f 100644 --- a/packages/anoncreds/src/utils/credentialPreviewAttributes.ts +++ b/packages/anoncreds/src/utils/credentialPreviewAttributes.ts @@ -1,4 +1,4 @@ -import type { CredentialPreviewAttributeOptions } from '@credo-ts/core' +import type { CredentialPreviewAttributeOptions } from '@credo-ts/didcomm' export function areCredentialPreviewAttributesEqual( firstAttributes: CredentialPreviewAttributeOptions[], diff --git a/packages/anoncreds/tests/anoncreds-flow.test.ts b/packages/anoncreds/tests/anoncreds-flow.test.ts index 10be999c06..e5f040dd44 100644 --- a/packages/anoncreds/tests/anoncreds-flow.test.ts +++ b/packages/anoncreds/tests/anoncreds-flow.test.ts @@ -1,20 +1,22 @@ import type { AnonCredsCredentialRequest } from '@credo-ts/anoncreds' import type { DidRepository, Wallet } from '@credo-ts/core' +import { + InjectionSymbols, + DidResolverService, + DidsModuleConfig, + SignatureSuiteToken, + W3cCredentialsModuleConfig, +} from '@credo-ts/core' import { CredentialRole, ProofRole, - InjectionSymbols, ProofState, ProofExchangeRecord, CredentialExchangeRecord, CredentialPreviewAttribute, CredentialState, - DidResolverService, - DidsModuleConfig, - SignatureSuiteToken, - W3cCredentialsModuleConfig, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/tests/anoncreds.test.ts b/packages/anoncreds/tests/anoncreds.test.ts index 5ef2f84f7d..81f5305d3e 100644 --- a/packages/anoncreds/tests/anoncreds.test.ts +++ b/packages/anoncreds/tests/anoncreds.test.ts @@ -74,6 +74,7 @@ const agent = new Agent( getInMemoryAgentOptions( 'credo-anoncreds-package', {}, + {}, { anoncreds: new AnonCredsModule({ autoCreateLinkSecret: false, diff --git a/packages/anoncreds/tests/anoncredsSetup.ts b/packages/anoncreds/tests/anoncredsSetup.ts index 558f13b299..c6518c9829 100644 --- a/packages/anoncreds/tests/anoncredsSetup.ts +++ b/packages/anoncreds/tests/anoncredsSetup.ts @@ -1,4 +1,5 @@ import type { EventReplaySubject } from '../../core/tests' +import type { DefaultAgentModulesInput } from '../../didcomm/src/util/modules' import type { AnonCredsRegisterCredentialDefinitionOptions, AnonCredsOfferCredentialFormat, @@ -14,7 +15,7 @@ import type { AnonCredsRequestedPredicate, } from '../src' import type { CheqdDidCreateOptions } from '@credo-ts/cheqd' -import type { AutoAcceptProof, ConnectionRecord } from '@credo-ts/core' +import type { AutoAcceptProof, ConnectionRecord } from '@credo-ts/didcomm' import { DidDocumentBuilder, @@ -22,6 +23,10 @@ import { InMemoryLruCache, Agent, CredoError, + DidsModule, + TypedArrayEncoder, +} from '@credo-ts/core' +import { AutoAcceptCredential, CredentialEventTypes, CredentialsModule, @@ -30,11 +35,9 @@ import { ProofsModule, V2CredentialProtocol, V2ProofProtocol, - DidsModule, DifPresentationExchangeProofFormatService, - TypedArrayEncoder, ProofState, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { randomUUID } from 'crypto' import { CheqdDidRegistrar, CheqdDidResolver, CheqdModule } from '../../cheqd/src/index' @@ -58,10 +61,7 @@ import { anoncreds } from './helpers' import { anoncredsDefinitionFourAttributesNoRevocation } from './preCreatedAnonCredsDefinition' // Helper type to get the type of the agents (with the custom modules) for the credential tests -export type AnonCredsTestsAgent = Agent< - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ReturnType & { mediationRecipient?: any; mediator?: any } -> +export type AnonCredsTestsAgent = Agent & DefaultAgentModulesInput> export const getAnonCredsModules = ({ autoAcceptCredentials, @@ -150,7 +150,7 @@ export async function issueAnonCredsCredential({ revocationRegistryDefinitionId: string | null offer: AnonCredsOfferCredentialFormat }) { - let issuerCredentialExchangeRecord = await issuerAgent.credentials.offerCredential({ + let issuerCredentialExchangeRecord = await issuerAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: issuerHolderConnectionId, protocolVersion: 'v2', @@ -169,7 +169,7 @@ export async function issueAnonCredsCredential({ state: CredentialState.OfferReceived, }) - await holderAgent.credentials.acceptOffer({ + await holderAgent.modules.credentials.acceptOffer({ credentialRecordId: holderCredentialExchangeRecord.id, autoAcceptCredential: AutoAcceptCredential.ContentApproved, }) @@ -250,7 +250,7 @@ export async function presentAnonCredsProof({ state: ProofState.RequestReceived, }) - let verifierProofExchangeRecord = await verifierAgent.proofs.requestProof({ + let verifierProofExchangeRecord = await verifierAgent.modules.proofs.requestProof({ connectionId: verifierHolderConnectionId, proofFormats: { anoncreds: { @@ -265,7 +265,7 @@ export async function presentAnonCredsProof({ let holderProofExchangeRecord = await holderProofExchangeRecordPromise - const selectedCredentials = await holderAgent.proofs.selectCredentialsForRequest({ + const selectedCredentials = await holderAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: holderProofExchangeRecord.id, }) @@ -274,7 +274,7 @@ export async function presentAnonCredsProof({ state: ProofState.PresentationReceived, }) - await holderAgent.proofs.acceptRequest({ + await holderAgent.modules.proofs.acceptRequest({ proofRecordId: holderProofExchangeRecord.id, proofFormats: { anoncreds: selectedCredentials.proofFormats.anoncreds }, }) @@ -289,7 +289,7 @@ export async function presentAnonCredsProof({ state: ProofState.Done, }) - verifierProofExchangeRecord = await verifierAgent.proofs.acceptPresentation({ + verifierProofExchangeRecord = await verifierAgent.modules.proofs.acceptPresentation({ proofRecordId: verifierProofExchangeRecord.id, }) holderProofExchangeRecord = await holderProofExchangeRecordPromise @@ -337,6 +337,7 @@ export async function setupAnonCredsTests< { endpoints: ['rxjs:issuer'], }, + {}, getAnonCredsModules({ autoAcceptCredentials, autoAcceptProofs, @@ -352,6 +353,7 @@ export async function setupAnonCredsTests< { endpoints: ['rxjs:holder'], }, + {}, getAnonCredsModules({ autoAcceptCredentials, autoAcceptProofs, @@ -368,6 +370,7 @@ export async function setupAnonCredsTests< { endpoints: ['rxjs:verifier'], }, + {}, getAnonCredsModules({ autoAcceptCredentials, autoAcceptProofs, diff --git a/packages/anoncreds/tests/data-integrity-flow-anoncreds-pex.test.ts b/packages/anoncreds/tests/data-integrity-flow-anoncreds-pex.test.ts index 7e70b0de5d..01af084fcb 100644 --- a/packages/anoncreds/tests/data-integrity-flow-anoncreds-pex.test.ts +++ b/packages/anoncreds/tests/data-integrity-flow-anoncreds-pex.test.ts @@ -2,15 +2,8 @@ import type { AnonCredsTestsAgent } from './anoncredsSetup' import type { EventReplaySubject } from '../../core/tests' import type { InputDescriptorV2 } from '@sphereon/pex-models' -import { - AutoAcceptCredential, - CredentialExchangeRecord, - CredentialState, - ProofState, - W3cCredential, - W3cCredentialService, - W3cCredentialSubject, -} from '@credo-ts/core' +import { W3cCredential, W3cCredentialService, W3cCredentialSubject } from '@credo-ts/core' +import { AutoAcceptCredential, CredentialExchangeRecord, CredentialState, ProofState } from '@credo-ts/didcomm' import { createDidKidVerificationMethod, @@ -148,7 +141,7 @@ async function anonCredsFlowTest(options: { }) // issuer offers credential - let issuerRecord = await issuer.credentials.offerCredential({ + let issuerRecord = await issuer.modules.credentials.offerCredential({ protocolVersion: 'v2', autoAcceptCredential: AutoAcceptCredential.Never, connectionId: issuerHolderConnectionId, @@ -171,7 +164,7 @@ async function anonCredsFlowTest(options: { state: CredentialState.OfferReceived, threadId: issuerRecord.threadId, }) - holderRecord = await holder.credentials.acceptOffer({ + holderRecord = await holder.modules.credentials.acceptOffer({ credentialRecordId: holderRecord.id, autoAcceptCredential: AutoAcceptCredential.Never, credentialFormats: { @@ -188,7 +181,7 @@ async function anonCredsFlowTest(options: { state: CredentialState.RequestReceived, threadId: holderRecord.threadId, }) - issuerRecord = await issuer.credentials.acceptRequest({ + issuerRecord = await issuer.modules.credentials.acceptRequest({ credentialRecordId: issuerRecord.id, autoAcceptCredential: AutoAcceptCredential.Never, credentialFormats: { @@ -200,7 +193,7 @@ async function anonCredsFlowTest(options: { state: CredentialState.CredentialReceived, threadId: issuerRecord.threadId, }) - holderRecord = await holder.credentials.acceptCredential({ + holderRecord = await holder.modules.credentials.acceptCredential({ credentialRecordId: holderRecord.id, }) @@ -249,7 +242,7 @@ async function anonCredsFlowTest(options: { if (!revocationRegistryDefinitionId) pdCopy.input_descriptors.forEach((ide: InputDescriptorV2) => delete ide.constraints?.statuses) - let holderProofExchangeRecord = await holder.proofs.proposeProof({ + let holderProofExchangeRecord = await holder.modules.proofs.proposeProof({ protocolVersion: 'v2', connectionId: holderIssuerConnectionId, proofFormats: { @@ -265,13 +258,13 @@ async function anonCredsFlowTest(options: { state: ProofState.RequestReceived, }) - issuerProofExchangeRecord = await issuer.proofs.acceptProposal({ + issuerProofExchangeRecord = await issuer.modules.proofs.acceptProposal({ proofRecordId: issuerProofExchangeRecord.id, }) holderProofExchangeRecord = await holderProofExchangeRecordPromise - const requestedCredentials = await holder.proofs.selectCredentialsForRequest({ + const requestedCredentials = await holder.modules.proofs.selectCredentialsForRequest({ proofRecordId: holderProofExchangeRecord.id, }) @@ -285,7 +278,7 @@ async function anonCredsFlowTest(options: { state: ProofState.PresentationReceived, }) - await holder.proofs.acceptRequest({ + await holder.modules.proofs.acceptRequest({ proofRecordId: holderProofExchangeRecord.id, proofFormats: { presentationExchange: { @@ -300,7 +293,7 @@ async function anonCredsFlowTest(options: { state: ProofState.Done, }) - await issuer.proofs.acceptPresentation({ proofRecordId: issuerProofExchangeRecord.id }) + await issuer.modules.proofs.acceptPresentation({ proofRecordId: issuerProofExchangeRecord.id }) holderProofExchangeRecord = await holderProofExchangeRecordPromise } diff --git a/packages/anoncreds/tests/data-integrity-flow-anoncreds.test.ts b/packages/anoncreds/tests/data-integrity-flow-anoncreds.test.ts index 733490d843..1beaad4a79 100644 --- a/packages/anoncreds/tests/data-integrity-flow-anoncreds.test.ts +++ b/packages/anoncreds/tests/data-integrity-flow-anoncreds.test.ts @@ -1,25 +1,28 @@ -import type { DataIntegrityCredentialRequest, DidRepository } from '@credo-ts/core' +import type { DidRepository } from '@credo-ts/core' +import type { DataIntegrityCredentialRequest } from '@credo-ts/didcomm' import { - ProofRole, - CredentialRole, AgentContext, - CredentialExchangeRecord, - CredentialPreviewAttribute, - CredentialState, DidResolverService, DidsModuleConfig, InjectionSymbols, KeyDidRegistrar, KeyDidResolver, - ProofExchangeRecord, - ProofState, SignatureSuiteToken, W3cCredential, W3cCredentialService, W3cCredentialSubject, W3cCredentialsModuleConfig, } from '@credo-ts/core' +import { + ProofRole, + CredentialRole, + CredentialExchangeRecord, + CredentialPreviewAttribute, + CredentialState, + ProofExchangeRecord, + ProofState, +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/tests/data-integrity-flow-w3c.test.ts b/packages/anoncreds/tests/data-integrity-flow-w3c.test.ts index 6ed03f2abe..a9ba84d6ac 100644 --- a/packages/anoncreds/tests/data-integrity-flow-w3c.test.ts +++ b/packages/anoncreds/tests/data-integrity-flow-w3c.test.ts @@ -3,9 +3,6 @@ import type { DidRepository } from '@credo-ts/core' import { AgentContext, - CredentialExchangeRecord, - CredentialPreviewAttribute, - CredentialState, DidResolverService, DidsModuleConfig, Ed25519Signature2018, @@ -20,8 +17,13 @@ import { W3cCredentialService, W3cCredentialSubject, W3cCredentialsModuleConfig, - CredentialRole, } from '@credo-ts/core' +import { + CredentialExchangeRecord, + CredentialPreviewAttribute, + CredentialState, + CredentialRole, +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/tests/data-integrity-flow.test.ts b/packages/anoncreds/tests/data-integrity-flow.test.ts index 6e16fa5b51..8eb9e641e3 100644 --- a/packages/anoncreds/tests/data-integrity-flow.test.ts +++ b/packages/anoncreds/tests/data-integrity-flow.test.ts @@ -3,9 +3,6 @@ import type { DidRepository } from '@credo-ts/core' import { AgentContext, - CredentialExchangeRecord, - CredentialPreviewAttribute, - CredentialState, DidResolverService, DidsModuleConfig, Ed25519Signature2018, @@ -20,8 +17,13 @@ import { W3cCredentialService, W3cCredentialSubject, W3cCredentialsModuleConfig, - CredentialRole, } from '@credo-ts/core' +import { + CredentialExchangeRecord, + CredentialPreviewAttribute, + CredentialState, + CredentialRole, +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/tests/indy-flow.test.ts b/packages/anoncreds/tests/indy-flow.test.ts index 08dac4a6c0..e862b885b8 100644 --- a/packages/anoncreds/tests/indy-flow.test.ts +++ b/packages/anoncreds/tests/indy-flow.test.ts @@ -1,20 +1,22 @@ import type { AnonCredsCredentialRequest } from '@credo-ts/anoncreds' import type { DidRepository, Wallet } from '@credo-ts/core' +import { + InjectionSymbols, + SignatureSuiteToken, + W3cCredentialsModuleConfig, + DidResolverService, + DidsModuleConfig, +} from '@credo-ts/core' import { CredentialRole, ProofRole, CredentialState, CredentialExchangeRecord, CredentialPreviewAttribute, - InjectionSymbols, ProofState, ProofExchangeRecord, - SignatureSuiteToken, - W3cCredentialsModuleConfig, - DidResolverService, - DidsModuleConfig, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' diff --git a/packages/anoncreds/tests/legacyAnonCredsSetup.ts b/packages/anoncreds/tests/legacyAnonCredsSetup.ts index 41111b14bc..0f6ef79723 100644 --- a/packages/anoncreds/tests/legacyAnonCredsSetup.ts +++ b/packages/anoncreds/tests/legacyAnonCredsSetup.ts @@ -1,4 +1,5 @@ import type { PreCreatedAnonCredsDefinition } from './preCreatedAnonCredsDefinition' +import type { DefaultAgentModulesInput } from '../..//didcomm/src/util/modules' import type { EventReplaySubject } from '../../core/tests' import type { AnonCredsRegisterCredentialDefinitionOptions, @@ -9,15 +10,11 @@ import type { RegisterCredentialDefinitionReturnStateFinished, RegisterSchemaReturnStateFinished, } from '../src' -import type { AutoAcceptProof, ConnectionRecord } from '@credo-ts/core' +import type { AutoAcceptProof, ConnectionRecord } from '@credo-ts/didcomm' +import { TypedArrayEncoder, CacheModule, InMemoryLruCache, Agent, CredoError, DidsModule } from '@credo-ts/core' import { AgentEventTypes, - TypedArrayEncoder, - CacheModule, - InMemoryLruCache, - Agent, - CredoError, AutoAcceptCredential, CredentialEventTypes, CredentialsModule, @@ -27,8 +24,7 @@ import { ProofState, V2CredentialProtocol, V2ProofProtocol, - DidsModule, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { randomUUID } from 'crypto' import { sleep } from '../../core/src/utils/sleep' @@ -72,10 +68,7 @@ import { } from './preCreatedAnonCredsDefinition' // Helper type to get the type of the agents (with the custom modules) for the credential tests -export type AnonCredsTestsAgent = Agent< - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ReturnType & { mediationRecipient?: any; mediator?: any } -> +export type AnonCredsTestsAgent = Agent & DefaultAgentModulesInput> export const getAnonCredsIndyModules = ({ autoAcceptCredentials, @@ -165,7 +158,7 @@ export async function presentLegacyAnonCredsProof({ state: ProofState.RequestReceived, }) - let verifierProofExchangeRecord = await verifierAgent.proofs.requestProof({ + let verifierProofExchangeRecord = await verifierAgent.modules.proofs.requestProof({ connectionId: verifierHolderConnectionId, proofFormats: { indy: { @@ -180,7 +173,7 @@ export async function presentLegacyAnonCredsProof({ let holderProofExchangeRecord = await holderProofExchangeRecordPromise - const selectedCredentials = await holderAgent.proofs.selectCredentialsForRequest({ + const selectedCredentials = await holderAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: holderProofExchangeRecord.id, }) @@ -189,7 +182,7 @@ export async function presentLegacyAnonCredsProof({ state: ProofState.PresentationReceived, }) - await holderAgent.proofs.acceptRequest({ + await holderAgent.modules.proofs.acceptRequest({ proofRecordId: holderProofExchangeRecord.id, proofFormats: { indy: selectedCredentials.proofFormats.indy }, }) @@ -204,7 +197,7 @@ export async function presentLegacyAnonCredsProof({ state: ProofState.Done, }) - verifierProofExchangeRecord = await verifierAgent.proofs.acceptPresentation({ + verifierProofExchangeRecord = await verifierAgent.modules.proofs.acceptPresentation({ proofRecordId: verifierProofExchangeRecord.id, }) holderProofExchangeRecord = await holderProofExchangeRecordPromise @@ -234,7 +227,7 @@ export async function issueLegacyAnonCredsCredential({ issuerHolderConnectionId: string offer: AnonCredsOfferCredentialFormat }) { - let issuerCredentialExchangeRecord = await issuerAgent.credentials.offerCredential({ + let issuerCredentialExchangeRecord = await issuerAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: issuerHolderConnectionId, protocolVersion: 'v1', @@ -249,7 +242,7 @@ export async function issueLegacyAnonCredsCredential({ state: CredentialState.OfferReceived, }) - await holderAgent.credentials.acceptOffer({ + await holderAgent.modules.credentials.acceptOffer({ credentialRecordId: holderCredentialExchangeRecord.id, autoAcceptCredential: AutoAcceptCredential.ContentApproved, }) @@ -327,6 +320,9 @@ export async function setupAnonCredsTests< { endpoints: ['rxjs:issuer'], }, + { + logger: testLogger, + }, getAnonCredsIndyModules({ autoAcceptCredentials, autoAcceptProofs, @@ -340,6 +336,7 @@ export async function setupAnonCredsTests< { endpoints: ['rxjs:holder'], }, + {}, getAnonCredsIndyModules({ autoAcceptCredentials, autoAcceptProofs, @@ -354,6 +351,7 @@ export async function setupAnonCredsTests< { endpoints: ['rxjs:verifier'], }, + {}, getAnonCredsIndyModules({ autoAcceptCredentials, autoAcceptProofs, diff --git a/packages/anoncreds/tests/v2-credential-revocation.test.ts b/packages/anoncreds/tests/v2-credential-revocation.test.ts index d4de4a22c6..18868d88de 100644 --- a/packages/anoncreds/tests/v2-credential-revocation.test.ts +++ b/packages/anoncreds/tests/v2-credential-revocation.test.ts @@ -1,15 +1,15 @@ import type { AnonCredsTestsAgent } from './anoncredsSetup' import type { EventReplaySubject } from '../../core/tests' +import { JsonTransformer } from '@credo-ts/core' import { DidCommMessageRepository, - JsonTransformer, CredentialState, CredentialExchangeRecord, V2CredentialPreview, V2OfferCredentialMessage, CredentialRole, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { waitForCredentialRecordSubject } from '../../core/tests' import { waitForRevocationNotification } from '../../core/tests/helpers' @@ -68,7 +68,7 @@ describe('IC v2 credential revocation', () => { test('Alice starts with V2 credential proposal to Faber', async () => { testLogger.test('Alice sends (v2) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -99,7 +99,7 @@ describe('IC v2 credential revocation', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Proposal', credentialFormats: { @@ -171,7 +171,7 @@ describe('IC v2 credential revocation', () => { credentialIds: [], }) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -189,7 +189,7 @@ describe('IC v2 credential revocation', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Credential', }) @@ -200,7 +200,7 @@ describe('IC v2 credential revocation', () => { state: CredentialState.CredentialReceived, }) - await aliceAgent.credentials.acceptCredential({ + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) @@ -228,7 +228,7 @@ describe('IC v2 credential revocation', () => { options: {}, }) - await faberAgent.credentials.sendRevocationNotification({ + await faberAgent.modules.credentials.sendRevocationNotification({ credentialRecordId: doneCredentialRecord.id, revocationFormat: 'anoncreds', revocationId: `${credentialRevocationRegistryDefinitionId}::${credentialRevocationIndex}`, diff --git a/packages/anoncreds/tests/v2-credentials.test.ts b/packages/anoncreds/tests/v2-credentials.test.ts index d39d039579..7f3b3d8529 100644 --- a/packages/anoncreds/tests/v2-credentials.test.ts +++ b/packages/anoncreds/tests/v2-credentials.test.ts @@ -2,18 +2,18 @@ import type { AnonCredsTestsAgent } from './anoncredsSetup' import type { EventReplaySubject } from '../../core/tests' import type { AnonCredsHolderService, AnonCredsProposeCredentialFormat } from '@credo-ts/anoncreds' +import { JsonTransformer } from '@credo-ts/core' import { DidCommMessageRepository, - JsonTransformer, CredentialState, CredentialExchangeRecord, V2CredentialPreview, - V2IssueCredentialMessage, V2OfferCredentialMessage, + CredentialRole, + V2IssueCredentialMessage, V2ProposeCredentialMessage, V2RequestCredentialMessage, - CredentialRole, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { waitForCredentialRecord, waitForCredentialRecordSubject } from '../../core/tests' import testLogger from '../../core/tests/logger' @@ -90,7 +90,7 @@ describe('IC V2 AnonCreds credentials', () => { test('Alice starts with V2 credential proposal to Faber', async () => { testLogger.test('Alice sends (v2) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -121,7 +121,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Proposal', credentialFormats: { @@ -191,7 +191,7 @@ describe('IC V2 AnonCreds credentials', () => { credentialIds: [], }) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -209,7 +209,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Credential', }) @@ -220,7 +220,7 @@ describe('IC V2 AnonCreds credentials', () => { state: CredentialState.CredentialReceived, }) - await aliceAgent.credentials.acceptCredential({ + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) @@ -251,7 +251,7 @@ describe('IC V2 AnonCreds credentials', () => { const holderService = aliceAgent.dependencyManager.resolve(AnonCredsHolderServiceSymbol) const deleteCredentialSpy = jest.spyOn(holderService, 'deleteCredential') - await aliceAgent.credentials.deleteById(holderCredentialExchangeRecord.id, { + await aliceAgent.modules.credentials.deleteById(holderCredentialExchangeRecord.id, { deleteAssociatedCredentials: true, deleteAssociatedDidCommMessages: true, }) @@ -261,7 +261,7 @@ describe('IC V2 AnonCreds credentials', () => { holderCredentialExchangeRecord.credentials[0].credentialRecordId ) - return expect(aliceAgent.credentials.getById(holderCredentialExchangeRecord.id)).rejects.toThrowError( + return expect(aliceAgent.modules.credentials.getById(holderCredentialExchangeRecord.id)).rejects.toThrowError( `CredentialRecord: record with id ${holderCredentialExchangeRecord.id} not found.` ) }) @@ -274,7 +274,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Alice sends credential proposal to Faber') - let aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + let aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -295,7 +295,7 @@ describe('IC V2 AnonCreds credentials', () => { state: CredentialState.OfferReceived, }) - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { anoncreds: { @@ -309,10 +309,10 @@ describe('IC V2 AnonCreds credentials', () => { let aliceCredentialRecord = await aliceCredentialRecordPromise // Check if the state of the credential records did not change - faberCredentialRecord = await faberAgent.credentials.getById(faberCredentialRecord.id) + faberCredentialRecord = await faberAgent.modules.credentials.getById(faberCredentialRecord.id) faberCredentialRecord.assertState(CredentialState.OfferSent) - aliceCredentialRecord = await aliceAgent.credentials.getById(aliceCredentialRecord.id) + aliceCredentialRecord = await aliceAgent.modules.credentials.getById(aliceCredentialRecord.id) aliceCredentialRecord.assertState(CredentialState.OfferReceived) faberCredentialRecordPromise = waitForCredentialRecord(faberAgent, { @@ -321,7 +321,7 @@ describe('IC V2 AnonCreds credentials', () => { }) // second proposal - aliceCredentialExchangeRecord = await aliceAgent.credentials.negotiateOffer({ + aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { anoncreds: { @@ -341,7 +341,7 @@ describe('IC V2 AnonCreds credentials', () => { state: CredentialState.OfferReceived, }) - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { anoncreds: { @@ -355,7 +355,7 @@ describe('IC V2 AnonCreds credentials', () => { aliceCredentialRecord = await aliceCredentialRecordPromise - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialExchangeRecord.id, }) @@ -373,7 +373,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Credential', }) @@ -385,7 +385,7 @@ describe('IC V2 AnonCreds credentials', () => { }) // testLogger.test('Alice sends credential ack to Faber') - await aliceAgent.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) testLogger.test('Faber waits for credential ack from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -408,7 +408,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - let faberCredentialRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -428,7 +428,7 @@ describe('IC V2 AnonCreds credentials', () => { state: CredentialState.ProposalReceived, }) - aliceCredentialRecord = await aliceAgent.credentials.negotiateOffer({ + aliceCredentialRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { anoncreds: { @@ -447,7 +447,7 @@ describe('IC V2 AnonCreds credentials', () => { threadId: faberCredentialRecord.threadId, state: CredentialState.OfferReceived, }) - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { anoncreds: { @@ -466,7 +466,7 @@ describe('IC V2 AnonCreds credentials', () => { state: CredentialState.ProposalReceived, }) - aliceCredentialRecord = await aliceAgent.credentials.negotiateOffer({ + aliceCredentialRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { anoncreds: { @@ -487,7 +487,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Proposal', credentialFormats: { @@ -506,7 +506,7 @@ describe('IC V2 AnonCreds credentials', () => { state: CredentialState.RequestReceived, }) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -525,7 +525,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 AnonCreds Credential', }) @@ -533,17 +533,17 @@ describe('IC V2 AnonCreds credentials', () => { testLogger.test('Alice waits for credential from Faber') aliceCredentialRecord = await aliceCredentialRecordPromise - const proposalMessage = await aliceAgent.credentials.findProposalMessage(aliceCredentialRecord.id) - const offerMessage = await aliceAgent.credentials.findOfferMessage(aliceCredentialRecord.id) - const requestMessage = await aliceAgent.credentials.findRequestMessage(aliceCredentialRecord.id) - const credentialMessage = await aliceAgent.credentials.findCredentialMessage(aliceCredentialRecord.id) + const proposalMessage = await aliceAgent.modules.credentials.findProposalMessage(aliceCredentialRecord.id) + const offerMessage = await aliceAgent.modules.credentials.findOfferMessage(aliceCredentialRecord.id) + const requestMessage = await aliceAgent.modules.credentials.findRequestMessage(aliceCredentialRecord.id) + const credentialMessage = await aliceAgent.modules.credentials.findCredentialMessage(aliceCredentialRecord.id) expect(proposalMessage).toBeInstanceOf(V2ProposeCredentialMessage) expect(offerMessage).toBeInstanceOf(V2OfferCredentialMessage) expect(requestMessage).toBeInstanceOf(V2RequestCredentialMessage) expect(credentialMessage).toBeInstanceOf(V2IssueCredentialMessage) - const formatData = await aliceAgent.credentials.getFormatData(aliceCredentialRecord.id) + const formatData = await aliceAgent.modules.credentials.getFormatData(aliceCredentialRecord.id) expect(formatData).toMatchObject({ proposalAttributes: [ { @@ -647,7 +647,7 @@ describe('IC V2 AnonCreds credentials', () => { test('Faber starts with V2 offer, alice declines the offer', async () => { testLogger.test('Faber sends credential offer to Alice') - const faberCredentialExchangeRecord = await faberAgent.credentials.offerCredential({ + const faberCredentialExchangeRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -671,7 +671,7 @@ describe('IC V2 AnonCreds credentials', () => { }) testLogger.test('Alice declines offer') - aliceCredentialRecord = await aliceAgent.credentials.declineOffer(aliceCredentialRecord.id) + aliceCredentialRecord = await aliceAgent.modules.credentials.declineOffer(aliceCredentialRecord.id) expect(aliceCredentialRecord.state).toBe(CredentialState.Declined) }) diff --git a/packages/anoncreds/tests/v2-proofs.test.ts b/packages/anoncreds/tests/v2-proofs.test.ts index 7622c34126..547e794131 100644 --- a/packages/anoncreds/tests/v2-proofs.test.ts +++ b/packages/anoncreds/tests/v2-proofs.test.ts @@ -1,7 +1,7 @@ import type { AnonCredsTestsAgent } from './anoncredsSetup' import type { EventReplaySubject } from '../../core/tests' import type { AnonCredsRequestProofFormat } from '@credo-ts/anoncreds' -import type { CredentialExchangeRecord } from '@credo-ts/core' +import type { CredentialExchangeRecord } from '@credo-ts/didcomm' import { Attachment, @@ -12,7 +12,7 @@ import { V2ProposePresentationMessage, V2RequestPresentationMessage, V2PresentationMessage, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { sleep } from '../../core/src/utils/sleep' import { waitForProofExchangeRecord } from '../../core/tests' @@ -115,7 +115,7 @@ describe('PP V2 AnonCreds Proofs', () => { state: ProofState.ProposalReceived, }) - aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -145,7 +145,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Faber waits for a presentation proposal from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -178,7 +178,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber accepts the presentation proposal from Alice testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -186,7 +186,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -213,7 +213,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -222,7 +222,7 @@ describe('PP V2 AnonCreds Proofs', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: requestedCredentials.proofFormats.anoncreds }, }) @@ -231,7 +231,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -268,7 +268,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') @@ -293,15 +293,15 @@ describe('PP V2 AnonCreds Proofs', () => { state: ProofState.Done, }) - const proposalMessage = await aliceAgent.proofs.findProposalMessage(aliceProofExchangeRecord.id) - const requestMessage = await aliceAgent.proofs.findRequestMessage(aliceProofExchangeRecord.id) - const presentationMessage = await aliceAgent.proofs.findPresentationMessage(aliceProofExchangeRecord.id) + const proposalMessage = await aliceAgent.modules.proofs.findProposalMessage(aliceProofExchangeRecord.id) + const requestMessage = await aliceAgent.modules.proofs.findRequestMessage(aliceProofExchangeRecord.id) + const presentationMessage = await aliceAgent.modules.proofs.findPresentationMessage(aliceProofExchangeRecord.id) expect(proposalMessage).toBeInstanceOf(V2ProposePresentationMessage) expect(requestMessage).toBeInstanceOf(V2RequestPresentationMessage) expect(presentationMessage).toBeInstanceOf(V2PresentationMessage) - const formatData = await aliceAgent.proofs.getFormatData(aliceProofExchangeRecord.id) + const formatData = await aliceAgent.modules.proofs.getFormatData(aliceProofExchangeRecord.id) expect(formatData).toMatchObject({ proposal: { @@ -392,7 +392,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -437,7 +437,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -468,7 +468,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -477,7 +477,7 @@ describe('PP V2 AnonCreds Proofs', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: requestedCredentials.proofFormats.anoncreds }, }) @@ -486,7 +486,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -523,7 +523,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') @@ -556,7 +556,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -601,7 +601,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const retrievedCredentials = await aliceAgent.proofs.getCredentialsForRequest({ + const retrievedCredentials = await aliceAgent.modules.proofs.getCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -680,7 +680,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -725,7 +725,7 @@ describe('PP V2 AnonCreds Proofs', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', @@ -759,7 +759,7 @@ describe('PP V2 AnonCreds Proofs', () => { state: ProofState.Abandoned, }) - aliceProofExchangeRecord = await aliceAgent.proofs.sendProblemReport({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.sendProblemReport({ description: 'Problem inside proof request', proofRecordId: aliceProofExchangeRecord.id, }) @@ -818,7 +818,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -833,7 +833,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -862,7 +862,7 @@ describe('PP V2 AnonCreds Proofs', () => { options: {}, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: requestedCredentials.proofFormats.anoncreds }, }) @@ -878,7 +878,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') @@ -961,7 +961,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -976,7 +976,7 @@ describe('PP V2 AnonCreds Proofs', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: { filterByNonRevocationRequirements: false } }, }) @@ -985,7 +985,7 @@ describe('PP V2 AnonCreds Proofs', () => { threadId: aliceProofExchangeRecord.threadId, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: requestedCredentials.proofFormats.anoncreds }, }) diff --git a/packages/askar/src/__tests__/migration-postgres.e2e.test.ts b/packages/askar/src/__tests__/migration-postgres.e2e.test.ts index 6eeeb3769c..edc93c2291 100644 --- a/packages/askar/src/__tests__/migration-postgres.e2e.test.ts +++ b/packages/askar/src/__tests__/migration-postgres.e2e.test.ts @@ -4,7 +4,7 @@ import { Agent } from '../../../core/src/agent/Agent' import { CURRENT_FRAMEWORK_STORAGE_VERSION } from '../../../core/src/storage/migration/updates' import { askarPostgresStorageConfig, getAskarPostgresAgentOptions } from '../../tests/helpers' -const agentOptions = getAskarPostgresAgentOptions('Migration', askarPostgresStorageConfig, {}) +const agentOptions = getAskarPostgresAgentOptions('Migration', {}, askarPostgresStorageConfig) describe('migration with postgres backend', () => { test('Automatic update on agent startup', async () => { diff --git a/packages/askar/src/wallet/__tests__/packing.test.ts b/packages/askar/src/wallet/__tests__/packing.test.ts index c75e4d9f8c..eae5af557c 100644 --- a/packages/askar/src/wallet/__tests__/packing.test.ts +++ b/packages/askar/src/wallet/__tests__/packing.test.ts @@ -1,9 +1,10 @@ import type { WalletConfig } from '@credo-ts/core' -import { JsonTransformer, BasicMessage, KeyType, SigningProviderRegistry, KeyDerivationMethod } from '@credo-ts/core' +import { JsonTransformer, KeyType, SigningProviderRegistry, KeyDerivationMethod } from '@credo-ts/core' import { agentDependencies } from '../../../../core/tests/helpers' import testLogger from '../../../../core/tests/logger' +import { BasicMessage } from '../../../../didcomm' import { AskarWallet } from '../AskarWallet' // use raw key derivation method to speed up wallet creating / opening / closing between tests diff --git a/packages/askar/tests/askar-inmemory.test.ts b/packages/askar/tests/askar-inmemory.test.ts index d98e762fa5..deb0353873 100644 --- a/packages/askar/tests/askar-inmemory.test.ts +++ b/packages/askar/tests/askar-inmemory.test.ts @@ -14,6 +14,7 @@ const aliceInMemoryAgentOptions = getAskarSqliteAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, true ) const bobInMemoryAgentOptions = getAskarSqliteAgentOptions( @@ -21,6 +22,7 @@ const bobInMemoryAgentOptions = getAskarSqliteAgentOptions( { endpoints: ['rxjs:bob'], }, + {}, true ) @@ -50,13 +52,13 @@ describe('Askar In Memory agents', () => { } aliceAgent = new Agent(aliceInMemoryAgentOptions) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() bobAgent = new Agent(bobInMemoryAgentOptions) - bobAgent.registerInboundTransport(new SubjectInboundTransport(bobMessages)) - bobAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + bobAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(bobMessages)) + bobAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await bobAgent.initialize() await e2eTest(aliceAgent, bobAgent) diff --git a/packages/askar/tests/askar-postgres.e2e.test.ts b/packages/askar/tests/askar-postgres.e2e.test.ts index 92a7168b5f..7e6e5007d5 100644 --- a/packages/askar/tests/askar-postgres.e2e.test.ts +++ b/packages/askar/tests/askar-postgres.e2e.test.ts @@ -9,12 +9,18 @@ import { SubjectOutboundTransport } from '../../../tests/transport/SubjectOutbou import { askarPostgresStorageConfig, e2eTest, getAskarPostgresAgentOptions } from './helpers' -const alicePostgresAgentOptions = getAskarPostgresAgentOptions('AgentsAlice', askarPostgresStorageConfig, { - endpoints: ['rxjs:alice'], -}) -const bobPostgresAgentOptions = getAskarPostgresAgentOptions('AgentsBob', askarPostgresStorageConfig, { - endpoints: ['rxjs:bob'], -}) +const alicePostgresAgentOptions = getAskarPostgresAgentOptions( + 'AgentsAlice', + { endpoints: ['rxjs:alice'] }, + askarPostgresStorageConfig +) +const bobPostgresAgentOptions = getAskarPostgresAgentOptions( + 'AgentsBob', + { + endpoints: ['rxjs:bob'], + }, + askarPostgresStorageConfig +) describe('Askar Postgres agents', () => { let aliceAgent: Agent @@ -42,13 +48,13 @@ describe('Askar Postgres agents', () => { } aliceAgent = new Agent(alicePostgresAgentOptions) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() bobAgent = new Agent(bobPostgresAgentOptions) - bobAgent.registerInboundTransport(new SubjectInboundTransport(bobMessages)) - bobAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + bobAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(bobMessages)) + bobAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await bobAgent.initialize() await e2eTest(aliceAgent, bobAgent) diff --git a/packages/askar/tests/askar-sqlite.test.ts b/packages/askar/tests/askar-sqlite.test.ts index 2f13b84b23..f1630f0725 100644 --- a/packages/askar/tests/askar-sqlite.test.ts +++ b/packages/askar/tests/askar-sqlite.test.ts @@ -1,9 +1,6 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Agent, - BasicMessageRecord, - BasicMessageRepository, - BasicMessageRole, KeyDerivationMethod, TypedArrayEncoder, utils, @@ -15,6 +12,8 @@ import { Store } from '@hyperledger/aries-askar-shared' import { tmpdir } from 'os' import path from 'path' +import { BasicMessageRecord, BasicMessageRepository, BasicMessageRole } from '../..//didcomm' + import { getAskarSqliteAgentOptions } from './helpers' const aliceAgentOptions = getAskarSqliteAgentOptions('AgentsAlice') diff --git a/packages/askar/tests/helpers.ts b/packages/askar/tests/helpers.ts index af6fddea15..845d11067e 100644 --- a/packages/askar/tests/helpers.ts +++ b/packages/askar/tests/helpers.ts @@ -1,13 +1,16 @@ +import type { DidCommModuleConfig } from '../..//didcomm' import type { AskarWalletPostgresStorageConfig } from '../src/wallet' import type { Agent, InitConfig } from '@credo-ts/core' -import { ConnectionsModule, HandshakeProtocol, LogLevel, utils } from '@credo-ts/core' +import { LogLevel, utils } from '@credo-ts/core' import { ariesAskar } from '@hyperledger/aries-askar-nodejs' import { registerAriesAskar } from '@hyperledger/aries-askar-shared' import path from 'path' import { waitForBasicMessage } from '../../core/tests/helpers' import { TestLogger } from '../../core/tests/logger' +import { ConnectionsModule, HandshakeProtocol } from '../../didcomm' +import { getDefaultDidcommModules } from '../../didcomm/src/util/modules' import { agentDependencies } from '../../node/src' import { AskarModule } from '../src/AskarModule' import { AskarModuleConfig } from '../src/AskarModuleConfig' @@ -41,6 +44,7 @@ export const askarPostgresStorageConfig: AskarWalletPostgresStorageConfig = { export function getAskarPostgresAgentOptions( name: string, + didcommConfig: Partial = {}, storageConfig: AskarWalletPostgresStorageConfig, extraConfig: Partial = {} ) { @@ -60,6 +64,7 @@ export function getAskarPostgresAgentOptions( config, dependencies: agentDependencies, modules: { + ...getDefaultDidcommModules(didcommConfig), askar: new AskarModule(askarModuleConfig), connections: new ConnectionsModule({ autoAcceptConnections: true, @@ -68,7 +73,12 @@ export function getAskarPostgresAgentOptions( } as const } -export function getAskarSqliteAgentOptions(name: string, extraConfig: Partial = {}, inMemory?: boolean) { +export function getAskarSqliteAgentOptions( + name: string, + didcommConfig: Partial = {}, + extraConfig: Partial = {}, + inMemory?: boolean +) { const random = utils.uuid().slice(0, 4) const config: InitConfig = { label: `SQLiteAgent: ${name} - ${random}`, @@ -85,6 +95,7 @@ export function getAskarSqliteAgentOptions(name: string, extraConfig: Partial { test('Alice starts with V2 (ld format, BbsBlsSignature2020 signature) credential proposal to Faber', async () => { testLogger.test('Alice sends (v2 jsonld) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -108,7 +107,7 @@ describeSkipNode18('credentials, BBS+ signature', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 W3C Offer', }) @@ -119,7 +118,7 @@ describeSkipNode18('credentials, BBS+ signature', () => { state: CredentialState.OfferReceived, }) - const offerMessage = await faberAgent.credentials.findOfferMessage(faberCredentialRecord.id) + const offerMessage = await faberAgent.modules.credentials.findOfferMessage(faberCredentialRecord.id) expect(JsonTransformer.toJSON(offerMessage)).toMatchObject({ '@type': 'https://didcomm.org/issue-credential/2.0/offer-credential', '@id': expect.any(String), @@ -157,7 +156,7 @@ describeSkipNode18('credentials, BBS+ signature', () => { expect(aliceCredentialRecord.id).not.toBeNull() expect(aliceCredentialRecord.type).toBe(CredentialExchangeRecord.type) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { jsonld: undefined, @@ -176,7 +175,7 @@ describeSkipNode18('credentials, BBS+ signature', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 W3C Offer', }) @@ -188,7 +187,7 @@ describeSkipNode18('credentials, BBS+ signature', () => { }) testLogger.test('Alice sends credential ack to Faber') - await aliceAgent.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) testLogger.test('Faber waits for credential ack from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -204,7 +203,7 @@ describeSkipNode18('credentials, BBS+ signature', () => { state: CredentialState.CredentialReceived, }) - const credentialMessage = await faberAgent.credentials.findCredentialMessage(faberCredentialRecord.id) + const credentialMessage = await faberAgent.modules.credentials.findCredentialMessage(faberCredentialRecord.id) const w3cCredential = (credentialMessage as V2IssueCredentialMessage).credentialAttachments[0].getDataAsJson() expect(w3cCredential).toMatchObject({ diff --git a/packages/cheqd/package.json b/packages/cheqd/package.json index ae479fc70c..cfa83cb4a5 100644 --- a/packages/cheqd/package.json +++ b/packages/cheqd/package.json @@ -26,7 +26,7 @@ "test": "jest" }, "dependencies": { - "@cheqd/sdk": "^2.5.1", + "@cheqd/sdk": "2.5.1", "@cheqd/ts-proto": "~2.3.2", "@cosmjs/crypto": "~0.30.0", "@cosmjs/proto-signing": "~0.30.0", diff --git a/packages/cheqd/tests/cheqd-data-integrity.e2e.test.ts b/packages/cheqd/tests/cheqd-data-integrity.e2e.test.ts index 2cd830c6b0..c8f58320be 100644 --- a/packages/cheqd/tests/cheqd-data-integrity.e2e.test.ts +++ b/packages/cheqd/tests/cheqd-data-integrity.e2e.test.ts @@ -1,21 +1,14 @@ import type { AnonCredsTestsAgent } from '../../anoncreds/tests/anoncredsSetup' +import type { DifPresentationExchangeDefinitionV2 } from '../../core' import type { EventReplaySubject } from '../../core/tests' -import type { DifPresentationExchangeDefinitionV2 } from '@credo-ts/core' - -import { - AutoAcceptCredential, - CredentialExchangeRecord, - CredentialState, - ProofState, - W3cCredential, - W3cCredentialSubject, -} from '@credo-ts/core' import { InMemoryAnonCredsRegistry } from '../../anoncreds/tests/InMemoryAnonCredsRegistry' import { setupAnonCredsTests } from '../../anoncreds/tests/anoncredsSetup' import { presentationDefinition } from '../../anoncreds/tests/fixtures/presentation-definition' +import { W3cCredential, W3cCredentialSubject } from '../../core' import { createDidKidVerificationMethod } from '../../core/tests' import { waitForCredentialRecordSubject, waitForProofExchangeRecord } from '../../core/tests/helpers' +import { AutoAcceptCredential, CredentialExchangeRecord, CredentialState, ProofState } from '../../didcomm' import { cheqdPayerSeeds } from './setupCheqdModule' @@ -79,7 +72,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { }) // issuer offers credential - let issuerRecord = await issuerAgent.credentials.offerCredential({ + let issuerRecord = await issuerAgent.modules.credentials.offerCredential({ protocolVersion: 'v2', autoAcceptCredential: AutoAcceptCredential.Never, connectionId: issuerHolderConnectionId, @@ -102,7 +95,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { state: CredentialState.OfferReceived, threadId: issuerRecord.threadId, }) - holderRecord = await holderAgent.credentials.acceptOffer({ + holderRecord = await holderAgent.modules.credentials.acceptOffer({ credentialRecordId: holderRecord.id, autoAcceptCredential: AutoAcceptCredential.Never, credentialFormats: { @@ -119,7 +112,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { state: CredentialState.RequestReceived, threadId: holderRecord.threadId, }) - issuerRecord = await issuerAgent.credentials.acceptRequest({ + issuerRecord = await issuerAgent.modules.credentials.acceptRequest({ credentialRecordId: issuerRecord.id, autoAcceptCredential: AutoAcceptCredential.Never, credentialFormats: { @@ -131,7 +124,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { state: CredentialState.CredentialReceived, threadId: issuerRecord.threadId, }) - holderRecord = await holderAgent.credentials.acceptCredential({ + holderRecord = await holderAgent.modules.credentials.acceptCredential({ credentialRecordId: holderRecord.id, }) @@ -178,7 +171,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { } }) - let holderProofExchangeRecord = await holderAgent.proofs.proposeProof({ + let holderProofExchangeRecord = await holderAgent.modules.proofs.proposeProof({ protocolVersion: 'v2', connectionId: holderIssuerConnectionId, proofFormats: { @@ -194,13 +187,13 @@ describe('anoncreds w3c data integrity e2e tests', () => { state: ProofState.RequestReceived, }) - issuerProofExchangeRecord = await issuerAgent.proofs.acceptProposal({ + issuerProofExchangeRecord = await issuerAgent.modules.proofs.acceptProposal({ proofRecordId: issuerProofExchangeRecord.id, }) holderProofExchangeRecord = await holderProofExchangeRecordPromise - const requestedCredentials = await holderAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await holderAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: holderProofExchangeRecord.id, }) @@ -214,7 +207,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { state: ProofState.PresentationReceived, }) - await holderAgent.proofs.acceptRequest({ + await holderAgent.modules.proofs.acceptRequest({ proofRecordId: holderProofExchangeRecord.id, proofFormats: { presentationExchange: { @@ -229,7 +222,7 @@ describe('anoncreds w3c data integrity e2e tests', () => { state: ProofState.Done, }) - await issuerAgent.proofs.acceptPresentation({ proofRecordId: issuerProofExchangeRecord.id }) + await issuerAgent.modules.proofs.acceptPresentation({ proofRecordId: issuerProofExchangeRecord.id }) holderProofExchangeRecord = await holderProofExchangeRecordPromise }) diff --git a/packages/cheqd/tests/cheqd-did-registrar.e2e.test.ts b/packages/cheqd/tests/cheqd-did-registrar.e2e.test.ts index 9be77e675a..9f519cfc85 100644 --- a/packages/cheqd/tests/cheqd-did-registrar.e2e.test.ts +++ b/packages/cheqd/tests/cheqd-did-registrar.e2e.test.ts @@ -18,7 +18,7 @@ import { getInMemoryAgentOptions } from '../../core/tests/helpers' import { validService } from './setup' import { cheqdPayerSeeds, getCheqdModules } from './setupCheqdModule' -const agentOptions = getInMemoryAgentOptions('Faber Dids Registrar', {}, getCheqdModules(cheqdPayerSeeds[0])) +const agentOptions = getInMemoryAgentOptions('Faber Dids Registrar', {}, {}, getCheqdModules(cheqdPayerSeeds[0])) describe('Cheqd DID registrar', () => { let agent: Agent> diff --git a/packages/cheqd/tests/cheqd-did-resolver.e2e.test.ts b/packages/cheqd/tests/cheqd-did-resolver.e2e.test.ts index e5a861d224..c0b8137c29 100644 --- a/packages/cheqd/tests/cheqd-did-resolver.e2e.test.ts +++ b/packages/cheqd/tests/cheqd-did-resolver.e2e.test.ts @@ -9,7 +9,7 @@ import { getClosestResourceVersion } from '../src/dids/didCheqdUtil' import { cheqdPayerSeeds, getCheqdModules } from './setupCheqdModule' export const resolverAgent = new Agent( - getInMemoryAgentOptions('Cheqd resolver', {}, getCheqdModules(cheqdPayerSeeds[1])) + getInMemoryAgentOptions('Cheqd resolver', {}, {}, getCheqdModules(cheqdPayerSeeds[1])) ) describe('Cheqd DID resolver', () => { diff --git a/packages/cheqd/tests/cheqd-sdk-anoncreds-registry.e2e.test.ts b/packages/cheqd/tests/cheqd-sdk-anoncreds-registry.e2e.test.ts index 6c39cd3ab6..79fce1a58c 100644 --- a/packages/cheqd/tests/cheqd-sdk-anoncreds-registry.e2e.test.ts +++ b/packages/cheqd/tests/cheqd-sdk-anoncreds-registry.e2e.test.ts @@ -7,7 +7,7 @@ import { CheqdAnonCredsRegistry } from '../src/anoncreds' import { cheqdPayerSeeds, getCheqdModules } from './setupCheqdModule' -const agent = new Agent(getInMemoryAgentOptions('cheqdAnonCredsRegistry', {}, getCheqdModules(cheqdPayerSeeds[2]))) +const agent = new Agent(getInMemoryAgentOptions('cheqdAnonCredsRegistry', {}, {}, getCheqdModules(cheqdPayerSeeds[2]))) const cheqdAnonCredsRegistry = new CheqdAnonCredsRegistry() diff --git a/packages/core/package.json b/packages/core/package.json index e20317fac4..29c71726d6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,17 +31,17 @@ "@multiformats/base-x": "^4.0.1", "@noble/curves": "^1.6.0", "@noble/hashes": "^1.5.0", - "@peculiar/asn1-ecc": "^2.3.8", - "@peculiar/asn1-schema": "^2.3.8", - "@peculiar/asn1-x509": "^2.3.8", - "@peculiar/x509": "^1.11.0", + "@peculiar/asn1-ecc": "^2.3.13", + "@peculiar/asn1-schema": "^2.3.13", + "@peculiar/asn1-x509": "^2.3.13", + "@peculiar/x509": "^1.12.1", "@animo-id/mdoc": "0.2.39", - "@sd-jwt/core": "^0.7.0", - "@sd-jwt/decode": "^0.7.0", - "@sd-jwt/jwt-status-list": "^0.7.0", - "@sd-jwt/sd-jwt-vc": "^0.7.0", - "@sd-jwt/types": "^0.7.0", - "@sd-jwt/utils": "^0.7.0", + "@sd-jwt/core": "^0.7.2", + "@sd-jwt/decode": "^0.7.2", + "@sd-jwt/jwt-status-list": "^0.7.2", + "@sd-jwt/sd-jwt-vc": "^0.7.2", + "@sd-jwt/types": "^0.7.2", + "@sd-jwt/utils": "^0.7.2", "@animo-id/pex": "4.1.1-alpha.0", "@sphereon/pex-models": "^2.3.1", "@sphereon/ssi-types": "0.30.2-next.135", @@ -55,10 +55,8 @@ "did-resolver": "^4.1.0", "@astronautlabs/jsonpath": "^1.1.2", "lru_map": "^0.4.1", - "luxon": "^3.5.0", "make-error": "^1.3.6", "object-inspect": "^1.10.3", - "query-string": "^7.0.1", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.0", "tsyringe": "^4.8.0", @@ -69,7 +67,6 @@ }, "devDependencies": { "@types/events": "^3.0.0", - "@types/luxon": "^3.2.0", "@types/object-inspect": "^1.8.0", "@types/uuid": "^9.0.1", "@types/varint": "^6.0.0", diff --git a/packages/core/src/agent/Agent.ts b/packages/core/src/agent/Agent.ts index 0b417f9b03..530a9d32dd 100644 --- a/packages/core/src/agent/Agent.ts +++ b/packages/core/src/agent/Agent.ts @@ -1,34 +1,21 @@ import type { AgentDependencies } from './AgentDependencies' import type { AgentModulesInput } from './AgentModules' -import type { AgentMessageReceivedEvent } from './Events' import type { Module } from '../plugins' -import type { InboundTransport } from '../transport/InboundTransport' -import type { OutboundTransport } from '../transport/OutboundTransport' import type { InitConfig } from '../types' -import type { Subscription } from 'rxjs' import { Subject } from 'rxjs' -import { mergeMap, takeUntil } from 'rxjs/operators' import { InjectionSymbols } from '../constants' import { SigningProviderToken } from '../crypto' import { JwsService } from '../crypto/JwsService' import { CredoError } from '../error' import { DependencyManager } from '../plugins' -import { DidCommMessageRepository, StorageUpdateService, StorageVersionRepository } from '../storage' +import { StorageUpdateService, StorageVersionRepository } from '../storage' import { AgentConfig } from './AgentConfig' import { extendModulesWithDefaultModules } from './AgentModules' import { BaseAgent } from './BaseAgent' -import { Dispatcher } from './Dispatcher' -import { EnvelopeService } from './EnvelopeService' import { EventEmitter } from './EventEmitter' -import { AgentEventTypes } from './Events' -import { FeatureRegistry } from './FeatureRegistry' -import { MessageHandlerRegistry } from './MessageHandlerRegistry' -import { MessageReceiver } from './MessageReceiver' -import { MessageSender } from './MessageSender' -import { TransportService } from './TransportService' import { AgentContext, DefaultAgentContextProvider } from './context' interface AgentOptions { @@ -40,23 +27,13 @@ interface AgentOptions { // Any makes sure you can use Agent as a type without always needing to specify the exact generics for the agent // eslint-disable-next-line @typescript-eslint/no-explicit-any export class Agent extends BaseAgent { - private messageSubscription?: Subscription - public constructor(options: AgentOptions, dependencyManager = new DependencyManager()) { const agentConfig = new AgentConfig(options.config, options.dependencies) const modulesWithDefaultModules = extendModulesWithDefaultModules(options.modules) // Register internal dependencies - dependencyManager.registerSingleton(MessageHandlerRegistry) dependencyManager.registerSingleton(EventEmitter) - dependencyManager.registerSingleton(MessageSender) - dependencyManager.registerSingleton(MessageReceiver) - dependencyManager.registerSingleton(TransportService) - dependencyManager.registerSingleton(Dispatcher) - dependencyManager.registerSingleton(EnvelopeService) - dependencyManager.registerSingleton(FeatureRegistry) dependencyManager.registerSingleton(JwsService) - dependencyManager.registerSingleton(DidCommMessageRepository) dependencyManager.registerSingleton(StorageVersionRepository) dependencyManager.registerSingleton(StorageUpdateService) @@ -108,66 +85,11 @@ export class Agent extends BaseAge super(agentConfig, dependencyManager) } - public registerInboundTransport(inboundTransport: InboundTransport) { - this.messageReceiver.registerInboundTransport(inboundTransport) - } - - public async unregisterInboundTransport(inboundTransport: InboundTransport) { - await this.messageReceiver.unregisterInboundTransport(inboundTransport) - } - - public get inboundTransports() { - return this.messageReceiver.inboundTransports - } - - public registerOutboundTransport(outboundTransport: OutboundTransport) { - this.messageSender.registerOutboundTransport(outboundTransport) - } - - public async unregisterOutboundTransport(outboundTransport: OutboundTransport) { - await this.messageSender.unregisterOutboundTransport(outboundTransport) - } - - public get outboundTransports() { - return this.messageSender.outboundTransports - } - public get events() { return this.eventEmitter } - /** - * Agent's feature registry - */ - public get features() { - return this.featureRegistry - } - public async initialize() { - const stop$ = this.dependencyManager.resolve>(InjectionSymbols.Stop$) - - // Listen for new messages (either from transports or somewhere else in the framework / extensions) - // We create this before doing any other initialization, so the initialization could already receive messages - this.messageSubscription = this.eventEmitter - .observable(AgentEventTypes.AgentMessageReceived) - .pipe( - takeUntil(stop$), - mergeMap( - (e) => - this.messageReceiver - .receiveMessage(e.payload.message, { - connection: e.payload.connection, - contextCorrelationId: e.payload.contextCorrelationId, - session: e.payload.session, - }) - .catch((error) => { - this.logger.error('Failed to process message', { error }) - }), - this.agentConfig.processDidCommMessagesConcurrently ? undefined : 1 - ) - ) - .subscribe() - await super.initialize() for (const [, module] of Object.entries(this.dependencyManager.registeredModules) as [string, Module][]) { @@ -176,31 +98,6 @@ export class Agent extends BaseAge } } - for (const transport of this.inboundTransports) { - await transport.start(this) - } - - for (const transport of this.outboundTransports) { - await transport.start(this) - } - - // Connect to mediator through provided invitation if provided in config - // Also requests mediation ans sets as default mediator - // Because this requires the connections module, we do this in the agent constructor - if (this.mediationRecipient.config.mediatorInvitationUrl) { - this.logger.debug('Provision mediation with invitation', { - mediatorInvitationUrl: this.mediationRecipient.config.mediatorInvitationUrl, - }) - const mediationConnection = await this.getMediationConnection( - this.mediationRecipient.config.mediatorInvitationUrl - ) - await this.mediationRecipient.provision(mediationConnection) - } - - await this.messagePickup.initialize() - await this.mediator.initialize() - await this.mediationRecipient.initialize() - this._isInitialized = true } @@ -210,10 +107,11 @@ export class Agent extends BaseAge // this means all observables will stop running if a value is emitted on this observable stop$.next(true) - // Stop transports - const allTransports = [...this.inboundTransports, ...this.outboundTransports] - const transportPromises = allTransports.map((transport) => transport.stop()) - await Promise.all(transportPromises) + for (const [, module] of Object.entries(this.dependencyManager.registeredModules) as [string, Module][]) { + if (module.shutdown) { + await module.shutdown(this.agentContext) + } + } if (this.wallet.isInitialized) { await this.wallet.close() @@ -221,33 +119,4 @@ export class Agent extends BaseAge this._isInitialized = false } - - protected async getMediationConnection(mediatorInvitationUrl: string) { - const outOfBandInvitation = await this.oob.parseInvitation(mediatorInvitationUrl) - const outOfBandRecord = await this.oob.findByReceivedInvitationId(outOfBandInvitation.id) - const [connection] = outOfBandRecord ? await this.connections.findAllByOutOfBandId(outOfBandRecord.id) : [] - - if (!connection) { - this.logger.debug('Mediation connection does not exist, creating connection') - // We don't want to use the current default mediator when connecting to another mediator - const routing = await this.mediationRecipient.getRouting({ useDefaultMediator: false }) - - this.logger.debug('Routing created', routing) - const { connectionRecord: newConnection } = await this.oob.receiveInvitation(outOfBandInvitation, { - routing, - }) - this.logger.debug(`Mediation invitation processed`, { outOfBandInvitation }) - - if (!newConnection) { - throw new CredoError('No connection record to provision mediation.') - } - - return this.connections.returnWhenIsConnected(newConnection.id) - } - - if (!connection.isReady) { - return this.connections.returnWhenIsConnected(connection.id) - } - return connection - } } diff --git a/packages/core/src/agent/AgentConfig.ts b/packages/core/src/agent/AgentConfig.ts index fc160fd901..d1b5cba154 100644 --- a/packages/core/src/agent/AgentConfig.ts +++ b/packages/core/src/agent/AgentConfig.ts @@ -2,20 +2,16 @@ import type { AgentDependencies } from './AgentDependencies' import type { Logger } from '../logger' import type { InitConfig } from '../types' -import { DID_COMM_TRANSPORT_QUEUE } from '../constants' import { ConsoleLogger, LogLevel } from '../logger' -import { DidCommMimeType } from '../types' export class AgentConfig { private initConfig: InitConfig - private _endpoints: string[] | undefined public label: string public logger: Logger public readonly agentDependencies: AgentDependencies public constructor(initConfig: InitConfig, agentDependencies: AgentDependencies) { this.initConfig = initConfig - this._endpoints = initConfig.endpoints this.label = initConfig.label this.logger = initConfig.logger ?? new ConsoleLogger(LogLevel.off) this.agentDependencies = agentDependencies @@ -28,49 +24,10 @@ export class AgentConfig { return this.initConfig.walletConfig } - public get didCommMimeType() { - return this.initConfig.didCommMimeType ?? DidCommMimeType.V1 - } - public get allowInsecureHttpUrls() { return this.initConfig.allowInsecureHttpUrls ?? false } - /** - * Encode keys in did:key format instead of 'naked' keys, as stated in Aries RFC 0360. - * - * This setting will not be taken into account if the other party has previously used naked keys - * in a given protocol (i.e. it does not support Aries RFC 0360). - */ - public get useDidKeyInProtocols() { - return this.initConfig.useDidKeyInProtocols ?? true - } - - public get endpoints(): [string, ...string[]] { - // if endpoints is not set, return queue endpoint - // https://github.com/hyperledger/aries-rfcs/issues/405#issuecomment-582612875 - if (!this._endpoints || this._endpoints.length === 0) { - return [DID_COMM_TRANSPORT_QUEUE] - } - - return this._endpoints as [string, ...string[]] - } - - public set endpoints(endpoints: string[]) { - this._endpoints = endpoints - } - - public get useDidSovPrefixWhereAllowed() { - return this.initConfig.useDidSovPrefixWhereAllowed ?? false - } - - /** - * @todo move to context configuration - */ - public get connectionImageUrl() { - return this.initConfig.connectionImageUrl - } - public get autoUpdateStorageOnStartup() { return this.initConfig.autoUpdateStorageOnStartup ?? false } @@ -79,10 +36,6 @@ export class AgentConfig { return this.initConfig.backupBeforeStorageUpdate ?? true } - public get processDidCommMessagesConcurrently() { - return this.initConfig.processDidCommMessagesConcurrently ?? false - } - public extend(config: Partial): AgentConfig { return new AgentConfig( { ...this.initConfig, logger: this.logger, label: this.label, ...config }, diff --git a/packages/core/src/agent/AgentModules.ts b/packages/core/src/agent/AgentModules.ts index 7ca8b8851f..00bf292618 100644 --- a/packages/core/src/agent/AgentModules.ts +++ b/packages/core/src/agent/AgentModules.ts @@ -2,19 +2,11 @@ import type { Module, DependencyManager, ApiModule } from '../plugins' import type { IsAny } from '../types' import type { Constructor } from '../utils/mixins' -import { BasicMessagesModule } from '../modules/basic-messages' import { CacheModule } from '../modules/cache' -import { ConnectionsModule } from '../modules/connections' -import { CredentialsModule } from '../modules/credentials' import { DidsModule } from '../modules/dids' import { DifPresentationExchangeModule } from '../modules/dif-presentation-exchange' -import { DiscoverFeaturesModule } from '../modules/discover-features' import { GenericRecordsModule } from '../modules/generic-records' import { MdocModule } from '../modules/mdoc/MdocModule' -import { MessagePickupModule } from '../modules/message-pickup' -import { OutOfBandModule } from '../modules/oob' -import { ProofsModule } from '../modules/proofs' -import { MediationRecipientModule, MediatorModule } from '../modules/routing' import { SdJwtVcModule } from '../modules/sd-jwt-vc' import { W3cCredentialsModule } from '../modules/vc' import { X509Module } from '../modules/x509' @@ -32,18 +24,7 @@ export type EmptyModuleMap = {} * Default modules can be optionally defined to provide custom configuration. This type makes it so that it is not * possible to use a different key for the default modules */ -export type AgentModulesInput = Partial & ModulesMap - -/** - * Defines the input type for the default agent modules. This is overwritten as we - * want the input type to allow for generics to be passed in for the credentials module. - */ -export type DefaultAgentModulesInput = Omit & { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - credentials: CredentialsModule - // eslint-disable-next-line @typescript-eslint/no-explicit-any - proofs: ProofsModule -} +export type AgentModulesInput = ModulesMap /** * Type that represents the default agent modules. This is the {@link ModulesMap} variant for the default modules in the framework. @@ -121,18 +102,9 @@ export type CustomOrDefaultApi< */ function getDefaultAgentModules() { return { - connections: () => new ConnectionsModule(), - credentials: () => new CredentialsModule(), - proofs: () => new ProofsModule(), - mediator: () => new MediatorModule(), - mediationRecipient: () => new MediationRecipientModule(), - messagePickup: () => new MessagePickupModule(), - basicMessages: () => new BasicMessagesModule(), genericRecords: () => new GenericRecordsModule(), - discovery: () => new DiscoverFeaturesModule(), dids: () => new DidsModule(), wallet: () => new WalletModule(), - oob: () => new OutOfBandModule(), w3cCredentials: () => new W3cCredentialsModule(), cache: () => new CacheModule(), pex: () => new DifPresentationExchangeModule(), diff --git a/packages/core/src/agent/BaseAgent.ts b/packages/core/src/agent/BaseAgent.ts index b404e76798..d8b2e4b95f 100644 --- a/packages/core/src/agent/BaseAgent.ts +++ b/packages/core/src/agent/BaseAgent.ts @@ -1,24 +1,12 @@ import type { AgentConfig } from './AgentConfig' -import type { AgentApi, CustomOrDefaultApi, EmptyModuleMap, ModulesMap, WithoutDefaultModules } from './AgentModules' -import type { TransportSession } from './TransportService' +import type { AgentApi, EmptyModuleMap, ModulesMap, WithoutDefaultModules } from './AgentModules' import type { Logger } from '../logger' -import type { CredentialsModule } from '../modules/credentials' -import type { MessagePickupModule } from '../modules/message-pickup' -import type { ProofsModule } from '../modules/proofs' import type { DependencyManager } from '../plugins' import { CredoError } from '../error' -import { BasicMessagesApi } from '../modules/basic-messages' -import { ConnectionsApi } from '../modules/connections' -import { CredentialsApi } from '../modules/credentials' import { DidsApi } from '../modules/dids' -import { DiscoverFeaturesApi } from '../modules/discover-features' import { GenericRecordsApi } from '../modules/generic-records' import { MdocApi } from '../modules/mdoc' -import { MessagePickupApi } from '../modules/message-pickup/MessagePickupApi' -import { OutOfBandApi } from '../modules/oob' -import { ProofsApi } from '../modules/proofs' -import { MediatorApi, MediationRecipientApi } from '../modules/routing' import { SdJwtVcApi } from '../modules/sd-jwt-vc' import { W3cCredentialsApi } from '../modules/vc/W3cCredentialsApi' import { X509Api } from '../modules/x509' @@ -29,10 +17,6 @@ import { WalletError } from '../wallet/error' import { getAgentApi } from './AgentModules' import { EventEmitter } from './EventEmitter' -import { FeatureRegistry } from './FeatureRegistry' -import { MessageReceiver } from './MessageReceiver' -import { MessageSender } from './MessageSender' -import { TransportService } from './TransportService' import { AgentContext } from './context' export abstract class BaseAgent { @@ -40,26 +24,13 @@ export abstract class BaseAgent - public readonly proofs: CustomOrDefaultApi - public readonly mediator: MediatorApi - public readonly mediationRecipient: MediationRecipientApi - public readonly messagePickup: CustomOrDefaultApi - public readonly basicMessages: BasicMessagesApi public readonly mdoc: MdocApi public readonly genericRecords: GenericRecordsApi - public readonly discovery: DiscoverFeaturesApi public readonly dids: DidsApi public readonly wallet: WalletApi - public readonly oob: OutOfBandApi public readonly w3cCredentials: W3cCredentialsApi public readonly sdJwtVc: SdJwtVcApi public readonly x509: X509Api @@ -86,48 +57,20 @@ export abstract class BaseAgent - this.proofs = this.dependencyManager.resolve(ProofsApi) as CustomOrDefaultApi - this.mediator = this.dependencyManager.resolve(MediatorApi) - this.mediationRecipient = this.dependencyManager.resolve(MediationRecipientApi) - this.messagePickup = this.dependencyManager.resolve(MessagePickupApi) as CustomOrDefaultApi< - AgentModules['messagePickup'], - MessagePickupModule - > - this.basicMessages = this.dependencyManager.resolve(BasicMessagesApi) this.genericRecords = this.dependencyManager.resolve(GenericRecordsApi) - this.discovery = this.dependencyManager.resolve(DiscoverFeaturesApi) this.dids = this.dependencyManager.resolve(DidsApi) this.wallet = this.dependencyManager.resolve(WalletApi) - this.oob = this.dependencyManager.resolve(OutOfBandApi) this.w3cCredentials = this.dependencyManager.resolve(W3cCredentialsApi) this.sdJwtVc = this.dependencyManager.resolve(SdJwtVcApi) this.x509 = this.dependencyManager.resolve(X509Api) this.mdoc = this.dependencyManager.resolve(MdocApi) const defaultApis = [ - this.connections, - this.credentials, - this.proofs, - this.mediator, - this.mediationRecipient, - this.messagePickup, - this.basicMessages, this.genericRecords, - this.discovery, this.dids, this.wallet, - this.oob, this.w3cCredentials, this.sdJwtVc, this.x509, @@ -185,21 +128,6 @@ export abstract class BaseAgent metadata: EventMetadata } - -export interface AgentMessageReceivedEvent extends BaseEvent { - type: typeof AgentEventTypes.AgentMessageReceived - payload: { - message: unknown - connection?: ConnectionRecord - contextCorrelationId?: string - receivedAt?: Date - session?: TransportSession - } -} - -export interface AgentMessageProcessedEvent extends BaseEvent { - type: typeof AgentEventTypes.AgentMessageProcessed - payload: { - message: AgentMessage - connection?: ConnectionRecord - receivedAt?: Date - encryptedMessage?: EncryptedMessage - } -} - -export interface AgentMessageSentEvent extends BaseEvent { - type: typeof AgentEventTypes.AgentMessageSent - payload: { - message: OutboundMessageContext - status: OutboundMessageSendStatus - } -} diff --git a/packages/core/src/agent/__tests__/Agent.test.ts b/packages/core/src/agent/__tests__/Agent.test.ts index 57a33aecdc..eea6e95489 100644 --- a/packages/core/src/agent/__tests__/Agent.test.ts +++ b/packages/core/src/agent/__tests__/Agent.test.ts @@ -3,20 +3,24 @@ import type { Module } from '../../plugins' import { injectable } from 'tsyringe' import { InMemoryWalletModule } from '../../../../../tests/InMemoryWalletModule' -import { getInMemoryAgentOptions } from '../../../tests/helpers' -import { InjectionSymbols } from '../../constants' -import { BasicMessageRepository, BasicMessageService } from '../../modules/basic-messages' -import { BasicMessagesApi } from '../../modules/basic-messages/BasicMessagesApi' -import { DidRotateService } from '../../modules/connections' -import { ConnectionsApi } from '../../modules/connections/ConnectionsApi' -import { ConnectionRepository } from '../../modules/connections/repository/ConnectionRepository' -import { ConnectionService } from '../../modules/connections/services/ConnectionService' -import { TrustPingService } from '../../modules/connections/services/TrustPingService' -import { CredentialRepository } from '../../modules/credentials' -import { CredentialsApi } from '../../modules/credentials/CredentialsApi' -import { MessagePickupApi, InMemoryMessagePickupRepository } from '../../modules/message-pickup' -import { ProofRepository } from '../../modules/proofs' -import { ProofsApi } from '../../modules/proofs/ProofsApi' +import { + BasicMessageRepository, + BasicMessageService, + ConnectionService, + DidRotateService, + TrustPingService, + Dispatcher, + EnvelopeService, + FeatureRegistry, + MessageReceiver, + MessageSender, +} from '../../../../didcomm/src' +import { BasicMessagesApi } from '../../../../didcomm/src/modules/basic-messages/BasicMessagesApi' +import { ConnectionsApi, ConnectionRepository } from '../../../../didcomm/src/modules/connections' +import { CredentialRepository } from '../../../../didcomm/src/modules/credentials' +import { CredentialsApi } from '../../../../didcomm/src/modules/credentials/CredentialsApi' +import { MessagePickupApi, InMemoryMessagePickupRepository } from '../../../../didcomm/src/modules/message-pickup' +import { ProofsApi, ProofRepository } from '../../../../didcomm/src/modules/proofs' import { MediationRecipientService, MediationRepository, @@ -24,14 +28,12 @@ import { MediatorService, MediationRecipientApi, MediationRecipientModule, -} from '../../modules/routing' +} from '../../../../didcomm/src/modules/routing' +import { getDefaultDidcommModules } from '../../../../didcomm/src/util/modules' +import { getInMemoryAgentOptions } from '../../../tests/helpers' +import { InjectionSymbols } from '../../constants' import { WalletError } from '../../wallet/error' import { Agent } from '../Agent' -import { Dispatcher } from '../Dispatcher' -import { EnvelopeService } from '../EnvelopeService' -import { FeatureRegistry } from '../FeatureRegistry' -import { MessageReceiver } from '../MessageReceiver' -import { MessageSender } from '../MessageSender' const agentOptions = getInMemoryAgentOptions('Agent Class Test') @@ -51,11 +53,15 @@ class MyModule implements Module { describe('Agent', () => { describe('Module registration', () => { test('does not return default modules on modules key if no modules were provided', () => { - const agent = new Agent(agentOptions) + const agent = new Agent({ + ...agentOptions, + modules: { + inMemory: new InMemoryWalletModule(), + }, + }) expect(agent.modules).toEqual({}) }) - test('registers custom and default modules if custom modules are provided', () => { const agent = new Agent({ ...agentOptions, @@ -75,6 +81,7 @@ describe('Agent', () => { const agent = new Agent({ ...agentOptions, modules: { + ...getDefaultDidcommModules(), myModule: new MyModule(), mediationRecipient: new MediationRecipientModule({ maximumMessagePickup: 42, @@ -84,10 +91,8 @@ describe('Agent', () => { }) // Should be custom module config property, not the default value - expect(agent.mediationRecipient.config.maximumMessagePickup).toBe(42) - expect(agent.modules).toEqual({ - myModule: expect.any(MyApi), - }) + expect(agent.modules.mediationRecipient.config.maximumMessagePickup).toBe(42) + expect(agent.modules.myModule).toEqual(expect.any(MyApi)) }) }) @@ -237,12 +242,15 @@ describe('Agent', () => { }) }) - it('all core features are properly registered', () => { + it('all core features are properly registered', async () => { const agent = new Agent(agentOptions) + await agent.initialize() // Initialization is needed to properly register DIDComm features const registry = agent.dependencyManager.resolve(FeatureRegistry) const protocols = registry.query({ featureType: 'protocol', match: '*' }).map((p) => p.id) + expect(protocols.length).toEqual(14) + expect(protocols).toEqual( expect.arrayContaining([ 'https://didcomm.org/basicmessage/1.0', @@ -261,6 +269,5 @@ describe('Agent', () => { 'https://didcomm.org/revocation_notification/2.0', ]) ) - expect(protocols.length).toEqual(14) }) }) diff --git a/packages/core/src/agent/__tests__/AgentConfig.test.ts b/packages/core/src/agent/__tests__/AgentConfig.test.ts index 59a32da7f3..630c382774 100644 --- a/packages/core/src/agent/__tests__/AgentConfig.test.ts +++ b/packages/core/src/agent/__tests__/AgentConfig.test.ts @@ -2,44 +2,18 @@ import { agentDependencies, getAgentConfig } from '../../../tests/helpers' import { AgentConfig } from '../AgentConfig' describe('AgentConfig', () => { - describe('endpoints', () => { - it('should return the config endpoint if no inbound connection is available', () => { - const endpoint = 'https://local-url.com' - - const agentConfig = getAgentConfig('AgentConfig Test', { - endpoints: [endpoint], - }) - - expect(agentConfig.endpoints).toEqual([endpoint]) - }) - - it("should return ['didcomm:transport/queue'] if no inbound connection or config endpoint or host/port is available", () => { - const agentConfig = getAgentConfig('AgentConfig Test') - - expect(agentConfig.endpoints).toStrictEqual(['didcomm:transport/queue']) - }) - - it('should return the new config endpoint after setter is called', () => { - const endpoint = 'https://local-url.com' - const newEndpoint = 'https://new-local-url.com' - - const agentConfig = getAgentConfig('AgentConfig Test', { - endpoints: [endpoint], - }) - - agentConfig.endpoints = [newEndpoint] - expect(agentConfig.endpoints).toEqual([newEndpoint]) - }) - }) - describe('label', () => { it('should return new label after setter is called', async () => { expect.assertions(2) const newLabel = 'Agent: Agent Class Test 2' - const agentConfig = getAgentConfig('AgentConfig Test', { - label: 'Test', - }) + const agentConfig = getAgentConfig( + 'AgentConfig Test', + {}, + { + label: 'Test', + } + ) expect(agentConfig.label).toBe('Test') agentConfig.label = newLabel diff --git a/packages/core/src/agent/__tests__/AgentModules.test.ts b/packages/core/src/agent/__tests__/AgentModules.test.ts index f174d97a4a..a0394838ea 100644 --- a/packages/core/src/agent/__tests__/AgentModules.test.ts +++ b/packages/core/src/agent/__tests__/AgentModules.test.ts @@ -1,18 +1,10 @@ import type { Module } from '../../plugins' -import { BasicMessagesModule } from '../../modules/basic-messages' import { CacheModule } from '../../modules/cache' -import { ConnectionsModule } from '../../modules/connections' -import { CredentialsModule } from '../../modules/credentials' import { DidsModule } from '../../modules/dids' import { DifPresentationExchangeModule } from '../../modules/dif-presentation-exchange' -import { DiscoverFeaturesModule } from '../../modules/discover-features' import { GenericRecordsModule } from '../../modules/generic-records' import { MdocModule } from '../../modules/mdoc' -import { MessagePickupModule } from '../../modules/message-pickup' -import { OutOfBandModule } from '../../modules/oob' -import { ProofsModule } from '../../modules/proofs' -import { MediationRecipientModule, MediatorModule } from '../../modules/routing' import { SdJwtVcModule } from '../../modules/sd-jwt-vc' import { W3cCredentialsModule } from '../../modules/vc' import { X509Module } from '../../modules/x509' @@ -59,19 +51,10 @@ describe('AgentModules', () => { const extendedModules = extendModulesWithDefaultModules() expect(extendedModules).toEqual({ - connections: expect.any(ConnectionsModule), - credentials: expect.any(CredentialsModule), - proofs: expect.any(ProofsModule), - mediator: expect.any(MediatorModule), - mediationRecipient: expect.any(MediationRecipientModule), - messagePickup: expect.any(MessagePickupModule), - basicMessages: expect.any(BasicMessagesModule), pex: expect.any(DifPresentationExchangeModule), genericRecords: expect.any(GenericRecordsModule), - discovery: expect.any(DiscoverFeaturesModule), dids: expect.any(DidsModule), wallet: expect.any(WalletModule), - oob: expect.any(OutOfBandModule), w3cCredentials: expect.any(W3cCredentialsModule), sdJwtVc: expect.any(SdJwtVcModule), mdoc: expect.any(MdocModule), @@ -87,19 +70,10 @@ describe('AgentModules', () => { }) expect(extendedModules).toEqual({ - connections: expect.any(ConnectionsModule), - credentials: expect.any(CredentialsModule), - proofs: expect.any(ProofsModule), - mediator: expect.any(MediatorModule), - mediationRecipient: expect.any(MediationRecipientModule), - messagePickup: expect.any(MessagePickupModule), - basicMessages: expect.any(BasicMessagesModule), pex: expect.any(DifPresentationExchangeModule), genericRecords: expect.any(GenericRecordsModule), - discovery: expect.any(DiscoverFeaturesModule), dids: expect.any(DidsModule), wallet: expect.any(WalletModule), - oob: expect.any(OutOfBandModule), w3cCredentials: expect.any(W3cCredentialsModule), cache: expect.any(CacheModule), sdJwtVc: expect.any(SdJwtVcModule), @@ -111,26 +85,17 @@ describe('AgentModules', () => { test('does not override default module if provided as custom module', () => { const myModule = new MyModuleWithApi() - const connections = new ConnectionsModule() + const genericRecords = new GenericRecordsModule() const extendedModules = extendModulesWithDefaultModules({ myModule, - connections, + genericRecords, }) expect(extendedModules).toEqual({ - connections: connections, - credentials: expect.any(CredentialsModule), - proofs: expect.any(ProofsModule), - mediator: expect.any(MediatorModule), - mediationRecipient: expect.any(MediationRecipientModule), - messagePickup: expect.any(MessagePickupModule), - basicMessages: expect.any(BasicMessagesModule), + genericRecords: genericRecords, pex: expect.any(DifPresentationExchangeModule), - genericRecords: expect.any(GenericRecordsModule), - discovery: expect.any(DiscoverFeaturesModule), dids: expect.any(DidsModule), wallet: expect.any(WalletModule), - oob: expect.any(OutOfBandModule), w3cCredentials: expect.any(W3cCredentialsModule), cache: expect.any(CacheModule), sdJwtVc: expect.any(SdJwtVcModule), diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 7c35ad558b..adf9cfbb53 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -1,5 +1,5 @@ export const InjectionSymbols = { - MessagePickupRepository: Symbol('MessagePickupRepository'), + MessagePickupRepository: Symbol('MessagePickupRepository'), // TODO: Move to DIDComm StorageService: Symbol('StorageService'), Logger: Symbol('Logger'), AgentContextProvider: Symbol('AgentContextProvider'), @@ -9,5 +9,3 @@ export const InjectionSymbols = { Wallet: Symbol('Wallet'), WebCrypto: Symbol('WebCrypto'), } - -export const DID_COMM_TRANSPORT_QUEUE = 'didcomm:transport/queue' diff --git a/packages/core/src/crypto/WalletKeyPair.ts b/packages/core/src/crypto/WalletKeyPair.ts index d853c80fcc..dff6e15505 100644 --- a/packages/core/src/crypto/WalletKeyPair.ts +++ b/packages/core/src/crypto/WalletKeyPair.ts @@ -5,8 +5,7 @@ import type { Wallet } from '../wallet' import { VerificationMethod } from '../modules/dids' import { getKeyFromVerificationMethod } from '../modules/dids/domain/key-type/keyDidMapping' import { LdKeyPair } from '../modules/vc/data-integrity/models/LdKeyPair' -import { JsonTransformer } from '../utils' -import { MessageValidator } from '../utils/MessageValidator' +import { JsonTransformer, MessageValidator } from '../utils' import { Buffer } from '../utils/buffer' interface WalletKeyPairOptions extends LdKeyPairOptions { diff --git a/packages/core/src/crypto/index.ts b/packages/core/src/crypto/index.ts index 2d77c449cc..2eca6618c5 100644 --- a/packages/core/src/crypto/index.ts +++ b/packages/core/src/crypto/index.ts @@ -1,6 +1,6 @@ export { JwsService } from './JwsService' -export { JwsDetachedFormat, JwsProtectedHeaderOptions } from './JwsTypes' +export { JwsDetachedFormat, JwsFlattenedDetachedFormat, JwsGeneralFormat, JwsProtectedHeaderOptions } from './JwsTypes' export * from './keyUtils' export { KeyBackend } from './KeyBackend' diff --git a/packages/core/src/error/index.ts b/packages/core/src/error/index.ts index 7eb55c0d1f..3ed9b8a6a5 100644 --- a/packages/core/src/error/index.ts +++ b/packages/core/src/error/index.ts @@ -2,4 +2,3 @@ export * from './CredoError' export * from './RecordNotFoundError' export * from './RecordDuplicateError' export * from './ClassValidationError' -export * from './MessageSendingError' diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 1b98fd78cd..a4df071cf4 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,64 +1,43 @@ // reflect-metadata used for class-transformer + class-validator import 'reflect-metadata' -export { MessageReceiver } from './agent/MessageReceiver' export { Agent } from './agent/Agent' export { BaseAgent } from './agent/BaseAgent' export * from './agent' export type { ModulesMap, DefaultAgentModules, EmptyModuleMap } from './agent/AgentModules' export { EventEmitter } from './agent/EventEmitter' -export { FeatureRegistry } from './agent/FeatureRegistry' -export { MessageHandler, MessageHandlerInboundMessage } from './agent/MessageHandler' -export { MessageHandlerRegistry } from './agent/MessageHandlerRegistry' -export * from './agent/models' export { AgentConfig } from './agent/AgentConfig' -export { AgentMessage } from './agent/AgentMessage' -export { Dispatcher } from './agent/Dispatcher' -export { MessageSender } from './agent/MessageSender' + export type { AgentDependencies } from './agent/AgentDependencies' -export { getOutboundMessageContext } from './agent/getOutboundMessageContext' + export type { InitConfig, - OutboundPackage, - EncryptedMessage, WalletConfig, JsonArray, JsonObject, JsonValue, + ResolvedDidCommService, WalletConfigRekey, WalletExportImportConfig, WalletStorageConfig, } from './types' -export { DidCommMimeType, KeyDerivationMethod } from './types' +export { KeyDerivationMethod, EncryptedMessage, PlaintextMessage } from './types' export type { FileSystem, DownloadToFileOptions } from './storage/FileSystem' export * from './storage/BaseRecord' -export { DidCommMessageRecord, DidCommMessageRole, DidCommMessageRepository } from './storage/didcomm' export { Repository } from './storage/Repository' export * from './storage/RepositoryEvents' export { StorageService, Query, QueryOptions, SimpleQuery, BaseRecordConstructor } from './storage/StorageService' export * from './storage/migration' +export { Metadata } from './storage/Metadata' +export { UpdateConfig, V0_1ToV0_2UpdateConfig } from './storage/migration/updates' + export { getDirFromFilePath, joinUriParts } from './utils/path' export { InjectionSymbols } from './constants' export * from './wallet' -export type { TransportSession } from './agent/TransportService' -export { TransportService } from './agent/TransportService' -export { Attachment, AttachmentData } from './decorators/attachment/Attachment' -export { ServiceDecorator, ServiceDecoratorOptions } from './decorators/service/ServiceDecorator' -export { ReturnRouteTypes } from './decorators/transport/TransportDecorator' +export { VersionString } from './utils/version' export * from './plugins' -export * from './transport' -export * from './modules/basic-messages' export * from './modules/x509' -export * from './modules/common' -export * from './modules/credentials' -export * from './modules/discover-features' -export * from './modules/message-pickup' -export * from './modules/problem-reports' -export * from './modules/proofs' -export * from './modules/connections' -export * from './modules/routing' -export * from './modules/oob' export * from './modules/dids' export * from './modules/vc' export * from './modules/cache' @@ -69,11 +48,14 @@ export { JsonEncoder, JsonTransformer, isJsonObject, - isValidJweStructure, TypedArrayEncoder, + HashlinkEncoder, + BaseName, Buffer, deepEquality, isDid, + IsUri, + IsStringOrInstance, asArray, equalsIgnoreOrder, DateTransformer, @@ -81,30 +63,45 @@ export { export * from './logger' export * from './error' export * from './wallet/error' -export { VersionString } from './utils/version' -export { - type ParsedMessageType, - parseMessageType, - IsValidMessageType, - replaceLegacyDidSovPrefix, -} from './utils/messageType' export type { Constructor, Constructable } from './utils/mixins' export * from './agent/Events' export * from './crypto' +// TODO: Clean up these exports used by DIDComm module +export { + didKeyToInstanceOfKey, + didKeyToVerkey, + verkeyToDidKey, + verkeyToInstanceOfKey, + isDidKey, +} from './modules/dids/helpers' +export { tryParseDid } from './modules/dids/domain/parse' +export { base64ToBase64URL } from './utils/base64' +export { DidRecordMetadataKeys } from './modules/dids/repository/didRecordMetadataTypes' +export { didDocumentJsonToNumAlgo1Did } from './modules/dids/methods/peer/peerDidNumAlgo1' +export { didDocumentToNumAlgo2Did } from './modules/dids/methods/peer/peerDidNumAlgo2' +export { didDocumentToNumAlgo4Did } from './modules/dids/methods/peer/peerDidNumAlgo4' + +export { SingleOrArray } from './utils' + // TODO: clean up util exports -export { encodeAttachment, isLinkedAttachment } from './utils/attachment' export type { Optional } from './utils' -export { MessageValidator } from './utils/MessageValidator' -export { LinkedAttachment, LinkedAttachmentOptions } from './utils/LinkedAttachment' export { getDomainFromUrl } from './utils/domain' -import { parseInvitationUrl } from './utils/parseInvitation' +export { MessageValidator } from './utils' + +import { indyDidFromPublicKeyBase58 } from './utils/did' +import { areObjectsEqual } from './utils/objectEquality' +import timestamp from './utils/timestamp' +import { getProtocolScheme } from './utils/uri' import { uuid, isValidUuid } from './utils/uuid' const utils = { + areObjectsEqual, uuid, isValidUuid, - parseInvitationUrl, + getProtocolScheme, + timestamp, + indyDidFromPublicKeyBase58, } export { utils } diff --git a/packages/core/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts b/packages/core/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts deleted file mode 100644 index 7354486db1..0000000000 --- a/packages/core/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { DependencyManager } from '../../../plugins/DependencyManager' -import { BasicMessagesModule } from '../BasicMessagesModule' -import { BasicMessageRepository } from '../repository' -import { BasicMessageService } from '../services' - -jest.mock('../../../plugins/DependencyManager') -const DependencyManagerMock = DependencyManager as jest.Mock - -const dependencyManager = new DependencyManagerMock() - -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() - -describe('BasicMessagesModule', () => { - test('registers dependencies on the dependency manager', () => { - new BasicMessagesModule().register(dependencyManager, featureRegistry) - - expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(BasicMessageService) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(BasicMessageRepository) - }) -}) diff --git a/packages/core/src/modules/common/index.ts b/packages/core/src/modules/common/index.ts deleted file mode 100644 index 58debe2da7..0000000000 --- a/packages/core/src/modules/common/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './messages/AckMessage' diff --git a/packages/core/src/modules/connections/__tests__/ConnectionsModule.test.ts b/packages/core/src/modules/connections/__tests__/ConnectionsModule.test.ts deleted file mode 100644 index 5d026182dc..0000000000 --- a/packages/core/src/modules/connections/__tests__/ConnectionsModule.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { DependencyManager } from '../../../plugins/DependencyManager' -import { ConnectionsModule } from '../ConnectionsModule' -import { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' -import { DidExchangeProtocol } from '../DidExchangeProtocol' -import { ConnectionRepository } from '../repository' -import { ConnectionService, TrustPingService } from '../services' -import { DidRotateService } from '../services/DidRotateService' - -jest.mock('../../../plugins/DependencyManager') -const DependencyManagerMock = DependencyManager as jest.Mock - -const dependencyManager = new DependencyManagerMock() - -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() - -describe('ConnectionsModule', () => { - test('registers dependencies on the dependency manager', () => { - const connectionsModule = new ConnectionsModule() - connectionsModule.register(dependencyManager, featureRegistry) - - expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1) - expect(dependencyManager.registerInstance).toHaveBeenCalledWith(ConnectionsModuleConfig, connectionsModule.config) - - expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(5) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(ConnectionService) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(DidExchangeProtocol) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(TrustPingService) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(DidRotateService) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(ConnectionRepository) - }) -}) diff --git a/packages/core/src/modules/didcomm/index.ts b/packages/core/src/modules/didcomm/index.ts deleted file mode 100644 index ff4d44346c..0000000000 --- a/packages/core/src/modules/didcomm/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './types' -export * from './services' diff --git a/packages/core/src/modules/didcomm/types.ts b/packages/core/src/modules/didcomm/types.ts deleted file mode 100644 index e8f9e9a9a8..0000000000 --- a/packages/core/src/modules/didcomm/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Key } from '../../crypto' - -export interface ResolvedDidCommService { - id: string - serviceEndpoint: string - recipientKeys: Key[] - routingKeys: Key[] -} diff --git a/packages/core/src/modules/dids/__tests__/DidsApi.test.ts b/packages/core/src/modules/dids/__tests__/DidsApi.test.ts index 274a5bc031..fd3406ed8a 100644 --- a/packages/core/src/modules/dids/__tests__/DidsApi.test.ts +++ b/packages/core/src/modules/dids/__tests__/DidsApi.test.ts @@ -231,7 +231,7 @@ describe('DidsApi', () => { }) test('create and resolve did:peer:4 in short and long form', async () => { - const routing = await agent.mediationRecipient.getRouting({}) + const routing = await agent.modules.mediationRecipient.getRouting({}) const didDocument = createPeerDidDocumentFromServices([ { id: 'didcomm', diff --git a/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo2.test.ts b/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo2.test.ts index 2ae2b24b03..ba9e35a0d6 100644 --- a/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo2.test.ts +++ b/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo2.test.ts @@ -1,13 +1,12 @@ +import { OutOfBandDidCommService } from '../../../../../../../didcomm/src/modules/oob/domain/OutOfBandDidCommService' +import { + outOfBandServiceToInlineKeysNumAlgo2Did, + outOfBandServiceToNumAlgo2Did, +} from '../../../../../../../didcomm/src/modules/oob/helpers' import { JsonTransformer } from '../../../../../utils' -import { OutOfBandDidCommService } from '../../../../oob/domain/OutOfBandDidCommService' import { DidDocument } from '../../../domain' import { isValidPeerDid } from '../didPeer' -import { - didToNumAlgo2DidDocument, - didDocumentToNumAlgo2Did, - outOfBandServiceToNumAlgo2Did, - outOfBandServiceToInlineKeysNumAlgo2Did, -} from '../peerDidNumAlgo2' +import { didToNumAlgo2DidDocument, didDocumentToNumAlgo2Did } from '../peerDidNumAlgo2' import didPeer2Ez6L from './__fixtures__/didPeer2Ez6L.json' import didPeer2Ez6LMoreServices from './__fixtures__/didPeer2Ez6LMoreServices.json' diff --git a/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo4.test.ts b/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo4.test.ts index b6c09a663c..2937fe0488 100644 --- a/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo4.test.ts +++ b/packages/core/src/modules/dids/methods/peer/__tests__/peerDidNumAlgo4.test.ts @@ -1,7 +1,8 @@ +import { OutOfBandDidCommService } from '../../../../../../../didcomm/src/modules/oob' +import { outOfBandServiceToNumAlgo4Did } from '../../../../../../../didcomm/src/modules/oob/converters' import { JsonTransformer } from '../../../../../utils' -import { OutOfBandDidCommService } from '../../../../oob/domain/OutOfBandDidCommService' import { DidDocument } from '../../../domain' -import { didDocumentToNumAlgo4Did, didToNumAlgo4DidDocument, outOfBandServiceToNumAlgo4Did } from '../peerDidNumAlgo4' +import { didDocumentToNumAlgo4Did, didToNumAlgo4DidDocument } from '../peerDidNumAlgo4' import didPeer4zQmUJdJ from './__fixtures__/didPeer4zQmUJdJ.json' import didPeer4zQmd8Cp from './__fixtures__/didPeer4zQmd8Cp.json' diff --git a/packages/core/src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts b/packages/core/src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts index 504555b50d..0499d841db 100644 --- a/packages/core/src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts +++ b/packages/core/src/modules/dids/methods/peer/createPeerDidDocumentFromServices.ts @@ -1,4 +1,4 @@ -import type { ResolvedDidCommService } from '../../../didcomm' +import type { ResolvedDidCommService } from '../../../../types' import { convertPublicKeyToX25519 } from '@stablelib/ed25519' diff --git a/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo2.ts b/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo2.ts index a12801af84..064975f110 100644 --- a/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo2.ts +++ b/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo2.ts @@ -1,18 +1,13 @@ import type { JsonObject } from '../../../../types' -import type { OutOfBandDidCommService } from '../../../oob/domain/OutOfBandDidCommService' import type { DidDocument, VerificationMethod } from '../../domain' import { Key } from '../../../../crypto/Key' import { CredoError } from '../../../../error' import { JsonEncoder, JsonTransformer } from '../../../../utils' -import { DidCommV1Service, DidDocumentService } from '../../domain' +import { DidDocumentService } from '../../domain' import { DidDocumentBuilder } from '../../domain/DidDocumentBuilder' import { getKeyFromVerificationMethod, getKeyDidMappingByKeyType } from '../../domain/key-type' import { parseDid } from '../../domain/parse' -import { didKeyToInstanceOfKey } from '../../helpers' -import { DidKey } from '../key' - -import { createPeerDidDocumentFromServices } from './createPeerDidDocumentFromServices' enum DidPeerPurpose { Assertion = 'A', @@ -165,49 +160,6 @@ export function didDocumentToNumAlgo2Did(didDocument: DidDocument) { return did } -export function outOfBandServiceToNumAlgo2Did(service: OutOfBandDidCommService) { - const didDocument = createPeerDidDocumentFromServices([ - { - id: service.id, - recipientKeys: service.recipientKeys.map(didKeyToInstanceOfKey), - serviceEndpoint: service.serviceEndpoint, - routingKeys: service.routingKeys?.map(didKeyToInstanceOfKey) ?? [], - }, - ]) - - const did = didDocumentToNumAlgo2Did(didDocument) - - return did -} - -// This method is kept to support searching for existing connections created by -// credo-ts <= 0.5.1 -// TODO: Remove in 0.6.0 (when ConnectionRecord.invitationDid will be migrated) -export function outOfBandServiceToInlineKeysNumAlgo2Did(service: OutOfBandDidCommService) { - const didDocument = new DidDocumentBuilder('') - .addService( - new DidCommV1Service({ - id: service.id, - serviceEndpoint: service.serviceEndpoint, - accept: service.accept, - recipientKeys: service.recipientKeys.map((recipientKey) => { - const did = DidKey.fromDid(recipientKey) - return `${did.did}#${did.key.fingerprint}` - }), - // Map did:key:xxx to actual did:key:xxx#123 - routingKeys: service.routingKeys?.map((routingKey) => { - const did = DidKey.fromDid(routingKey) - return `${did.did}#${did.key.fingerprint}` - }), - }) - ) - .build() - - const did = didDocumentToNumAlgo2Did(didDocument) - - return did -} - function expandServiceAbbreviations(service: JsonObject) { const expand = (abbreviated: string) => didPeerExpansions[abbreviated] ?? abbreviated const expandJson = (json: unknown): unknown => { diff --git a/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo4.ts b/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo4.ts index 17ad9950c9..8fbbf5e1b4 100644 --- a/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo4.ts +++ b/packages/core/src/modules/dids/methods/peer/peerDidNumAlgo4.ts @@ -1,5 +1,3 @@ -import type { OutOfBandDidCommService } from '../../../oob/domain/OutOfBandDidCommService' - import { CredoError } from '../../../../error' import { JsonEncoder, @@ -10,10 +8,8 @@ import { VarintEncoder, } from '../../../../utils' import { Buffer } from '../../../../utils/buffer' -import { DidDocument, DidCommV1Service } from '../../domain' -import { DidDocumentBuilder } from '../../domain/DidDocumentBuilder' +import { DidDocument } from '../../domain' import { parseDid } from '../../domain/parse' -import { DidKey } from '../key' const LONG_RE = new RegExp(`^did:peer:4(z[1-9a-km-zA-HJ-NP-Z]{46}):(z[1-9a-km-zA-HJ-NP-Z]{6,})$`) const SHORT_RE = new RegExp(`^did:peer:4(z[1-9a-km-zA-HJ-NP-Z]{46})$`) @@ -111,28 +107,3 @@ export function didDocumentToNumAlgo4Did(didDocument: DidDocument) { return { shortFormDid, longFormDid } } - -export function outOfBandServiceToNumAlgo4Did(service: OutOfBandDidCommService) { - // FIXME: add the key entries for the recipientKeys to the did document. - const didDocument = new DidDocumentBuilder('') - .addService( - new DidCommV1Service({ - id: service.id, - serviceEndpoint: service.serviceEndpoint, - accept: service.accept, - // FIXME: this should actually be local key references, not did:key:123#456 references - recipientKeys: service.recipientKeys.map((recipientKey) => { - const did = DidKey.fromDid(recipientKey) - return `${did.did}#${did.key.fingerprint}` - }), - // Map did:key:xxx to actual did:key:xxx#123 - routingKeys: service.routingKeys?.map((routingKey) => { - const did = DidKey.fromDid(routingKey) - return `${did.did}#${did.key.fingerprint}` - }), - }) - ) - .build() - - return didDocumentToNumAlgo4Did(didDocument) -} diff --git a/packages/core/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts b/packages/core/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts deleted file mode 100644 index d7aa96511e..0000000000 --- a/packages/core/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { Protocol } from '../../../agent/models' -import { DependencyManager } from '../../../plugins/DependencyManager' -import { DiscoverFeaturesModule } from '../DiscoverFeaturesModule' -import { V1DiscoverFeaturesService } from '../protocol/v1' -import { V2DiscoverFeaturesService } from '../protocol/v2' - -jest.mock('../../../plugins/DependencyManager') -const DependencyManagerMock = DependencyManager as jest.Mock - -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const dependencyManager = new DependencyManagerMock() -const featureRegistry = new FeatureRegistryMock() - -describe('DiscoverFeaturesModule', () => { - test('registers dependencies on the dependency manager', () => { - new DiscoverFeaturesModule().register(dependencyManager, featureRegistry) - - expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(V1DiscoverFeaturesService) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(V2DiscoverFeaturesService) - - expect(featureRegistry.register).toHaveBeenCalledWith( - new Protocol({ - id: 'https://didcomm.org/discover-features/1.0', - roles: ['requester', 'responder'], - }), - new Protocol({ - id: 'https://didcomm.org/discover-features/2.0', - roles: ['requester', 'responder'], - }) - ) - }) -}) diff --git a/packages/core/src/modules/mdoc/__tests__/mdocDeviceResponse.test.ts b/packages/core/src/modules/mdoc/__tests__/mdocDeviceResponse.test.ts index b1610bf528..404b819d4c 100644 --- a/packages/core/src/modules/mdoc/__tests__/mdocDeviceResponse.test.ts +++ b/packages/core/src/modules/mdoc/__tests__/mdocDeviceResponse.test.ts @@ -1,7 +1,9 @@ import { Optionality } from '@sphereon/pex-models' -import { Agent, KeyType, X509Service } from '../../..' import { getInMemoryAgentOptions } from '../../../../tests' +import { Agent } from '../../../agent/Agent' +import { KeyType } from '../../../crypto' +import { X509Service } from '../../x509' import { Mdoc } from '../Mdoc' import { MdocDeviceResponse } from '../MdocDeviceResponse' diff --git a/packages/core/src/modules/mdoc/__tests__/mdocOpenId4VcDeviceResponse.test.ts b/packages/core/src/modules/mdoc/__tests__/mdocOpenId4VcDeviceResponse.test.ts index 53e4759b8d..9788f9f8ad 100644 --- a/packages/core/src/modules/mdoc/__tests__/mdocOpenId4VcDeviceResponse.test.ts +++ b/packages/core/src/modules/mdoc/__tests__/mdocOpenId4VcDeviceResponse.test.ts @@ -2,8 +2,9 @@ import { cborEncode, parseDeviceResponse } from '@animo-id/mdoc' // eslint-disable-next-line import/no-extraneous-dependencies import { Key as AskarKey, Jwk } from '@hyperledger/aries-askar-nodejs' -import { Agent, KeyType } from '../../..' import { getInMemoryAgentOptions } from '../../../../tests' +import { Agent } from '../../../agent/Agent' +import { KeyType } from '../../../crypto' import { getJwkFromJson } from '../../../crypto/jose/jwk/transform' import { Buffer, TypedArrayEncoder } from '../../../utils' import { Mdoc } from '../Mdoc' diff --git a/packages/core/src/modules/mdoc/__tests__/mdocServer.test.ts b/packages/core/src/modules/mdoc/__tests__/mdocServer.test.ts index 4caf90bea5..c57bba7755 100644 --- a/packages/core/src/modules/mdoc/__tests__/mdocServer.test.ts +++ b/packages/core/src/modules/mdoc/__tests__/mdocServer.test.ts @@ -1,8 +1,9 @@ -import type { AgentContext } from '../../..' +import type { AgentContext } from '../../../agent' -import { KeyType, X509ModuleConfig, X509Service } from '../../..' import { InMemoryWallet } from '../../../../../../tests/InMemoryWallet' import { getAgentConfig, getAgentContext } from '../../../../tests' +import { KeyType } from '../../../crypto' +import { X509ModuleConfig, X509Service } from '../../x509' import { Mdoc } from '../Mdoc' import { sprindFunkeTestVectorBase64Url, sprindFunkeX509TrustedCertificate } from './mdoc.fixtures' diff --git a/packages/core/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts b/packages/core/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts deleted file mode 100644 index 6bb3c4f992..0000000000 --- a/packages/core/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { Protocol } from '../../../agent/models' -import { InjectionSymbols } from '../../../constants' -import { DependencyManager } from '../../../plugins/DependencyManager' -import { MessagePickupModule } from '../MessagePickupModule' -import { MessagePickupModuleConfig } from '../MessagePickupModuleConfig' -import { MessagePickupSessionService } from '../services' -import { InMemoryMessagePickupRepository } from '../storage' - -jest.mock('../../../plugins/DependencyManager') -const DependencyManagerMock = DependencyManager as jest.Mock - -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const dependencyManager = new DependencyManagerMock() -const featureRegistry = new FeatureRegistryMock() - -describe('MessagePickupModule', () => { - test('registers dependencies on the dependency manager', () => { - const module = new MessagePickupModule() - module.register(dependencyManager, featureRegistry) - - expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1) - expect(dependencyManager.registerInstance).toHaveBeenCalledWith(MessagePickupModuleConfig, module.config) - - expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith( - InjectionSymbols.MessagePickupRepository, - InMemoryMessagePickupRepository - ) - expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(MessagePickupSessionService) - expect(featureRegistry.register).toHaveBeenCalledTimes(2) - expect(featureRegistry.register).toHaveBeenCalledWith( - new Protocol({ - id: 'https://didcomm.org/messagepickup/1.0', - roles: ['message_holder', 'recipient', 'batch_sender', 'batch_recipient'], - }) - ) - expect(featureRegistry.register).toHaveBeenCalledWith( - new Protocol({ - id: 'https://didcomm.org/messagepickup/2.0', - roles: ['mediator', 'recipient'], - }) - ) - }) -}) diff --git a/packages/core/src/modules/problem-reports/index.ts b/packages/core/src/modules/problem-reports/index.ts deleted file mode 100644 index 479c831166..0000000000 --- a/packages/core/src/modules/problem-reports/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './errors' -export * from './messages' -export * from './models' diff --git a/packages/core/src/modules/sd-jwt-vc/__tests__/SdJwtVcService.test.ts b/packages/core/src/modules/sd-jwt-vc/__tests__/SdJwtVcService.test.ts index 345091c609..2d1c9a3c77 100644 --- a/packages/core/src/modules/sd-jwt-vc/__tests__/SdJwtVcService.test.ts +++ b/packages/core/src/modules/sd-jwt-vc/__tests__/SdJwtVcService.test.ts @@ -54,6 +54,7 @@ const agent = new Agent( getInMemoryAgentOptions( 'sdjwtvcserviceagent', {}, + {}, { dids: new DidsModule({ resolvers: [new KeyDidResolver()], diff --git a/packages/core/src/modules/vc/__tests__/W3cCredentialsApi.test.ts b/packages/core/src/modules/vc/__tests__/W3cCredentialsApi.test.ts index c39f408452..54cdc70425 100644 --- a/packages/core/src/modules/vc/__tests__/W3cCredentialsApi.test.ts +++ b/packages/core/src/modules/vc/__tests__/W3cCredentialsApi.test.ts @@ -11,6 +11,7 @@ import { W3cCredentialRepository } from '../repository' const agentOptions = getInMemoryAgentOptions( 'W3cCredentialsApi', {}, + {}, { w3cCredentials: new W3cCredentialsModule({ documentLoader: customDocumentLoader, diff --git a/packages/core/src/modules/vc/data-integrity/index.ts b/packages/core/src/modules/vc/data-integrity/index.ts index d2cfc71995..7314cb363b 100644 --- a/packages/core/src/modules/vc/data-integrity/index.ts +++ b/packages/core/src/modules/vc/data-integrity/index.ts @@ -5,3 +5,4 @@ export * from './libraries' export * from './models' export * from './proof-purposes' export * from './deriveProof' +export { W3cJsonLdCredentialService } from './W3cJsonLdCredentialService' diff --git a/packages/core/src/modules/vc/models/presentation/index.ts b/packages/core/src/modules/vc/models/presentation/index.ts index c9c056c1c4..44b6e8b4a8 100644 --- a/packages/core/src/modules/vc/models/presentation/index.ts +++ b/packages/core/src/modules/vc/models/presentation/index.ts @@ -1,2 +1,3 @@ export * from './W3cPresentation' +export * from './W3cJsonPresentation' export * from './W3cVerifiablePresentation' diff --git a/packages/core/src/modules/x509/__tests__/X509ServiceModule.test.ts b/packages/core/src/modules/x509/__tests__/X509ServiceModule.test.ts index f54e224d94..2aafcca56f 100644 --- a/packages/core/src/modules/x509/__tests__/X509ServiceModule.test.ts +++ b/packages/core/src/modules/x509/__tests__/X509ServiceModule.test.ts @@ -1,4 +1,4 @@ -import type { DependencyManager } from '../../..' +import type { DependencyManager } from '../../../plugins' import { X509ModuleConfig, X509Module, type X509ModuleConfigOptions, X509Service } from './../index' diff --git a/packages/core/src/plugins/DependencyManager.ts b/packages/core/src/plugins/DependencyManager.ts index 3487ec443e..ebeecc3764 100644 --- a/packages/core/src/plugins/DependencyManager.ts +++ b/packages/core/src/plugins/DependencyManager.ts @@ -1,13 +1,9 @@ import type { ModulesMap } from '../agent/AgentModules' -import type { MessageHandler } from '../agent/MessageHandler' -import type { MessageHandlerMiddleware } from '../agent/MessageHandlerMiddleware' import type { Constructor } from '../utils/mixins' import type { DependencyContainer } from 'tsyringe' import { container as rootContainer, InjectionToken, Lifecycle } from 'tsyringe' -import { FeatureRegistry } from '../agent/FeatureRegistry' -import { MessageHandlerRegistry } from '../agent/MessageHandlerRegistry' import { CredoError } from '../error' export { InjectionToken } @@ -25,8 +21,6 @@ export class DependencyManager { } public registerModules(modules: ModulesMap) { - const featureRegistry = this.resolve(FeatureRegistry) - for (const [moduleKey, module] of Object.entries(modules)) { if (this.registeredModules[moduleKey]) { throw new CredoError( @@ -38,46 +32,14 @@ export class DependencyManager { if (module.api) { this.registerContextScoped(module.api) } - module.register(this, featureRegistry) - } - } - - public registerMessageHandlers(messageHandlers: MessageHandler[]) { - const messageHandlerRegistry = this.resolve(MessageHandlerRegistry) - - for (const messageHandler of messageHandlers) { - messageHandlerRegistry.registerMessageHandler(messageHandler) + try { + module.register(this) + } catch (error) { + throw new CredoError(`Cannot register ${moduleKey}: ${error}`) + } } } - public registerMessageHandlerMiddleware(messageHandlerMiddleware: MessageHandlerMiddleware) { - const messageHandlerRegistry = this.resolve(MessageHandlerRegistry) - - messageHandlerRegistry.registerMessageHandlerMiddleware(messageHandlerMiddleware) - } - - public get fallbackMessageHandler() { - const messageHandlerRegistry = this.resolve(MessageHandlerRegistry) - - return messageHandlerRegistry.fallbackMessageHandler - } - - public get messageHandlerMiddlewares() { - const messageHandlerRegistry = this.resolve(MessageHandlerRegistry) - - return messageHandlerRegistry.messageHandlerMiddlewares - } - - /** - * Sets the fallback message handler, the message handler that will be called if no handler - * is registered for an incoming message type. - */ - public setFallbackMessageHandler(fallbackMessageHandler: MessageHandler['handle']) { - const messageHandlerRegistry = this.resolve(MessageHandlerRegistry) - - messageHandlerRegistry.setFallbackMessageHandler(fallbackMessageHandler) - } - public registerSingleton(from: InjectionToken, to: InjectionToken): void public registerSingleton(token: Constructor): void // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/core/src/plugins/Module.ts b/packages/core/src/plugins/Module.ts index 183a47c7f8..2ce03332ff 100644 --- a/packages/core/src/plugins/Module.ts +++ b/packages/core/src/plugins/Module.ts @@ -1,13 +1,13 @@ import type { DependencyManager } from './DependencyManager' import type { AgentContext } from '../agent' -import type { FeatureRegistry } from '../agent/FeatureRegistry' import type { Update } from '../storage/migration/updates' import type { Constructor } from '../utils/mixins' export interface Module { api?: Constructor - register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void + register(dependencyManager: DependencyManager): void initialize?(agentContext: AgentContext): Promise + shutdown?(agentContext: AgentContext): Promise /** * List of updates that should be executed when the framework version is updated. diff --git a/packages/core/src/plugins/__tests__/DependencyManager.test.ts b/packages/core/src/plugins/__tests__/DependencyManager.test.ts index 780bbaba67..446fce2b1a 100644 --- a/packages/core/src/plugins/__tests__/DependencyManager.test.ts +++ b/packages/core/src/plugins/__tests__/DependencyManager.test.ts @@ -3,7 +3,6 @@ import type { DependencyContainer } from 'tsyringe' import { container as rootContainer, injectable, Lifecycle } from 'tsyringe' -import { FeatureRegistry } from '../../agent/FeatureRegistry' import { DependencyManager } from '../DependencyManager' class Instance { @@ -40,14 +39,12 @@ describe('DependencyManager', () => { const module1 = new Module1() const module2 = new Module2() - const featureRegistry = container.resolve(FeatureRegistry) - dependencyManager.registerModules({ module1, module2 }) expect(module1.register).toHaveBeenCalledTimes(1) - expect(module1.register).toHaveBeenLastCalledWith(dependencyManager, featureRegistry) + expect(module1.register).toHaveBeenLastCalledWith(dependencyManager) expect(module2.register).toHaveBeenCalledTimes(1) - expect(module2.register).toHaveBeenLastCalledWith(dependencyManager, featureRegistry) + expect(module2.register).toHaveBeenLastCalledWith(dependencyManager) expect(dependencyManager.registeredModules).toMatchObject({ module1, diff --git a/packages/core/src/storage/index.ts b/packages/core/src/storage/index.ts index deb5cb0901..472e3addc8 100644 --- a/packages/core/src/storage/index.ts +++ b/packages/core/src/storage/index.ts @@ -1,2 +1 @@ -export * from './didcomm' export * from './migration' diff --git a/packages/core/src/storage/migration/UpdateAssistant.ts b/packages/core/src/storage/migration/UpdateAssistant.ts index b1df93c427..d0bbea9dc8 100644 --- a/packages/core/src/storage/migration/UpdateAssistant.ts +++ b/packages/core/src/storage/migration/UpdateAssistant.ts @@ -178,7 +178,7 @@ export class UpdateAssistant = BaseAgent> { this.agent.config.logger.info( `Starting update of agent storage from version ${update.fromVersion} to version ${update.toVersion}. Found ${modulesWithUpdate.length} extension module(s) with update scripts` ) - await update.doUpdate(this.agent, this.updateConfig) + await update.doUpdate(this.agent) this.agent.config.logger.info( `Finished update of core agent storage from version ${update.fromVersion} to version ${update.toVersion}. Starting update of extension modules` diff --git a/packages/core/src/storage/migration/__tests__/0.1.test.ts b/packages/core/src/storage/migration/__tests__/0.1.test.ts index d7b7481263..d9caf14a03 100644 --- a/packages/core/src/storage/migration/__tests__/0.1.test.ts +++ b/packages/core/src/storage/migration/__tests__/0.1.test.ts @@ -1,15 +1,15 @@ -import type { V0_1ToV0_2UpdateConfig } from '../updates/0.1-0.2' +import type { V0_1ToV0_2UpdateConfig } from '../../../../src' import { readFileSync } from 'fs' import path from 'path' import { InMemoryStorageService } from '../../../../../../tests/InMemoryStorageService' import { RegisteredAskarTestWallet } from '../../../../../askar/tests/helpers' -import { Agent } from '../../../../src' +import { getDefaultDidcommModules } from '../../../../../didcomm/src/util/modules' +import { Agent, utils } from '../../../../src' import { agentDependencies as dependencies } from '../../../../tests/helpers' import { InjectionSymbols } from '../../../constants' import { DependencyManager } from '../../../plugins' -import * as uuid from '../../../utils/uuid' import { UpdateAssistant } from '../UpdateAssistant' const backupDate = new Date('2022-01-21T22:50:20.522Z') @@ -45,6 +45,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { { config: { label: 'Test Agent', walletConfig }, dependencies, + modules: getDefaultDidcommModules(), }, dependencyManager ) @@ -91,7 +92,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { it(`should correctly update credential records and create didcomm records`, async () => { // We need to mock the uuid generation to make sure we generate consistent uuids for the new records created. let uuidCounter = 1 - const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) + const uuidSpy = jest.spyOn(utils, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) const aliceCredentialRecordsString = readFileSync( path.join(__dirname, '__fixtures__/alice-4-credentials-0.1.json'), @@ -108,6 +109,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { { config: { label: 'Test Agent', walletConfig }, dependencies, + modules: getDefaultDidcommModules(), }, dependencyManager ) @@ -154,7 +156,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { it(`should correctly update the credential records and create didcomm records with auto update`, async () => { // We need to mock the uuid generation to make sure we generate consistent uuids for the new records created. let uuidCounter = 1 - const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) + const uuidSpy = jest.spyOn(utils, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) const aliceCredentialRecordsString = readFileSync( path.join(__dirname, '__fixtures__/alice-4-credentials-0.1.json'), @@ -171,6 +173,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { { config: { label: 'Test Agent', walletConfig, autoUpdateStorageOnStartup: true }, dependencies, + modules: getDefaultDidcommModules(), }, dependencyManager ) @@ -217,7 +220,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { it(`should correctly update the connection record and create the did and oob records`, async () => { // We need to mock the uuid generation to make sure we generate consistent uuids for the new records created. let uuidCounter = 1 - const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) + const uuidSpy = jest.spyOn(utils, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) const aliceConnectionRecordsString = readFileSync( path.join(__dirname, '__fixtures__/alice-8-connections-0.1.json'), @@ -237,6 +240,7 @@ describe('UpdateAssistant | v0.1 - v0.2', () => { walletConfig, autoUpdateStorageOnStartup: true, }, + modules: getDefaultDidcommModules(), dependencies, }, dependencyManager diff --git a/packages/core/src/storage/migration/__tests__/0.2.test.ts b/packages/core/src/storage/migration/__tests__/0.2.test.ts index bbb00eb2a8..09890e5dce 100644 --- a/packages/core/src/storage/migration/__tests__/0.2.test.ts +++ b/packages/core/src/storage/migration/__tests__/0.2.test.ts @@ -3,7 +3,9 @@ import path from 'path' import { InMemoryStorageService } from '../../../../../../tests/InMemoryStorageService' import { RegisteredAskarTestWallet } from '../../../../../askar/tests/helpers' -import { Agent, MediatorRoutingRecord } from '../../../../src' +import { MediatorRoutingRecord } from '../../../../../didcomm/src/modules' +import { getDefaultDidcommModules } from '../../../../../didcomm/src/util/modules' +import { Agent } from '../../../../src' import { agentDependencies } from '../../../../tests/helpers' import { InjectionSymbols } from '../../../constants' import { DependencyManager } from '../../../plugins' @@ -42,6 +44,7 @@ describe('UpdateAssistant | v0.2 - v0.3.1', () => { walletConfig, }, dependencies: agentDependencies, + modules: getDefaultDidcommModules(), }, dependencyManager ) @@ -112,6 +115,7 @@ describe('UpdateAssistant | v0.2 - v0.3.1', () => { walletConfig, autoUpdateStorageOnStartup: true, }, + modules: getDefaultDidcommModules(), dependencies: agentDependencies, }, dependencyManager @@ -163,6 +167,7 @@ describe('UpdateAssistant | v0.2 - v0.3.1', () => { autoUpdateStorageOnStartup: true, }, dependencies: agentDependencies, + modules: getDefaultDidcommModules(), }, dependencyManager ) diff --git a/packages/core/src/storage/migration/__tests__/0.4.test.ts b/packages/core/src/storage/migration/__tests__/0.4.test.ts index 943e3f2c87..a5b2e430c4 100644 --- a/packages/core/src/storage/migration/__tests__/0.4.test.ts +++ b/packages/core/src/storage/migration/__tests__/0.4.test.ts @@ -3,6 +3,7 @@ import path from 'path' import { InMemoryStorageService } from '../../../../../../tests/InMemoryStorageService' import { RegisteredAskarTestWallet } from '../../../../../askar/tests/helpers' +import { getDefaultDidcommModules } from '../../../../../didcomm/src/util/modules' import { agentDependencies } from '../../../../tests/helpers' import { Agent } from '../../../agent/Agent' import { InjectionSymbols } from '../../../constants' @@ -94,8 +95,8 @@ describe('UpdateAssistant | v0.4 - v0.5', () => { it(`should correctly add role to credential exchange records`, async () => { // We need to mock the uuid generation to make sure we generate consistent uuids for the new records created. - // let uuidCounter = 1 - // const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) + let uuidCounter = 1 + const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) const aliceW3cCredentialRecordsString = readFileSync( path.join(__dirname, '__fixtures__/2-credentials-0.4.json'), @@ -108,12 +109,14 @@ describe('UpdateAssistant | v0.4 - v0.5', () => { // If we register the AskarModule it will register the storage service, but we use in memory storage here dependencyManager.registerContextScoped(InjectionSymbols.Wallet, RegisteredAskarTestWallet) + // We need core DIDComm modules for this update to fully work const agent = new Agent( { config: { label: 'Test Agent', walletConfig, }, + modules: getDefaultDidcommModules(), dependencies: agentDependencies, }, dependencyManager @@ -155,13 +158,13 @@ describe('UpdateAssistant | v0.4 - v0.5', () => { await agent.shutdown() await agent.wallet.delete() - // uuidSpy.mockReset() + uuidSpy.mockReset() }) it(`should correctly add role to proof exchange records`, async () => { // We need to mock the uuid generation to make sure we generate consistent uuids for the new records created. - // let uuidCounter = 1 - // const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) + let uuidCounter = 1 + const uuidSpy = jest.spyOn(uuid, 'uuid').mockImplementation(() => `${uuidCounter++}-4e4f-41d9-94c4-f49351b811f1`) const aliceW3cCredentialRecordsString = readFileSync(path.join(__dirname, '__fixtures__/2-proofs-0.4.json'), 'utf8') @@ -171,12 +174,14 @@ describe('UpdateAssistant | v0.4 - v0.5', () => { // If we register the AskarModule it will register the storage service, but we use in memory storage here dependencyManager.registerContextScoped(InjectionSymbols.Wallet, RegisteredAskarTestWallet) + // We need core DIDComm modules for this update to fully work const agent = new Agent( { config: { label: 'Test Agent', walletConfig, }, + modules: getDefaultDidcommModules(), dependencies: agentDependencies, }, dependencyManager @@ -218,6 +223,6 @@ describe('UpdateAssistant | v0.4 - v0.5', () => { await agent.shutdown() await agent.wallet.delete() - // uuidSpy.mockReset() + uuidSpy.mockReset() }) }) diff --git a/packages/core/src/storage/migration/__tests__/__snapshots__/0.1.test.ts.snap b/packages/core/src/storage/migration/__tests__/__snapshots__/0.1.test.ts.snap index d39faf48e5..3409f4eb9b 100644 --- a/packages/core/src/storage/migration/__tests__/__snapshots__/0.1.test.ts.snap +++ b/packages/core/src/storage/migration/__tests__/__snapshots__/0.1.test.ts.snap @@ -3676,4 +3676,4 @@ exports[`UpdateAssistant | v0.1 - v0.2 should correctly update the role in the m }, }, } -`; +`; \ No newline at end of file diff --git a/packages/core/src/storage/migration/__tests__/backup-askar.test.ts b/packages/core/src/storage/migration/__tests__/backup-askar.test.ts index a8fdc3a618..a83129af3e 100644 --- a/packages/core/src/storage/migration/__tests__/backup-askar.test.ts +++ b/packages/core/src/storage/migration/__tests__/backup-askar.test.ts @@ -5,17 +5,18 @@ import { readFileSync, unlinkSync } from 'fs' import path from 'path' import { askarModule } from '../../../../../askar/tests/helpers' +import { CredentialExchangeRecord, CredentialRepository } from '../../../../../didcomm/src/modules/credentials' import { getAgentOptions, getAskarWalletConfig } from '../../../../tests/helpers' import { Agent } from '../../../agent/Agent' import { InjectionSymbols } from '../../../constants' import { CredoError } from '../../../error' -import { CredentialExchangeRecord, CredentialRepository } from '../../../modules/credentials' import { JsonTransformer } from '../../../utils' import { StorageUpdateService } from '../StorageUpdateService' import { UpdateAssistant } from '../UpdateAssistant' const agentOptions = getAgentOptions( 'UpdateAssistant | Backup | Aries Askar', + {}, { walletConfig: getAskarWalletConfig('UpdateAssistant | Backup | Aries Askar', { inMemory: false }), }, diff --git a/packages/core/src/storage/migration/__tests__/backup.test.ts b/packages/core/src/storage/migration/__tests__/backup.test.ts index 5e3b09e78d..094a8739f1 100644 --- a/packages/core/src/storage/migration/__tests__/backup.test.ts +++ b/packages/core/src/storage/migration/__tests__/backup.test.ts @@ -5,17 +5,18 @@ import { readFileSync, unlinkSync } from 'fs' import path from 'path' import { askarModule } from '../../../../../askar/tests/helpers' +import { CredentialExchangeRecord, CredentialRepository } from '../../../../../didcomm/src/modules/credentials' import { getAgentOptions, getAskarWalletConfig } from '../../../../tests/helpers' import { Agent } from '../../../agent/Agent' import { InjectionSymbols } from '../../../constants' import { CredoError } from '../../../error' -import { CredentialExchangeRecord, CredentialRepository } from '../../../modules/credentials' import { JsonTransformer } from '../../../utils' import { StorageUpdateService } from '../StorageUpdateService' import { UpdateAssistant } from '../UpdateAssistant' const agentOptions = getAgentOptions( 'UpdateAssistant | Backup', + {}, { walletConfig: getAskarWalletConfig('UpdateAssistant | Backup', { inMemory: false, diff --git a/packages/core/src/storage/migration/__tests__/updates.ts b/packages/core/src/storage/migration/__tests__/updates.ts index 520f4518ab..4d9c6690ba 100644 --- a/packages/core/src/storage/migration/__tests__/updates.ts +++ b/packages/core/src/storage/migration/__tests__/updates.ts @@ -1,16 +1,8 @@ import { supportedUpdates } from '../updates' -import { updateV0_1ToV0_2 } from '../updates/0.1-0.2' describe('supportedUpdates', () => { // This test is intentional to be bumped explicitly when a new upgrade is added it('supports 1 update(s)', () => { - expect(supportedUpdates.length).toBe(1) - }) - - it('supports an update from 0.1 to 0.2', () => { - const upgrade = supportedUpdates[0] - expect(upgrade.fromVersion).toBe('0.1') - expect(upgrade.toVersion).toBe('0.2') - expect(upgrade.doUpdate).toBe(updateV0_1ToV0_2) + expect(supportedUpdates.length).toBe(0) }) }) diff --git a/packages/core/src/storage/migration/updates.ts b/packages/core/src/storage/migration/updates.ts index ad06ad3178..84fa9a2267 100644 --- a/packages/core/src/storage/migration/updates.ts +++ b/packages/core/src/storage/migration/updates.ts @@ -1,23 +1,24 @@ -import type { V0_1ToV0_2UpdateConfig } from './updates/0.1-0.2' import type { BaseAgent } from '../../agent/BaseAgent' import type { VersionString } from '../../utils/version' -import { updateV0_1ToV0_2 } from './updates/0.1-0.2' -import { updateV0_2ToV0_3 } from './updates/0.2-0.3' import { updateV0_3ToV0_3_1 } from './updates/0.3-0.3.1' import { updateV0_3_1ToV0_4 } from './updates/0.3.1-0.4' import { updateV0_4ToV0_5 } from './updates/0.4-0.5' export const INITIAL_STORAGE_VERSION = '0.1' +export interface UpdateConfig { + v0_1ToV0_2: V0_1ToV0_2UpdateConfig +} + export interface Update { fromVersion: VersionString toVersion: VersionString doUpdate: (agent: Agent, updateConfig: UpdateConfig) => Promise } -export interface UpdateConfig { - v0_1ToV0_2: V0_1ToV0_2UpdateConfig +export interface V0_1ToV0_2UpdateConfig { + mediationRoleUpdateStrategy: 'allMediator' | 'allRecipient' | 'recipientIfEndpoint' | 'doNotChange' } export const DEFAULT_UPDATE_CONFIG: UpdateConfig = { @@ -30,12 +31,12 @@ export const supportedUpdates = [ { fromVersion: '0.1', toVersion: '0.2', - doUpdate: updateV0_1ToV0_2, + doUpdate: () => {}, // Nothing to do in Core module }, { fromVersion: '0.2', toVersion: '0.3', - doUpdate: updateV0_2ToV0_3, + doUpdate: () => {}, // Nothing to do in Core module }, { fromVersion: '0.3', diff --git a/packages/core/src/storage/migration/updates/0.4-0.5/index.ts b/packages/core/src/storage/migration/updates/0.4-0.5/index.ts index 7a612c2815..8b1a9428b9 100644 --- a/packages/core/src/storage/migration/updates/0.4-0.5/index.ts +++ b/packages/core/src/storage/migration/updates/0.4-0.5/index.ts @@ -1,11 +1,7 @@ import type { BaseAgent } from '../../../../agent/BaseAgent' -import { migrateCredentialExchangeRecordToV0_5 } from './credentialExchangeRecord' -import { migrateProofExchangeRecordToV0_5 } from './proofExchangeRecord' import { migrateW3cCredentialRecordToV0_5 } from './w3cCredentialRecord' export async function updateV0_4ToV0_5(agent: Agent): Promise { await migrateW3cCredentialRecordToV0_5(agent) - await migrateCredentialExchangeRecordToV0_5(agent) - await migrateProofExchangeRecordToV0_5(agent) } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 3620ceafe1..9152f3f35e 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -1,3 +1,4 @@ +import type { Key } from './crypto' import type { Logger } from './logger' export enum KeyDerivationMethod { @@ -34,56 +35,15 @@ export interface WalletExportImportConfig { path: string } -export type EncryptedMessage = { - /** - * The "protected" member MUST be present and contain the value - * BASE64URL(UTF8(JWE Protected Header)) when the JWE Protected - * Header value is non-empty; otherwise, it MUST be absent. These - * Header Parameter values are integrity protected. - */ - protected: string - - /** - * The "iv" member MUST be present and contain the value - * BASE64URL(JWE Initialization Vector) when the JWE Initialization - * Vector value is non-empty; otherwise, it MUST be absent. - */ - iv: string - - /** - * The "ciphertext" member MUST be present and contain the value - * BASE64URL(JWE Ciphertext). - */ - ciphertext: string - - /** - * The "tag" member MUST be present and contain the value - * BASE64URL(JWE Authentication Tag) when the JWE Authentication Tag - * value is non-empty; otherwise, it MUST be absent. - */ - tag: string -} - -export enum DidCommMimeType { - V0 = 'application/ssi-agent-wire', - V1 = 'application/didcomm-envelope-enc', -} - export interface InitConfig { /** * Agent public endpoints, sorted by priority (higher priority first) */ - endpoints?: string[] label: string walletConfig?: WalletConfig logger?: Logger - didCommMimeType?: DidCommMimeType - useDidKeyInProtocols?: boolean - useDidSovPrefixWhereAllowed?: boolean - connectionImageUrl?: string autoUpdateStorageOnStartup?: boolean backupBeforeStorageUpdate?: boolean - processDidCommMessagesConcurrently?: boolean /** * Allow insecure http urls in places where this is usually required. @@ -99,24 +59,6 @@ export interface InitConfig { allowInsecureHttpUrls?: boolean } -export type ProtocolVersion = `${number}.${number}` -export interface PlaintextMessage { - '@type': string - '@id': string - '~thread'?: { - thid?: string - pthid?: string - } - [key: string]: unknown -} - -export interface OutboundPackage { - payload: EncryptedMessage - responseRequested?: boolean - endpoint?: string - connectionId?: string -} - export type JsonValue = string | number | boolean | null | JsonObject | JsonArray export type JsonArray = Array export interface JsonObject { @@ -144,3 +86,29 @@ export type Awaited = T extends Promise ? U : never * Type util that returns `true` or `false` based on whether the input type `T` is of type `any` */ export type IsAny = unknown extends T ? ([keyof T] extends [never] ? false : true) : false + +// FIXME: the following types are duplicated in DIDComm module. They were placed here to remove dependency +// to that module +export interface ResolvedDidCommService { + id: string + serviceEndpoint: string + recipientKeys: Key[] + routingKeys: Key[] +} + +export interface PlaintextMessage { + '@type': string + '@id': string + '~thread'?: { + thid?: string + pthid?: string + } + [key: string]: unknown +} + +export type EncryptedMessage = { + protected: string + iv: string + ciphertext: string + tag: string +} diff --git a/packages/core/src/utils/__tests__/JsonTransformer.test.ts b/packages/core/src/utils/__tests__/JsonTransformer.test.ts index 0d7158fb80..e79d01046e 100644 --- a/packages/core/src/utils/__tests__/JsonTransformer.test.ts +++ b/packages/core/src/utils/__tests__/JsonTransformer.test.ts @@ -1,4 +1,4 @@ -import { ConnectionInvitationMessage } from '../../modules/connections' +import { ConnectionInvitationMessage } from '../../../../didcomm/src' import { DidDocument, VerificationMethod } from '../../modules/dids' import { JsonTransformer } from '../JsonTransformer' diff --git a/packages/core/src/utils/__tests__/MessageValidator.test.ts b/packages/core/src/utils/__tests__/MessageValidator.test.ts index b0c15e2491..5a3dd5126f 100644 --- a/packages/core/src/utils/__tests__/MessageValidator.test.ts +++ b/packages/core/src/utils/__tests__/MessageValidator.test.ts @@ -1,5 +1,5 @@ +import { ConnectionInvitationMessage } from '../../../../didcomm/src/modules/connections' import { ClassValidationError } from '../../error/ClassValidationError' -import { ConnectionInvitationMessage } from '../../modules/connections' import { MessageValidator } from '../MessageValidator' describe('MessageValidator', () => { diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index 4cb2f5dc20..0ef10ab4f6 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -4,7 +4,7 @@ export * from './JsonTransformer' export * from './MultiBaseEncoder' export * from './buffer' export * from './MultiHashEncoder' -export * from './JWE' +export * from './HashlinkEncoder' export * from './VarintEncoder' export * from './validators' export * from './type' diff --git a/packages/core/src/utils/transformers.ts b/packages/core/src/utils/transformers.ts index a19310b617..d5c934b3b8 100644 --- a/packages/core/src/utils/transformers.ts +++ b/packages/core/src/utils/transformers.ts @@ -2,7 +2,6 @@ import type { ValidationOptions } from 'class-validator' import { Transform, TransformationType } from 'class-transformer' import { isString, ValidateBy, buildMessage } from 'class-validator' -import { DateTime } from 'luxon' import { Metadata } from '../storage/Metadata' @@ -45,23 +44,6 @@ export function DateTransformer() { }) } -/* - * Function that parses date from multiple formats - * including SQL formats. - */ - -export function DateParser(value: string): Date { - const parsedDate = new Date(value) - if (parsedDate instanceof Date && !isNaN(parsedDate.getTime())) { - return parsedDate - } - const luxonDate = DateTime.fromSQL(value) - if (luxonDate.isValid) { - return new Date(luxonDate.toString()) - } - return new Date() -} - /** * Checks if a given value is a Map */ diff --git a/packages/core/tests/TestMessage.ts b/packages/core/tests/TestMessage.ts index 040e4303f7..f78dad1feb 100644 --- a/packages/core/tests/TestMessage.ts +++ b/packages/core/tests/TestMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage } from '../src/agent/AgentMessage' +import { AgentMessage } from '../../didcomm/src' export class TestMessage extends AgentMessage { public constructor() { diff --git a/packages/core/tests/agents.test.ts b/packages/core/tests/agents.test.ts index 6a8a7b23b4..d642cc7cd2 100644 --- a/packages/core/tests/agents.test.ts +++ b/packages/core/tests/agents.test.ts @@ -1,8 +1,9 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { ConnectionRecord } from '../src/modules/connections' +import type { ConnectionRecord } from '../../didcomm/src' + +import { HandshakeProtocol } from '../../didcomm/src' import { Agent } from '../src/agent/Agent' -import { HandshakeProtocol } from '../src/modules/connections' import { waitForBasicMessage, getInMemoryAgentOptions } from './helpers' import { setupSubjectTransports } from './transport' @@ -36,17 +37,19 @@ describe('agents', () => { await aliceAgent.initialize() await bobAgent.initialize() - const aliceBobOutOfBandRecord = await aliceAgent.oob.createInvitation({ + const aliceBobOutOfBandRecord = await aliceAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], }) - const { connectionRecord: bobConnectionAtBobAlice } = await bobAgent.oob.receiveInvitation( + const { connectionRecord: bobConnectionAtBobAlice } = await bobAgent.modules.oob.receiveInvitation( aliceBobOutOfBandRecord.outOfBandInvitation ) - bobConnection = await bobAgent.connections.returnWhenIsConnected(bobConnectionAtBobAlice!.id) + bobConnection = await bobAgent.modules.connections.returnWhenIsConnected(bobConnectionAtBobAlice!.id) - const [aliceConnectionAtAliceBob] = await aliceAgent.connections.findAllByOutOfBandId(aliceBobOutOfBandRecord.id) - aliceConnection = await aliceAgent.connections.returnWhenIsConnected(aliceConnectionAtAliceBob!.id) + const [aliceConnectionAtAliceBob] = await aliceAgent.modules.connections.findAllByOutOfBandId( + aliceBobOutOfBandRecord.id + ) + aliceConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceConnectionAtAliceBob!.id) expect(aliceConnection).toBeConnectedWith(bobConnection) expect(bobConnection).toBeConnectedWith(aliceConnection) @@ -54,7 +57,7 @@ describe('agents', () => { test('send a message to connection', async () => { const message = 'hello, world' - await aliceAgent.basicMessages.sendMessage(aliceConnection.id, message) + await aliceAgent.modules.basicMessages.sendMessage(aliceConnection.id, message) const basicMessage = await waitForBasicMessage(bobAgent, { content: message, diff --git a/packages/core/tests/connections.test.ts b/packages/core/tests/connections.test.ts index d158acc272..d0662b875b 100644 --- a/packages/core/tests/connections.test.ts +++ b/packages/core/tests/connections.test.ts @@ -1,57 +1,57 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { AgentMessageProcessedEvent, KeylistUpdate } from '../src' +import type { AgentMessageProcessedEvent, KeylistUpdate } from '../../didcomm/src' import { filter, firstValueFrom, map, timeout } from 'rxjs' import { MediatorModule, - Key, AgentEventTypes, KeylistUpdateMessage, DidExchangeState, HandshakeProtocol, KeylistUpdateAction, -} from '../src' +} from '../../didcomm/src' +import { OutOfBandState } from '../../didcomm/src/modules/oob/domain/OutOfBandState' import { Agent } from '../src/agent/Agent' import { didKeyToVerkey } from '../src/modules/dids/helpers' -import { OutOfBandState } from '../src/modules/oob/domain/OutOfBandState' import { getInMemoryAgentOptions, waitForTrustPingResponseReceivedEvent } from './helpers' import { setupSubjectTransports } from './transport' -describe('connections', () => { - let faberAgent: Agent - let aliceAgent: Agent - let acmeAgent: Agent - let mediatorAgent: Agent - - beforeEach(async () => { - const faberAgentOptions = getInMemoryAgentOptions('Faber Agent Connections', { - endpoints: ['rxjs:faber'], - }) - const aliceAgentOptions = getInMemoryAgentOptions('Alice Agent Connections', { - endpoints: ['rxjs:alice'], - }) - const acmeAgentOptions = getInMemoryAgentOptions('Acme Agent Connections', { - endpoints: ['rxjs:acme'], - }) - const mediatorAgentOptions = getInMemoryAgentOptions( - 'Mediator Agent Connections', - { - endpoints: ['rxjs:mediator'], - }, - { - mediator: new MediatorModule({ - autoAcceptMediationRequests: true, - }), - } - ) +import { Key } from '@credo-ts/core' - faberAgent = new Agent(faberAgentOptions) - aliceAgent = new Agent(aliceAgentOptions) - acmeAgent = new Agent(acmeAgentOptions) - mediatorAgent = new Agent(mediatorAgentOptions) +const faberAgent = new Agent( + getInMemoryAgentOptions('Faber Agent Connections', { + endpoints: ['rxjs:faber'], + }) +) +const aliceAgent = new Agent( + getInMemoryAgentOptions('Alice Agent Connections', { + endpoints: ['rxjs:alice'], + }) +) +const acmeAgent = new Agent( + getInMemoryAgentOptions('Acme Agent Connections', { + endpoints: ['rxjs:acme'], + }) +) +const mediatorAgent = new Agent( + getInMemoryAgentOptions( + 'Mediator Agent Connections', + { + endpoints: ['rxjs:mediator'], + }, + {}, + { + mediator: new MediatorModule({ + autoAcceptMediationRequests: true, + }), + } + ) +) +describe('connections', () => { + beforeEach(async () => { setupSubjectTransports([faberAgent, aliceAgent, acmeAgent, mediatorAgent]) await faberAgent.initialize() @@ -72,7 +72,7 @@ describe('connections', () => { }) it('one agent should be able to send and receive a ping', async () => { - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], multiUseInvitation: true, }) @@ -81,17 +81,19 @@ describe('connections', () => { const invitationUrl = invitation.toUrl({ domain: 'https://example.com' }) // Receive invitation with alice agent - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl + ) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) - const ping = await aliceAgent.connections.sendPing(aliceFaberConnection.id, {}) + const ping = await aliceAgent.modules.connections.sendPing(aliceFaberConnection.id, {}) await waitForTrustPingResponseReceivedEvent(aliceAgent, { threadId: ping.threadId }) }) it('one should be able to make multiple connections using a multi use invite', async () => { - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], multiUseInvitation: true, }) @@ -100,22 +102,27 @@ describe('connections', () => { const invitationUrl = invitation.toUrl({ domain: 'https://example.com' }) // Receive invitation first time with alice agent - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl + ) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) // Receive invitation second time with acme agent - let { connectionRecord: acmeFaberConnection } = await acmeAgent.oob.receiveInvitationFromUrl(invitationUrl, { - reuseConnection: false, - }) - acmeFaberConnection = await acmeAgent.connections.returnWhenIsConnected(acmeFaberConnection!.id) + let { connectionRecord: acmeFaberConnection } = await acmeAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl, + { + reuseConnection: false, + } + ) + acmeFaberConnection = await acmeAgent.modules.connections.returnWhenIsConnected(acmeFaberConnection!.id) expect(acmeFaberConnection.state).toBe(DidExchangeState.Completed) - let faberAliceConnection = await faberAgent.connections.getByThreadId(aliceFaberConnection.threadId!) - let faberAcmeConnection = await faberAgent.connections.getByThreadId(acmeFaberConnection.threadId!) + let faberAliceConnection = await faberAgent.modules.connections.getByThreadId(aliceFaberConnection.threadId!) + let faberAcmeConnection = await faberAgent.modules.connections.getByThreadId(acmeFaberConnection.threadId!) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection.id) - faberAcmeConnection = await faberAgent.connections.returnWhenIsConnected(faberAcmeConnection.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection.id) + faberAcmeConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAcmeConnection.id) expect(faberAliceConnection).toBeConnectedWith(aliceFaberConnection) expect(faberAcmeConnection).toBeConnectedWith(acmeFaberConnection) @@ -126,7 +133,7 @@ describe('connections', () => { }) it('tag connections with multiple types and query them', async () => { - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], multiUseInvitation: true, }) @@ -135,38 +142,49 @@ describe('connections', () => { const invitationUrl = invitation.toUrl({ domain: 'https://example.com' }) // Receive invitation first time with alice agent - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl + ) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) // Mark connection with three different types - aliceFaberConnection = await aliceAgent.connections.addConnectionType(aliceFaberConnection.id, 'alice-faber-1') - aliceFaberConnection = await aliceAgent.connections.addConnectionType(aliceFaberConnection.id, 'alice-faber-2') - aliceFaberConnection = await aliceAgent.connections.addConnectionType(aliceFaberConnection.id, 'alice-faber-3') + aliceFaberConnection = await aliceAgent.modules.connections.addConnectionType( + aliceFaberConnection.id, + 'alice-faber-1' + ) + aliceFaberConnection = await aliceAgent.modules.connections.addConnectionType( + aliceFaberConnection.id, + 'alice-faber-2' + ) + aliceFaberConnection = await aliceAgent.modules.connections.addConnectionType( + aliceFaberConnection.id, + 'alice-faber-3' + ) // Now search for them - let connectionsFound = await aliceAgent.connections.findAllByConnectionTypes(['alice-faber-4']) + let connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes(['alice-faber-4']) expect(connectionsFound).toEqual([]) - connectionsFound = await aliceAgent.connections.findAllByConnectionTypes(['alice-faber-1']) + connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes(['alice-faber-1']) expect(connectionsFound.map((item) => item.id)).toMatchObject([aliceFaberConnection.id]) - connectionsFound = await aliceAgent.connections.findAllByConnectionTypes(['alice-faber-2']) + connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes(['alice-faber-2']) expect(connectionsFound.map((item) => item.id)).toMatchObject([aliceFaberConnection.id]) - connectionsFound = await aliceAgent.connections.findAllByConnectionTypes(['alice-faber-3']) + connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes(['alice-faber-3']) expect(connectionsFound.map((item) => item.id)).toMatchObject([aliceFaberConnection.id]) - connectionsFound = await aliceAgent.connections.findAllByConnectionTypes(['alice-faber-1', 'alice-faber-3']) + connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes(['alice-faber-1', 'alice-faber-3']) expect(connectionsFound.map((item) => item.id)).toMatchObject([aliceFaberConnection.id]) - connectionsFound = await aliceAgent.connections.findAllByConnectionTypes([ + connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes([ 'alice-faber-1', 'alice-faber-2', 'alice-faber-3', ]) expect(connectionsFound.map((item) => item.id)).toMatchObject([aliceFaberConnection.id]) - connectionsFound = await aliceAgent.connections.findAllByConnectionTypes(['alice-faber-1', 'alice-faber-4']) + connectionsFound = await aliceAgent.modules.connections.findAllByConnectionTypes(['alice-faber-1', 'alice-faber-4']) expect(connectionsFound).toEqual([]) }) xit('should be able to make multiple connections using a multi use invite', async () => { - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], multiUseInvitation: true, }) @@ -175,22 +193,27 @@ describe('connections', () => { const invitationUrl = invitation.toUrl({ domain: 'https://example.com' }) // Create first connection - let { connectionRecord: aliceFaberConnection1 } = await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) - aliceFaberConnection1 = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection1!.id) + let { connectionRecord: aliceFaberConnection1 } = await aliceAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl + ) + aliceFaberConnection1 = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection1!.id) expect(aliceFaberConnection1.state).toBe(DidExchangeState.Completed) // Create second connection - let { connectionRecord: aliceFaberConnection2 } = await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl, { - reuseConnection: false, - }) - aliceFaberConnection2 = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection2!.id) + let { connectionRecord: aliceFaberConnection2 } = await aliceAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl, + { + reuseConnection: false, + } + ) + aliceFaberConnection2 = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection2!.id) expect(aliceFaberConnection2.state).toBe(DidExchangeState.Completed) - let faberAliceConnection1 = await faberAgent.connections.getByThreadId(aliceFaberConnection1.threadId!) - let faberAliceConnection2 = await faberAgent.connections.getByThreadId(aliceFaberConnection2.threadId!) + let faberAliceConnection1 = await faberAgent.modules.connections.getByThreadId(aliceFaberConnection1.threadId!) + let faberAliceConnection2 = await faberAgent.modules.connections.getByThreadId(aliceFaberConnection2.threadId!) - faberAliceConnection1 = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection1.id) - faberAliceConnection2 = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection2.id) + faberAliceConnection1 = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection1.id) + faberAliceConnection2 = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection2.id) expect(faberAliceConnection1).toBeConnectedWith(aliceFaberConnection1) expect(faberAliceConnection2).toBeConnectedWith(aliceFaberConnection2) @@ -202,11 +225,11 @@ describe('connections', () => { it('agent using mediator should be able to make multiple connections using a multi use invite', async () => { // Make Faber use a mediator - const { outOfBandInvitation: mediatorOutOfBandInvitation } = await mediatorAgent.oob.createInvitation({}) - let { connectionRecord } = await faberAgent.oob.receiveInvitation(mediatorOutOfBandInvitation) - connectionRecord = await faberAgent.connections.returnWhenIsConnected(connectionRecord!.id) - await faberAgent.mediationRecipient.provision(connectionRecord!) - await faberAgent.mediationRecipient.initialize() + const { outOfBandInvitation: mediatorOutOfBandInvitation } = await mediatorAgent.modules.oob.createInvitation({}) + let { connectionRecord } = await faberAgent.modules.oob.receiveInvitation(mediatorOutOfBandInvitation) + connectionRecord = await faberAgent.modules.connections.returnWhenIsConnected(connectionRecord!.id) + await faberAgent.modules.mediationRecipient.provision(connectionRecord!) + await faberAgent.modules.mediationRecipient.initialize() // Create observable for event const keyAddMessageObservable = mediatorAgent.events @@ -225,7 +248,7 @@ describe('connections', () => { }) // Now create invitations that will be mediated - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], multiUseInvitation: true, }) @@ -234,22 +257,27 @@ describe('connections', () => { const invitationUrl = invitation.toUrl({ domain: 'https://example.com' }) // Receive invitation first time with alice agent - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl + ) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) // Receive invitation second time with acme agent - let { connectionRecord: acmeFaberConnection } = await acmeAgent.oob.receiveInvitationFromUrl(invitationUrl, { - reuseConnection: false, - }) - acmeFaberConnection = await acmeAgent.connections.returnWhenIsConnected(acmeFaberConnection!.id) + let { connectionRecord: acmeFaberConnection } = await acmeAgent.modules.oob.receiveInvitationFromUrl( + invitationUrl, + { + reuseConnection: false, + } + ) + acmeFaberConnection = await acmeAgent.modules.connections.returnWhenIsConnected(acmeFaberConnection!.id) expect(acmeFaberConnection.state).toBe(DidExchangeState.Completed) - let faberAliceConnection = await faberAgent.connections.getByThreadId(aliceFaberConnection.threadId!) - let faberAcmeConnection = await faberAgent.connections.getByThreadId(acmeFaberConnection.threadId!) + let faberAliceConnection = await faberAgent.modules.connections.getByThreadId(aliceFaberConnection.threadId!) + let faberAcmeConnection = await faberAgent.modules.connections.getByThreadId(acmeFaberConnection.threadId!) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection.id) - faberAcmeConnection = await faberAgent.connections.returnWhenIsConnected(faberAcmeConnection.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection.id) + faberAcmeConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAcmeConnection.id) expect(faberAliceConnection).toBeConnectedWith(aliceFaberConnection) expect(faberAcmeConnection).toBeConnectedWith(acmeFaberConnection) @@ -289,7 +317,7 @@ describe('connections', () => { ) ) - await faberAgent.connections.deleteById(connection.id) + await faberAgent.modules.connections.deleteById(connection.id) const keyRemoveMessage = await keyRemoveMessagePromise expect(keyRemoveMessage.updates.length).toEqual(1) diff --git a/packages/core/tests/helpers.ts b/packages/core/tests/helpers.ts index d103d5827b..cc459d6d3d 100644 --- a/packages/core/tests/helpers.ts +++ b/packages/core/tests/helpers.ts @@ -1,28 +1,35 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { AskarWalletSqliteStorageConfig } from '../../askar/src/wallet' import type { - AgentDependencies, - BaseEvent, BasicMessage, BasicMessageStateChangedEvent, ConnectionRecordProps, CredentialStateChangedEvent, - InitConfig, - InjectionToken, ProofStateChangedEvent, - Wallet, - Agent, CredentialState, ConnectionStateChangedEvent, - Buffer, AgentMessageProcessedEvent, RevocationNotificationReceivedEvent, - KeyDidCreateOptions, ConnectionDidRotatedEvent, +} from '../../didcomm/src' +import type { DidCommModuleConfigOptions } from '../../didcomm/src/DidCommModuleConfig' +import type { + TrustPingReceivedEvent, + TrustPingResponseReceivedEvent, +} from '../../didcomm/src/modules/connections/TrustPingEvents' +import type { ProofState } from '../../didcomm/src/modules/proofs' +import type { DefaultAgentModulesInput } from '../../didcomm/src/util/modules' +import type { + AgentDependencies, + BaseEvent, + InitConfig, + InjectionToken, + Wallet, + Agent, + Buffer, + KeyDidCreateOptions, } from '../src' import type { AgentModulesInput, EmptyModuleMap } from '../src/agent/AgentModules' -import type { TrustPingReceivedEvent, TrustPingResponseReceivedEvent } from '../src/modules/connections/TrustPingEvents' -import type { ProofState } from '../src/modules/proofs/models/ProofState' import type { WalletConfig } from '../src/types' import type { Observable } from 'rxjs' @@ -32,34 +39,37 @@ import { lastValueFrom, firstValueFrom, ReplaySubject } from 'rxjs' import { catchError, filter, map, take, timeout } from 'rxjs/operators' import { InMemoryWalletModule } from '../../../tests/InMemoryWalletModule' -import { agentDependencies } from '../../node/src' import { AgentEventTypes, OutOfBandDidCommService, ConnectionsModule, ConnectionEventTypes, - TypedArrayEncoder, - AgentConfig, - AgentContext, BasicMessageEventTypes, ConnectionRecord, CredentialEventTypes, - DependencyManager, DidExchangeRole, DidExchangeState, HandshakeProtocol, - InjectionSymbols, ProofEventTypes, TrustPingEventTypes, +} from '../../didcomm/src' +import { OutOfBandRole } from '../../didcomm/src/modules/oob/domain/OutOfBandRole' +import { OutOfBandState } from '../../didcomm/src/modules/oob/domain/OutOfBandState' +import { OutOfBandInvitation } from '../../didcomm/src/modules/oob/messages' +import { OutOfBandRecord } from '../../didcomm/src/modules/oob/repository' +import { getDefaultDidcommModules } from '../../didcomm/src/util/modules' +import { agentDependencies } from '../../node/src' +import { DidsApi, X509Api, + TypedArrayEncoder, + AgentConfig, + AgentContext, + DependencyManager, + InjectionSymbols, } from '../src' import { Key, KeyType } from '../src/crypto' import { DidKey } from '../src/modules/dids/methods/key' -import { OutOfBandRole } from '../src/modules/oob/domain/OutOfBandRole' -import { OutOfBandState } from '../src/modules/oob/domain/OutOfBandState' -import { OutOfBandInvitation } from '../src/modules/oob/messages' -import { OutOfBandRecord } from '../src/modules/oob/repository' import { KeyDerivationMethod } from '../src/types' import { sleep } from '../src/utils/sleep' import { uuid } from '../src/utils/uuid' @@ -102,10 +112,16 @@ export function getAskarWalletConfig( export function getAgentOptions( name: string, + didcommConfig: Partial = {}, extraConfig: Partial = {}, inputModules?: AgentModules, inMemoryWallet = true -): { config: InitConfig; modules: AgentModules; dependencies: AgentDependencies; inMemory?: boolean } { +): { + config: InitConfig + modules: AgentModules & DefaultAgentModulesInput + dependencies: AgentDependencies + inMemory?: boolean +} { const random = uuid().slice(0, 4) const config: InitConfig = { label: `Agent: ${name} - ${random}`, @@ -118,6 +134,7 @@ export function getAgentOptions( +export function getInMemoryAgentOptions< + AgentModules extends DefaultAgentModulesInput | AgentModulesInput | EmptyModuleMap +>( name: string, + didcommExtraConfig: Partial = {}, extraConfig: Partial = {}, inputModules?: AgentModules -): { config: InitConfig; modules: AgentModules; dependencies: AgentDependencies } { +): { + config: InitConfig + modules: AgentModules & DefaultAgentModulesInput + dependencies: AgentDependencies +} { const random = uuid().slice(0, 4) const config: InitConfig = { label: `Agent: ${name} - ${random}`, @@ -148,8 +176,11 @@ export function getInMemoryAgentOptions = {}, extraConfig: Partial = {} ): AgentConfig & { walletConfig: WalletConfig } { - const { config, dependencies } = getAgentOptions(name, extraConfig) + const { config, dependencies } = getAgentOptions(name, didcommConfig, extraConfig) return new AgentConfig(config, dependencies) as AgentConfig & { walletConfig: WalletConfig } } @@ -687,16 +723,18 @@ export function getMockOutOfBand({ return outOfBandRecord } -export async function makeConnection(agentA: Agent, agentB: Agent) { - const agentAOutOfBand = await agentA.oob.createInvitation({ +export async function makeConnection(agentA: Agent, agentB: Agent) { + const agentAOutOfBand = await agentA.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], }) - let { connectionRecord: agentBConnection } = await agentB.oob.receiveInvitation(agentAOutOfBand.outOfBandInvitation) + let { connectionRecord: agentBConnection } = await agentB.modules.oob.receiveInvitation( + agentAOutOfBand.outOfBandInvitation + ) - agentBConnection = await agentB.connections.returnWhenIsConnected(agentBConnection!.id) - let [agentAConnection] = await agentA.connections.findAllByOutOfBandId(agentAOutOfBand.id) - agentAConnection = await agentA.connections.returnWhenIsConnected(agentAConnection!.id) + agentBConnection = await agentB.modules.connections.returnWhenIsConnected(agentBConnection!.id) + let [agentAConnection] = await agentA.modules.connections.findAllByOutOfBandId(agentAOutOfBand.id) + agentAConnection = await agentA.modules.connections.returnWhenIsConnected(agentAConnection!.id) return [agentAConnection, agentBConnection] } diff --git a/packages/core/tests/jsonld.ts b/packages/core/tests/jsonld.ts index 69ecb70f10..678c80696d 100644 --- a/packages/core/tests/jsonld.ts +++ b/packages/core/tests/jsonld.ts @@ -1,5 +1,6 @@ import type { EventReplaySubject } from './events' -import type { AutoAcceptCredential, AutoAcceptProof, ConnectionRecord } from '../src' +import type { AutoAcceptCredential, AutoAcceptProof, ConnectionRecord } from '../../didcomm/src' +import type { DefaultAgentModulesInput } from '../../didcomm/src/util/modules' import { InMemoryWalletModule } from '../../../tests/InMemoryWalletModule' import { askarModule } from '../../askar/tests/helpers' @@ -7,24 +8,21 @@ import { BbsModule } from '../../bbs-signatures/src/BbsModule' import { DifPresentationExchangeProofFormatService, V2ProofProtocol, - CacheModule, CredentialEventTypes, - InMemoryLruCache, ProofEventTypes, - Agent, ProofsModule, CredentialsModule, JsonLdCredentialFormatService, V2CredentialProtocol, - W3cCredentialsModule, -} from '../src' +} from '../../didcomm/src' +import { CacheModule, InMemoryLruCache, Agent, W3cCredentialsModule } from '../src' import { customDocumentLoader } from '../src/modules/vc/data-integrity/__tests__/documentLoader' import { setupEventReplaySubjects } from './events' import { getAgentOptions, makeConnection } from './helpers' import { setupSubjectTransports } from './transport' -export type JsonLdTestsAgent = Agent> +export type JsonLdTestsAgent = Agent & DefaultAgentModulesInput> export const getJsonLdModules = ({ autoAcceptCredentials, @@ -116,6 +114,7 @@ export async function setupJsonLdTests< { endpoints: ['rxjs:issuer'], }, + {}, modules ) ) @@ -126,6 +125,7 @@ export async function setupJsonLdTests< { endpoints: ['rxjs:holder'], }, + {}, modules ) ) @@ -137,6 +137,7 @@ export async function setupJsonLdTests< { endpoints: ['rxjs:verifier'], }, + {}, modules ) ) diff --git a/packages/core/tests/middleware.test.ts b/packages/core/tests/middleware.test.ts index cf76ca8031..c142ab890e 100644 --- a/packages/core/tests/middleware.test.ts +++ b/packages/core/tests/middleware.test.ts @@ -1,5 +1,5 @@ import type { SubjectMessage } from '../../../tests/transport/SubjectInboundTransport' -import type { ConnectionRecord, InboundMessageContext } from '../src' +import type { ConnectionRecord, InboundMessageContext } from '../../didcomm' import { Subject } from 'rxjs' @@ -11,9 +11,8 @@ import { getOutboundMessageContext, MessageSender, AgentMessage, - JsonTransformer, - Agent, -} from '../src' +} from '../../didcomm/src' +import { JsonTransformer, Agent } from '../src' import { getInMemoryAgentOptions, @@ -22,17 +21,19 @@ import { waitForBasicMessage, } from './helpers' -const faberConfig = getInMemoryAgentOptions('Faber Message Handler Middleware', { - endpoints: ['rxjs:faber'], -}) +const faberAgent = new Agent( + getInMemoryAgentOptions('Faber Message Handler Middleware', { + endpoints: ['rxjs:faber'], + }) +) -const aliceConfig = getInMemoryAgentOptions('Alice Message Handler Middleware', { - endpoints: ['rxjs:alice'], -}) +const aliceAgent = new Agent( + getInMemoryAgentOptions('Alice Message Handler Middleware', { + endpoints: ['rxjs:alice'], + }) +) describe('Message Handler Middleware E2E', () => { - let faberAgent: Agent - let aliceAgent: Agent let faberConnection: ConnectionRecord // eslint-disable-next-line @typescript-eslint/no-unused-vars let aliceConnection: ConnectionRecord @@ -45,14 +46,12 @@ describe('Message Handler Middleware E2E', () => { 'rxjs:alice': aliceMessages, } - faberAgent = new Agent(faberConfig) - faberAgent.registerInboundTransport(new SubjectInboundTransport(faberMessages)) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(faberMessages)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() - aliceAgent = new Agent(aliceConfig) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() ;[aliceConnection, faberConnection] = await makeConnection(aliceAgent, faberAgent) }) @@ -66,7 +65,7 @@ describe('Message Handler Middleware E2E', () => { test('Correctly calls the fallback message handler if no message handler is defined', async () => { // Fallback message handler - aliceAgent.dependencyManager.setFallbackMessageHandler((messageContext) => { + aliceAgent.modules.didcomm.setFallbackMessageHandler((messageContext) => { return getOutboundMessageContext(messageContext.agentContext, { connectionRecord: messageContext.connection, message: new BasicMessage({ @@ -98,7 +97,7 @@ describe('Message Handler Middleware E2E', () => { }) test('Correctly calls the registered message handler middleware', async () => { - aliceAgent.dependencyManager.registerMessageHandlerMiddleware( + aliceAgent.modules.didcomm.registerMessageHandlerMiddleware( async (inboundMessageContext: InboundMessageContext, next) => { await next() @@ -110,7 +109,7 @@ describe('Message Handler Middleware E2E', () => { } ) - await faberAgent.connections.sendPing(faberConnection.id, {}) + await faberAgent.modules.connections.sendPing(faberConnection.id, {}) const receiveMessage = await waitForAgentMessageProcessedEvent(faberAgent, { messageType: TrustPingResponseMessage.type.messageTypeUri, }) diff --git a/packages/core/tests/migration.test.ts b/packages/core/tests/migration.test.ts index bc39a9382a..3b412cec47 100644 --- a/packages/core/tests/migration.test.ts +++ b/packages/core/tests/migration.test.ts @@ -6,7 +6,7 @@ import { UpdateAssistant } from '../src/storage/migration/UpdateAssistant' import { getAgentOptions } from './helpers' -const agentOptions = getAgentOptions('Migration', {}, { askar: askarModule }) +const agentOptions = getAgentOptions('Migration', {}, {}, { askar: askarModule }) describe('migration', () => { test('manually initiating the update assistant to perform an update', async () => { diff --git a/packages/core/tests/multi-protocol-version.test.ts b/packages/core/tests/multi-protocol-version.test.ts index 1f9fa3c915..c422f45602 100644 --- a/packages/core/tests/multi-protocol-version.test.ts +++ b/packages/core/tests/multi-protocol-version.test.ts @@ -1,11 +1,16 @@ -import type { AgentMessageProcessedEvent } from '../src/agent/Events' +import type { AgentMessageProcessedEvent } from '../../didcomm/src' import { filter, firstValueFrom, timeout } from 'rxjs' -import { parseMessageType, MessageSender, AgentMessage, IsValidMessageType } from '../src' +import { + AgentEventTypes, + OutboundMessageContext, + parseMessageType, + MessageSender, + AgentMessage, + IsValidMessageType, +} from '../../didcomm/src' import { Agent } from '../src/agent/Agent' -import { AgentEventTypes } from '../src/agent/Events' -import { OutboundMessageContext } from '../src/agent/models' import { getInMemoryAgentOptions } from './helpers' import { setupSubjectTransports } from './transport' @@ -35,13 +40,13 @@ describe('multi version protocols', () => { // Register the test handler with the v1.3 version of the message const mockHandle = jest.fn() - aliceAgent.dependencyManager.registerMessageHandlers([{ supportedMessages: [TestMessageV13], handle: mockHandle }]) + aliceAgent.modules.didcomm.registerMessageHandlers([{ supportedMessages: [TestMessageV13], handle: mockHandle }]) await aliceAgent.initialize() await bobAgent.initialize() - const { outOfBandInvitation, id } = await aliceAgent.oob.createInvitation() - let { connectionRecord: bobConnection } = await bobAgent.oob.receiveInvitation(outOfBandInvitation, { + const { outOfBandInvitation, id } = await aliceAgent.modules.oob.createInvitation() + let { connectionRecord: bobConnection } = await bobAgent.modules.oob.receiveInvitation(outOfBandInvitation, { autoAcceptConnection: true, autoAcceptInvitation: true, }) @@ -50,10 +55,10 @@ describe('multi version protocols', () => { throw new Error('No connection for bob') } - bobConnection = await bobAgent.connections.returnWhenIsConnected(bobConnection.id) + bobConnection = await bobAgent.modules.connections.returnWhenIsConnected(bobConnection.id) - let [aliceConnection] = await aliceAgent.connections.findAllByOutOfBandId(id) - aliceConnection = await aliceAgent.connections.returnWhenIsConnected(aliceConnection.id) + let [aliceConnection] = await aliceAgent.modules.connections.findAllByOutOfBandId(id) + aliceConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceConnection.id) expect(aliceConnection).toBeConnectedWith(bobConnection) expect(bobConnection).toBeConnectedWith(aliceConnection) diff --git a/packages/core/tests/oob-mediation-provision.test.ts b/packages/core/tests/oob-mediation-provision.test.ts index 3bf27ba9eb..2ce49e0161 100644 --- a/packages/core/tests/oob-mediation-provision.test.ts +++ b/packages/core/tests/oob-mediation-provision.test.ts @@ -1,14 +1,14 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { OutOfBandInvitation } from '../src/modules/oob/messages' +import type { OutOfBandInvitation } from '../../didcomm/src/modules/oob/messages' -import { Agent } from '../src/agent/Agent' -import { DidExchangeState, HandshakeProtocol } from '../src/modules/connections' +import { DidExchangeState, HandshakeProtocol } from '../../didcomm/src/modules/connections' import { MediationState, MediatorModule, MediatorPickupStrategy, MediationRecipientModule, -} from '../src/modules/routing' +} from '../../didcomm/src/modules/routing' +import { Agent } from '../src/agent/Agent' import { getInMemoryAgentOptions, waitForBasicMessage } from './helpers' import { setupSubjectTransports } from './transport' @@ -21,6 +21,7 @@ const aliceAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, { mediationRecipient: new MediationRecipientModule({ mediatorPickupStrategy: MediatorPickupStrategy.PickUpV1, @@ -32,6 +33,7 @@ const mediatorAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:mediator'], }, + {}, { mediator: new MediatorModule({ autoAcceptMediationRequests: true }) } ) @@ -61,13 +63,13 @@ describe('out of band with mediation set up with provision method', () => { await aliceAgent.initialize() await faberAgent.initialize() - const mediationOutOfBandRecord = await mediatorAgent.oob.createInvitation(makeConnectionConfig) + const mediationOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation(makeConnectionConfig) mediatorOutOfBandInvitation = mediationOutOfBandRecord.outOfBandInvitation - let { connectionRecord } = await aliceAgent.oob.receiveInvitation(mediatorOutOfBandInvitation) - connectionRecord = await aliceAgent.connections.returnWhenIsConnected(connectionRecord!.id) - await aliceAgent.mediationRecipient.provision(connectionRecord!) - await aliceAgent.mediationRecipient.initialize() + let { connectionRecord } = await aliceAgent.modules.oob.receiveInvitation(mediatorOutOfBandInvitation) + connectionRecord = await aliceAgent.modules.connections.returnWhenIsConnected(connectionRecord!.id) + await aliceAgent.modules.mediationRecipient.provision(connectionRecord!) + await aliceAgent.modules.mediationRecipient.initialize() }) afterAll(async () => { @@ -81,39 +83,41 @@ describe('out of band with mediation set up with provision method', () => { test(`make a connection with ${HandshakeProtocol.DidExchange} on OOB invitation encoded in URL`, async () => { // Check if mediation between Alice and Mediator has been set - const defaultMediator = await aliceAgent.mediationRecipient.findDefaultMediator() + const defaultMediator = await aliceAgent.modules.mediationRecipient.findDefaultMediator() expect(defaultMediator).not.toBeNull() expect(defaultMediator?.state).toBe(MediationState.Granted) // Make a connection between Alice and Faber - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) const { outOfBandInvitation } = outOfBandRecord const urlMessage = outOfBandInvitation.toUrl({ domain: 'http://example.com' }) - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(urlMessage) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) expect(faberAliceConnection).toBeConnectedWith(aliceFaberConnection) - await aliceAgent.basicMessages.sendMessage(aliceFaberConnection.id, 'hello') + await aliceAgent.modules.basicMessages.sendMessage(aliceFaberConnection.id, 'hello') const basicMessage = await waitForBasicMessage(faberAgent, {}) expect(basicMessage.content).toBe('hello') // Test if we can call provision for the same out-of-band record, respectively connection - const reusedOutOfBandRecord = await aliceAgent.oob.findByReceivedInvitationId(mediatorOutOfBandInvitation.id) + const reusedOutOfBandRecord = await aliceAgent.modules.oob.findByReceivedInvitationId( + mediatorOutOfBandInvitation.id + ) const [reusedAliceMediatorConnection] = reusedOutOfBandRecord - ? await aliceAgent.connections.findAllByOutOfBandId(reusedOutOfBandRecord.id) + ? await aliceAgent.modules.connections.findAllByOutOfBandId(reusedOutOfBandRecord.id) : [] - await aliceAgent.mediationRecipient.provision(reusedAliceMediatorConnection!) - const mediators = await aliceAgent.mediationRecipient.getMediators() + await aliceAgent.modules.mediationRecipient.provision(reusedAliceMediatorConnection!) + const mediators = await aliceAgent.modules.mediationRecipient.getMediators() expect(mediators).toHaveLength(1) }) }) diff --git a/packages/core/tests/oob-mediation.test.ts b/packages/core/tests/oob-mediation.test.ts index 3372ccc8cf..c44472255b 100644 --- a/packages/core/tests/oob-mediation.test.ts +++ b/packages/core/tests/oob-mediation.test.ts @@ -1,25 +1,24 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { SubjectMessage } from '../../../tests/transport/SubjectInboundTransport' -import type { AgentMessageProcessedEvent } from '../src/agent/Events' -import type { OutOfBandDidCommService } from '../src/modules/oob' +import type { AgentMessageProcessedEvent } from '../../didcomm/src' +import type { OutOfBandDidCommService } from '../../didcomm/src/modules/oob' import { filter, firstValueFrom, map, Subject, timeout } from 'rxjs' import { SubjectInboundTransport } from '../../../tests/transport/SubjectInboundTransport' import { SubjectOutboundTransport } from '../../../tests/transport/SubjectOutboundTransport' -import { Agent } from '../src/agent/Agent' -import { AgentEventTypes } from '../src/agent/Events' -import { DidExchangeState, HandshakeProtocol } from '../src/modules/connections' -import { ConnectionType } from '../src/modules/connections/models/ConnectionType' -import { didKeyToVerkey } from '../src/modules/dids/helpers' +import { AgentEventTypes } from '../../didcomm/src' +import { ConnectionType, DidExchangeState, HandshakeProtocol } from '../../didcomm/src/modules/connections' import { - KeylistUpdateMessage, KeylistUpdateAction, - MediationState, - MediatorPickupStrategy, + KeylistUpdateMessage, MediationRecipientModule, + MediationState, MediatorModule, -} from '../src/modules/routing' + MediatorPickupStrategy, +} from '../../didcomm/src/modules/routing' +import { Agent } from '../src/agent/Agent' +import { didKeyToVerkey } from '../src/modules/dids/helpers' import { getInMemoryAgentOptions, waitForBasicMessage } from './helpers' @@ -31,6 +30,7 @@ const aliceAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, { mediationRecipient: new MediationRecipientModule({ mediatorPickupStrategy: MediatorPickupStrategy.PickUpV1, @@ -42,6 +42,7 @@ const mediatorAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:mediator'], }, + {}, { mediator: new MediatorModule({ autoAcceptMediationRequests: true }) } ) @@ -69,54 +70,59 @@ describe('out of band with mediation', () => { } faberAgent = new Agent(faberAgentOptions) - faberAgent.registerInboundTransport(new SubjectInboundTransport(faberMessages)) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(faberMessages)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() aliceAgent = new Agent(aliceAgentOptions) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() mediatorAgent = new Agent(mediatorAgentOptions) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await mediatorAgent.initialize() // ========== Make a connection between Alice and Mediator agents ========== - const mediationOutOfBandRecord = await mediatorAgent.oob.createInvitation(makeConnectionConfig) + const mediationOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation(makeConnectionConfig) const { outOfBandInvitation: mediatorOutOfBandInvitation } = mediationOutOfBandRecord const mediatorUrlMessage = mediatorOutOfBandInvitation.toUrl({ domain: 'http://example.com' }) - let { connectionRecord: aliceMediatorConnection } = await aliceAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: aliceMediatorConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl( mediatorUrlMessage ) - aliceMediatorConnection = await aliceAgent.connections.returnWhenIsConnected(aliceMediatorConnection!.id) + aliceMediatorConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceMediatorConnection!.id) expect(aliceMediatorConnection.state).toBe(DidExchangeState.Completed) // Tag the connection with an initial type - aliceMediatorConnection = await aliceAgent.connections.addConnectionType(aliceMediatorConnection.id, 'initial-type') + aliceMediatorConnection = await aliceAgent.modules.connections.addConnectionType( + aliceMediatorConnection.id, + 'initial-type' + ) - let [mediatorAliceConnection] = await mediatorAgent.connections.findAllByOutOfBandId(mediationOutOfBandRecord.id) - mediatorAliceConnection = await mediatorAgent.connections.returnWhenIsConnected(mediatorAliceConnection!.id) + let [mediatorAliceConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( + mediationOutOfBandRecord.id + ) + mediatorAliceConnection = await mediatorAgent.modules.connections.returnWhenIsConnected(mediatorAliceConnection!.id) expect(mediatorAliceConnection.state).toBe(DidExchangeState.Completed) // ========== Set mediation between Alice and Mediator agents ========== - let connectionTypes = await aliceAgent.connections.getConnectionTypes(aliceMediatorConnection.id) + let connectionTypes = await aliceAgent.modules.connections.getConnectionTypes(aliceMediatorConnection.id) expect(connectionTypes).toMatchObject(['initial-type']) - const mediationRecord = await aliceAgent.mediationRecipient.requestAndAwaitGrant(aliceMediatorConnection) - connectionTypes = await aliceAgent.connections.getConnectionTypes(mediationRecord.connectionId) + const mediationRecord = await aliceAgent.modules.mediationRecipient.requestAndAwaitGrant(aliceMediatorConnection) + connectionTypes = await aliceAgent.modules.connections.getConnectionTypes(mediationRecord.connectionId) expect(connectionTypes.sort()).toMatchObject(['initial-type', ConnectionType.Mediator].sort()) - await aliceAgent.connections.removeConnectionType(mediationRecord.connectionId, 'initial-type') - connectionTypes = await aliceAgent.connections.getConnectionTypes(mediationRecord.connectionId) + await aliceAgent.modules.connections.removeConnectionType(mediationRecord.connectionId, 'initial-type') + connectionTypes = await aliceAgent.modules.connections.getConnectionTypes(mediationRecord.connectionId) expect(connectionTypes).toMatchObject([ConnectionType.Mediator]) expect(mediationRecord.state).toBe(MediationState.Granted) - await aliceAgent.mediationRecipient.setDefaultMediator(mediationRecord) - await aliceAgent.mediationRecipient.initiateMessagePickup(mediationRecord) - const defaultMediator = await aliceAgent.mediationRecipient.findDefaultMediator() + await aliceAgent.modules.mediationRecipient.setDefaultMediator(mediationRecord) + await aliceAgent.modules.mediationRecipient.initiateMessagePickup(mediationRecord) + const defaultMediator = await aliceAgent.modules.mediationRecipient.findDefaultMediator() expect(defaultMediator?.id).toBe(mediationRecord.id) }) @@ -131,24 +137,24 @@ describe('out of band with mediation', () => { test(`make a connection with ${HandshakeProtocol.DidExchange} on OOB invitation encoded in URL`, async () => { // ========== Make a connection between Alice and Faber ========== - const outOfBandRecord = await faberAgent.oob.createInvitation({ multiUseInvitation: false }) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ multiUseInvitation: false }) const { outOfBandInvitation } = outOfBandRecord const urlMessage = outOfBandInvitation.toUrl({ domain: 'http://example.com' }) - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(urlMessage) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) expect(faberAliceConnection).toBeConnectedWith(aliceFaberConnection) - await aliceAgent.basicMessages.sendMessage(aliceFaberConnection.id, 'hello') + await aliceAgent.modules.basicMessages.sendMessage(aliceFaberConnection.id, 'hello') const basicMessage = await waitForBasicMessage(faberAgent, {}) expect(basicMessage.content).toBe('hello') @@ -165,7 +171,7 @@ describe('out of band with mediation', () => { ) ) - const outOfBandRecord = await aliceAgent.oob.createInvitation({}) + const outOfBandRecord = await aliceAgent.modules.oob.createInvitation({}) const { outOfBandInvitation } = outOfBandRecord const keyAddMessage = await keyAddMessagePromise @@ -189,7 +195,7 @@ describe('out of band with mediation', () => { ) ) - await aliceAgent.oob.deleteById(outOfBandRecord.id) + await aliceAgent.modules.oob.deleteById(outOfBandRecord.id) const keyRemoveMessage = await keyRemoveMessagePromise expect(keyRemoveMessage.updates.length).toEqual(1) diff --git a/packages/core/tests/oob.test.ts b/packages/core/tests/oob.test.ts index c5fb26d71e..46356ff7f6 100644 --- a/packages/core/tests/oob.test.ts +++ b/packages/core/tests/oob.test.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { SubjectMessage } from '../../../tests/transport/SubjectInboundTransport' import type { AnonCredsCredentialFormatService } from '../../anoncreds/src' -import type { CreateCredentialOfferOptions, V2CredentialProtocol } from '../src/modules/credentials' -import type { AgentMessage, AgentMessageReceivedEvent } from '@credo-ts/core' +import type { AgentMessage } from '../../didcomm/src/AgentMessage' +import type { AgentMessageReceivedEvent } from '../../didcomm/src/Events' import { Subject } from 'rxjs' @@ -13,38 +13,54 @@ import { anoncredsDefinitionFourAttributesNoRevocation, storePreCreatedAnonCredsDefinition, } from '../../anoncreds/tests/preCreatedAnonCredsDefinition' +import { AgentEventTypes } from '../../didcomm/src/Events' +import { DidExchangeState, HandshakeProtocol } from '../../didcomm/src/modules/connections' +import { + AutoAcceptCredential, + CredentialState, + type CreateCredentialOfferOptions, + type V2CredentialProtocol, +} from '../../didcomm/src/modules/credentials' +import { OutOfBandDidCommService } from '../../didcomm/src/modules/oob/domain/OutOfBandDidCommService' +import { OutOfBandEventTypes } from '../../didcomm/src/modules/oob/domain/OutOfBandEvents' +import { OutOfBandRole } from '../../didcomm/src/modules/oob/domain/OutOfBandRole' +import { OutOfBandState } from '../../didcomm/src/modules/oob/domain/OutOfBandState' +import { OutOfBandInvitation } from '../../didcomm/src/modules/oob/messages' import { Agent } from '../src/agent/Agent' import { Key } from '../src/crypto' -import { DidExchangeState, HandshakeProtocol } from '../src/modules/connections' -import { OutOfBandDidCommService } from '../src/modules/oob/domain/OutOfBandDidCommService' -import { OutOfBandEventTypes } from '../src/modules/oob/domain/OutOfBandEvents' -import { OutOfBandRole } from '../src/modules/oob/domain/OutOfBandRole' -import { OutOfBandState } from '../src/modules/oob/domain/OutOfBandState' -import { OutOfBandInvitation } from '../src/modules/oob/messages' import { JsonEncoder, JsonTransformer } from '../src/utils' import { TestMessage } from './TestMessage' import { getInMemoryAgentOptions, waitForCredentialRecord } from './helpers' - -import { AgentEventTypes, CredoError, AutoAcceptCredential, CredentialState } from '@credo-ts/core' - -const faberAgentOptions = getInMemoryAgentOptions( - 'Faber Agent OOB', - { - endpoints: ['rxjs:faber'], - }, - getAnonCredsIndyModules({ - autoAcceptCredentials: AutoAcceptCredential.ContentApproved, - }) +import testLogger from './logger' + +import { CredoError } from '@credo-ts/core' + +const faberAgent = new Agent( + getInMemoryAgentOptions( + 'Faber Agent OOB', + { + endpoints: ['rxjs:faber'], + }, + {}, + getAnonCredsIndyModules({ + autoAcceptCredentials: AutoAcceptCredential.ContentApproved, + }) + ) ) -const aliceAgentOptions = getInMemoryAgentOptions( - 'Alice Agent OOB', - { - endpoints: ['rxjs:alice'], - }, - getAnonCredsIndyModules({ - autoAcceptCredentials: AutoAcceptCredential.ContentApproved, - }) +const aliceAgent = new Agent( + getInMemoryAgentOptions( + 'Alice Agent OOB', + { + endpoints: ['rxjs:alice'], + }, + { + logger: testLogger, + }, + getAnonCredsIndyModules({ + autoAcceptCredentials: AutoAcceptCredential.ContentApproved, + }) + ) ) describe('out of band', () => { @@ -67,8 +83,6 @@ describe('out of band', () => { autoAcceptConnection: false, } - let faberAgent: Agent> - let aliceAgent: Agent> let credentialTemplate: CreateCredentialOfferOptions<[V2CredentialProtocol<[AnonCredsCredentialFormatService]>]> beforeAll(async () => { @@ -79,18 +93,15 @@ describe('out of band', () => { 'rxjs:alice': aliceMessages, } - faberAgent = new Agent(faberAgentOptions) - - faberAgent.registerInboundTransport(new SubjectInboundTransport(faberMessages)) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(faberMessages)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() - aliceAgent = new Agent(aliceAgentOptions) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() - await aliceAgent.modules.anoncreds.createLinkSecret() + //await aliceAgent.modules.anoncreds.createLinkSecret() const { credentialDefinitionId } = await storePreCreatedAnonCredsDefinition( faberAgent, @@ -133,14 +144,14 @@ describe('out of band', () => { }) afterEach(async () => { - const credentials = await aliceAgent.credentials.getAll() + const credentials = await aliceAgent.modules.credentials.getAll() for (const credential of credentials) { - await aliceAgent.credentials.deleteById(credential.id) + await aliceAgent.modules.credentials.deleteById(credential.id) } - const connections = await faberAgent.connections.getAll() + const connections = await faberAgent.modules.connections.getAll() for (const connection of connections) { - await faberAgent.connections.deleteById(connection.id) + await faberAgent.modules.connections.deleteById(connection.id) } jest.resetAllMocks() @@ -148,14 +159,16 @@ describe('out of band', () => { describe('createInvitation', () => { test('throw error when there is no handshake or message', async () => { - await expect(faberAgent.oob.createInvitation({ label: 'test-connection', handshake: false })).rejects.toEqual( + await expect( + faberAgent.modules.oob.createInvitation({ label: 'test-connection', handshake: false }) + ).rejects.toEqual( new CredoError('One or both of handshake_protocols and requests~attach MUST be included in the message.') ) }) test('throw error when multiUseInvitation is true and messages are provided', async () => { await expect( - faberAgent.oob.createInvitation({ + faberAgent.modules.oob.createInvitation({ label: 'test-connection', messages: [{} as AgentMessage], multiUseInvitation: true, @@ -165,7 +178,7 @@ describe('out of band', () => { test('handles empty messages array as no messages being passed', async () => { await expect( - faberAgent.oob.createInvitation({ + faberAgent.modules.oob.createInvitation({ messages: [], handshake: false, }) @@ -175,7 +188,7 @@ describe('out of band', () => { }) test('create OOB record', async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) // expect contains services expect(outOfBandRecord.autoAcceptConnection).toBe(true) @@ -190,7 +203,7 @@ describe('out of band', () => { }) test('create OOB message only with handshake', async () => { - const { outOfBandInvitation } = await faberAgent.oob.createInvitation(makeConnectionConfig) + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) // expect supported handshake protocols expect(outOfBandInvitation.handshakeProtocols).toContain('https://didcomm.org/didexchange/1.1') @@ -209,8 +222,8 @@ describe('out of band', () => { }) test('create OOB message only with requests', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const { outOfBandInvitation } = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation({ label: 'test-connection', handshake: false, messages: [message], @@ -233,8 +246,8 @@ describe('out of band', () => { }) test('create OOB message with both handshake and requests', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const { outOfBandInvitation } = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation({ label: 'test-connection', handshakeProtocols: [HandshakeProtocol.Connections], messages: [message], @@ -260,7 +273,7 @@ describe('out of band', () => { const eventListener = jest.fn() faberAgent.events.on(OutOfBandEventTypes.OutOfBandStateChanged, eventListener) - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ label: 'test-connection', handshake: true, }) @@ -282,16 +295,14 @@ describe('out of band', () => { describe('receiveInvitation', () => { test('receive OOB connection invitation', async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) const { outOfBandInvitation } = outOfBandRecord - const { outOfBandRecord: receivedOutOfBandRecord, connectionRecord } = await aliceAgent.oob.receiveInvitation( - outOfBandInvitation, - { + const { outOfBandRecord: receivedOutOfBandRecord, connectionRecord } = + await aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation, { autoAcceptInvitation: false, autoAcceptConnection: false, - } - ) + }) expect(connectionRecord).not.toBeDefined() expect(receivedOutOfBandRecord.role).toBe(OutOfBandRole.Receiver) @@ -300,20 +311,20 @@ describe('out of band', () => { }) test(`make a connection with ${HandshakeProtocol.DidExchange} on OOB invitation encoded in URL`, async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) const { outOfBandInvitation } = outOfBandRecord const urlMessage = outOfBandInvitation.toUrl({ domain: 'http://example.com' }) // eslint-disable-next-line prefer-const let { outOfBandRecord: receivedOutOfBandRecord, connectionRecord: aliceFaberConnection } = - await aliceAgent.oob.receiveInvitationFromUrl(urlMessage) + await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage) expect(receivedOutOfBandRecord.state).toBe(OutOfBandState.PrepareResponse) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord!.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord!.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection?.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection!) @@ -323,20 +334,20 @@ describe('out of band', () => { }) test(`make a connection with ${HandshakeProtocol.Connections} based on OOB invitation encoded in URL`, async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ ...makeConnectionConfig, handshakeProtocols: [HandshakeProtocol.Connections], }) const { outOfBandInvitation } = outOfBandRecord const urlMessage = outOfBandInvitation.toUrl({ domain: 'http://example.com' }) - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(urlMessage) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord!.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord!.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) @@ -345,14 +356,14 @@ describe('out of band', () => { }) test('make a connection based on old connection invitation encoded in URL', async () => { - const { outOfBandRecord, invitation } = await faberAgent.oob.createLegacyInvitation(makeConnectionConfig) + const { outOfBandRecord, invitation } = await faberAgent.modules.oob.createLegacyInvitation(makeConnectionConfig) const urlMessage = invitation.toUrl({ domain: 'http://example.com' }) - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitationFromUrl(urlMessage) + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) @@ -362,7 +373,7 @@ describe('out of band', () => { }) test('make a connection based on old connection invitation with multiple endpoints uses first endpoint for invitation', async () => { - const { invitation } = await faberAgent.oob.createLegacyInvitation({ + const { invitation } = await faberAgent.modules.oob.createLegacyInvitation({ ...makeConnectionConfig, routing: { endpoints: ['https://endpoint-1.com', 'https://endpoint-2.com'], @@ -375,8 +386,9 @@ describe('out of band', () => { }) test('process credential offer requests based on OOB message', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const { outOfBandInvitation } = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation({ ...issueCredentialConfig, messages: [message], }) @@ -387,20 +399,20 @@ describe('out of band', () => { state: CredentialState.OfferReceived, threadId: message.threadId, }) - await aliceAgent.oob.receiveInvitationFromUrl(urlMessage, receiveInvitationConfig) + await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage, receiveInvitationConfig) const aliceCredentialRecord = await aliceCredentialRecordPromise expect(aliceCredentialRecord.state).toBe(CredentialState.OfferReceived) }) test('process credential offer requests with legacy did:sov prefix on message type based on OOB message', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) // we need to override the message type to use the legacy did:sov prefix // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore message.type = message.type.replace('https://didcomm.org', 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec') - const { outOfBandInvitation } = await faberAgent.oob.createInvitation({ + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation({ ...issueCredentialConfig, messages: [message], }) @@ -411,7 +423,7 @@ describe('out of band', () => { state: CredentialState.OfferReceived, threadId: message.threadId, }) - await aliceAgent.oob.receiveInvitationFromUrl(urlMessage, receiveInvitationConfig) + await aliceAgent.modules.oob.receiveInvitationFromUrl(urlMessage, receiveInvitationConfig) const aliceCredentialRecord = await aliceCredentialRecordPromise expect(aliceCredentialRecord.state).toBe(CredentialState.OfferReceived) @@ -421,14 +433,14 @@ describe('out of band', () => { const eventListener = jest.fn() aliceAgent.events.on(AgentEventTypes.AgentMessageReceived, eventListener) - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const { outOfBandInvitation } = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation({ ...makeConnectionConfig, messages: [message], }) // First, we crate a connection but we won't accept it, therefore it won't be ready - await aliceAgent.oob.receiveInvitation(outOfBandInvitation, { autoAcceptConnection: false }) + await aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation, { autoAcceptConnection: false }) // Event should not be emitted because an agent must wait until the connection is ready expect(eventListener).toHaveBeenCalledTimes(0) @@ -437,15 +449,15 @@ describe('out of band', () => { }) test('make a connection based on OOB invitation and process requests after the acceptation', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ ...makeConnectionConfig, messages: [message], }) const { outOfBandInvitation } = outOfBandRecord // First, we crate a connection but we won't accept it, therefore it won't be ready - const { outOfBandRecord: aliceFaberOutOfBandRecord } = await aliceAgent.oob.receiveInvitation( + const { outOfBandRecord: aliceFaberOutOfBandRecord } = await aliceAgent.modules.oob.receiveInvitation( outOfBandInvitation, { autoAcceptInvitation: false, @@ -461,7 +473,7 @@ describe('out of band', () => { }) // Accept connection invitation - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.acceptInvitation( + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.acceptInvitation( aliceFaberOutOfBandRecord.id, { label: 'alice', @@ -470,10 +482,10 @@ describe('out of band', () => { ) // Wait until connection is ready - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord!.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord!.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection).toBeConnectedWith(aliceFaberConnection) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) @@ -486,16 +498,18 @@ describe('out of band', () => { const faberReuseListener = jest.fn() // Create first connection - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) - let { connectionRecord: firstAliceFaberConnection } = await aliceAgent.oob.receiveInvitation( + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) + let { connectionRecord: firstAliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitation( outOfBandRecord.outOfBandInvitation ) - firstAliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(firstAliceFaberConnection!.id) + firstAliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected( + firstAliceFaberConnection!.id + ) - const [firstFaberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) + const [firstFaberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) // Create second connection - const outOfBandRecord2 = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord2 = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) // Take over the recipientKeys from the first invitation so they match when encoded const [firstInvitationService] = outOfBandRecord.outOfBandInvitation.getInlineServices() @@ -508,14 +522,16 @@ describe('out of band', () => { const { connectionRecord: secondAliceFaberConnection, outOfBandRecord: { id: secondOobRecordId }, - } = await aliceAgent.oob.receiveInvitation(outOfBandRecord2.outOfBandInvitation, { reuseConnection: true }) + } = await aliceAgent.modules.oob.receiveInvitation(outOfBandRecord2.outOfBandInvitation, { + reuseConnection: true, + }) aliceAgent.events.off(OutOfBandEventTypes.HandshakeReused, aliceReuseListener) faberAgent.events.off(OutOfBandEventTypes.HandshakeReused, faberReuseListener) - await aliceAgent.connections.returnWhenIsConnected(secondAliceFaberConnection!.id) + await aliceAgent.modules.connections.returnWhenIsConnected(secondAliceFaberConnection!.id) // There shouldn't be any connection records for this oob id, as we reused an existing one - expect((await faberAgent.connections.findAllByOutOfBandId(secondOobRecordId)).length).toBe(0) + expect((await faberAgent.modules.connections.findAllByOutOfBandId(secondOobRecordId)).length).toBe(0) expect(firstAliceFaberConnection.id).toEqual(secondAliceFaberConnection?.id) @@ -557,35 +573,41 @@ describe('out of band', () => { const reuseListener = jest.fn() // Create first connection - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) - let { connectionRecord: firstAliceFaberConnection } = await aliceAgent.oob.receiveInvitation( + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) + let { connectionRecord: firstAliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitation( outOfBandRecord.outOfBandInvitation ) - firstAliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(firstAliceFaberConnection!.id) + firstAliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected( + firstAliceFaberConnection!.id + ) // Create second connection - const outOfBandRecord2 = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord2 = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) aliceAgent.events.on(OutOfBandEventTypes.HandshakeReused, reuseListener) faberAgent.events.on(OutOfBandEventTypes.HandshakeReused, reuseListener) - const { connectionRecord: secondAliceFaberConnection } = await aliceAgent.oob.receiveInvitation( + const { connectionRecord: secondAliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitation( outOfBandRecord2.outOfBandInvitation, { reuseConnection: false } ) aliceAgent.events.off(OutOfBandEventTypes.HandshakeReused, reuseListener) faberAgent.events.off(OutOfBandEventTypes.HandshakeReused, reuseListener) - await aliceAgent.connections.returnWhenIsConnected(secondAliceFaberConnection!.id) + await aliceAgent.modules.connections.returnWhenIsConnected(secondAliceFaberConnection!.id) // If we're not reusing the connection, the reuse listener shouldn't be called expect(reuseListener).not.toHaveBeenCalled() expect(firstAliceFaberConnection.id).not.toEqual(secondAliceFaberConnection?.id) - const faberConnections = await faberAgent.connections.getAll() + const faberConnections = await faberAgent.modules.connections.getAll() let [firstFaberAliceConnection, secondFaberAliceConnection] = faberConnections - firstFaberAliceConnection = await faberAgent.connections.returnWhenIsConnected(firstFaberAliceConnection.id) - secondFaberAliceConnection = await faberAgent.connections.returnWhenIsConnected(secondFaberAliceConnection.id) + firstFaberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected( + firstFaberAliceConnection.id + ) + secondFaberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected( + secondFaberAliceConnection.id + ) // expect the two connections contain the two out of band ids expect(faberConnections.map((c) => c.outOfBandId)).toEqual( @@ -598,19 +620,21 @@ describe('out of band', () => { }) test('throws an error when the invitation has already been received', async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation(makeConnectionConfig) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) const { outOfBandInvitation } = outOfBandRecord - const { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitation(outOfBandInvitation) + const { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitation( + outOfBandInvitation + ) // Wait until connection is ready - await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) - const [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + const [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) // Try to receive the invitation again - await expect(aliceAgent.oob.receiveInvitation(outOfBandInvitation)).rejects.toThrow( + await expect(aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation)).rejects.toThrow( new CredoError( `An out of band record with invitation ${outOfBandInvitation.id} has already been received. Invitations should have a unique id.` ) @@ -619,21 +643,24 @@ describe('out of band', () => { test('emits OutOfBandStateChanged event', async () => { const eventListener = jest.fn() - const { outOfBandInvitation, id } = await faberAgent.oob.createInvitation(makeConnectionConfig) + const { outOfBandInvitation, id } = await faberAgent.modules.oob.createInvitation(makeConnectionConfig) aliceAgent.events.on(OutOfBandEventTypes.OutOfBandStateChanged, eventListener) - const { outOfBandRecord, connectionRecord } = await aliceAgent.oob.receiveInvitation(outOfBandInvitation, { - autoAcceptConnection: true, - autoAcceptInvitation: true, - }) + const { outOfBandRecord, connectionRecord } = await aliceAgent.modules.oob.receiveInvitation( + outOfBandInvitation, + { + autoAcceptConnection: true, + autoAcceptInvitation: true, + } + ) // Wait for the connection to complete so we don't get wallet closed errors - await aliceAgent.connections.returnWhenIsConnected(connectionRecord!.id) + await aliceAgent.modules.connections.returnWhenIsConnected(connectionRecord!.id) aliceAgent.events.off(OutOfBandEventTypes.OutOfBandStateChanged, eventListener) - const [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(id) - await faberAgent.connections.returnWhenIsConnected(faberAliceConnection.id) + const [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(id) + await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection.id) // Receiving the invitation expect(eventListener).toHaveBeenNthCalledWith(1, { @@ -661,23 +688,27 @@ describe('out of band', () => { }) test.skip('do not create a new connection when connection exists and multiuse is false', async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ ...makeConnectionConfig, multiUseInvitation: false, }) const { outOfBandInvitation } = outOfBandRecord - let { connectionRecord: firstAliceFaberConnection } = await aliceAgent.oob.receiveInvitation(outOfBandInvitation) - firstAliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(firstAliceFaberConnection!.id) + let { connectionRecord: firstAliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitation( + outOfBandInvitation + ) + firstAliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected( + firstAliceFaberConnection!.id + ) - await aliceAgent.oob.receiveInvitation(outOfBandInvitation) + await aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation) // TODO Somehow check agents throws an error or sends problem report - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord!.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord!.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) - const faberConnections = await faberAgent.connections.getAll() + const faberConnections = await faberAgent.modules.connections.getAll() expect(faberConnections).toHaveLength(1) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) expect(firstAliceFaberConnection.state).toBe(DidExchangeState.Completed) @@ -688,7 +719,9 @@ describe('out of band', () => { const unsupportedProtocol = 'https://didcomm.org/unsupported-connections-protocol/1.0' outOfBandInvitation.handshakeProtocols = [unsupportedProtocol as HandshakeProtocol] - await expect(aliceAgent.oob.receiveInvitation(outOfBandInvitation, receiveInvitationConfig)).rejects.toEqual( + await expect( + aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation, receiveInvitationConfig) + ).rejects.toEqual( new CredoError( `Handshake protocols [${unsupportedProtocol}] are not supported. Supported protocols are [https://didcomm.org/didexchange/1.x,https://didcomm.org/connections/1.x]` ) @@ -698,7 +731,9 @@ describe('out of band', () => { test('throw an error when the OOB message does not contain either handshake or requests', async () => { const outOfBandInvitation = new OutOfBandInvitation({ label: 'test-connection', services: [] }) - await expect(aliceAgent.oob.receiveInvitation(outOfBandInvitation, receiveInvitationConfig)).rejects.toEqual( + await expect( + aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation, receiveInvitationConfig) + ).rejects.toEqual( new CredoError('One or both of handshake_protocols and requests~attach MUST be included in the message.') ) }) @@ -706,57 +741,57 @@ describe('out of band', () => { test('throw an error when the OOB message contains unsupported message request', async () => { const testMessage = new TestMessage() testMessage.type = 'https://didcomm.org/test-protocol/1.0/test-message' - const { outOfBandInvitation } = await faberAgent.oob.createInvitation({ + const { outOfBandInvitation } = await faberAgent.modules.oob.createInvitation({ ...issueCredentialConfig, messages: [testMessage], }) - await expect(aliceAgent.oob.receiveInvitation(outOfBandInvitation, receiveInvitationConfig)).rejects.toEqual( - new CredoError('There is no message in requests~attach supported by agent.') - ) + await expect( + aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation, receiveInvitationConfig) + ).rejects.toEqual(new CredoError('There is no message in requests~attach supported by agent.')) }) test(`make two connections with ${HandshakeProtocol.DidExchange} by reusing the did from the first connection as the 'invitationDid' in oob invitation for the second connection`, async () => { - const outOfBandRecord1 = await faberAgent.oob.createInvitation({}) + const outOfBandRecord1 = await faberAgent.modules.oob.createInvitation({}) - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveInvitation( + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveInvitation( outOfBandRecord1.outOfBandInvitation ) - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) - let [faberAliceConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord1!.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + let [faberAliceConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord1!.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection?.state).toBe(DidExchangeState.Completed) // Use the invitation did from the first connection to create the second connection - const outOfBandRecord2 = await faberAgent.oob.createInvitation({ + const outOfBandRecord2 = await faberAgent.modules.oob.createInvitation({ invitationDid: outOfBandRecord1.outOfBandInvitation.invitationDids[0], }) - let { connectionRecord: aliceFaberConnection2 } = await aliceAgent.oob.receiveInvitation( + let { connectionRecord: aliceFaberConnection2 } = await aliceAgent.modules.oob.receiveInvitation( outOfBandRecord2.outOfBandInvitation ) - aliceFaberConnection2 = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection2!.id) + aliceFaberConnection2 = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection2!.id) expect(aliceFaberConnection2.state).toBe(DidExchangeState.Completed) - let [faberAliceConnection2] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord2!.id) - faberAliceConnection2 = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection2!.id) + let [faberAliceConnection2] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord2!.id) + faberAliceConnection2 = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection2!.id) expect(faberAliceConnection2?.state).toBe(DidExchangeState.Completed) }) }) describe('messages and connection exchange', () => { test('oob exchange with handshake where response is received to invitation', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshake: true, messages: [message], }) const { outOfBandInvitation } = outOfBandRecord - await aliceAgent.oob.receiveInvitation(outOfBandInvitation) + await aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation) const aliceCredentialRecordPromise = waitForCredentialRecord(aliceAgent, { state: CredentialState.OfferReceived, @@ -774,7 +809,7 @@ describe('out of band', () => { timeoutMs: 10000, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -782,25 +817,27 @@ describe('out of band', () => { }) test('oob exchange with reuse where response is received to invitation', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) - const routing = await faberAgent.mediationRecipient.getRouting({}) - const connectionOutOfBandRecord = await faberAgent.oob.createInvitation({ + const routing = await faberAgent.modules.mediationRecipient.getRouting({}) + const connectionOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ routing, }) // Create connection - const { connectionRecord } = await aliceAgent.oob.receiveInvitation(connectionOutOfBandRecord.outOfBandInvitation) + const { connectionRecord } = await aliceAgent.modules.oob.receiveInvitation( + connectionOutOfBandRecord.outOfBandInvitation + ) if (!connectionRecord) throw new Error('Connection record is undefined') - await aliceAgent.connections.returnWhenIsConnected(connectionRecord.id) + await aliceAgent.modules.connections.returnWhenIsConnected(connectionRecord.id) // Create offer and reuse - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ routing, messages: [message], }) // Create connection - const { connectionRecord: offerConnectionRecord } = await aliceAgent.oob.receiveInvitation( + const { connectionRecord: offerConnectionRecord } = await aliceAgent.modules.oob.receiveInvitation( outOfBandRecord.outOfBandInvitation, { reuseConnection: true, @@ -827,7 +864,7 @@ describe('out of band', () => { timeoutMs: 10000, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -837,14 +874,14 @@ describe('out of band', () => { describe('connection-less exchange', () => { test('oob exchange without handshake where response is received to invitation', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshake: false, messages: [message], }) const { outOfBandInvitation } = outOfBandRecord - await aliceAgent.oob.receiveInvitation(outOfBandInvitation) + await aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation) const aliceCredentialRecordPromise = waitForCredentialRecord(aliceAgent, { state: CredentialState.OfferReceived, @@ -862,7 +899,7 @@ describe('out of band', () => { timeoutMs: 10000, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -870,16 +907,16 @@ describe('out of band', () => { }) test('oob exchange without handshake where response is received and custom routing is used on recipient', async () => { - const { message } = await faberAgent.credentials.createOffer(credentialTemplate) - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const { message } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshake: false, messages: [message], }) const { outOfBandInvitation } = outOfBandRecord - const routing = await aliceAgent.mediationRecipient.getRouting({}) + const routing = await aliceAgent.modules.mediationRecipient.getRouting({}) - await aliceAgent.oob.receiveInvitation(outOfBandInvitation, { + await aliceAgent.modules.oob.receiveInvitation(outOfBandInvitation, { routing, }) @@ -899,13 +936,13 @@ describe('out of band', () => { timeoutMs: 10000, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) const faberCredentialRecord = await faberCredentialRecordPromise - const faberCredentialRequest = await faberAgent.credentials.findRequestMessage(faberCredentialRecord.id) + const faberCredentialRequest = await faberAgent.modules.credentials.findRequestMessage(faberCredentialRecord.id) expect(JsonTransformer.toJSON(faberCredentialRequest?.service)).toEqual({ recipientKeys: [routing.recipientKey.publicKeyBase58], @@ -915,8 +952,8 @@ describe('out of band', () => { }) test('legacy connectionless exchange where response is received to invitation', async () => { - const { message, credentialRecord } = await faberAgent.credentials.createOffer(credentialTemplate) - const { invitationUrl } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message, credentialRecord } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const { invitationUrl } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ domain: 'http://example.com', message, recordId: credentialRecord.id, @@ -927,7 +964,7 @@ describe('out of band', () => { threadId: message.threadId, timeoutMs: 10000, }) - await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl) + await aliceAgent.modules.oob.receiveInvitationFromUrl(invitationUrl) const aliceCredentialRecord = await aliceCredentialRecordPromise expect(aliceCredentialRecord.state).toBe(CredentialState.OfferReceived) @@ -939,7 +976,7 @@ describe('out of band', () => { timeoutMs: 10000, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -947,21 +984,21 @@ describe('out of band', () => { }) test('legacy connectionless exchange where response is received to invitation and custom routing is used on recipient', async () => { - const { message, credentialRecord } = await faberAgent.credentials.createOffer(credentialTemplate) - const { invitationUrl } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message, credentialRecord } = await faberAgent.modules.credentials.createOffer(credentialTemplate) + const { invitationUrl } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ domain: 'http://example.com', message, recordId: credentialRecord.id, }) - const routing = await aliceAgent.mediationRecipient.getRouting({}) + const routing = await aliceAgent.modules.mediationRecipient.getRouting({}) const aliceCredentialRecordPromise = waitForCredentialRecord(aliceAgent, { state: CredentialState.OfferReceived, threadId: message.threadId, timeoutMs: 10000, }) - await aliceAgent.oob.receiveInvitationFromUrl(invitationUrl, { routing }) + await aliceAgent.modules.oob.receiveInvitationFromUrl(invitationUrl, { routing }) const aliceCredentialRecord = await aliceCredentialRecordPromise expect(aliceCredentialRecord.state).toBe(CredentialState.OfferReceived) @@ -973,13 +1010,13 @@ describe('out of band', () => { timeoutMs: 10000, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) const faberCredentialRecord = await faberCredentialRecordPromise - const faberCredentialRequest = await faberAgent.credentials.findRequestMessage(faberCredentialRecord.id) + const faberCredentialRequest = await faberAgent.modules.credentials.findRequestMessage(faberCredentialRecord.id) expect(JsonTransformer.toJSON(faberCredentialRequest?.service)).toEqual({ recipientKeys: [routing.recipientKey.publicKeyBase58], @@ -988,46 +1025,15 @@ describe('out of band', () => { }) }) - test('legacy connectionless exchange without receiving message through oob receiveInvitation, where response is received to invitation', async () => { - const { message, credentialRecord } = await faberAgent.credentials.createOffer(credentialTemplate) - const { message: messageWithService } = await faberAgent.oob.createLegacyConnectionlessInvitation({ - domain: 'http://example.com', - message, - recordId: credentialRecord.id, - }) - - const aliceCredentialRecordPromise = waitForCredentialRecord(aliceAgent, { - state: CredentialState.OfferReceived, - threadId: message.threadId, - timeoutMs: 10000, - }) - await aliceAgent.receiveMessage(messageWithService.toJSON()) - - const aliceCredentialRecord = await aliceCredentialRecordPromise - expect(aliceCredentialRecord.state).toBe(CredentialState.OfferReceived) - - // If we receive the event, we know the processing went well - const faberCredentialRecordPromise = waitForCredentialRecord(faberAgent, { - state: CredentialState.RequestReceived, - threadId: message.threadId, - timeoutMs: 10000, - }) - - await aliceAgent.credentials.acceptOffer({ - credentialRecordId: aliceCredentialRecord.id, - }) - - await faberCredentialRecordPromise - }) - test('add ~service decorator to the message and returns invitation url in createLegacyConnectionlessInvitation', async () => { - const { message, credentialRecord } = await faberAgent.credentials.createOffer(credentialTemplate) + const { message, credentialRecord } = await faberAgent.modules.credentials.createOffer(credentialTemplate) - const { message: offerMessage, invitationUrl } = await faberAgent.oob.createLegacyConnectionlessInvitation({ - recordId: credentialRecord.id, - domain: 'https://test.com', - message, - }) + const { message: offerMessage, invitationUrl } = + await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ + recordId: credentialRecord.id, + domain: 'https://test.com', + message, + }) expect(offerMessage.service).toMatchObject({ serviceEndpoint: expect.any(String), diff --git a/packages/core/tests/proofs-sub-protocol.e2e.test.ts b/packages/core/tests/proofs-sub-protocol.e2e.test.ts index 244eacd496..2342992b84 100644 --- a/packages/core/tests/proofs-sub-protocol.e2e.test.ts +++ b/packages/core/tests/proofs-sub-protocol.e2e.test.ts @@ -2,7 +2,7 @@ import type { EventReplaySubject } from './events' import type { AnonCredsTestsAgent } from '../../anoncreds/tests/legacyAnonCredsSetup' import { issueLegacyAnonCredsCredential, setupAnonCredsTests } from '../../anoncreds/tests/legacyAnonCredsSetup' -import { ProofState } from '../src/modules/proofs/models/ProofState' +import { ProofState } from '../../didcomm/src/modules/proofs' import { uuid } from '../src/utils/uuid' import { waitForProofExchangeRecord } from './helpers' @@ -74,7 +74,7 @@ describe('Present Proof Subprotocol', () => { state: ProofState.ProposalReceived, }) - const aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + const aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v1', parentThreadId, @@ -102,7 +102,7 @@ describe('Present Proof Subprotocol', () => { }) expect(aliceProofExchangeRecord.parentThreadId).toBe(parentThreadId) - const proofsByParentThread = await aliceAgent.proofs.getByParentThreadAndConnectionId(parentThreadId) + const proofsByParentThread = await aliceAgent.modules.proofs.getByParentThreadAndConnectionId(parentThreadId) expect(proofsByParentThread.length).toEqual(1) expect(proofsByParentThread[0].parentThreadId).toBe(parentThreadId) @@ -113,7 +113,7 @@ describe('Present Proof Subprotocol', () => { // Faber accepts the presentation proposal from Alice testLogger.test('Faber accepts the presentation proposal from Alice') - await faberAgent.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id }) testLogger.test('Alice waits till it receives presentation ack') await waitForProofExchangeRecord(aliceAgent, { @@ -124,10 +124,10 @@ describe('Present Proof Subprotocol', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: requestedCredentials.proofFormats, }) @@ -141,7 +141,7 @@ describe('Present Proof Subprotocol', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') @@ -163,7 +163,7 @@ describe('Present Proof Subprotocol', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - const faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + const faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ connectionId: faberConnectionId, parentThreadId, protocolVersion: 'v1', @@ -198,7 +198,7 @@ describe('Present Proof Subprotocol', () => { }) expect(faberProofExchangeRecord.parentThreadId).toBe(parentThreadId) - const proofsByParentThread = await faberAgent.proofs.getByParentThreadAndConnectionId(parentThreadId) + const proofsByParentThread = await faberAgent.modules.proofs.getByParentThreadAndConnectionId(parentThreadId) expect(proofsByParentThread.length).toEqual(1) expect(proofsByParentThread[0].parentThreadId).toBe(parentThreadId) @@ -210,10 +210,10 @@ describe('Present Proof Subprotocol', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: requestedCredentials.proofFormats, }) @@ -228,7 +228,7 @@ describe('Present Proof Subprotocol', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') @@ -250,7 +250,7 @@ describe('Present Proof Subprotocol', () => { state: ProofState.ProposalReceived, }) - const aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + const aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', parentThreadId, @@ -278,7 +278,7 @@ describe('Present Proof Subprotocol', () => { }) expect(aliceProofExchangeRecord.parentThreadId).toBe(parentThreadId) - const proofsByParentThread = await aliceAgent.proofs.getByParentThreadAndConnectionId(parentThreadId) + const proofsByParentThread = await aliceAgent.modules.proofs.getByParentThreadAndConnectionId(parentThreadId) expect(proofsByParentThread.length).toEqual(1) expect(proofsByParentThread[0].parentThreadId).toBe(parentThreadId) @@ -289,7 +289,7 @@ describe('Present Proof Subprotocol', () => { // Faber accepts the presentation proposal from Alice testLogger.test('Faber accepts the presentation proposal from Alice') - await faberAgent.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id }) testLogger.test('Alice waits till it receives presentation ack') await waitForProofExchangeRecord(aliceAgent, { @@ -300,10 +300,10 @@ describe('Present Proof Subprotocol', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: requestedCredentials.proofFormats, }) @@ -317,7 +317,7 @@ describe('Present Proof Subprotocol', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') @@ -339,7 +339,7 @@ describe('Present Proof Subprotocol', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - const faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + const faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ connectionId: faberConnectionId, parentThreadId, protocolVersion: 'v2', @@ -374,7 +374,7 @@ describe('Present Proof Subprotocol', () => { }) expect(faberProofExchangeRecord.parentThreadId).toBe(parentThreadId) - const proofsByParentThread = await faberAgent.proofs.getByParentThreadAndConnectionId(parentThreadId) + const proofsByParentThread = await faberAgent.modules.proofs.getByParentThreadAndConnectionId(parentThreadId) expect(proofsByParentThread.length).toEqual(1) expect(proofsByParentThread[0].parentThreadId).toBe(parentThreadId) @@ -386,10 +386,10 @@ describe('Present Proof Subprotocol', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: requestedCredentials.proofFormats, }) @@ -404,7 +404,7 @@ describe('Present Proof Subprotocol', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') diff --git a/packages/core/tests/setup.ts b/packages/core/tests/setup.ts index a2ba1429d2..cd6ef08ee3 100644 --- a/packages/core/tests/setup.ts +++ b/packages/core/tests/setup.ts @@ -1,6 +1,6 @@ import 'reflect-metadata' -import type { ConnectionRecord } from '../src/modules/connections/repository/ConnectionRecord' +import type { ConnectionRecord } from '../../didcomm/src' jest.setTimeout(120000) expect.extend({ toBeConnectedWith }) diff --git a/packages/core/tests/transport.ts b/packages/core/tests/transport.ts index 2577fdd428..8aa4dd4b49 100644 --- a/packages/core/tests/transport.ts +++ b/packages/core/tests/transport.ts @@ -11,8 +11,8 @@ export function setupSubjectTransports(agents: Agent[]) { for (const agent of agents) { const messages = new Subject() - subjectMap[agent.config.endpoints[0]] = messages - agent.registerInboundTransport(new SubjectInboundTransport(messages)) - agent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + subjectMap[agent.modules.didcomm.config.endpoints[0]] = messages + agent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(messages)) + agent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) } } diff --git a/packages/core/types/jest.d.ts b/packages/core/types/jest.d.ts index 4f68767c96..747396c9a8 100644 --- a/packages/core/types/jest.d.ts +++ b/packages/core/types/jest.d.ts @@ -1,4 +1,5 @@ -import type { ConnectionRecord } from '../src/modules/connections/repository/ConnectionRecord' +// eslint-disable-next-line workspaces/require-dependency, workspaces/no-relative-imports +import type { ConnectionRecord } from '../../didcomm/src' declare global { namespace jest { diff --git a/packages/didcomm/README.md b/packages/didcomm/README.md new file mode 100644 index 0000000000..9af5a1d9d0 --- /dev/null +++ b/packages/didcomm/README.md @@ -0,0 +1,84 @@ +

+
+ Credo Logo +

+

Credo DIDComm Module

+

+ License + typescript + @credo-ts/action-menu version + +

+
+ +Base DIDComm package for [Credo](https://github.com/openwallet-foundation/credo-ts.git). Adds all [DIDComm v1](https://hyperledger.github.io/aries-rfcs/latest/concepts/0005-didcomm/) Core protocols, such as Connections, Out-of-Band, Discover Features, Mediation Coordination, Message Pickup, Proofs and Credentials as defined in [Aries RFCs](https://github.com/hyperledger/aries-rfcs/tree/main/features). + +### Quick start + +In order for this module to work, we have to inject it into the agent to access agent functionality. See the example for more information. + +> **Note**: At the moment, for a basic DIDComm agent to work, it is required to instantiate at least 3 modules besides the basic `DidCommModule`: `OutOfBandModule`, `ConnectionsModule` and `MessagePickupModule` + +### Example of usage + +```ts +import type { DidCommModuleConfigOptions } from '@credo-ts/didcomm' + +import { agentDependencies, HttpInboundTransport } from '@credo-ts/node' +import { + ConnectionsModule, + ProofsModule, + CredentialsModule, + HttpOutboundTransport, + getDefaultDidcommModules, +} from '@credo-ts/didcomm' + +const agent = new Agent({ + config: { + /* config */ + }, + dependencies: agentDependencies, + modules: { + ...getDefaultDidcommModules(didcommConfig), + connections: new ConnectionsModule({ + /* Custom module settings */ + }), + credentials: new CredentialsModule({ + /* Custom module settings */ + }), + proofs: new ProofsModule({ + /* Custom module settings */ + }), + /* */ + /* other custom modules */ + }, +}) + +// Register inbound and outbound transports for DIDComm +agent.modules.didcomm.registerInboundTransport(new HttpInboundTransport({ port })) +agent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) + +await agent.initialize() + +// Create an invitation +const outOfBand = await this.agent.modules.oob.createInvitation() +``` + +In this example, by using the convenient method `getDefaultDidcommModules` you can easily instantiate the basic DIDComm protocols: out-of-band, connections, message pickup, discover features, proof exchange, issue credentials, basic message and mediation coordination. You can of course instantiate only the ones you need for your particular implementation. diff --git a/packages/didcomm/jest.config.ts b/packages/didcomm/jest.config.ts new file mode 100644 index 0000000000..93c0197296 --- /dev/null +++ b/packages/didcomm/jest.config.ts @@ -0,0 +1,13 @@ +import type { Config } from '@jest/types' + +import base from '../../jest.config.base' + +import packageJson from './package.json' + +const config: Config.InitialOptions = { + ...base, + displayName: packageJson.name, + setupFilesAfterEnv: ['./tests/setup.ts'], +} + +export default config diff --git a/packages/didcomm/package.json b/packages/didcomm/package.json new file mode 100644 index 0000000000..58a97b1de6 --- /dev/null +++ b/packages/didcomm/package.json @@ -0,0 +1,44 @@ +{ + "name": "@credo-ts/didcomm", + "main": "src/index", + "types": "src/index", + "version": "0.5.13", + "files": [ + "build" + ], + "license": "Apache-2.0", + "publishConfig": { + "main": "build/index", + "types": "build/index", + "access": "public" + }, + "homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/didcomm", + "repository": { + "type": "git", + "url": "https://github.com/openwallet-foundation/credo-ts", + "directory": "packages/didcomm" + }, + "scripts": { + "build": "pnpm run clean && pnpm run compile", + "clean": "rimraf ./build", + "compile": "tsc -p tsconfig.build.json", + "prepublishOnly": "pnpm run build", + "test": "jest" + }, + "dependencies": { + "@credo-ts/core": "workspace:*", + "class-transformer": "0.5.1", + "class-validator": "0.14.1", + "luxon": "^3.5.0", + "query-string": "^7.0.1", + "rxjs": "^7.8.0" + }, + "devDependencies": { + "@animo-id/pex": "4.1.1-alpha.0", + "@sphereon/pex-models": "^2.3.1", + "@types/luxon": "^3.2.0", + "reflect-metadata": "^0.1.13", + "rimraf": "^4.4.0", + "typescript": "~5.5.2" + } +} diff --git a/packages/core/src/agent/AgentMessage.ts b/packages/didcomm/src/AgentMessage.ts similarity index 71% rename from packages/core/src/agent/AgentMessage.ts rename to packages/didcomm/src/AgentMessage.ts index fdca23daa9..cd76823ad1 100644 --- a/packages/core/src/agent/AgentMessage.ts +++ b/packages/didcomm/src/AgentMessage.ts @@ -1,20 +1,19 @@ -import type { PlaintextMessage } from '../types' -import type { ParsedMessageType } from '../utils/messageType' -import type { Constructor } from '../utils/mixins' +import type { PlaintextMessage } from './types' +import type { ParsedMessageType } from './util/messageType' +import type { Constructor } from '@credo-ts/core' +import { JsonTransformer } from '@credo-ts/core' import { Exclude } from 'class-transformer' -import { AckDecorated } from '../decorators/ack/AckDecoratorExtension' -import { AttachmentDecorated } from '../decorators/attachment/AttachmentExtension' -import { L10nDecorated } from '../decorators/l10n/L10nDecoratorExtension' -import { ServiceDecorated } from '../decorators/service/ServiceDecoratorExtension' -import { ThreadDecorated } from '../decorators/thread/ThreadDecoratorExtension' -import { TimingDecorated } from '../decorators/timing/TimingDecoratorExtension' -import { TransportDecorated } from '../decorators/transport/TransportDecoratorExtension' -import { JsonTransformer } from '../utils/JsonTransformer' -import { replaceNewDidCommPrefixWithLegacyDidSovOnMessage } from '../utils/messageType' - import { BaseMessage } from './BaseMessage' +import { AckDecorated } from './decorators/ack/AckDecoratorExtension' +import { AttachmentDecorated } from './decorators/attachment/AttachmentExtension' +import { L10nDecorated } from './decorators/l10n/L10nDecoratorExtension' +import { ServiceDecorated } from './decorators/service/ServiceDecoratorExtension' +import { ThreadDecorated } from './decorators/thread/ThreadDecoratorExtension' +import { TimingDecorated } from './decorators/timing/TimingDecoratorExtension' +import { TransportDecorated } from './decorators/transport/TransportDecoratorExtension' +import { replaceNewDidCommPrefixWithLegacyDidSovOnMessage } from './util/messageType' export type ConstructableAgentMessage = Constructor & { type: ParsedMessageType } diff --git a/packages/core/src/agent/BaseMessage.ts b/packages/didcomm/src/BaseMessage.ts similarity index 76% rename from packages/core/src/agent/BaseMessage.ts rename to packages/didcomm/src/BaseMessage.ts index 9ff18ccaf5..124eef07b2 100644 --- a/packages/core/src/agent/BaseMessage.ts +++ b/packages/didcomm/src/BaseMessage.ts @@ -1,11 +1,10 @@ -import type { ParsedMessageType } from '../utils/messageType' -import type { Constructor } from '../utils/mixins' +import type { ParsedMessageType } from './util/messageType' +import type { Constructor } from '@credo-ts/core' +import { utils } from '@credo-ts/core' import { Expose } from 'class-transformer' import { Matches } from 'class-validator' -import { uuid } from '../utils/uuid' - export const MessageIdRegExp = /[-_./a-zA-Z0-9]{8,64}/ export const MessageTypeRegExp = /(.*?)([a-zA-Z0-9._-]+)\/(\d[^/]*)\/([a-zA-Z0-9._-]+)$/ @@ -22,6 +21,6 @@ export class BaseMessage { public static readonly type: ParsedMessageType public generateId() { - return uuid() + return utils.uuid() } } diff --git a/packages/didcomm/src/DidCommApi.ts b/packages/didcomm/src/DidCommApi.ts new file mode 100644 index 0000000000..a149864ef1 --- /dev/null +++ b/packages/didcomm/src/DidCommApi.ts @@ -0,0 +1,90 @@ +import type { MessageHandler, MessageHandlerMiddleware } from './handlers' +import type { InboundTransport, OutboundTransport } from './transport' + +import { injectable } from '@credo-ts/core' + +import { DidCommModuleConfig } from './DidCommModuleConfig' +import { FeatureRegistry } from './FeatureRegistry' +import { MessageHandlerRegistry } from './MessageHandlerRegistry' +import { MessageReceiver } from './MessageReceiver' +import { MessageSender } from './MessageSender' + +@injectable() +export class DidCommApi { + public config: DidCommModuleConfig + + private featureRegistry: FeatureRegistry + private messageSender: MessageSender + private messageReceiver: MessageReceiver + private messageHandlerRegistry: MessageHandlerRegistry + + public constructor( + messageHandlerRegistry: MessageHandlerRegistry, + messageSender: MessageSender, + messageReceiver: MessageReceiver, + featureRegistry: FeatureRegistry, + config: DidCommModuleConfig + ) { + this.messageReceiver = messageReceiver + this.messageSender = messageSender + this.featureRegistry = featureRegistry + this.config = config + this.messageHandlerRegistry = messageHandlerRegistry + } + + public registerInboundTransport(inboundTransport: InboundTransport) { + this.messageReceiver.registerInboundTransport(inboundTransport) + } + + public async unregisterInboundTransport(inboundTransport: InboundTransport) { + await this.messageReceiver.unregisterInboundTransport(inboundTransport) + } + + public get inboundTransports() { + return this.messageReceiver.inboundTransports + } + + public registerOutboundTransport(outboundTransport: OutboundTransport) { + this.messageSender.registerOutboundTransport(outboundTransport) + } + + public async unregisterOutboundTransport(outboundTransport: OutboundTransport) { + await this.messageSender.unregisterOutboundTransport(outboundTransport) + } + + public get outboundTransports() { + return this.messageSender.outboundTransports + } + + /** + * Agent's feature registry + */ + public registerMessageHandlers(messageHandlers: MessageHandler[]) { + for (const messageHandler of messageHandlers) { + this.messageHandlerRegistry.registerMessageHandler(messageHandler) + } + } + + public registerMessageHandlerMiddleware(messageHandlerMiddleware: MessageHandlerMiddleware) { + this.messageHandlerRegistry.registerMessageHandlerMiddleware(messageHandlerMiddleware) + } + + public get fallbackMessageHandler() { + return this.messageHandlerRegistry.fallbackMessageHandler + } + + public get messageHandlerMiddlewares() { + return this.messageHandlerRegistry.messageHandlerMiddlewares + } + + /** + * Sets the fallback message handler, the message handler that will be called if no handler + * is registered for an incoming message type. + */ + public setFallbackMessageHandler(fallbackMessageHandler: MessageHandler['handle']) { + this.messageHandlerRegistry.setFallbackMessageHandler(fallbackMessageHandler) + } + public get features() { + return this.featureRegistry + } +} diff --git a/packages/didcomm/src/DidCommModule.ts b/packages/didcomm/src/DidCommModule.ts new file mode 100644 index 0000000000..bec9ab8c0f --- /dev/null +++ b/packages/didcomm/src/DidCommModule.ts @@ -0,0 +1,122 @@ +import type { DidCommModuleConfigOptions } from './DidCommModuleConfig' +import type { AgentMessageReceivedEvent } from './Events' +import type { AgentContext, DependencyManager, Module, Update } from '@credo-ts/core' +import type { Subject } from 'rxjs' + +import { EventEmitter, InjectionSymbols } from '@credo-ts/core' +import { mergeMap, takeUntil } from 'rxjs' + +import { DidCommApi } from './DidCommApi' +import { DidCommModuleConfig } from './DidCommModuleConfig' +import { Dispatcher } from './Dispatcher' +import { EnvelopeService } from './EnvelopeService' +import { AgentEventTypes } from './Events' +import { FeatureRegistry } from './FeatureRegistry' +import { MessageHandlerRegistry } from './MessageHandlerRegistry' +import { MessageReceiver } from './MessageReceiver' +import { MessageSender } from './MessageSender' +import { TransportService } from './TransportService' +import { DidCommMessageRepository } from './repository' +import { updateV0_1ToV0_2 } from './updates/0.1-0.2' +import { updateV0_2ToV0_3 } from './updates/0.2-0.3' +import { updateV0_4ToV0_5 } from './updates/0.4-0.5' + +export class DidCommModule implements Module { + public readonly config: DidCommModuleConfig + public readonly api = DidCommApi + + public constructor(config?: DidCommModuleConfigOptions) { + this.config = new DidCommModuleConfig(config) + } + + /** + * Registers the dependencies of the question answer module on the dependency manager. + */ + public register(dependencyManager: DependencyManager) { + // Config + dependencyManager.registerInstance(DidCommModuleConfig, this.config) + + // Registries + dependencyManager.registerSingleton(MessageHandlerRegistry) + dependencyManager.registerSingleton(FeatureRegistry) + + // Services + dependencyManager.registerSingleton(MessageSender) + dependencyManager.registerSingleton(MessageReceiver) + dependencyManager.registerSingleton(TransportService) + dependencyManager.registerSingleton(Dispatcher) + dependencyManager.registerSingleton(EnvelopeService) + + // Repositories + dependencyManager.registerSingleton(DidCommMessageRepository) + + // Features + // TODO: Constraints? + } + + public async initialize(agentContext: AgentContext): Promise { + const stop$ = agentContext.dependencyManager.resolve>(InjectionSymbols.Stop$) + const eventEmitter = agentContext.dependencyManager.resolve(EventEmitter) + const messageReceiver = agentContext.dependencyManager.resolve(MessageReceiver) + const messageSender = agentContext.dependencyManager.resolve(MessageSender) + + // Listen for new messages (either from transports or somewhere else in the framework / extensions) + // We create this before doing any other initialization, so the initialization could already receive messages + eventEmitter + .observable(AgentEventTypes.AgentMessageReceived) + .pipe( + takeUntil(stop$), + mergeMap( + (e) => + messageReceiver + .receiveMessage(e.payload.message, { + connection: e.payload.connection, + contextCorrelationId: e.payload.contextCorrelationId, + session: e.payload.session, + }) + .catch((error) => { + agentContext.config.logger.error('Failed to process message', { error }) + }), + this.config.processDidCommMessagesConcurrently ? undefined : 1 + ) + ) + .subscribe() + + for (const transport of messageReceiver.inboundTransports) { + await transport.start(agentContext) + } + + for (const transport of messageSender.outboundTransports) { + await transport.start(agentContext) + } + } + + // TODO: Shall shutdown and initialize be part of API (so Agent can be stopped/restarted without creating a new instance)? + public async shutdown(agentContext: AgentContext) { + const messageReceiver = agentContext.dependencyManager.resolve(MessageReceiver) + const messageSender = agentContext.dependencyManager.resolve(MessageSender) + + // Stop transports + const allTransports = [...messageReceiver.inboundTransports, ...messageSender.outboundTransports] + const transportPromises = allTransports.map((transport) => transport.stop()) + await Promise.all(transportPromises) + } + + public updates = [ + { + fromVersion: '0.1', + toVersion: '0.2', + doUpdate: updateV0_1ToV0_2, + }, + { + fromVersion: '0.2', + toVersion: '0.3', + doUpdate: updateV0_2ToV0_3, + }, + { + fromVersion: '0.4', + toVersion: '0.5', + doUpdate: updateV0_4ToV0_5, + }, + ] satisfies Update[] +} diff --git a/packages/didcomm/src/DidCommModuleConfig.ts b/packages/didcomm/src/DidCommModuleConfig.ts new file mode 100644 index 0000000000..c2dface42b --- /dev/null +++ b/packages/didcomm/src/DidCommModuleConfig.ts @@ -0,0 +1,68 @@ +import { DID_COMM_TRANSPORT_QUEUE } from './constants' +import { DidCommMimeType } from './types' + +/** + * MediatorModuleConfigOptions defines the interface for the options of the MediatorModuleConfig class. + * This can contain optional parameters that have default values in the config class itself. + */ +export interface DidCommModuleConfigOptions { + endpoints?: string[] + useDidSovPrefixWhereAllowed?: boolean + connectionImageUrl?: string + processDidCommMessagesConcurrently?: boolean + didCommMimeType?: string + useDidKeyInProtocols?: boolean +} + +export class DidCommModuleConfig { + private options: DidCommModuleConfigOptions + private _endpoints?: string[] + + public constructor(options?: DidCommModuleConfigOptions) { + this.options = options ?? {} + this._endpoints = options?.endpoints + } + + public get endpoints(): [string, ...string[]] { + // if endpoints is not set, return queue endpoint + // https://github.com/hyperledger/aries-rfcs/issues/405#issuecomment-582612875 + if (!this._endpoints || this._endpoints.length === 0) { + return [DID_COMM_TRANSPORT_QUEUE] + } + + return this._endpoints as [string, ...string[]] + } + + public set endpoints(endpoints: string[]) { + this._endpoints = endpoints + } + + public get useDidSovPrefixWhereAllowed() { + return this.options.useDidSovPrefixWhereAllowed ?? false + } + + /** + * @todo move to context configuration + */ + public get connectionImageUrl() { + return this.options.connectionImageUrl + } + + public get processDidCommMessagesConcurrently() { + return this.options.processDidCommMessagesConcurrently ?? false + } + + public get didCommMimeType() { + return this.options.didCommMimeType ?? DidCommMimeType.V1 + } + + /** + * Encode keys in did:key format instead of 'naked' keys, as stated in Aries RFC 0360. + * + * This setting will not be taken into account if the other party has previously used naked keys + * in a given protocol (i.e. it does not support Aries RFC 0360). + */ + public get useDidKeyInProtocols() { + return this.options.useDidKeyInProtocols ?? true + } +} diff --git a/packages/core/src/agent/Dispatcher.ts b/packages/didcomm/src/Dispatcher.ts similarity index 83% rename from packages/core/src/agent/Dispatcher.ts rename to packages/didcomm/src/Dispatcher.ts index 1d4b5ef91f..392e1acf09 100644 --- a/packages/core/src/agent/Dispatcher.ts +++ b/packages/didcomm/src/Dispatcher.ts @@ -1,22 +1,19 @@ import type { AgentMessage } from './AgentMessage' import type { AgentMessageProcessedEvent } from './Events' -import type { MessageHandlerMiddleware } from './MessageHandlerMiddleware' +import type { MessageHandlerMiddleware } from './handlers/MessageHandlerMiddleware' import type { InboundMessageContext } from './models/InboundMessageContext' -import { InjectionSymbols } from '../constants' -import { CredoError } from '../error' -import { Logger } from '../logger' -import { ProblemReportError, ProblemReportReason } from '../modules/problem-reports' -import { injectable, inject } from '../plugins' -import { canHandleMessageType, parseMessageType } from '../utils/messageType' +import { CredoError, EventEmitter, injectable, inject, InjectionSymbols, Logger } from '@credo-ts/core' -import { ProblemReportMessage } from './../modules/problem-reports/messages/ProblemReportMessage' -import { EventEmitter } from './EventEmitter' import { AgentEventTypes } from './Events' -import { MessageHandlerMiddlewareRunner } from './MessageHandlerMiddleware' import { MessageHandlerRegistry } from './MessageHandlerRegistry' import { MessageSender } from './MessageSender' +import { ProblemReportError } from './errors/problem-reports' +import { MessageHandlerMiddlewareRunner } from './handlers' +import { ProblemReportMessage } from './messages' import { OutboundMessageContext } from './models' +import { ProblemReportReason } from './models/problem-reports' +import { canHandleMessageType, parseMessageType } from './util/messageType' @injectable() class Dispatcher { @@ -40,10 +37,12 @@ class Dispatcher { private defaultHandlerMiddleware: MessageHandlerMiddleware = async (inboundMessageContext, next) => { let messageHandler = inboundMessageContext.messageHandler - if (!messageHandler && inboundMessageContext.agentContext.dependencyManager.fallbackMessageHandler) { + const fallbackMessageHandler = + inboundMessageContext.agentContext.dependencyManager.resolve(MessageHandlerRegistry).fallbackMessageHandler + if (!messageHandler && fallbackMessageHandler) { messageHandler = { supportedMessages: [], - handle: inboundMessageContext.agentContext.dependencyManager.fallbackMessageHandler, + handle: fallbackMessageHandler, } } @@ -76,7 +75,9 @@ class Dispatcher { let outboundMessage: OutboundMessageContext | undefined try { - const middlewares = [...agentContext.dependencyManager.messageHandlerMiddlewares, this.defaultHandlerMiddleware] + const messageHandlerMiddlewares = + agentContext.dependencyManager.resolve(MessageHandlerRegistry).messageHandlerMiddlewares + const middlewares = [...messageHandlerMiddlewares, this.defaultHandlerMiddleware] await MessageHandlerMiddlewareRunner.run(middlewares, messageContext) outboundMessage = messageContext.responseMessage diff --git a/packages/core/src/agent/EnvelopeService.ts b/packages/didcomm/src/EnvelopeService.ts similarity index 81% rename from packages/core/src/agent/EnvelopeService.ts rename to packages/didcomm/src/EnvelopeService.ts index 37b341cd6f..7f7db6202c 100644 --- a/packages/core/src/agent/EnvelopeService.ts +++ b/packages/didcomm/src/EnvelopeService.ts @@ -1,12 +1,11 @@ import type { AgentMessage } from './AgentMessage' -import type { AgentContext } from './context' -import type { EncryptedMessage, PlaintextMessage } from '../types' +import type { EncryptedMessage, PlaintextMessage } from './types' +import type { AgentContext } from '@credo-ts/core' -import { InjectionSymbols } from '../constants' -import { Key, KeyType } from '../crypto' -import { Logger } from '../logger' -import { ForwardMessage } from '../modules/routing/messages' -import { inject, injectable } from '../plugins' +import { InjectionSymbols, Key, KeyType, Logger, inject, injectable } from '@credo-ts/core' + +import { DidCommModuleConfig } from './DidCommModuleConfig' +import { ForwardMessage } from './modules/routing/messages' export interface EnvelopeKeys { recipientKeys: Key[] @@ -27,13 +26,15 @@ export class EnvelopeService { payload: AgentMessage, keys: EnvelopeKeys ): Promise { + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) + const { recipientKeys, routingKeys, senderKey } = keys let recipientKeysBase58 = recipientKeys.map((key) => key.publicKeyBase58) const routingKeysBase58 = routingKeys.map((key) => key.publicKeyBase58) const senderKeyBase58 = senderKey && senderKey.publicKeyBase58 // pass whether we want to use legacy did sov prefix - const message = payload.toJSON({ useDidSovPrefixWhereAllowed: agentContext.config.useDidSovPrefixWhereAllowed }) + const message = payload.toJSON({ useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed }) this.logger.debug(`Pack outbound message ${message['@type']}`) @@ -50,7 +51,7 @@ export class EnvelopeService { this.logger.debug('Forward message created', forwardMessage) const forwardJson = forwardMessage.toJSON({ - useDidSovPrefixWhereAllowed: agentContext.config.useDidSovPrefixWhereAllowed, + useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed, }) // Forward messages are anon packed diff --git a/packages/didcomm/src/Events.ts b/packages/didcomm/src/Events.ts new file mode 100644 index 0000000000..6f6c7a24c4 --- /dev/null +++ b/packages/didcomm/src/Events.ts @@ -0,0 +1,41 @@ +import type { AgentMessage } from './AgentMessage' +import type { TransportSession } from './TransportService' +import type { OutboundMessageContext, OutboundMessageSendStatus } from './models' +import type { ConnectionRecord } from './modules/connections/repository' +import type { EncryptedMessage } from './types' +import type { BaseEvent } from '@credo-ts/core' + +export enum AgentEventTypes { + AgentMessageReceived = 'AgentMessageReceived', + AgentMessageProcessed = 'AgentMessageProcessed', + AgentMessageSent = 'AgentMessageSent', +} + +export interface AgentMessageReceivedEvent extends BaseEvent { + type: typeof AgentEventTypes.AgentMessageReceived + payload: { + message: unknown + connection?: ConnectionRecord + contextCorrelationId?: string + receivedAt?: Date + session?: TransportSession + } +} + +export interface AgentMessageProcessedEvent extends BaseEvent { + type: typeof AgentEventTypes.AgentMessageProcessed + payload: { + message: AgentMessage + connection?: ConnectionRecord + receivedAt?: Date + encryptedMessage?: EncryptedMessage + } +} + +export interface AgentMessageSentEvent extends BaseEvent { + type: typeof AgentEventTypes.AgentMessageSent + payload: { + message: OutboundMessageContext + status: OutboundMessageSendStatus + } +} diff --git a/packages/core/src/agent/FeatureRegistry.ts b/packages/didcomm/src/FeatureRegistry.ts similarity index 97% rename from packages/core/src/agent/FeatureRegistry.ts rename to packages/didcomm/src/FeatureRegistry.ts index bfcf3e5f8c..78779fb6f0 100644 --- a/packages/core/src/agent/FeatureRegistry.ts +++ b/packages/didcomm/src/FeatureRegistry.ts @@ -1,6 +1,6 @@ import type { FeatureQuery, Feature } from './models' -import { injectable } from 'tsyringe' +import { injectable } from '@credo-ts/core' @injectable() class FeatureRegistry { diff --git a/packages/core/src/agent/MessageHandlerRegistry.ts b/packages/didcomm/src/MessageHandlerRegistry.ts similarity index 86% rename from packages/core/src/agent/MessageHandlerRegistry.ts rename to packages/didcomm/src/MessageHandlerRegistry.ts index 67c1de08fb..f61da78437 100644 --- a/packages/core/src/agent/MessageHandlerRegistry.ts +++ b/packages/didcomm/src/MessageHandlerRegistry.ts @@ -1,11 +1,11 @@ import type { AgentMessage } from './AgentMessage' -import type { MessageHandler } from './MessageHandler' -import type { MessageHandlerMiddleware } from './MessageHandlerMiddleware' -import type { ParsedDidCommProtocolUri } from '../utils/messageType' +import type { MessageHandler } from './handlers/MessageHandler' +import type { MessageHandlerMiddleware } from './handlers/MessageHandlerMiddleware' +import type { ParsedDidCommProtocolUri } from './util/messageType' -import { injectable } from 'tsyringe' +import { injectable } from '@credo-ts/core' -import { supportsIncomingDidCommProtocolUri, canHandleMessageType, parseMessageType } from '../utils/messageType' +import { supportsIncomingDidCommProtocolUri, canHandleMessageType, parseMessageType } from './util/messageType' @injectable() export class MessageHandlerRegistry { @@ -17,6 +17,12 @@ export class MessageHandlerRegistry { this.messageHandlers.push(messageHandler) } + public registerMessageHandlers(messageHandlers: MessageHandler[]) { + for (const messageHandler of messageHandlers) { + this.registerMessageHandler(messageHandler) + } + } + public registerMessageHandlerMiddleware(messageHandlerMiddleware: MessageHandlerMiddleware) { this.messageHandlerMiddlewares.push(messageHandlerMiddleware) } diff --git a/packages/core/src/agent/MessageReceiver.ts b/packages/didcomm/src/MessageReceiver.ts similarity index 92% rename from packages/core/src/agent/MessageReceiver.ts rename to packages/didcomm/src/MessageReceiver.ts index cd23d55889..3211aabf18 100644 --- a/packages/core/src/agent/MessageReceiver.ts +++ b/packages/didcomm/src/MessageReceiver.ts @@ -1,19 +1,19 @@ import type { DecryptedMessageContext } from './EnvelopeService' import type { TransportSession } from './TransportService' -import type { AgentContext } from './context' -import type { ConnectionRecord } from '../modules/connections' -import type { InboundTransport } from '../transport' -import type { EncryptedMessage, PlaintextMessage } from '../types' +import type { ConnectionRecord } from './modules/connections/repository' +import type { InboundTransport } from './transport' +import type { EncryptedMessage, PlaintextMessage } from './types' +import type { AgentContext } from '@credo-ts/core' -import { InjectionSymbols } from '../constants' -import { CredoError } from '../error' -import { Logger } from '../logger' -import { ConnectionService } from '../modules/connections' -import { ProblemReportError, ProblemReportMessage, ProblemReportReason } from '../modules/problem-reports' -import { inject, injectable } from '../plugins' -import { isValidJweStructure } from '../utils/JWE' -import { JsonTransformer } from '../utils/JsonTransformer' -import { canHandleMessageType, parseMessageType, replaceLegacyDidSovPrefixOnMessage } from '../utils/messageType' +import { + AgentContextProvider, + CredoError, + InjectionSymbols, + JsonTransformer, + Logger, + inject, + injectable, +} from '@credo-ts/core' import { AgentMessage } from './AgentMessage' import { Dispatcher } from './Dispatcher' @@ -21,8 +21,12 @@ import { EnvelopeService } from './EnvelopeService' import { MessageHandlerRegistry } from './MessageHandlerRegistry' import { MessageSender } from './MessageSender' import { TransportService } from './TransportService' -import { AgentContextProvider } from './context' -import { InboundMessageContext, OutboundMessageContext } from './models' +import { ProblemReportError } from './errors' +import { ProblemReportMessage } from './messages' +import { InboundMessageContext, OutboundMessageContext, ProblemReportReason } from './models' +import { ConnectionService } from './modules/connections/services' +import { isValidJweStructure } from './util/JWE' +import { canHandleMessageType, parseMessageType, replaceLegacyDidSovPrefixOnMessage } from './util/messageType' @injectable() export class MessageReceiver { diff --git a/packages/core/src/agent/MessageSender.ts b/packages/didcomm/src/MessageSender.ts similarity index 92% rename from packages/core/src/agent/MessageSender.ts rename to packages/didcomm/src/MessageSender.ts index 1787f7ac02..53d835f8ca 100644 --- a/packages/core/src/agent/MessageSender.ts +++ b/packages/didcomm/src/MessageSender.ts @@ -2,32 +2,39 @@ import type { AgentMessage } from './AgentMessage' import type { EnvelopeKeys } from './EnvelopeService' import type { AgentMessageSentEvent } from './Events' import type { TransportSession } from './TransportService' -import type { AgentContext } from './context' -import type { ConnectionRecord } from '../modules/connections' -import type { ResolvedDidCommService } from '../modules/didcomm' -import type { OutOfBandRecord } from '../modules/oob/repository' -import type { OutboundTransport } from '../transport/OutboundTransport' -import type { EncryptedMessage, OutboundPackage } from '../types' - -import { DID_COMM_TRANSPORT_QUEUE, InjectionSymbols } from '../constants' -import { ReturnRouteTypes } from '../decorators/transport/TransportDecorator' -import { CredoError, MessageSendingError } from '../error' -import { Logger } from '../logger' -import { DidCommDocumentService } from '../modules/didcomm' -import { DidKey, type DidDocument } from '../modules/dids' -import { getKeyFromVerificationMethod } from '../modules/dids/domain/key-type' -import { didKeyToInstanceOfKey, verkeyToDidKey } from '../modules/dids/helpers' -import { DidResolverService } from '../modules/dids/services/DidResolverService' -import { MessagePickupRepository } from '../modules/message-pickup/storage' -import { inject, injectable } from '../plugins' -import { MessageValidator } from '../utils/MessageValidator' -import { getProtocolScheme } from '../utils/uri' +import type { ConnectionRecord } from './modules/connections/repository' +import type { OutOfBandRecord } from './modules/oob/repository' +import type { OutboundTransport } from './transport/OutboundTransport' +import type { EncryptedMessage, OutboundPackage } from './types' + +import { + AgentContext, + DidDocument, + utils, + CredoError, + DidKey, + DidResolverService, + EventEmitter, + InjectionSymbols, + inject, + injectable, + Logger, + MessageValidator, + getKeyFromVerificationMethod, + didKeyToInstanceOfKey, + verkeyToDidKey, + ResolvedDidCommService, +} from '@credo-ts/core' import { EnvelopeService } from './EnvelopeService' -import { EventEmitter } from './EventEmitter' import { AgentEventTypes } from './Events' import { TransportService } from './TransportService' +import { DID_COMM_TRANSPORT_QUEUE } from './constants' +import { ReturnRouteTypes } from './decorators/transport/TransportDecorator' +import { MessageSendingError } from './errors' import { OutboundMessageContext, OutboundMessageSendStatus } from './models' +import { MessagePickupRepository } from './modules/message-pickup/storage' +import { DidCommDocumentService } from './services/DidCommDocumentService' export interface TransportPriorityOptions { schemes: string[] @@ -151,7 +158,7 @@ export class MessageSender { for await (const service of services) { this.logger.debug(`Sending outbound message to service:`, { service }) try { - const protocolScheme = getProtocolScheme(service.serviceEndpoint) + const protocolScheme = utils.getProtocolScheme(service.serviceEndpoint) for (const transport of this.outboundTransports) { if (transport.supportedSchemes.includes(protocolScheme)) { await transport.sendMessage({ @@ -440,7 +447,7 @@ export class MessageSender { outboundPackage.endpoint = service.serviceEndpoint outboundPackage.connectionId = connection?.id for (const transport of this.outboundTransports) { - const protocolScheme = getProtocolScheme(service.serviceEndpoint) + const protocolScheme = utils.getProtocolScheme(service.serviceEndpoint) if (!protocolScheme) { this.logger.warn('Service does not have a protocol scheme.') } else if (transport.supportedSchemes.includes(protocolScheme)) { @@ -516,7 +523,7 @@ export class MessageSender { // If restrictive will remove services not listed in schemes list if (transportPriority?.restrictive) { services = services.filter((service) => { - const serviceSchema = getProtocolScheme(service.serviceEndpoint) + const serviceSchema = utils.getProtocolScheme(service.serviceEndpoint) return transportPriority.schemes.includes(serviceSchema) }) } @@ -524,8 +531,8 @@ export class MessageSender { // If transport priority is set we will sort services by our priority if (transportPriority?.schemes) { services = services.sort(function (a, b) { - const aScheme = getProtocolScheme(a.serviceEndpoint) - const bScheme = getProtocolScheme(b.serviceEndpoint) + const aScheme = utils.getProtocolScheme(a.serviceEndpoint) + const bScheme = utils.getProtocolScheme(b.serviceEndpoint) return transportPriority?.schemes.indexOf(aScheme) - transportPriority?.schemes.indexOf(bScheme) }) } diff --git a/packages/core/src/agent/TransportService.ts b/packages/didcomm/src/TransportService.ts similarity index 90% rename from packages/core/src/agent/TransportService.ts rename to packages/didcomm/src/TransportService.ts index fee9f1166e..b74abc584b 100644 --- a/packages/core/src/agent/TransportService.ts +++ b/packages/didcomm/src/TransportService.ts @@ -1,16 +1,13 @@ import type { AgentMessage } from './AgentMessage' import type { EnvelopeKeys } from './EnvelopeService' -import type { DidDocument } from '../modules/dids' -import type { TransportSessionRemovedEvent, TransportSessionSavedEvent } from '../transport' -import type { EncryptedMessage } from '../types' +import type { TransportSessionRemovedEvent, TransportSessionSavedEvent } from './transport' +import type { EncryptedMessage } from './types' +import type { DidDocument } from '@credo-ts/core' -import { DID_COMM_TRANSPORT_QUEUE } from '../constants' -import { CredoError } from '../error' -import { injectable } from '../plugins' -import { TransportEventTypes } from '../transport' +import { AgentContext, CredoError, EventEmitter, injectable } from '@credo-ts/core' -import { EventEmitter } from './EventEmitter' -import { AgentContext } from './context' +import { DID_COMM_TRANSPORT_QUEUE } from './constants' +import { TransportEventTypes } from './transport' @injectable() export class TransportService { diff --git a/packages/core/src/agent/__tests__/AgentMessage.test.ts b/packages/didcomm/src/__tests__/AgentMessage.test.ts similarity index 93% rename from packages/core/src/agent/__tests__/AgentMessage.test.ts rename to packages/didcomm/src/__tests__/AgentMessage.test.ts index cfe2f70796..b343688587 100644 --- a/packages/core/src/agent/__tests__/AgentMessage.test.ts +++ b/packages/didcomm/src/__tests__/AgentMessage.test.ts @@ -1,8 +1,8 @@ -import { TestMessage } from '../../../tests/TestMessage' -import { ClassValidationError } from '../../error/ClassValidationError' -import { JsonTransformer } from '../../utils' -import { IsValidMessageType, parseMessageType } from '../../utils/messageType' +import { ClassValidationError } from '../../../core/src/error/ClassValidationError' +import { JsonTransformer } from '../../../core/src/utils' import { AgentMessage } from '../AgentMessage' +import { TestMessage } from '../util/__tests__/messageType.test' +import { IsValidMessageType, parseMessageType } from '../util/messageType' class CustomProtocolMessage extends AgentMessage { @IsValidMessageType(CustomProtocolMessage.type) @@ -26,11 +26,11 @@ describe('AgentMessage', () => { // useDidSovPrefixWhereAllowed & allowDidSovPrefix are both false let testMessageJson = message.toJSON() - expect(testMessageJson['@type']).toBe('https://didcomm.org/connections/1.0/invitation') + expect(testMessageJson['@type']).toBe('https://didcomm.org/fake-protocol/1.5/invitation') // useDidSovPrefixWhereAllowed is true, but allowDidSovPrefix is false testMessageJson = message.toJSON({ useDidSovPrefixWhereAllowed: true }) - expect(testMessageJson['@type']).toBe('https://didcomm.org/connections/1.0/invitation') + expect(testMessageJson['@type']).toBe('https://didcomm.org/fake-protocol/1.5/invitation') // useDidSovPrefixWhereAllowed is false, but allowDidSovPrefix is true testMessageJson = legacyPrefixMessage.toJSON() diff --git a/packages/didcomm/src/__tests__/DidCommConfig.test.ts b/packages/didcomm/src/__tests__/DidCommConfig.test.ts new file mode 100644 index 0000000000..d1c1a1724d --- /dev/null +++ b/packages/didcomm/src/__tests__/DidCommConfig.test.ts @@ -0,0 +1,29 @@ +import { DidCommModuleConfig } from '../DidCommModuleConfig' + +describe('DidCommModuleConfig', () => { + describe('endpoints', () => { + it('should return the config endpoint if no inbound connection is available', () => { + const endpoint = 'https://local-url.com' + + const didcommConfig = new DidCommModuleConfig({ endpoints: [endpoint] }) + + expect(didcommConfig.endpoints).toEqual([endpoint]) + }) + + it("should return ['didcomm:transport/queue'] if no inbound connection or config endpoint or host/port is available", () => { + const didcommConfig = new DidCommModuleConfig() + + expect(didcommConfig.endpoints).toStrictEqual(['didcomm:transport/queue']) + }) + + it('should return the new config endpoint after setter is called', () => { + const endpoint = 'https://local-url.com' + const newEndpoint = 'https://new-local-url.com' + + const didcommConfig = new DidCommModuleConfig({ endpoints: [endpoint] }) + + didcommConfig.endpoints = [newEndpoint] + expect(didcommConfig.endpoints).toEqual([newEndpoint]) + }) + }) +}) diff --git a/packages/core/src/agent/__tests__/Dispatcher.test.ts b/packages/didcomm/src/__tests__/Dispatcher.test.ts similarity index 88% rename from packages/core/src/agent/__tests__/Dispatcher.test.ts rename to packages/didcomm/src/__tests__/Dispatcher.test.ts index 6326fe78e0..a79991f710 100644 --- a/packages/core/src/agent/__tests__/Dispatcher.test.ts +++ b/packages/didcomm/src/__tests__/Dispatcher.test.ts @@ -1,16 +1,15 @@ -import type { ConnectionRecord } from '../../modules/connections' - import { Subject } from 'rxjs' -import { getAgentConfig, getAgentContext } from '../../../tests/helpers' -import { parseMessageType } from '../../utils/messageType' +import { EventEmitter } from '../../../core/src/agent/EventEmitter' +import { getAgentConfig, getAgentContext } from '../../../core/tests/helpers' import { AgentMessage } from '../AgentMessage' import { Dispatcher } from '../Dispatcher' -import { EventEmitter } from '../EventEmitter' import { MessageHandlerRegistry } from '../MessageHandlerRegistry' import { MessageSender } from '../MessageSender' import { getOutboundMessageContext } from '../getOutboundMessageContext' -import { InboundMessageContext } from '../models/InboundMessageContext' +import { InboundMessageContext } from '../models' +import { type ConnectionRecord } from '../modules/connections' +import { parseMessageType } from '../util/messageType' jest.mock('../MessageSender') @@ -94,8 +93,8 @@ describe('Dispatcher', () => { const firstMiddleware = jest.fn().mockImplementation(async (_, next) => next()) const secondMiddleware = jest.fn() - agentContext.dependencyManager.registerMessageHandlerMiddleware(firstMiddleware) - agentContext.dependencyManager.registerMessageHandlerMiddleware(secondMiddleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(firstMiddleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(secondMiddleware) await dispatcher.dispatch(inboundMessageContext) @@ -128,8 +127,8 @@ describe('Dispatcher', () => { const firstMiddleware = jest.fn().mockImplementation(async (_, next) => next()) const secondMiddleware = jest.fn() - agentContext.dependencyManager.registerMessageHandlerMiddleware(firstMiddleware) - agentContext.dependencyManager.registerMessageHandlerMiddleware(secondMiddleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(firstMiddleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(secondMiddleware) await dispatcher.dispatch(inboundMessageContext) @@ -161,7 +160,7 @@ describe('Dispatcher', () => { const inboundMessageContext = new InboundMessageContext(customProtocolMessage, { agentContext }) const fallbackMessageHandler = jest.fn() - agentContext.dependencyManager.setFallbackMessageHandler(fallbackMessageHandler) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).setFallbackMessageHandler(fallbackMessageHandler) await dispatcher.dispatch(inboundMessageContext) @@ -187,7 +186,7 @@ describe('Dispatcher', () => { const inboundMessageContext = new InboundMessageContext(customProtocolMessage, { agentContext }) const mockHandle = jest.fn() - agentContext.dependencyManager.registerMessageHandlers([ + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlers([ { supportedMessages: [CustomProtocolMessage], handle: mockHandle, @@ -195,7 +194,7 @@ describe('Dispatcher', () => { ]) const middleware = jest.fn() - agentContext.dependencyManager.registerMessageHandlerMiddleware(middleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(middleware) await dispatcher.dispatch(inboundMessageContext) expect(mockHandle).not.toHaveBeenCalled() @@ -235,7 +234,7 @@ describe('Dispatcher', () => { await next() }) - agentContext.dependencyManager.registerMessageHandlerMiddleware(middleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(middleware) await dispatcher.dispatch(inboundMessageContext) expect(middleware).toHaveBeenCalled() expect(handle).toHaveBeenCalled() @@ -277,7 +276,7 @@ describe('Dispatcher', () => { }) }) - agentContext.dependencyManager.registerMessageHandlerMiddleware(middleware) + agentContext.dependencyManager.resolve(MessageHandlerRegistry).registerMessageHandlerMiddleware(middleware) await dispatcher.dispatch(inboundMessageContext) expect(middleware).toHaveBeenCalled() expect(messageSenderMock.sendMessage).toHaveBeenCalledWith({ diff --git a/packages/core/src/agent/__tests__/EventEmitter.test.ts b/packages/didcomm/src/__tests__/EventEmitter.test.ts similarity index 91% rename from packages/core/src/agent/__tests__/EventEmitter.test.ts rename to packages/didcomm/src/__tests__/EventEmitter.test.ts index 480ccbedbb..ad7a5ab4f2 100644 --- a/packages/core/src/agent/__tests__/EventEmitter.test.ts +++ b/packages/didcomm/src/__tests__/EventEmitter.test.ts @@ -2,8 +2,8 @@ import type { EventEmitter as NativeEventEmitter } from 'events' import { Subject } from 'rxjs' -import { agentDependencies, getAgentContext } from '../../../tests/helpers' -import { EventEmitter } from '../EventEmitter' +import { EventEmitter } from '../../../core/src/agent/EventEmitter' +import { agentDependencies, getAgentContext } from '../../../core/tests/helpers' const mockEmit = jest.fn() const mockOn = jest.fn() diff --git a/packages/core/src/agent/__tests__/MessageHandlerRegistry.test.ts b/packages/didcomm/src/__tests__/MessageHandlerRegistry.test.ts similarity index 97% rename from packages/core/src/agent/__tests__/MessageHandlerRegistry.test.ts rename to packages/didcomm/src/__tests__/MessageHandlerRegistry.test.ts index 4c20ac1fa2..59f4ef99c0 100644 --- a/packages/core/src/agent/__tests__/MessageHandlerRegistry.test.ts +++ b/packages/didcomm/src/__tests__/MessageHandlerRegistry.test.ts @@ -1,8 +1,8 @@ -import type { MessageHandler } from '../MessageHandler' +import type { MessageHandler } from '../handlers/MessageHandler' -import { parseDidCommProtocolUri, parseMessageType } from '../../utils/messageType' import { AgentMessage } from '../AgentMessage' import { MessageHandlerRegistry } from '../MessageHandlerRegistry' +import { parseDidCommProtocolUri, parseMessageType } from '../util/messageType' class ConnectionInvitationTestMessage extends AgentMessage { public static readonly type = parseMessageType('https://didcomm.org/connections/1.0/invitation') diff --git a/packages/core/src/agent/__tests__/MessageSender.test.ts b/packages/didcomm/src/__tests__/MessageSender.test.ts similarity index 94% rename from packages/core/src/agent/__tests__/MessageSender.test.ts rename to packages/didcomm/src/__tests__/MessageSender.test.ts index 0d6682a90d..5364f1baf2 100644 --- a/packages/core/src/agent/__tests__/MessageSender.test.ts +++ b/packages/didcomm/src/__tests__/MessageSender.test.ts @@ -1,43 +1,45 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ -import type { ConnectionRecord } from '../../modules/connections' -import type { ResolvedDidCommService } from '../../modules/didcomm' -import type { DidDocumentService, IndyAgentService } from '../../modules/dids' -import type { MessagePickupRepository } from '../../modules/message-pickup/storage' -import type { OutboundTransport } from '../../transport' -import type { EncryptedMessage } from '../../types' + +import type { DidDocumentService, IndyAgentService } from '../../../core/src/modules/dids' +import type { ResolvedDidCommService } from '../../../core/src/types' import type { AgentMessageSentEvent } from '../Events' +import type { ConnectionRecord } from '../modules' +import type { MessagePickupRepository } from '../modules/message-pickup/storage' +import type { OutboundTransport } from '../transport' +import type { EncryptedMessage } from '../types' import { Subject } from 'rxjs' -import { TestMessage } from '../../../tests/TestMessage' +import { EventEmitter } from '../../../core/src/agent/EventEmitter' +import { Key, KeyType } from '../../../core/src/crypto' +import { DidDocument, VerificationMethod } from '../../../core/src/modules/dids' +import { DidCommV1Service } from '../../../core/src/modules/dids/domain/service/DidCommV1Service' +import { verkeyToInstanceOfKey } from '../../../core/src/modules/dids/helpers' +import { DidResolverService } from '../../../core/src/modules/dids/services/DidResolverService' +import { TestMessage } from '../../../core/tests/TestMessage' import { agentDependencies, getAgentConfig, getAgentContext, getMockConnection, mockFunction, -} from '../../../tests/helpers' -import testLogger from '../../../tests/logger' -import { Key, KeyType } from '../../crypto' -import { ReturnRouteTypes } from '../../decorators/transport/TransportDecorator' -import { DidCommDocumentService } from '../../modules/didcomm' -import { DidResolverService, DidDocument, VerificationMethod } from '../../modules/dids' -import { DidCommV1Service } from '../../modules/dids/domain/service/DidCommV1Service' -import { verkeyToInstanceOfKey } from '../../modules/dids/helpers' -import { InMemoryMessagePickupRepository } from '../../modules/message-pickup/storage' +} from '../../../core/tests/helpers' +import testLogger from '../../../core/tests/logger' import { EnvelopeService as EnvelopeServiceImpl } from '../EnvelopeService' -import { EventEmitter } from '../EventEmitter' import { AgentEventTypes } from '../Events' import { MessageSender } from '../MessageSender' import { TransportService } from '../TransportService' +import { ReturnRouteTypes } from '../decorators/transport/TransportDecorator' import { OutboundMessageContext, OutboundMessageSendStatus } from '../models' +import { InMemoryMessagePickupRepository } from '../modules/message-pickup/storage' +import { DidCommDocumentService } from '../services/DidCommDocumentService' import { DummyTransportSession } from './stubs' jest.mock('../TransportService') jest.mock('../EnvelopeService') -jest.mock('../../modules/dids/services/DidResolverService') -jest.mock('../../modules/didcomm/services/DidCommDocumentService') +jest.mock('../../../core/src/modules/dids/services/DidResolverService') +jest.mock('../services/DidCommDocumentService') const logger = testLogger diff --git a/packages/core/src/agent/__tests__/TransportService.test.ts b/packages/didcomm/src/__tests__/TransportService.test.ts similarity index 87% rename from packages/core/src/agent/__tests__/TransportService.test.ts rename to packages/didcomm/src/__tests__/TransportService.test.ts index fdfbc57bf9..e2f2af0284 100644 --- a/packages/core/src/agent/__tests__/TransportService.test.ts +++ b/packages/didcomm/src/__tests__/TransportService.test.ts @@ -1,9 +1,9 @@ import { Subject } from 'rxjs' -import { agentDependencies, getAgentContext, getMockConnection } from '../../../tests/helpers' -import { DidExchangeRole } from '../../modules/connections' -import { EventEmitter } from '../EventEmitter' +import { EventEmitter } from '../../../core/src/agent/EventEmitter' +import { agentDependencies, getAgentContext, getMockConnection } from '../../../core/tests/helpers' import { TransportService } from '../TransportService' +import { DidExchangeRole } from '../modules' import { DummyTransportSession } from './stubs' diff --git a/packages/core/src/agent/__tests__/stubs.ts b/packages/didcomm/src/__tests__/stubs.ts similarity index 100% rename from packages/core/src/agent/__tests__/stubs.ts rename to packages/didcomm/src/__tests__/stubs.ts diff --git a/packages/didcomm/src/constants.ts b/packages/didcomm/src/constants.ts new file mode 100644 index 0000000000..9183ddeff3 --- /dev/null +++ b/packages/didcomm/src/constants.ts @@ -0,0 +1 @@ +export const DID_COMM_TRANSPORT_QUEUE = 'didcomm:transport/queue' diff --git a/packages/core/src/decorators/ack/AckDecorator.test.ts b/packages/didcomm/src/decorators/ack/AckDecorator.test.ts similarity index 91% rename from packages/core/src/decorators/ack/AckDecorator.test.ts rename to packages/didcomm/src/decorators/ack/AckDecorator.test.ts index 7ef68f3693..adc34d5718 100644 --- a/packages/core/src/decorators/ack/AckDecorator.test.ts +++ b/packages/didcomm/src/decorators/ack/AckDecorator.test.ts @@ -1,8 +1,8 @@ -import { BaseMessage } from '../../agent/BaseMessage' -import { ClassValidationError } from '../../error/ClassValidationError' -import { JsonTransformer } from '../../utils/JsonTransformer' -import { MessageValidator } from '../../utils/MessageValidator' -import { Compose } from '../../utils/mixins' +import { ClassValidationError } from '../../../../core/src/error/ClassValidationError' +import { JsonTransformer } from '../../../../core/src/utils/JsonTransformer' +import { MessageValidator } from '../../../../core/src/utils/MessageValidator' +import { Compose } from '../../../../core/src/utils/mixins' +import { BaseMessage } from '../../BaseMessage' import { AckValues } from './AckDecorator' import { AckDecorated } from './AckDecoratorExtension' diff --git a/packages/core/src/decorators/ack/AckDecorator.ts b/packages/didcomm/src/decorators/ack/AckDecorator.ts similarity index 100% rename from packages/core/src/decorators/ack/AckDecorator.ts rename to packages/didcomm/src/decorators/ack/AckDecorator.ts diff --git a/packages/core/src/decorators/ack/AckDecoratorExtension.ts b/packages/didcomm/src/decorators/ack/AckDecoratorExtension.ts similarity index 92% rename from packages/core/src/decorators/ack/AckDecoratorExtension.ts rename to packages/didcomm/src/decorators/ack/AckDecoratorExtension.ts index 0088c241e1..7ea7c9baf8 100644 --- a/packages/core/src/decorators/ack/AckDecoratorExtension.ts +++ b/packages/didcomm/src/decorators/ack/AckDecoratorExtension.ts @@ -1,4 +1,4 @@ -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/decorators/attachment/Attachment.ts b/packages/didcomm/src/decorators/attachment/Attachment.ts similarity index 94% rename from packages/core/src/decorators/attachment/Attachment.ts rename to packages/didcomm/src/decorators/attachment/Attachment.ts index 0e50069ae0..ace5233d88 100644 --- a/packages/core/src/decorators/attachment/Attachment.ts +++ b/packages/didcomm/src/decorators/attachment/Attachment.ts @@ -1,13 +1,9 @@ -import type { JwsDetachedFormat, JwsFlattenedDetachedFormat, JwsGeneralFormat } from '../../crypto/JwsTypes' +import type { JwsDetachedFormat, JwsFlattenedDetachedFormat, JwsGeneralFormat } from '@credo-ts/core' +import { CredoError, JsonEncoder, JsonValue, utils } from '@credo-ts/core' import { Expose, Type } from 'class-transformer' import { IsDate, IsHash, IsInstance, IsInt, IsMimeType, IsOptional, IsString, ValidateNested } from 'class-validator' -import { CredoError } from '../../error' -import { JsonValue } from '../../types' -import { JsonEncoder } from '../../utils/JsonEncoder' -import { uuid } from '../../utils/uuid' - export interface AttachmentOptions { id?: string description?: string @@ -82,7 +78,7 @@ export class AttachmentData { export class Attachment { public constructor(options: AttachmentOptions) { if (options) { - this.id = options.id ?? uuid() + this.id = options.id ?? utils.uuid() this.description = options.description this.filename = options.filename this.mimeType = options.mimeType diff --git a/packages/core/src/decorators/attachment/AttachmentExtension.ts b/packages/didcomm/src/decorators/attachment/AttachmentExtension.ts similarity index 93% rename from packages/core/src/decorators/attachment/AttachmentExtension.ts rename to packages/didcomm/src/decorators/attachment/AttachmentExtension.ts index 565e203da8..80747e2a5a 100644 --- a/packages/core/src/decorators/attachment/AttachmentExtension.ts +++ b/packages/didcomm/src/decorators/attachment/AttachmentExtension.ts @@ -1,4 +1,4 @@ -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/decorators/attachment/__tests__/Attachment.test.ts b/packages/didcomm/src/decorators/attachment/__tests__/Attachment.test.ts similarity index 91% rename from packages/core/src/decorators/attachment/__tests__/Attachment.test.ts rename to packages/didcomm/src/decorators/attachment/__tests__/Attachment.test.ts index 682151e402..c8eb1e3c7a 100644 --- a/packages/core/src/decorators/attachment/__tests__/Attachment.test.ts +++ b/packages/didcomm/src/decorators/attachment/__tests__/Attachment.test.ts @@ -1,7 +1,7 @@ -import * as didJwsz6Mkf from '../../../crypto/__tests__/__fixtures__/didJwsz6Mkf' -import * as didJwsz6Mkv from '../../../crypto/__tests__/__fixtures__/didJwsz6Mkv' -import { JsonEncoder } from '../../../utils/JsonEncoder' -import { JsonTransformer } from '../../../utils/JsonTransformer' +import * as didJwsz6Mkf from '../../../../../core/src/crypto/__tests__/__fixtures__/didJwsz6Mkf' +import * as didJwsz6Mkv from '../../../../../core/src/crypto/__tests__/__fixtures__/didJwsz6Mkv' +import { JsonEncoder } from '../../../../../core/src/utils/JsonEncoder' +import { JsonTransformer } from '../../../../../core/src/utils/JsonTransformer' import { Attachment, AttachmentData } from '../Attachment' const mockJson = { diff --git a/packages/core/src/decorators/l10n/L10nDecorator.test.ts b/packages/didcomm/src/decorators/l10n/L10nDecorator.test.ts similarity index 88% rename from packages/core/src/decorators/l10n/L10nDecorator.test.ts rename to packages/didcomm/src/decorators/l10n/L10nDecorator.test.ts index 5c13b5d0ca..c6751a0e19 100644 --- a/packages/core/src/decorators/l10n/L10nDecorator.test.ts +++ b/packages/didcomm/src/decorators/l10n/L10nDecorator.test.ts @@ -1,4 +1,4 @@ -import { JsonTransformer } from '../../utils/JsonTransformer' +import { JsonTransformer } from '../../../../core/src/utils/JsonTransformer' import { L10nDecorator } from './L10nDecorator' diff --git a/packages/core/src/decorators/l10n/L10nDecorator.ts b/packages/didcomm/src/decorators/l10n/L10nDecorator.ts similarity index 100% rename from packages/core/src/decorators/l10n/L10nDecorator.ts rename to packages/didcomm/src/decorators/l10n/L10nDecorator.ts diff --git a/packages/core/src/decorators/l10n/L10nDecoratorExtension.ts b/packages/didcomm/src/decorators/l10n/L10nDecoratorExtension.ts similarity index 91% rename from packages/core/src/decorators/l10n/L10nDecoratorExtension.ts rename to packages/didcomm/src/decorators/l10n/L10nDecoratorExtension.ts index ddadc06354..dcf5f15274 100644 --- a/packages/core/src/decorators/l10n/L10nDecoratorExtension.ts +++ b/packages/didcomm/src/decorators/l10n/L10nDecoratorExtension.ts @@ -1,4 +1,4 @@ -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/decorators/service/ServiceDecorator.test.ts b/packages/didcomm/src/decorators/service/ServiceDecorator.test.ts similarity index 84% rename from packages/core/src/decorators/service/ServiceDecorator.test.ts rename to packages/didcomm/src/decorators/service/ServiceDecorator.test.ts index 69936286a3..44c6a589cb 100644 --- a/packages/core/src/decorators/service/ServiceDecorator.test.ts +++ b/packages/didcomm/src/decorators/service/ServiceDecorator.test.ts @@ -1,6 +1,6 @@ -import { BaseMessage } from '../../agent/BaseMessage' -import { JsonTransformer } from '../../utils/JsonTransformer' -import { Compose } from '../../utils/mixins' +import { JsonTransformer } from '../../../../core/src/utils/JsonTransformer' +import { Compose } from '../../../../core/src/utils/mixins' +import { BaseMessage } from '../../BaseMessage' import { ServiceDecorated } from './ServiceDecoratorExtension' diff --git a/packages/core/src/decorators/service/ServiceDecorator.ts b/packages/didcomm/src/decorators/service/ServiceDecorator.ts similarity index 88% rename from packages/core/src/decorators/service/ServiceDecorator.ts rename to packages/didcomm/src/decorators/service/ServiceDecorator.ts index 793509d678..8d28990545 100644 --- a/packages/core/src/decorators/service/ServiceDecorator.ts +++ b/packages/didcomm/src/decorators/service/ServiceDecorator.ts @@ -1,10 +1,8 @@ -import type { ResolvedDidCommService } from '../../modules/didcomm' +import type { ResolvedDidCommService } from '@credo-ts/core' +import { utils, verkeyToInstanceOfKey } from '@credo-ts/core' import { IsArray, IsOptional, IsString } from 'class-validator' -import { verkeyToInstanceOfKey } from '../../modules/dids/helpers' -import { uuid } from '../../utils/uuid' - export interface ServiceDecoratorOptions { recipientKeys: string[] routingKeys?: string[] @@ -40,7 +38,7 @@ export class ServiceDecorator { public get resolvedDidCommService(): ResolvedDidCommService { return { - id: uuid(), + id: utils.uuid(), recipientKeys: this.recipientKeys.map(verkeyToInstanceOfKey), routingKeys: this.routingKeys?.map(verkeyToInstanceOfKey) ?? [], serviceEndpoint: this.serviceEndpoint, diff --git a/packages/core/src/decorators/service/ServiceDecoratorExtension.ts b/packages/didcomm/src/decorators/service/ServiceDecoratorExtension.ts similarity index 90% rename from packages/core/src/decorators/service/ServiceDecoratorExtension.ts rename to packages/didcomm/src/decorators/service/ServiceDecoratorExtension.ts index 776e8f702f..d7e406d7e8 100644 --- a/packages/core/src/decorators/service/ServiceDecoratorExtension.ts +++ b/packages/didcomm/src/decorators/service/ServiceDecoratorExtension.ts @@ -1,5 +1,5 @@ import type { ServiceDecoratorOptions } from './ServiceDecorator' -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/decorators/signature/SignatureDecorator.ts b/packages/didcomm/src/decorators/signature/SignatureDecorator.ts similarity index 88% rename from packages/core/src/decorators/signature/SignatureDecorator.ts rename to packages/didcomm/src/decorators/signature/SignatureDecorator.ts index 2e87ea66f5..dd42b25eba 100644 --- a/packages/core/src/decorators/signature/SignatureDecorator.ts +++ b/packages/didcomm/src/decorators/signature/SignatureDecorator.ts @@ -1,8 +1,8 @@ import { Expose, Transform } from 'class-transformer' import { IsString, Matches } from 'class-validator' -import { MessageTypeRegExp } from '../../agent/BaseMessage' -import { replaceLegacyDidSovPrefix } from '../../utils/messageType' +import { MessageTypeRegExp } from '../../BaseMessage' +import { replaceLegacyDidSovPrefix } from '../../util/messageType' /** * Represents `[field]~sig` decorator diff --git a/packages/core/src/decorators/signature/SignatureDecoratorUtils.test.ts b/packages/didcomm/src/decorators/signature/SignatureDecoratorUtils.test.ts similarity index 92% rename from packages/core/src/decorators/signature/SignatureDecoratorUtils.test.ts rename to packages/didcomm/src/decorators/signature/SignatureDecoratorUtils.test.ts index e3fbdbfe11..2555994cc0 100644 --- a/packages/core/src/decorators/signature/SignatureDecoratorUtils.test.ts +++ b/packages/didcomm/src/decorators/signature/SignatureDecoratorUtils.test.ts @@ -1,14 +1,13 @@ -import type { Wallet } from '../../wallet' +import type { Wallet } from '../../../../core' import { InMemoryWallet } from '../../../../../tests/InMemoryWallet' -import { getAgentConfig } from '../../../tests/helpers' -import { KeyType } from '../../crypto' -import { TypedArrayEncoder } from '../../utils' +import { KeyType, TypedArrayEncoder } from '../../../../core' +import { getAgentConfig } from '../../../../core/tests/helpers' import { SignatureDecorator } from './SignatureDecorator' import { signData, unpackAndVerifySignatureDecorator } from './SignatureDecoratorUtils' -jest.mock('../../utils/timestamp', () => { +jest.mock('../../../../core/src/utils/timestamp', () => { return { __esModule: true, default: jest.fn(() => Uint8Array.of(0, 0, 0, 0, 0, 0, 0, 0)), diff --git a/packages/core/src/decorators/signature/SignatureDecoratorUtils.ts b/packages/didcomm/src/decorators/signature/SignatureDecoratorUtils.ts similarity index 81% rename from packages/core/src/decorators/signature/SignatureDecoratorUtils.ts rename to packages/didcomm/src/decorators/signature/SignatureDecoratorUtils.ts index 55eecf2538..39e5f25072 100644 --- a/packages/core/src/decorators/signature/SignatureDecoratorUtils.ts +++ b/packages/didcomm/src/decorators/signature/SignatureDecoratorUtils.ts @@ -1,11 +1,6 @@ -import type { Wallet } from '../../wallet/Wallet' +import type { Wallet } from '@credo-ts/core' -import { Key, KeyType } from '../../crypto' -import { CredoError } from '../../error' -import { JsonEncoder } from '../../utils/JsonEncoder' -import { TypedArrayEncoder } from '../../utils/TypedArrayEncoder' -import { Buffer } from '../../utils/buffer' -import timestamp from '../../utils/timestamp' +import { Buffer, CredoError, JsonEncoder, Key, KeyType, TypedArrayEncoder, utils } from '@credo-ts/core' import { SignatureDecorator } from './SignatureDecorator' @@ -49,7 +44,7 @@ export async function unpackAndVerifySignatureDecorator( * @returns Resulting signature decorator. */ export async function signData(data: unknown, wallet: Wallet, signerKey: string): Promise { - const dataBuffer = Buffer.concat([timestamp(), JsonEncoder.toBuffer(data)]) + const dataBuffer = Buffer.concat([utils.timestamp(), JsonEncoder.toBuffer(data)]) const key = Key.fromPublicKeyBase58(signerKey, KeyType.Ed25519) const signatureBuffer = await wallet.sign({ key, data: dataBuffer }) diff --git a/packages/core/src/decorators/thread/ThreadDecorator.test.ts b/packages/didcomm/src/decorators/thread/ThreadDecorator.test.ts similarity index 95% rename from packages/core/src/decorators/thread/ThreadDecorator.test.ts rename to packages/didcomm/src/decorators/thread/ThreadDecorator.test.ts index 18ef71ab6f..48cccfa4ec 100644 --- a/packages/core/src/decorators/thread/ThreadDecorator.test.ts +++ b/packages/didcomm/src/decorators/thread/ThreadDecorator.test.ts @@ -1,4 +1,4 @@ -import { JsonTransformer } from '../../utils/JsonTransformer' +import { JsonTransformer } from '../../../../core' import { ThreadDecorator } from './ThreadDecorator' diff --git a/packages/core/src/decorators/thread/ThreadDecorator.ts b/packages/didcomm/src/decorators/thread/ThreadDecorator.ts similarity index 96% rename from packages/core/src/decorators/thread/ThreadDecorator.ts rename to packages/didcomm/src/decorators/thread/ThreadDecorator.ts index 6614870ef1..df44680592 100644 --- a/packages/core/src/decorators/thread/ThreadDecorator.ts +++ b/packages/didcomm/src/decorators/thread/ThreadDecorator.ts @@ -1,7 +1,7 @@ import { Expose } from 'class-transformer' import { IsInt, IsOptional, Matches } from 'class-validator' -import { MessageIdRegExp } from '../../agent/BaseMessage' +import { MessageIdRegExp } from '../../BaseMessage' /** * Represents `~thread` decorator diff --git a/packages/core/src/decorators/thread/ThreadDecoratorExtension.ts b/packages/didcomm/src/decorators/thread/ThreadDecoratorExtension.ts similarity index 92% rename from packages/core/src/decorators/thread/ThreadDecoratorExtension.ts rename to packages/didcomm/src/decorators/thread/ThreadDecoratorExtension.ts index 5ba09d8461..a8a54d9482 100644 --- a/packages/core/src/decorators/thread/ThreadDecoratorExtension.ts +++ b/packages/didcomm/src/decorators/thread/ThreadDecoratorExtension.ts @@ -1,4 +1,4 @@ -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/decorators/timing/TimingDecorator.test.ts b/packages/didcomm/src/decorators/timing/TimingDecorator.test.ts similarity index 96% rename from packages/core/src/decorators/timing/TimingDecorator.test.ts rename to packages/didcomm/src/decorators/timing/TimingDecorator.test.ts index 321eb44579..4875c2c034 100644 --- a/packages/core/src/decorators/timing/TimingDecorator.test.ts +++ b/packages/didcomm/src/decorators/timing/TimingDecorator.test.ts @@ -1,4 +1,4 @@ -import { JsonTransformer } from '../../utils/JsonTransformer' +import { JsonTransformer } from '../../../../core' import { TimingDecorator } from './TimingDecorator' diff --git a/packages/core/src/decorators/timing/TimingDecorator.ts b/packages/didcomm/src/decorators/timing/TimingDecorator.ts similarity index 100% rename from packages/core/src/decorators/timing/TimingDecorator.ts rename to packages/didcomm/src/decorators/timing/TimingDecorator.ts diff --git a/packages/core/src/decorators/timing/TimingDecoratorExtension.ts b/packages/didcomm/src/decorators/timing/TimingDecoratorExtension.ts similarity index 91% rename from packages/core/src/decorators/timing/TimingDecoratorExtension.ts rename to packages/didcomm/src/decorators/timing/TimingDecoratorExtension.ts index da4ef6a5cc..893d0eedff 100644 --- a/packages/core/src/decorators/timing/TimingDecoratorExtension.ts +++ b/packages/didcomm/src/decorators/timing/TimingDecoratorExtension.ts @@ -1,4 +1,4 @@ -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/decorators/transport/TransportDecorator.test.ts b/packages/didcomm/src/decorators/transport/TransportDecorator.test.ts similarity index 91% rename from packages/core/src/decorators/transport/TransportDecorator.test.ts rename to packages/didcomm/src/decorators/transport/TransportDecorator.test.ts index edea4acd28..5c2956f6f8 100644 --- a/packages/core/src/decorators/transport/TransportDecorator.test.ts +++ b/packages/didcomm/src/decorators/transport/TransportDecorator.test.ts @@ -1,6 +1,4 @@ -import { ClassValidationError } from '../../error/ClassValidationError' -import { JsonTransformer } from '../../utils/JsonTransformer' -import { MessageValidator } from '../../utils/MessageValidator' +import { ClassValidationError, JsonTransformer, MessageValidator } from '../../../../core' import { TransportDecorator, ReturnRouteTypes } from './TransportDecorator' diff --git a/packages/core/src/decorators/transport/TransportDecorator.ts b/packages/didcomm/src/decorators/transport/TransportDecorator.ts similarity index 95% rename from packages/core/src/decorators/transport/TransportDecorator.ts rename to packages/didcomm/src/decorators/transport/TransportDecorator.ts index 8dac5aa4a7..eaa753d50b 100644 --- a/packages/core/src/decorators/transport/TransportDecorator.ts +++ b/packages/didcomm/src/decorators/transport/TransportDecorator.ts @@ -1,7 +1,7 @@ import { Expose } from 'class-transformer' import { IsEnum, ValidateIf, Matches, IsOptional } from 'class-validator' -import { MessageIdRegExp } from '../../agent/BaseMessage' +import { MessageIdRegExp } from '../../BaseMessage' /** * Return route types. diff --git a/packages/core/src/decorators/transport/TransportDecoratorExtension.ts b/packages/didcomm/src/decorators/transport/TransportDecoratorExtension.ts similarity index 95% rename from packages/core/src/decorators/transport/TransportDecoratorExtension.ts rename to packages/didcomm/src/decorators/transport/TransportDecoratorExtension.ts index b62f985cf7..5e1a98811d 100644 --- a/packages/core/src/decorators/transport/TransportDecoratorExtension.ts +++ b/packages/didcomm/src/decorators/transport/TransportDecoratorExtension.ts @@ -1,4 +1,4 @@ -import type { BaseMessageConstructor } from '../../agent/BaseMessage' +import type { BaseMessageConstructor } from '../../BaseMessage' import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, ValidateNested } from 'class-validator' diff --git a/packages/core/src/error/MessageSendingError.ts b/packages/didcomm/src/errors/MessageSendingError.ts similarity index 77% rename from packages/core/src/error/MessageSendingError.ts rename to packages/didcomm/src/errors/MessageSendingError.ts index eb511be5e9..a0f4257a52 100644 --- a/packages/core/src/error/MessageSendingError.ts +++ b/packages/didcomm/src/errors/MessageSendingError.ts @@ -1,6 +1,6 @@ -import type { OutboundMessageContext } from '../agent/models' +import type { OutboundMessageContext } from '../models' -import { CredoError } from './CredoError' +import { CredoError } from '@credo-ts/core' export class MessageSendingError extends CredoError { public outboundMessageContext: OutboundMessageContext diff --git a/packages/didcomm/src/errors/index.ts b/packages/didcomm/src/errors/index.ts new file mode 100644 index 0000000000..351029fa43 --- /dev/null +++ b/packages/didcomm/src/errors/index.ts @@ -0,0 +1,2 @@ +export * from './problem-reports' +export { MessageSendingError } from './MessageSendingError' diff --git a/packages/core/src/modules/problem-reports/errors/ProblemReportError.ts b/packages/didcomm/src/errors/problem-reports/ProblemReportError.ts similarity index 75% rename from packages/core/src/modules/problem-reports/errors/ProblemReportError.ts rename to packages/didcomm/src/errors/problem-reports/ProblemReportError.ts index 8fe3dd8db5..039bf5adbd 100644 --- a/packages/core/src/modules/problem-reports/errors/ProblemReportError.ts +++ b/packages/didcomm/src/errors/problem-reports/ProblemReportError.ts @@ -1,5 +1,6 @@ -import { CredoError } from '../../../error/CredoError' -import { ProblemReportMessage } from '../messages/ProblemReportMessage' +import { CredoError } from '@credo-ts/core' + +import { ProblemReportMessage } from '../../messages/problem-reports/ProblemReportMessage' export interface ProblemReportErrorOptions { problemCode: string diff --git a/packages/core/src/modules/problem-reports/errors/index.ts b/packages/didcomm/src/errors/problem-reports/index.ts similarity index 100% rename from packages/core/src/modules/problem-reports/errors/index.ts rename to packages/didcomm/src/errors/problem-reports/index.ts diff --git a/packages/core/src/agent/getOutboundMessageContext.ts b/packages/didcomm/src/getOutboundMessageContext.ts similarity index 93% rename from packages/core/src/agent/getOutboundMessageContext.ts rename to packages/didcomm/src/getOutboundMessageContext.ts index 86af4462f9..c543b86648 100644 --- a/packages/core/src/agent/getOutboundMessageContext.ts +++ b/packages/didcomm/src/getOutboundMessageContext.ts @@ -1,20 +1,17 @@ import type { AgentMessage } from './AgentMessage' -import type { AgentContext } from './context' -import type { ConnectionRecord, Routing } from '../modules/connections' -import type { ResolvedDidCommService } from '../modules/didcomm' -import type { OutOfBandRecord } from '../modules/oob' -import type { BaseRecordAny } from '../storage/BaseRecord' - -import { Key } from '../crypto' -import { ServiceDecorator } from '../decorators/service/ServiceDecorator' -import { CredoError } from '../error' -import { InvitationType, OutOfBandRepository, OutOfBandRole, OutOfBandService } from '../modules/oob' -import { OutOfBandRecordMetadataKeys } from '../modules/oob/repository/outOfBandRecordMetadataTypes' -import { RoutingService } from '../modules/routing' -import { DidCommMessageRepository, DidCommMessageRole } from '../storage/didcomm' -import { uuid } from '../utils/uuid' +import type { Routing } from './models' +import type { ConnectionRecord } from './modules/connections/repository' +import type { OutOfBandRecord } from './modules/oob' +import type { AgentContext, BaseRecordAny, ResolvedDidCommService } from '@credo-ts/core' +import { CredoError, Key, utils } from '@credo-ts/core' + +import { ServiceDecorator } from './decorators/service/ServiceDecorator' import { OutboundMessageContext } from './models' +import { InvitationType, OutOfBandRepository, OutOfBandRole, OutOfBandService } from './modules/oob' +import { OutOfBandRecordMetadataKeys } from './modules/oob/repository/outOfBandRecordMetadataTypes' +import { RoutingService } from './modules/routing' +import { DidCommMessageRepository, DidCommMessageRole } from './repository' /** * Maybe these methods should be moved to a service, but that would require @@ -272,7 +269,7 @@ async function createOurService( } return { - id: uuid(), + id: utils.uuid(), serviceEndpoint: routing.endpoints[0], recipientKeys: [routing.recipientKey], routingKeys: routing.routingKeys, diff --git a/packages/core/src/agent/MessageHandler.ts b/packages/didcomm/src/handlers/MessageHandler.ts similarity index 89% rename from packages/core/src/agent/MessageHandler.ts rename to packages/didcomm/src/handlers/MessageHandler.ts index 692cea5cc5..49f5fb5cc3 100644 --- a/packages/core/src/agent/MessageHandler.ts +++ b/packages/didcomm/src/handlers/MessageHandler.ts @@ -1,5 +1,5 @@ -import type { ConstructableAgentMessage } from './AgentMessage' -import type { InboundMessageContext, OutboundMessageContext } from './models' +import type { ConstructableAgentMessage } from '../AgentMessage' +import type { InboundMessageContext, OutboundMessageContext } from '../models' export interface MessageHandler { readonly supportedMessages: readonly ConstructableAgentMessage[] diff --git a/packages/core/src/agent/MessageHandlerMiddleware.ts b/packages/didcomm/src/handlers/MessageHandlerMiddleware.ts similarity index 92% rename from packages/core/src/agent/MessageHandlerMiddleware.ts rename to packages/didcomm/src/handlers/MessageHandlerMiddleware.ts index 9eff446bbd..180149f7b3 100644 --- a/packages/core/src/agent/MessageHandlerMiddleware.ts +++ b/packages/didcomm/src/handlers/MessageHandlerMiddleware.ts @@ -1,4 +1,4 @@ -import type { InboundMessageContext } from './models/InboundMessageContext' +import type { InboundMessageContext } from '../models/InboundMessageContext' export interface MessageHandlerMiddleware { (inboundMessageContext: InboundMessageContext, next: () => Promise): Promise diff --git a/packages/didcomm/src/handlers/index.ts b/packages/didcomm/src/handlers/index.ts new file mode 100644 index 0000000000..1f309df07b --- /dev/null +++ b/packages/didcomm/src/handlers/index.ts @@ -0,0 +1,2 @@ +export { MessageHandler, MessageHandlerInboundMessage } from './MessageHandler' +export { MessageHandlerMiddleware, MessageHandlerMiddlewareRunner } from './MessageHandlerMiddleware' diff --git a/packages/didcomm/src/index.ts b/packages/didcomm/src/index.ts new file mode 100644 index 0000000000..318bdf4c2d --- /dev/null +++ b/packages/didcomm/src/index.ts @@ -0,0 +1,44 @@ +export * from './errors' +export * from './handlers' +export * from './messages' +export * from './models' +export * from './modules' +export * from './repository' +export * from './services' +export * from './transport' +export * from './types' + +export * from './Events' +export type { TransportSession } from './TransportService' +export { TransportService } from './TransportService' +export { Attachment, AttachmentData } from './decorators/attachment/Attachment' +export { ServiceDecorator, ServiceDecoratorOptions } from './decorators/service/ServiceDecorator' +export { ReturnRouteTypes } from './decorators/transport/TransportDecorator' +export { AckDecorator } from './decorators/ack/AckDecorator' + +export { FeatureRegistry } from './FeatureRegistry' +export { AgentMessage } from './AgentMessage' +export { Dispatcher } from './Dispatcher' +export { EnvelopeService } from './EnvelopeService' +export { MessageSender } from './MessageSender' +export { MessageReceiver } from './MessageReceiver' +export { MessageHandlerRegistry } from './MessageHandlerRegistry' + +export { DidCommApi } from './DidCommApi' +export { DidCommModule } from './DidCommModule' +export { DidCommModuleConfig, DidCommModuleConfigOptions } from './DidCommModuleConfig' + +export { getOutboundMessageContext } from './getOutboundMessageContext' + +export { getDefaultDidcommModules } from './util/modules' +export { + type ParsedMessageType, + parseMessageType, + IsValidMessageType, + replaceLegacyDidSovPrefix, +} from './util/messageType' + +export { LinkedAttachment, LinkedAttachmentOptions } from './util/LinkedAttachment' +export { oobInvitationFromShortUrl, parseInvitationUrl, parseInvitationShortUrl } from './util/parseInvitation' +export { encodeAttachment, isLinkedAttachment } from './util/attachment' +export { isValidJweStructure } from './util/JWE' diff --git a/packages/core/src/modules/common/messages/AckMessage.ts b/packages/didcomm/src/messages/common/AckMessage.ts similarity index 87% rename from packages/core/src/modules/common/messages/AckMessage.ts rename to packages/didcomm/src/messages/common/AckMessage.ts index 933bfa7620..891bb594af 100644 --- a/packages/core/src/modules/common/messages/AckMessage.ts +++ b/packages/didcomm/src/messages/common/AckMessage.ts @@ -1,7 +1,7 @@ import { IsEnum } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../util/messageType' /** * Ack message status types diff --git a/packages/didcomm/src/messages/common/index.ts b/packages/didcomm/src/messages/common/index.ts new file mode 100644 index 0000000000..70fe5a5d2c --- /dev/null +++ b/packages/didcomm/src/messages/common/index.ts @@ -0,0 +1 @@ +export * from './AckMessage' diff --git a/packages/didcomm/src/messages/index.ts b/packages/didcomm/src/messages/index.ts new file mode 100644 index 0000000000..7aa0fc8d95 --- /dev/null +++ b/packages/didcomm/src/messages/index.ts @@ -0,0 +1,2 @@ +export * from './common' +export * from './problem-reports' diff --git a/packages/core/src/modules/problem-reports/messages/ProblemReportMessage.ts b/packages/didcomm/src/messages/problem-reports/ProblemReportMessage.ts similarity index 95% rename from packages/core/src/modules/problem-reports/messages/ProblemReportMessage.ts rename to packages/didcomm/src/messages/problem-reports/ProblemReportMessage.ts index 2c4a8d16fc..840e92678a 100644 --- a/packages/core/src/modules/problem-reports/messages/ProblemReportMessage.ts +++ b/packages/didcomm/src/messages/problem-reports/ProblemReportMessage.ts @@ -2,8 +2,8 @@ import { Expose } from 'class-transformer' import { IsEnum, IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../util/messageType' export enum WhoRetriesStatus { You = 'YOU', diff --git a/packages/core/src/modules/problem-reports/messages/index.ts b/packages/didcomm/src/messages/problem-reports/index.ts similarity index 100% rename from packages/core/src/modules/problem-reports/messages/index.ts rename to packages/didcomm/src/messages/problem-reports/index.ts diff --git a/packages/core/src/agent/models/InboundMessageContext.ts b/packages/didcomm/src/models/InboundMessageContext.ts similarity index 87% rename from packages/core/src/agent/models/InboundMessageContext.ts rename to packages/didcomm/src/models/InboundMessageContext.ts index 67ae9274e1..bb540105d7 100644 --- a/packages/core/src/agent/models/InboundMessageContext.ts +++ b/packages/didcomm/src/models/InboundMessageContext.ts @@ -1,12 +1,11 @@ import type { OutboundMessageContext } from './OutboundMessageContext' -import type { Key } from '../../crypto' -import type { ConnectionRecord } from '../../modules/connections' -import type { EncryptedMessage } from '../../types' import type { AgentMessage } from '../AgentMessage' -import type { MessageHandler } from '../MessageHandler' -import type { AgentContext } from '../context' +import type { MessageHandler } from '../handlers' +import type { ConnectionRecord } from '../modules/connections/repository' +import type { EncryptedMessage } from '../types' +import type { AgentContext, Key } from '@credo-ts/core' -import { CredoError } from '../../error' +import { CredoError } from '@credo-ts/core' export interface MessageContextParams { connection?: ConnectionRecord diff --git a/packages/core/src/agent/models/OutboundMessageContext.ts b/packages/didcomm/src/models/OutboundMessageContext.ts similarity index 85% rename from packages/core/src/agent/models/OutboundMessageContext.ts rename to packages/didcomm/src/models/OutboundMessageContext.ts index bb031594c1..1a2bf2e7d5 100644 --- a/packages/core/src/agent/models/OutboundMessageContext.ts +++ b/packages/didcomm/src/models/OutboundMessageContext.ts @@ -1,14 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import type { InboundMessageContext } from './InboundMessageContext' -import type { Key } from '../../crypto' -import type { ConnectionRecord } from '../../modules/connections' -import type { ResolvedDidCommService } from '../../modules/didcomm' -import type { OutOfBandRecord } from '../../modules/oob' -import type { BaseRecord } from '../../storage/BaseRecord' import type { AgentMessage } from '../AgentMessage' -import type { AgentContext } from '../context' +import type { ConnectionRecord } from '../modules/connections/repository' +import type { OutOfBandRecord } from '../modules/oob' +import type { AgentContext, BaseRecord, Key, ResolvedDidCommService } from '@credo-ts/core' -import { CredoError } from '../../error' +import { CredoError } from '@credo-ts/core' export interface ServiceMessageParams { senderKey: Key diff --git a/packages/core/src/agent/models/OutboundMessageSendStatus.ts b/packages/didcomm/src/models/OutboundMessageSendStatus.ts similarity index 100% rename from packages/core/src/agent/models/OutboundMessageSendStatus.ts rename to packages/didcomm/src/models/OutboundMessageSendStatus.ts diff --git a/packages/didcomm/src/models/Routing.ts b/packages/didcomm/src/models/Routing.ts new file mode 100644 index 0000000000..c1b293f32d --- /dev/null +++ b/packages/didcomm/src/models/Routing.ts @@ -0,0 +1,8 @@ +import type { Key } from '@credo-ts/core' + +export interface Routing { + endpoints: string[] + recipientKey: Key + routingKeys: Key[] + mediatorId?: string +} diff --git a/packages/core/src/agent/models/features/Feature.ts b/packages/didcomm/src/models/features/Feature.ts similarity index 92% rename from packages/core/src/agent/models/features/Feature.ts rename to packages/didcomm/src/models/features/Feature.ts index 00464ee77f..07cf29d765 100644 --- a/packages/core/src/agent/models/features/Feature.ts +++ b/packages/didcomm/src/models/features/Feature.ts @@ -1,9 +1,7 @@ +import { CredoError, JsonTransformer } from '@credo-ts/core' import { Expose } from 'class-transformer' import { IsString } from 'class-validator' -import { CredoError } from '../../../error' -import { JsonTransformer } from '../../../utils/JsonTransformer' - export interface FeatureOptions { id: string type: string diff --git a/packages/core/src/agent/models/features/FeatureQuery.ts b/packages/didcomm/src/models/features/FeatureQuery.ts similarity index 100% rename from packages/core/src/agent/models/features/FeatureQuery.ts rename to packages/didcomm/src/models/features/FeatureQuery.ts diff --git a/packages/core/src/agent/models/features/GoalCode.ts b/packages/didcomm/src/models/features/GoalCode.ts similarity index 100% rename from packages/core/src/agent/models/features/GoalCode.ts rename to packages/didcomm/src/models/features/GoalCode.ts diff --git a/packages/core/src/agent/models/features/GovernanceFramework.ts b/packages/didcomm/src/models/features/GovernanceFramework.ts similarity index 100% rename from packages/core/src/agent/models/features/GovernanceFramework.ts rename to packages/didcomm/src/models/features/GovernanceFramework.ts diff --git a/packages/core/src/agent/models/features/Protocol.ts b/packages/didcomm/src/models/features/Protocol.ts similarity index 100% rename from packages/core/src/agent/models/features/Protocol.ts rename to packages/didcomm/src/models/features/Protocol.ts diff --git a/packages/core/src/agent/models/features/index.ts b/packages/didcomm/src/models/features/index.ts similarity index 100% rename from packages/core/src/agent/models/features/index.ts rename to packages/didcomm/src/models/features/index.ts diff --git a/packages/core/src/agent/models/index.ts b/packages/didcomm/src/models/index.ts similarity index 71% rename from packages/core/src/agent/models/index.ts rename to packages/didcomm/src/models/index.ts index 1383036898..2fe6bc6e89 100644 --- a/packages/core/src/agent/models/index.ts +++ b/packages/didcomm/src/models/index.ts @@ -1,4 +1,6 @@ export * from './features' +export * from './problem-reports' export * from './InboundMessageContext' export * from './OutboundMessageContext' export * from './OutboundMessageSendStatus' +export * from './Routing' diff --git a/packages/core/src/modules/problem-reports/models/ProblemReportReason.ts b/packages/didcomm/src/models/problem-reports/ProblemReportReason.ts similarity index 100% rename from packages/core/src/modules/problem-reports/models/ProblemReportReason.ts rename to packages/didcomm/src/models/problem-reports/ProblemReportReason.ts diff --git a/packages/core/src/modules/problem-reports/models/index.ts b/packages/didcomm/src/models/problem-reports/index.ts similarity index 100% rename from packages/core/src/modules/problem-reports/models/index.ts rename to packages/didcomm/src/models/problem-reports/index.ts diff --git a/packages/core/src/modules/basic-messages/BasicMessageEvents.ts b/packages/didcomm/src/modules/basic-messages/BasicMessageEvents.ts similarity index 88% rename from packages/core/src/modules/basic-messages/BasicMessageEvents.ts rename to packages/didcomm/src/modules/basic-messages/BasicMessageEvents.ts index f05873f5de..b143045900 100644 --- a/packages/core/src/modules/basic-messages/BasicMessageEvents.ts +++ b/packages/didcomm/src/modules/basic-messages/BasicMessageEvents.ts @@ -1,6 +1,6 @@ import type { BasicMessage } from './messages' import type { BasicMessageRecord } from './repository' -import type { BaseEvent } from '../../agent/Events' +import type { BaseEvent } from '@credo-ts/core' export enum BasicMessageEventTypes { BasicMessageStateChanged = 'BasicMessageStateChanged', diff --git a/packages/core/src/modules/basic-messages/BasicMessageRole.ts b/packages/didcomm/src/modules/basic-messages/BasicMessageRole.ts similarity index 100% rename from packages/core/src/modules/basic-messages/BasicMessageRole.ts rename to packages/didcomm/src/modules/basic-messages/BasicMessageRole.ts diff --git a/packages/core/src/modules/basic-messages/BasicMessagesApi.ts b/packages/didcomm/src/modules/basic-messages/BasicMessagesApi.ts similarity index 89% rename from packages/core/src/modules/basic-messages/BasicMessagesApi.ts rename to packages/didcomm/src/modules/basic-messages/BasicMessagesApi.ts index 644926756a..c8149056ba 100644 --- a/packages/core/src/modules/basic-messages/BasicMessagesApi.ts +++ b/packages/didcomm/src/modules/basic-messages/BasicMessagesApi.ts @@ -1,12 +1,12 @@ import type { BasicMessageRecord } from './repository/BasicMessageRecord' -import type { Query, QueryOptions } from '../../storage/StorageService' +import type { Query, QueryOptions } from '@credo-ts/core' -import { AgentContext } from '../../agent' -import { MessageHandlerRegistry } from '../../agent/MessageHandlerRegistry' -import { MessageSender } from '../../agent/MessageSender' -import { OutboundMessageContext } from '../../agent/models' -import { injectable } from '../../plugins' -import { ConnectionService } from '../connections' +import { AgentContext, injectable } from '@credo-ts/core' + +import { MessageHandlerRegistry } from '../../MessageHandlerRegistry' +import { MessageSender } from '../../MessageSender' +import { OutboundMessageContext } from '../../models' +import { ConnectionService } from '../connections/services' import { BasicMessageHandler } from './handlers' import { BasicMessageService } from './services' diff --git a/packages/core/src/modules/basic-messages/BasicMessagesModule.ts b/packages/didcomm/src/modules/basic-messages/BasicMessagesModule.ts similarity index 66% rename from packages/core/src/modules/basic-messages/BasicMessagesModule.ts rename to packages/didcomm/src/modules/basic-messages/BasicMessagesModule.ts index 346b3bd1c4..8affa839c6 100644 --- a/packages/core/src/modules/basic-messages/BasicMessagesModule.ts +++ b/packages/didcomm/src/modules/basic-messages/BasicMessagesModule.ts @@ -1,7 +1,7 @@ -import type { FeatureRegistry } from '../../agent/FeatureRegistry' -import type { DependencyManager, Module } from '../../plugins' +import type { AgentContext, DependencyManager, Module } from '@credo-ts/core' -import { Protocol } from '../../agent/models' +import { FeatureRegistry } from '../../FeatureRegistry' +import { Protocol } from '../../models' import { BasicMessageRole } from './BasicMessageRole' import { BasicMessagesApi } from './BasicMessagesApi' @@ -14,14 +14,17 @@ export class BasicMessagesModule implements Module { /** * Registers the dependencies of the basic message module on the dependency manager. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Services dependencyManager.registerSingleton(BasicMessageService) // Repositories dependencyManager.registerSingleton(BasicMessageRepository) + } + + public async initialize(agentContext: AgentContext): Promise { + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) - // Features featureRegistry.register( new Protocol({ id: 'https://didcomm.org/basicmessage/1.0', diff --git a/packages/core/src/modules/basic-messages/__tests__/BasicMessageService.test.ts b/packages/didcomm/src/modules/basic-messages/__tests__/BasicMessageService.test.ts similarity index 93% rename from packages/core/src/modules/basic-messages/__tests__/BasicMessageService.test.ts rename to packages/didcomm/src/modules/basic-messages/__tests__/BasicMessageService.test.ts index 83dd0c4c01..c6e1d075cd 100644 --- a/packages/core/src/modules/basic-messages/__tests__/BasicMessageService.test.ts +++ b/packages/didcomm/src/modules/basic-messages/__tests__/BasicMessageService.test.ts @@ -1,6 +1,6 @@ -import { getAgentContext, getMockConnection } from '../../../../tests/helpers' -import { EventEmitter } from '../../../agent/EventEmitter' -import { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import { EventEmitter } from '../../../../../core/src/agent/EventEmitter' +import { getAgentContext, getMockConnection } from '../../../../../core/tests/helpers' +import { InboundMessageContext } from '../../../models' import { BasicMessageRole } from '../BasicMessageRole' import { BasicMessage } from '../messages' import { BasicMessageRecord } from '../repository/BasicMessageRecord' @@ -11,7 +11,7 @@ jest.mock('../repository/BasicMessageRepository') const BasicMessageRepositoryMock = BasicMessageRepository as jest.Mock const basicMessageRepository = new BasicMessageRepositoryMock() -jest.mock('../../../agent/EventEmitter') +jest.mock('../../../../../core/src/agent/EventEmitter') const EventEmitterMock = EventEmitter as jest.Mock const eventEmitter = new EventEmitterMock() diff --git a/packages/didcomm/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts b/packages/didcomm/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts new file mode 100644 index 0000000000..7ff362c02e --- /dev/null +++ b/packages/didcomm/src/modules/basic-messages/__tests__/BasicMessagesModule.test.ts @@ -0,0 +1,27 @@ +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { DependencyManager } from '@credo-ts/core' + +import { BasicMessagesModule } from '../BasicMessagesModule' +import { BasicMessageRepository } from '../repository' +import { BasicMessageService } from '../services' + +const featureRegistry = { + register: jest.fn(), +} as unknown as FeatureRegistry + +const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + registerContextScoped: jest.fn(), + resolve: () => featureRegistry, +} as unknown as DependencyManager + +describe('BasicMessagesModule', () => { + test('registers dependencies on the dependency manager', () => { + new BasicMessagesModule().register(dependencyManager) + + expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(BasicMessageService) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(BasicMessageRepository) + }) +}) diff --git a/packages/core/src/modules/basic-messages/__tests__/basic-messages.test.ts b/packages/didcomm/src/modules/basic-messages/__tests__/basic-messages.test.ts similarity index 68% rename from packages/core/src/modules/basic-messages/__tests__/basic-messages.test.ts rename to packages/didcomm/src/modules/basic-messages/__tests__/basic-messages.test.ts index 57ceae6bb5..9682b14bf1 100644 --- a/packages/core/src/modules/basic-messages/__tests__/basic-messages.test.ts +++ b/packages/didcomm/src/modules/basic-messages/__tests__/basic-messages.test.ts @@ -1,15 +1,15 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { SubjectMessage } from '../../../../../../tests/transport/SubjectInboundTransport' -import type { ConnectionRecord } from '../../../modules/connections' +import type { ConnectionRecord } from '../../connections' +import { Agent, RecordNotFoundError } from '@credo-ts/core' import { Subject } from 'rxjs' import { SubjectInboundTransport } from '../../../../../../tests/transport/SubjectInboundTransport' import { SubjectOutboundTransport } from '../../../../../../tests/transport/SubjectOutboundTransport' -import { getInMemoryAgentOptions, makeConnection, waitForBasicMessage } from '../../../../tests/helpers' -import testLogger from '../../../../tests/logger' -import { Agent } from '../../../agent/Agent' -import { MessageSendingError, RecordNotFoundError } from '../../../error' +import { getInMemoryAgentOptions, makeConnection, waitForBasicMessage } from '../../../../../core/tests/helpers' +import testLogger from '../../../../../core/tests/logger' +import { MessageSendingError } from '../../../errors' import { BasicMessage } from '../messages' import { BasicMessageRecord } from '../repository' @@ -36,13 +36,13 @@ describe('Basic Messages E2E', () => { } faberAgent = new Agent(faberConfig) - faberAgent.registerInboundTransport(new SubjectInboundTransport(faberMessages)) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(faberMessages)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() aliceAgent = new Agent(aliceConfig) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() ;[aliceConnection, faberConnection] = await makeConnection(aliceAgent, faberAgent) }) @@ -56,7 +56,7 @@ describe('Basic Messages E2E', () => { test('Alice and Faber exchange messages', async () => { testLogger.test('Alice sends message to Faber') - const helloRecord = await aliceAgent.basicMessages.sendMessage(aliceConnection.id, 'Hello') + const helloRecord = await aliceAgent.modules.basicMessages.sendMessage(aliceConnection.id, 'Hello') expect(helloRecord.content).toBe('Hello') @@ -66,7 +66,7 @@ describe('Basic Messages E2E', () => { }) testLogger.test('Faber sends message to Alice') - const replyRecord = await faberAgent.basicMessages.sendMessage(faberConnection.id, 'How are you?') + const replyRecord = await faberAgent.modules.basicMessages.sendMessage(faberConnection.id, 'How are you?') expect(replyRecord.content).toBe('How are you?') testLogger.test('Alice waits until she receives message from faber') @@ -77,7 +77,7 @@ describe('Basic Messages E2E', () => { test('Alice and Faber exchange messages using threadId', async () => { testLogger.test('Alice sends message to Faber') - const helloRecord = await aliceAgent.basicMessages.sendMessage(aliceConnection.id, 'Hello') + const helloRecord = await aliceAgent.modules.basicMessages.sendMessage(aliceConnection.id, 'Hello') expect(helloRecord.content).toBe('Hello') @@ -87,7 +87,11 @@ describe('Basic Messages E2E', () => { }) testLogger.test('Faber sends message to Alice') - const replyRecord = await faberAgent.basicMessages.sendMessage(faberConnection.id, 'How are you?', helloMessage.id) + const replyRecord = await faberAgent.modules.basicMessages.sendMessage( + faberConnection.id, + 'How are you?', + helloMessage.id + ) expect(replyRecord.content).toBe('How are you?') expect(replyRecord.parentThreadId).toBe(helloMessage.id) @@ -100,8 +104,8 @@ describe('Basic Messages E2E', () => { // Both sender and recipient shall be able to find the threaded messages // Hello message - const aliceHelloMessage = await aliceAgent.basicMessages.getByThreadId(helloMessage.id) - const faberHelloMessage = await faberAgent.basicMessages.getByThreadId(helloMessage.id) + const aliceHelloMessage = await aliceAgent.modules.basicMessages.getByThreadId(helloMessage.id) + const faberHelloMessage = await faberAgent.modules.basicMessages.getByThreadId(helloMessage.id) expect(aliceHelloMessage).toMatchObject({ content: helloRecord.content, threadId: helloRecord.threadId, @@ -112,8 +116,12 @@ describe('Basic Messages E2E', () => { }) // Reply message - const aliceReplyMessages = await aliceAgent.basicMessages.findAllByQuery({ parentThreadId: helloMessage.id }) - const faberReplyMessages = await faberAgent.basicMessages.findAllByQuery({ parentThreadId: helloMessage.id }) + const aliceReplyMessages = await aliceAgent.modules.basicMessages.findAllByQuery({ + parentThreadId: helloMessage.id, + }) + const faberReplyMessages = await faberAgent.modules.basicMessages.findAllByQuery({ + parentThreadId: helloMessage.id, + }) expect(aliceReplyMessages.length).toBe(1) expect(aliceReplyMessages[0]).toMatchObject({ content: replyRecord.content, @@ -127,13 +135,15 @@ describe('Basic Messages E2E', () => { test('Alice is unable to send a message', async () => { testLogger.test('Alice sends message to Faber that is undeliverable') - const spy = jest.spyOn(aliceAgent.outboundTransports[0], 'sendMessage').mockRejectedValue(new Error('any error')) + const spy = jest + .spyOn(aliceAgent.modules.didcomm.outboundTransports[0], 'sendMessage') + .mockRejectedValue(new Error('any error')) - await expect(aliceAgent.basicMessages.sendMessage(aliceConnection.id, 'Hello')).rejects.toThrowError( + await expect(aliceAgent.modules.basicMessages.sendMessage(aliceConnection.id, 'Hello')).rejects.toThrowError( MessageSendingError ) try { - await aliceAgent.basicMessages.sendMessage(aliceConnection.id, 'Hello undeliverable') + await aliceAgent.modules.basicMessages.sendMessage(aliceConnection.id, 'Hello undeliverable') } catch (error) { const thrownError = error as MessageSendingError expect(thrownError.message).toEqual( @@ -145,15 +155,15 @@ describe('Basic Messages E2E', () => { expect((thrownError.outboundMessageContext.message as BasicMessage).content).toBe('Hello undeliverable') testLogger.test('Created record can be found and deleted by id') - const storedRecord = await aliceAgent.basicMessages.getById( + const storedRecord = await aliceAgent.modules.basicMessages.getById( thrownError.outboundMessageContext.associatedRecord!.id ) expect(storedRecord).toBeInstanceOf(BasicMessageRecord) expect(storedRecord.content).toBe('Hello undeliverable') - await aliceAgent.basicMessages.deleteById(storedRecord.id) + await aliceAgent.modules.basicMessages.deleteById(storedRecord.id) await expect( - aliceAgent.basicMessages.getById(thrownError.outboundMessageContext.associatedRecord!.id) + aliceAgent.modules.basicMessages.getById(thrownError.outboundMessageContext.associatedRecord!.id) ).rejects.toThrowError(RecordNotFoundError) } spy.mockClear() diff --git a/packages/core/src/modules/basic-messages/handlers/BasicMessageHandler.ts b/packages/didcomm/src/modules/basic-messages/handlers/BasicMessageHandler.ts similarity index 95% rename from packages/core/src/modules/basic-messages/handlers/BasicMessageHandler.ts rename to packages/didcomm/src/modules/basic-messages/handlers/BasicMessageHandler.ts index cec6931983..6ff699e16f 100644 --- a/packages/core/src/modules/basic-messages/handlers/BasicMessageHandler.ts +++ b/packages/didcomm/src/modules/basic-messages/handlers/BasicMessageHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { BasicMessageService } from '../services/BasicMessageService' import { BasicMessage } from '../messages' diff --git a/packages/core/src/modules/basic-messages/handlers/index.ts b/packages/didcomm/src/modules/basic-messages/handlers/index.ts similarity index 100% rename from packages/core/src/modules/basic-messages/handlers/index.ts rename to packages/didcomm/src/modules/basic-messages/handlers/index.ts diff --git a/packages/core/src/modules/basic-messages/index.ts b/packages/didcomm/src/modules/basic-messages/index.ts similarity index 100% rename from packages/core/src/modules/basic-messages/index.ts rename to packages/didcomm/src/modules/basic-messages/index.ts diff --git a/packages/core/src/modules/basic-messages/messages/BasicMessage.ts b/packages/didcomm/src/modules/basic-messages/messages/BasicMessage.ts similarity index 89% rename from packages/core/src/modules/basic-messages/messages/BasicMessage.ts rename to packages/didcomm/src/modules/basic-messages/messages/BasicMessage.ts index 7dd48b5dde..f5d4fdeae2 100644 --- a/packages/core/src/modules/basic-messages/messages/BasicMessage.ts +++ b/packages/didcomm/src/modules/basic-messages/messages/BasicMessage.ts @@ -1,9 +1,9 @@ import { Expose, Transform } from 'class-transformer' import { IsDate, IsString } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' -import { DateParser } from '../../../utils/transformers' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' +import { DateParser } from '../../../util/transformers' export class BasicMessage extends AgentMessage { public readonly allowDidSovPrefix = true diff --git a/packages/core/src/modules/basic-messages/messages/index.ts b/packages/didcomm/src/modules/basic-messages/messages/index.ts similarity index 100% rename from packages/core/src/modules/basic-messages/messages/index.ts rename to packages/didcomm/src/modules/basic-messages/messages/index.ts diff --git a/packages/core/src/modules/basic-messages/repository/BasicMessageRecord.ts b/packages/didcomm/src/modules/basic-messages/repository/BasicMessageRecord.ts similarity index 88% rename from packages/core/src/modules/basic-messages/repository/BasicMessageRecord.ts rename to packages/didcomm/src/modules/basic-messages/repository/BasicMessageRecord.ts index 42199106c6..62384dcced 100644 --- a/packages/core/src/modules/basic-messages/repository/BasicMessageRecord.ts +++ b/packages/didcomm/src/modules/basic-messages/repository/BasicMessageRecord.ts @@ -1,8 +1,7 @@ -import type { RecordTags, TagsBase } from '../../../storage/BaseRecord' import type { BasicMessageRole } from '../BasicMessageRole' +import type { RecordTags, TagsBase } from '@credo-ts/core' -import { BaseRecord } from '../../../storage/BaseRecord' -import { uuid } from '../../../utils/uuid' +import { BaseRecord, utils } from '@credo-ts/core' export type CustomBasicMessageTags = TagsBase export type DefaultBasicMessageTags = { @@ -41,7 +40,7 @@ export class BasicMessageRecord extends BaseRecord { // Features + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) + featureRegistry.register( new Protocol({ id: 'https://didcomm.org/connections/1.0', diff --git a/packages/core/src/modules/connections/ConnectionsModuleConfig.ts b/packages/didcomm/src/modules/connections/ConnectionsModuleConfig.ts similarity index 98% rename from packages/core/src/modules/connections/ConnectionsModuleConfig.ts rename to packages/didcomm/src/modules/connections/ConnectionsModuleConfig.ts index a978241c70..0ea97be5dd 100644 --- a/packages/core/src/modules/connections/ConnectionsModuleConfig.ts +++ b/packages/didcomm/src/modules/connections/ConnectionsModuleConfig.ts @@ -1,4 +1,4 @@ -import { PeerDidNumAlgo } from '../dids' +import { PeerDidNumAlgo } from '@credo-ts/core' /** * ConnectionsModuleConfigOptions defines the interface for the options of the ConnectionsModuleConfig class. diff --git a/packages/core/src/modules/connections/DidExchangeProtocol.ts b/packages/didcomm/src/modules/connections/DidExchangeProtocol.ts similarity index 95% rename from packages/core/src/modules/connections/DidExchangeProtocol.ts rename to packages/didcomm/src/modules/connections/DidExchangeProtocol.ts index ce77b8b2eb..ef73da90b4 100644 --- a/packages/core/src/modules/connections/DidExchangeProtocol.ts +++ b/packages/didcomm/src/modules/connections/DidExchangeProtocol.ts @@ -1,25 +1,25 @@ import type { ConnectionRecord } from './repository' -import type { Routing } from './services/ConnectionService' -import type { AgentContext } from '../../agent' -import type { InboundMessageContext } from '../../agent/models/InboundMessageContext' -import type { ParsedMessageType } from '../../utils/messageType' -import type { ResolvedDidCommService } from '../didcomm' +import type { Routing } from '../../models' import type { OutOfBandRecord } from '../oob/repository' +import type { AgentContext, ResolvedDidCommService } from '@credo-ts/core' -import { InjectionSymbols } from '../../constants' -import { Key, KeyType } from '../../crypto' -import { JwsService } from '../../crypto/JwsService' -import { JwaSignatureAlgorithm } from '../../crypto/jose/jwa' -import { getJwkFromKey } from '../../crypto/jose/jwk' -import { Attachment, AttachmentData } from '../../decorators/attachment/Attachment' -import { CredoError } from '../../error' -import { Logger } from '../../logger' -import { inject, injectable } from '../../plugins' -import { TypedArrayEncoder, isDid, Buffer } from '../../utils' -import { JsonEncoder } from '../../utils/JsonEncoder' -import { JsonTransformer } from '../../utils/JsonTransformer' -import { base64ToBase64URL } from '../../utils/base64' import { + InjectionSymbols, + Key, + KeyType, + JwsService, + JwaSignatureAlgorithm, + getJwkFromKey, + Logger, + CredoError, + inject, + injectable, + TypedArrayEncoder, + isDid, + Buffer, + JsonEncoder, + JsonTransformer, + base64ToBase64URL, DidDocument, DidKey, getNumAlgoFromPeerDid, @@ -27,11 +27,15 @@ import { DidsApi, isValidPeerDid, getAlternativeDidsForPeerDid, -} from '../dids' -import { getKeyFromVerificationMethod } from '../dids/domain/key-type' -import { tryParseDid } from '../dids/domain/parse' -import { didKeyToInstanceOfKey } from '../dids/helpers' -import { DidRepository } from '../dids/repository' + getKeyFromVerificationMethod, + tryParseDid, + didKeyToInstanceOfKey, + DidRepository, +} from '@credo-ts/core' + +import { Attachment, AttachmentData } from '../../decorators/attachment/Attachment' +import { InboundMessageContext } from '../../models' +import { ParsedMessageType } from '../../util/messageType' import { OutOfBandRole } from '../oob/domain/OutOfBandRole' import { OutOfBandState } from '../oob/domain/OutOfBandState' import { getMediationRecordForDidDocument } from '../routing/services/helpers' diff --git a/packages/core/src/modules/connections/DidExchangeStateMachine.ts b/packages/didcomm/src/modules/connections/DidExchangeStateMachine.ts similarity index 94% rename from packages/core/src/modules/connections/DidExchangeStateMachine.ts rename to packages/didcomm/src/modules/connections/DidExchangeStateMachine.ts index 9a962ce77e..6702293704 100644 --- a/packages/core/src/modules/connections/DidExchangeStateMachine.ts +++ b/packages/didcomm/src/modules/connections/DidExchangeStateMachine.ts @@ -1,8 +1,9 @@ import type { ConnectionRecord } from './repository' -import type { ParsedMessageType } from '../../utils/messageType' +import type { ParsedMessageType } from '../../util/messageType' -import { CredoError } from '../../error' -import { canHandleMessageType } from '../../utils/messageType' +import { CredoError } from '@credo-ts/core' + +import { canHandleMessageType } from '../../util/messageType' import { DidExchangeRequestMessage, DidExchangeResponseMessage, DidExchangeCompleteMessage } from './messages' import { DidExchangeState, DidExchangeRole } from './models' diff --git a/packages/core/src/modules/connections/TrustPingEvents.ts b/packages/didcomm/src/modules/connections/TrustPingEvents.ts similarity index 84% rename from packages/core/src/modules/connections/TrustPingEvents.ts rename to packages/didcomm/src/modules/connections/TrustPingEvents.ts index 2b0fcf66c9..8f45c72c84 100644 --- a/packages/core/src/modules/connections/TrustPingEvents.ts +++ b/packages/didcomm/src/modules/connections/TrustPingEvents.ts @@ -1,6 +1,6 @@ import type { TrustPingMessage, TrustPingResponseMessage } from './messages' -import type { ConnectionRecord } from './repository/ConnectionRecord' -import type { BaseEvent } from '../../agent/Events' +import type { ConnectionRecord } from './repository' +import type { BaseEvent } from '@credo-ts/core' export enum TrustPingEventTypes { TrustPingReceivedEvent = 'TrustPingReceivedEvent', diff --git a/packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts b/packages/didcomm/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts similarity index 96% rename from packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts rename to packages/didcomm/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts index 188083309a..b6a9d58bb2 100644 --- a/packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts @@ -1,10 +1,10 @@ import { validateOrReject } from 'class-validator' import { parseUrl } from 'query-string' +import { ClassValidationError } from '../../../../../core/src/error/ClassValidationError' +import { JsonEncoder } from '../../../../../core/src/utils/JsonEncoder' +import { JsonTransformer } from '../../../../../core/src/utils/JsonTransformer' import { Attachment } from '../../../decorators/attachment/Attachment' -import { ClassValidationError } from '../../../error/ClassValidationError' -import { JsonEncoder } from '../../../utils/JsonEncoder' -import { JsonTransformer } from '../../../utils/JsonTransformer' import { ConnectionInvitationMessage } from '../messages/ConnectionInvitationMessage' describe('ConnectionInvitationMessage', () => { diff --git a/packages/core/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts b/packages/didcomm/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts similarity index 78% rename from packages/core/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts rename to packages/didcomm/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts index 91d9e11955..f86ad751d2 100644 --- a/packages/core/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/ConnectionRequestMessage.test.ts @@ -1,5 +1,5 @@ -import { ClassValidationError } from '../../../error/ClassValidationError' -import { MessageValidator } from '../../../utils/MessageValidator' +import { ClassValidationError } from '../../../../../core/src/error/ClassValidationError' +import { MessageValidator } from '../../../../../core/src/utils' import { ConnectionRequestMessage } from '../messages/ConnectionRequestMessage' describe('ConnectionRequestMessage', () => { diff --git a/packages/core/src/modules/connections/__tests__/ConnectionService.test.ts b/packages/didcomm/src/modules/connections/__tests__/ConnectionService.test.ts similarity index 95% rename from packages/core/src/modules/connections/__tests__/ConnectionService.test.ts rename to packages/didcomm/src/modules/connections/__tests__/ConnectionService.test.ts index 39e46b91a9..dfafbb837a 100644 --- a/packages/core/src/modules/connections/__tests__/ConnectionService.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/ConnectionService.test.ts @@ -1,31 +1,32 @@ -import type { AgentContext } from '../../../agent' -import type { Wallet } from '../../../wallet/Wallet' -import type { Routing } from '../services/ConnectionService' +import type { Routing } from '../../../models' +import type { AgentContext } from '@credo-ts/core/src/agent' +import type { Wallet } from '@credo-ts/core/src/wallet/Wallet' import { Subject } from 'rxjs' import { InMemoryWallet } from '../../../../../../tests/InMemoryWallet' +import { EventEmitter } from '../../../../../core/src/agent/EventEmitter' +import { Key, KeyType } from '../../../../../core/src/crypto' +import { DidKey, IndyAgentService } from '../../../../../core/src/modules/dids' +import { DidDocumentRole } from '../../../../../core/src/modules/dids/domain/DidDocumentRole' +import { DidCommV1Service } from '../../../../../core/src/modules/dids/domain/service/DidCommV1Service' +import { didDocumentJsonToNumAlgo1Did } from '../../../../../core/src/modules/dids/methods/peer/peerDidNumAlgo1' +import { DidRecord, DidRepository } from '../../../../../core/src/modules/dids/repository' +import { JsonTransformer } from '../../../../../core/src/utils/JsonTransformer' +import { indyDidFromPublicKeyBase58 } from '../../../../../core/src/utils/did' +import { uuid } from '../../../../../core/src/utils/uuid' import { getAgentConfig, getAgentContext, getMockConnection, getMockOutOfBand, mockFunction, -} from '../../../../tests/helpers' -import { AgentMessage } from '../../../agent/AgentMessage' -import { EventEmitter } from '../../../agent/EventEmitter' -import { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import { Key, KeyType } from '../../../crypto' +} from '../../../../../core/tests/helpers' +import { AgentMessage } from '../../../AgentMessage' +import { DidCommModuleConfig } from '../../../DidCommModuleConfig' import { signData, unpackAndVerifySignatureDecorator } from '../../../decorators/signature/SignatureDecoratorUtils' -import { JsonTransformer } from '../../../utils/JsonTransformer' -import { indyDidFromPublicKeyBase58 } from '../../../utils/did' -import { uuid } from '../../../utils/uuid' -import { AckMessage, AckStatus } from '../../common' -import { DidKey, IndyAgentService } from '../../dids' -import { DidDocumentRole } from '../../dids/domain/DidDocumentRole' -import { DidCommV1Service } from '../../dids/domain/service/DidCommV1Service' -import { didDocumentJsonToNumAlgo1Did } from '../../dids/methods/peer/peerDidNumAlgo1' -import { DidRecord, DidRepository } from '../../dids/repository' +import { AckMessage, AckStatus } from '../../../messages' +import { InboundMessageContext } from '../../../models' import { OutOfBandService } from '../../oob/OutOfBandService' import { OutOfBandRole } from '../../oob/domain/OutOfBandRole' import { OutOfBandState } from '../../oob/domain/OutOfBandState' @@ -41,14 +42,14 @@ import { ReferencedAuthentication, authenticationTypes, } from '../models' -import { ConnectionRepository } from '../repository/ConnectionRepository' -import { ConnectionService } from '../services/ConnectionService' +import { ConnectionRepository } from '../repository' +import { ConnectionService } from '../services' import { convertToNewDidDocument } from '../services/helpers' jest.mock('../repository/ConnectionRepository') jest.mock('../../oob/repository/OutOfBandRepository') jest.mock('../../oob/OutOfBandService') -jest.mock('../../dids/repository/DidRepository') +jest.mock('../../../../../core/src/modules/dids/repository/DidRepository') const ConnectionRepositoryMock = ConnectionRepository as jest.Mock const OutOfBandRepositoryMock = OutOfBandRepository as jest.Mock const OutOfBandServiceMock = OutOfBandService as jest.Mock @@ -56,8 +57,9 @@ const DidRepositoryMock = DidRepository as jest.Mock const connectionImageUrl = 'https://example.com/image.png' +const endpoint = 'http://agent.com:8080' const agentConfig = getAgentConfig('ConnectionServiceTest', { - endpoints: ['http://agent.com:8080'], + endpoints: [endpoint], connectionImageUrl, }) @@ -83,6 +85,7 @@ describe('ConnectionService', () => { [OutOfBandRepository, outOfBandRepository], [OutOfBandService, outOfBandService], [DidRepository, didRepository], + [DidCommModuleConfig, new DidCommModuleConfig({ endpoints: [endpoint], connectionImageUrl })], ], }) await wallet.createAndOpen(agentConfig.walletConfig) @@ -98,7 +101,7 @@ describe('ConnectionService', () => { connectionService = new ConnectionService(agentConfig.logger, connectionRepository, didRepository, eventEmitter) myRouting = { recipientKey: Key.fromFingerprint('z6MkwFkSP4uv5PhhKJCGehtjuZedkotC7VF64xtMsxuM8R3W'), - endpoints: agentConfig.endpoints ?? [], + endpoints: [endpoint], routingKeys: [], mediatorId: 'fakeMediatorId', } @@ -142,7 +145,7 @@ describe('ConnectionService', () => { service: [ new IndyAgentService({ id: `XpwgBjsC2wh3eHcMW6ZRJT#IndyAgentService-1`, - serviceEndpoint: agentConfig.endpoints[0], + serviceEndpoint: endpoint, recipientKeys: ['HoVPnpfUjrDECoMZy8vu4U6dwEcLhbzjNwyS3gwLDCG8'], routingKeys: [], }), diff --git a/packages/didcomm/src/modules/connections/__tests__/ConnectionsModule.test.ts b/packages/didcomm/src/modules/connections/__tests__/ConnectionsModule.test.ts new file mode 100644 index 0000000000..5abe04686d --- /dev/null +++ b/packages/didcomm/src/modules/connections/__tests__/ConnectionsModule.test.ts @@ -0,0 +1,56 @@ +import type { DependencyManager } from '../../../../../core/src/plugins/DependencyManager' + +import { getAgentContext } from '../../../../../core/tests' +import { FeatureRegistry } from '../../../FeatureRegistry' +import { Protocol } from '../../../models' +import { ConnectionsModule } from '../ConnectionsModule' +import { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' +import { DidExchangeProtocol } from '../DidExchangeProtocol' +import { ConnectionRole, DidExchangeRole, DidRotateRole } from '../models' +import { ConnectionRepository } from '../repository' +import { ConnectionService, TrustPingService } from '../services' +import { DidRotateService } from '../services/DidRotateService' + +describe('ConnectionsModule', () => { + test('registers dependencies on the dependency manager', () => { + const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + registerContextScoped: jest.fn(), + } as unknown as DependencyManager + + const connectionsModule = new ConnectionsModule() + connectionsModule.register(dependencyManager) + + expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1) + expect(dependencyManager.registerInstance).toHaveBeenCalledWith(ConnectionsModuleConfig, connectionsModule.config) + + expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(5) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(ConnectionService) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(DidExchangeProtocol) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(TrustPingService) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(DidRotateService) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(ConnectionRepository) + }) + + test('registers features on the feature registry', async () => { + const featureRegistry = new FeatureRegistry() + const agentContext = getAgentContext({ registerInstances: [[FeatureRegistry, featureRegistry]] }) + await new ConnectionsModule().initialize(agentContext) + + expect(featureRegistry.query({ featureType: 'protocol', match: '*' })).toEqual([ + new Protocol({ + id: 'https://didcomm.org/connections/1.0', + roles: [ConnectionRole.Invitee, ConnectionRole.Inviter], + }), + new Protocol({ + id: 'https://didcomm.org/didexchange/1.1', + roles: [DidExchangeRole.Requester, DidExchangeRole.Responder], + }), + new Protocol({ + id: 'https://didcomm.org/did-rotate/1.0', + roles: [DidRotateRole.RotatingParty, DidRotateRole.ObservingParty], + }), + ]) + }) +}) diff --git a/packages/core/src/modules/connections/__tests__/ConnectionsModuleConfig.test.ts b/packages/didcomm/src/modules/connections/__tests__/ConnectionsModuleConfig.test.ts similarity index 100% rename from packages/core/src/modules/connections/__tests__/ConnectionsModuleConfig.test.ts rename to packages/didcomm/src/modules/connections/__tests__/ConnectionsModuleConfig.test.ts diff --git a/packages/core/src/modules/connections/__tests__/InMemoryDidRegistry.ts b/packages/didcomm/src/modules/connections/__tests__/InMemoryDidRegistry.ts similarity index 94% rename from packages/core/src/modules/connections/__tests__/InMemoryDidRegistry.ts rename to packages/didcomm/src/modules/connections/__tests__/InMemoryDidRegistry.ts index 0741c5abf7..891c73b682 100644 --- a/packages/core/src/modules/connections/__tests__/InMemoryDidRegistry.ts +++ b/packages/didcomm/src/modules/connections/__tests__/InMemoryDidRegistry.ts @@ -1,5 +1,5 @@ -import type { AgentContext } from '../../../agent' import type { + AgentContext, DidRegistrar, DidResolver, DidDocument, @@ -8,9 +8,9 @@ import type { DidUpdateResult, DidDeactivateResult, DidResolutionResult, -} from '../../dids' +} from '@credo-ts/core' -import { DidRecord, DidDocumentRole, DidRepository } from '../../dids' +import { DidRecord, DidDocumentRole, DidRepository } from '@credo-ts/core' export class InMemoryDidRegistry implements DidRegistrar, DidResolver { public readonly supportedMethods = ['inmemory'] diff --git a/packages/core/src/modules/connections/__tests__/connection-manual.test.ts b/packages/didcomm/src/modules/connections/__tests__/connection-manual.test.ts similarity index 78% rename from packages/core/src/modules/connections/__tests__/connection-manual.test.ts rename to packages/didcomm/src/modules/connections/__tests__/connection-manual.test.ts index fe519c8950..3054610b13 100644 --- a/packages/core/src/modules/connections/__tests__/connection-manual.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/connection-manual.test.ts @@ -4,9 +4,9 @@ import type { ConnectionStateChangedEvent } from '../ConnectionEvents' import { firstValueFrom } from 'rxjs' import { filter, first, map, timeout } from 'rxjs/operators' -import { setupSubjectTransports } from '../../../../tests' -import { getInMemoryAgentOptions } from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' +import { Agent } from '../../../../../core/src/agent/Agent' +import { setupSubjectTransports } from '../../../../../core/tests' +import { getInMemoryAgentOptions } from '../../../../../core/tests/helpers' import { ConnectionEventTypes } from '../ConnectionEvents' import { ConnectionsModule } from '../ConnectionsModule' import { DidExchangeState } from '../models' @@ -48,9 +48,11 @@ describe('Manual Connection Flow', () => { const aliceAgentOptions = getInMemoryAgentOptions( 'Manual Connection Flow Alice', { - label: 'alice', endpoints: ['rxjs:alice'], }, + { + label: 'alice', + }, { connections: new ConnectionsModule({ autoAcceptConnections: false, @@ -60,9 +62,11 @@ describe('Manual Connection Flow', () => { const bobAgentOptions = getInMemoryAgentOptions( 'Manual Connection Flow Bob', { - label: 'bob', endpoints: ['rxjs:bob'], }, + { + label: 'bob', + }, { connections: new ConnectionsModule({ autoAcceptConnections: false, @@ -74,6 +78,7 @@ describe('Manual Connection Flow', () => { { endpoints: ['rxjs:faber'], }, + {}, { connections: new ConnectionsModule({ autoAcceptConnections: false, @@ -90,7 +95,7 @@ describe('Manual Connection Flow', () => { await bobAgent.initialize() await faberAgent.initialize() - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ autoAcceptConnection: false, multiUseInvitation: true, }) @@ -98,7 +103,7 @@ describe('Manual Connection Flow', () => { const waitForAliceRequest = waitForRequest(faberAgent, 'alice') const waitForBobRequest = waitForRequest(faberAgent, 'bob') - let { connectionRecord: aliceConnectionRecord } = await aliceAgent.oob.receiveInvitation( + let { connectionRecord: aliceConnectionRecord } = await aliceAgent.modules.oob.receiveInvitation( faberOutOfBandRecord.outOfBandInvitation, { autoAcceptInvitation: true, @@ -106,7 +111,7 @@ describe('Manual Connection Flow', () => { } ) - let { connectionRecord: bobConnectionRecord } = await bobAgent.oob.receiveInvitation( + let { connectionRecord: bobConnectionRecord } = await bobAgent.modules.oob.receiveInvitation( faberOutOfBandRecord.outOfBandInvitation, { autoAcceptInvitation: true, @@ -120,19 +125,21 @@ describe('Manual Connection Flow', () => { const waitForAliceResponse = waitForResponse(aliceAgent, aliceConnectionRecord!.id) const waitForBobResponse = waitForResponse(bobAgent, bobConnectionRecord!.id) - await faberAgent.connections.acceptRequest(faberAliceConnectionRecord.id) - await faberAgent.connections.acceptRequest(faberBobConnectionRecord.id) + await faberAgent.modules.connections.acceptRequest(faberAliceConnectionRecord.id) + await faberAgent.modules.connections.acceptRequest(faberBobConnectionRecord.id) aliceConnectionRecord = await waitForAliceResponse - await aliceAgent.connections.acceptResponse(aliceConnectionRecord!.id) + await aliceAgent.modules.connections.acceptResponse(aliceConnectionRecord!.id) bobConnectionRecord = await waitForBobResponse - await bobAgent.connections.acceptResponse(bobConnectionRecord!.id) + await bobAgent.modules.connections.acceptResponse(bobConnectionRecord!.id) - aliceConnectionRecord = await aliceAgent.connections.returnWhenIsConnected(aliceConnectionRecord!.id) - bobConnectionRecord = await bobAgent.connections.returnWhenIsConnected(bobConnectionRecord!.id) - faberAliceConnectionRecord = await faberAgent.connections.returnWhenIsConnected(faberAliceConnectionRecord!.id) - faberBobConnectionRecord = await faberAgent.connections.returnWhenIsConnected(faberBobConnectionRecord!.id) + aliceConnectionRecord = await aliceAgent.modules.connections.returnWhenIsConnected(aliceConnectionRecord!.id) + bobConnectionRecord = await bobAgent.modules.connections.returnWhenIsConnected(bobConnectionRecord!.id) + faberAliceConnectionRecord = await faberAgent.modules.connections.returnWhenIsConnected( + faberAliceConnectionRecord!.id + ) + faberBobConnectionRecord = await faberAgent.modules.connections.returnWhenIsConnected(faberBobConnectionRecord!.id) expect(aliceConnectionRecord).toBeConnectedWith(faberAliceConnectionRecord) expect(bobConnectionRecord).toBeConnectedWith(faberBobConnectionRecord) diff --git a/packages/core/src/modules/connections/__tests__/did-rotate.test.ts b/packages/didcomm/src/modules/connections/__tests__/did-rotate.test.ts similarity index 76% rename from packages/core/src/modules/connections/__tests__/did-rotate.test.ts rename to packages/didcomm/src/modules/connections/__tests__/did-rotate.test.ts index ee791adcd4..5b7a6f7f5c 100644 --- a/packages/core/src/modules/connections/__tests__/did-rotate.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/did-rotate.test.ts @@ -1,23 +1,24 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ +import type { DefaultAgentModulesInput } from '../../../util/modules' + import { ReplaySubject, first, firstValueFrom, timeout } from 'rxjs' -import { MessageSender } from '../../..//agent/MessageSender' -import { setupSubjectTransports, testLogger } from '../../../../tests' +import { Agent } from '../../../../../core/src/agent/Agent' +import { RecordNotFoundError } from '../../../../../core/src/error' +import { createPeerDidDocumentFromServices } from '../../../../../core/src/modules/dids' +import { uuid } from '../../../../../core/src/utils/uuid' +import { setupSubjectTransports } from '../../../../../core/tests' import { getInMemoryAgentOptions, makeConnection, waitForAgentMessageProcessedEvent, waitForBasicMessage, waitForDidRotate, -} from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' -import { getOutboundMessageContext } from '../../../agent/getOutboundMessageContext' -import { RecordNotFoundError } from '../../../error' -import { uuid } from '../../../utils/uuid' +} from '../../../../../core/tests/helpers' +import { MessageSender } from '../../../MessageSender' +import { getOutboundMessageContext } from '../../../getOutboundMessageContext' import { BasicMessage } from '../../basic-messages' -import { createPeerDidDocumentFromServices } from '../../dids' -import { ConnectionsModule } from '../ConnectionsModule' import { DidRotateProblemReportMessage, HangupMessage, DidRotateAckMessage } from '../messages' import { ConnectionRecord } from '../repository' @@ -25,38 +26,18 @@ import { InMemoryDidRegistry } from './InMemoryDidRegistry' // This is the most common flow describe('Rotation E2E tests', () => { - let aliceAgent: Agent - let bobAgent: Agent + let aliceAgent: Agent + let bobAgent: Agent let aliceBobConnection: ConnectionRecord | undefined let bobAliceConnection: ConnectionRecord | undefined beforeEach(async () => { - const aliceAgentOptions = getInMemoryAgentOptions( - 'DID Rotate Alice', - { - label: 'alice', - endpoints: ['rxjs:alice'], - logger: testLogger, - }, - { - connections: new ConnectionsModule({ - autoAcceptConnections: true, - }), - } - ) - const bobAgentOptions = getInMemoryAgentOptions( - 'DID Rotate Bob', - { - label: 'bob', - endpoints: ['rxjs:bob'], - logger: testLogger, - }, - { - connections: new ConnectionsModule({ - autoAcceptConnections: true, - }), - } - ) + const aliceAgentOptions = getInMemoryAgentOptions('DID Rotate Alice', { + endpoints: ['rxjs:alice'], + }) + const bobAgentOptions = getInMemoryAgentOptions('DID Rotate Bob', { + endpoints: ['rxjs:bob'], + }) aliceAgent = new Agent(aliceAgentOptions) bobAgent = new Agent(bobAgentOptions) @@ -80,19 +61,19 @@ describe('Rotation E2E tests', () => { expect(bobAliceConnection!.theirDid).toEqual(oldDid) // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) // Do did rotate - const { newDid } = await aliceAgent.connections.rotate({ connectionId: aliceBobConnection!.id }) + const { newDid } = await aliceAgent.modules.connections.rotate({ connectionId: aliceBobConnection!.id }) // Wait for acknowledge await waitForAgentMessageProcessedEvent(aliceAgent, { messageType: DidRotateAckMessage.type.messageTypeUri }) // Check that new did is taken into account by both parties - const newAliceBobConnection = await aliceAgent.connections.getById(aliceBobConnection!.id) - const newBobAliceConnection = await bobAgent.connections.getById(bobAliceConnection!.id) + const newAliceBobConnection = await aliceAgent.modules.connections.getById(aliceBobConnection!.id) + const newBobAliceConnection = await bobAgent.modules.connections.getById(bobAliceConnection!.id) expect(newAliceBobConnection.did).toEqual(newDid) expect(newBobAliceConnection.theirDid).toEqual(newDid) @@ -102,14 +83,14 @@ describe('Rotation E2E tests', () => { expect(newBobAliceConnection.previousTheirDids).toContain(oldDid) // Send message to new did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello new did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello new did') await waitForBasicMessage(aliceAgent, { content: 'Hello new did', connectionId: aliceBobConnection!.id }) }) test('Rotate succesfully and send messages to previous did afterwards', async () => { // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) @@ -119,7 +100,7 @@ describe('Rotation E2E tests', () => { }) // Do did rotate - await aliceAgent.connections.rotate({ connectionId: aliceBobConnection!.id }) + await aliceAgent.modules.connections.rotate({ connectionId: aliceBobConnection!.id }) // Wait for acknowledge await waitForAgentMessageProcessedEvent(aliceAgent, { messageType: DidRotateAckMessage.type.messageTypeUri }) @@ -140,7 +121,7 @@ describe('Rotation E2E tests', () => { expect(bobAliceConnection!.theirDid).toEqual(oldDid) // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) @@ -153,7 +134,7 @@ describe('Rotation E2E tests', () => { bobAgent.dids.config.addRegistrar(didRegistry) bobAgent.dids.config.addResolver(didRegistry) - const didRouting = await aliceAgent.mediationRecipient.getRouting({}) + const didRouting = await aliceAgent.modules.mediationRecipient.getRouting({}) const did = `did:inmemory:${uuid()}` const didDocument = createPeerDidDocumentFromServices([ { @@ -171,7 +152,7 @@ describe('Rotation E2E tests', () => { }) // Do did rotate - const { newDid } = await aliceAgent.connections.rotate({ + const { newDid } = await aliceAgent.modules.connections.rotate({ connectionId: aliceBobConnection!.id, toDid: did, }) @@ -180,8 +161,8 @@ describe('Rotation E2E tests', () => { await waitForAgentMessageProcessedEvent(aliceAgent, { messageType: DidRotateAckMessage.type.messageTypeUri }) // Check that new did is taken into account by both parties - const newAliceBobConnection = await aliceAgent.connections.getById(aliceBobConnection!.id) - const newBobAliceConnection = await bobAgent.connections.getById(bobAliceConnection!.id) + const newAliceBobConnection = await aliceAgent.modules.connections.getById(aliceBobConnection!.id) + const newBobAliceConnection = await bobAgent.modules.connections.getById(bobAliceConnection!.id) expect(newAliceBobConnection.did).toEqual(newDid) expect(newBobAliceConnection.theirDid).toEqual(newDid) @@ -191,14 +172,14 @@ describe('Rotation E2E tests', () => { expect(newBobAliceConnection.previousTheirDids).toContain(oldDid) // Send message to new did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello new did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello new did') await waitForBasicMessage(aliceAgent, { content: 'Hello new did', connectionId: aliceBobConnection!.id }) }) test('Rotate succesfully and send messages to previous did afterwards', async () => { // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) @@ -216,7 +197,7 @@ describe('Rotation E2E tests', () => { bobAgent.dids.config.addRegistrar(didRegistry) bobAgent.dids.config.addResolver(didRegistry) - const didRouting = await aliceAgent.mediationRecipient.getRouting({}) + const didRouting = await aliceAgent.modules.mediationRecipient.getRouting({}) const did = `did:inmemory:${uuid()}` const didDocument = createPeerDidDocumentFromServices([ { @@ -236,7 +217,7 @@ describe('Rotation E2E tests', () => { const waitForAllDidRotate = Promise.all([waitForDidRotate(aliceAgent, {}), waitForDidRotate(bobAgent, {})]) // Do did rotate - await aliceAgent.connections.rotate({ connectionId: aliceBobConnection!.id, toDid: did }) + await aliceAgent.modules.connections.rotate({ connectionId: aliceBobConnection!.id, toDid: did }) // Wait for acknowledge await waitForAgentMessageProcessedEvent(aliceAgent, { messageType: DidRotateAckMessage.type.messageTypeUri }) @@ -272,7 +253,7 @@ describe('Rotation E2E tests', () => { test('Rotate failed and send messages to previous did afterwards', async () => { // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) @@ -288,7 +269,7 @@ describe('Rotation E2E tests', () => { aliceAgent.dids.config.addRegistrar(didRegistry) aliceAgent.dids.config.addResolver(didRegistry) - const didRouting = await aliceAgent.mediationRecipient.getRouting({}) + const didRouting = await aliceAgent.modules.mediationRecipient.getRouting({}) const did = `did:inmemory:${uuid()}` const didDocument = createPeerDidDocumentFromServices([ { @@ -306,7 +287,7 @@ describe('Rotation E2E tests', () => { }) // Do did rotate - await aliceAgent.connections.rotate({ connectionId: aliceBobConnection!.id, toDid: did }) + await aliceAgent.modules.connections.rotate({ connectionId: aliceBobConnection!.id, toDid: did }) // Wait for a problem report await waitForAgentMessageProcessedEvent(aliceAgent, { @@ -322,7 +303,7 @@ describe('Rotation E2E tests', () => { }) // Send message to stored did (should be the previous one) - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Message after did rotation failure') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Message after did rotation failure') await waitForBasicMessage(aliceAgent, { content: 'Message after did rotation failure', @@ -334,7 +315,7 @@ describe('Rotation E2E tests', () => { describe('Hangup', () => { test('Hangup without record deletion', async () => { // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) @@ -345,7 +326,7 @@ describe('Rotation E2E tests', () => { connectionRecord: bobAliceConnection!.clone(), }) - await aliceAgent.connections.hangup({ connectionId: aliceBobConnection!.id }) + await aliceAgent.modules.connections.hangup({ connectionId: aliceBobConnection!.id }) // Wait for hangup await waitForAgentMessageProcessedEvent(bobAgent, { @@ -353,7 +334,9 @@ describe('Rotation E2E tests', () => { }) // If Bob attempts to send a message to Alice after they received the hangup, framework should reject it - expect(bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Message after hangup')).rejects.toThrowError() + expect( + bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Message after hangup') + ).rejects.toThrowError() // If Bob sends a message afterwards, Alice should still be able to receive it await bobAgent.dependencyManager.resolve(MessageSender).sendMessage(messageBeforeHangup) @@ -366,7 +349,7 @@ describe('Rotation E2E tests', () => { test('Hangup and delete connection record', async () => { // Send message to initial did - await bobAgent.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') + await bobAgent.modules.basicMessages.sendMessage(bobAliceConnection!.id, 'Hello initial did') await waitForBasicMessage(aliceAgent, { content: 'Hello initial did' }) @@ -377,10 +360,10 @@ describe('Rotation E2E tests', () => { connectionRecord: bobAliceConnection!.clone(), }) - await aliceAgent.connections.hangup({ connectionId: aliceBobConnection!.id, deleteAfterHangup: true }) + await aliceAgent.modules.connections.hangup({ connectionId: aliceBobConnection!.id, deleteAfterHangup: true }) // Verify that alice connection has been effectively deleted - expect(aliceAgent.connections.getById(aliceBobConnection!.id)).rejects.toThrow(RecordNotFoundError) + expect(aliceAgent.modules.connections.getById(aliceBobConnection!.id)).rejects.toThrow(RecordNotFoundError) // Wait for hangup await waitForAgentMessageProcessedEvent(bobAgent, { @@ -397,7 +380,7 @@ describe('Rotation E2E tests', () => { observable.pipe(first(), timeout({ first: 10000 })).subscribe(subject) await firstValueFrom(subject) - const aliceBasicMessages = await aliceAgent.basicMessages.findAllByQuery({}) + const aliceBasicMessages = await aliceAgent.modules.basicMessages.findAllByQuery({}) expect(aliceBasicMessages.find((message) => message.content === 'Message before hangup')).toBeUndefined() }) }) diff --git a/packages/core/src/modules/connections/__tests__/didexchange-numalgo.test.ts b/packages/didcomm/src/modules/connections/__tests__/didexchange-numalgo.test.ts similarity index 86% rename from packages/core/src/modules/connections/__tests__/didexchange-numalgo.test.ts rename to packages/didcomm/src/modules/connections/__tests__/didexchange-numalgo.test.ts index 3edcc48d0f..424ca394ee 100644 --- a/packages/core/src/modules/connections/__tests__/didexchange-numalgo.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/didexchange-numalgo.test.ts @@ -4,11 +4,11 @@ import type { ConnectionStateChangedEvent } from '../ConnectionEvents' import { firstValueFrom } from 'rxjs' import { filter, first, map, timeout } from 'rxjs/operators' -import { setupSubjectTransports } from '../../../../tests' -import { getInMemoryAgentOptions } from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' -import { uuid } from '../../../utils/uuid' -import { DidsModule, PeerDidNumAlgo, createPeerDidDocumentFromServices } from '../../dids' +import { Agent } from '../../../../../core/src/agent/Agent' +import { DidsModule, PeerDidNumAlgo, createPeerDidDocumentFromServices } from '../../../../../core/src/modules/dids' +import { uuid } from '../../../../../core/src/utils/uuid' +import { setupSubjectTransports } from '../../../../../core/tests' +import { getInMemoryAgentOptions } from '../../../../../core/tests/helpers' import { ConnectionEventTypes } from '../ConnectionEvents' import { ConnectionsModule } from '../ConnectionsModule' import { DidExchangeState } from '../models' @@ -98,9 +98,11 @@ async function didExchangeNumAlgoBaseTest(options: { const aliceAgentOptions = getInMemoryAgentOptions( 'DID Exchange numalgo settings Alice', { - label: 'alice', endpoints: ['rxjs:alice'], }, + { + label: 'alice', + }, { connections: new ConnectionsModule({ autoAcceptConnections: false, @@ -114,6 +116,7 @@ async function didExchangeNumAlgoBaseTest(options: { { endpoints: ['rxjs:faber'], }, + {}, { connections: new ConnectionsModule({ autoAcceptConnections: false, @@ -130,7 +133,7 @@ async function didExchangeNumAlgoBaseTest(options: { await aliceAgent.initialize() await faberAgent.initialize() - const faberOutOfBandRecord = await faberAgent.oob.createInvitation({ + const faberOutOfBandRecord = await faberAgent.modules.oob.createInvitation({ autoAcceptConnection: false, multiUseInvitation: false, }) @@ -140,7 +143,7 @@ async function didExchangeNumAlgoBaseTest(options: { let ourDid, routing if (options.createExternalDidForRequester) { // Create did externally - const didRouting = await aliceAgent.mediationRecipient.getRouting({}) + const didRouting = await aliceAgent.modules.mediationRecipient.getRouting({}) ourDid = `did:inmemory:${uuid()}` const didDocument = createPeerDidDocumentFromServices([ { @@ -158,7 +161,7 @@ async function didExchangeNumAlgoBaseTest(options: { }) } - let { connectionRecord: aliceConnectionRecord } = await aliceAgent.oob.receiveInvitation( + let { connectionRecord: aliceConnectionRecord } = await aliceAgent.modules.oob.receiveInvitation( faberOutOfBandRecord.outOfBandInvitation, { autoAcceptInvitation: true, @@ -172,13 +175,15 @@ async function didExchangeNumAlgoBaseTest(options: { const waitForAliceResponse = waitForResponse(aliceAgent, aliceConnectionRecord!.id) - await faberAgent.connections.acceptRequest(faberAliceConnectionRecord.id) + await faberAgent.modules.connections.acceptRequest(faberAliceConnectionRecord.id) aliceConnectionRecord = await waitForAliceResponse - await aliceAgent.connections.acceptResponse(aliceConnectionRecord!.id) + await aliceAgent.modules.connections.acceptResponse(aliceConnectionRecord!.id) - aliceConnectionRecord = await aliceAgent.connections.returnWhenIsConnected(aliceConnectionRecord!.id) - faberAliceConnectionRecord = await faberAgent.connections.returnWhenIsConnected(faberAliceConnectionRecord!.id) + aliceConnectionRecord = await aliceAgent.modules.connections.returnWhenIsConnected(aliceConnectionRecord!.id) + faberAliceConnectionRecord = await faberAgent.modules.connections.returnWhenIsConnected( + faberAliceConnectionRecord!.id + ) expect(aliceConnectionRecord).toBeConnectedWith(faberAliceConnectionRecord) diff --git a/packages/core/src/modules/connections/__tests__/helpers.test.ts b/packages/didcomm/src/modules/connections/__tests__/helpers.test.ts similarity index 99% rename from packages/core/src/modules/connections/__tests__/helpers.test.ts rename to packages/didcomm/src/modules/connections/__tests__/helpers.test.ts index ae144cc34d..af60cd9397 100644 --- a/packages/core/src/modules/connections/__tests__/helpers.test.ts +++ b/packages/didcomm/src/modules/connections/__tests__/helpers.test.ts @@ -1,4 +1,4 @@ -import { DidCommV1Service, IndyAgentService, VerificationMethod } from '../../dids' +import { DidCommV1Service, IndyAgentService, VerificationMethod } from '../../../../../core/src/modules/dids' import { DidDoc, Ed25119Sig2018, diff --git a/packages/core/src/modules/connections/errors/ConnectionProblemReportError.ts b/packages/didcomm/src/modules/connections/errors/ConnectionProblemReportError.ts similarity index 84% rename from packages/core/src/modules/connections/errors/ConnectionProblemReportError.ts rename to packages/didcomm/src/modules/connections/errors/ConnectionProblemReportError.ts index f96f98261d..2fb74d42c5 100644 --- a/packages/core/src/modules/connections/errors/ConnectionProblemReportError.ts +++ b/packages/didcomm/src/modules/connections/errors/ConnectionProblemReportError.ts @@ -1,7 +1,7 @@ import type { ConnectionProblemReportReason } from './ConnectionProblemReportReason' -import type { ProblemReportErrorOptions } from '../../problem-reports' +import type { ProblemReportErrorOptions } from '../../../errors' -import { ProblemReportError } from '../../problem-reports' +import { ProblemReportError } from '../../../errors' import { ConnectionProblemReportMessage } from '../messages' interface ConnectionProblemReportErrorOptions extends ProblemReportErrorOptions { diff --git a/packages/core/src/modules/connections/errors/ConnectionProblemReportReason.ts b/packages/didcomm/src/modules/connections/errors/ConnectionProblemReportReason.ts similarity index 100% rename from packages/core/src/modules/connections/errors/ConnectionProblemReportReason.ts rename to packages/didcomm/src/modules/connections/errors/ConnectionProblemReportReason.ts diff --git a/packages/core/src/modules/connections/errors/DidExchangeProblemReportError.ts b/packages/didcomm/src/modules/connections/errors/DidExchangeProblemReportError.ts similarity index 84% rename from packages/core/src/modules/connections/errors/DidExchangeProblemReportError.ts rename to packages/didcomm/src/modules/connections/errors/DidExchangeProblemReportError.ts index 6e8d9a9925..51692e6201 100644 --- a/packages/core/src/modules/connections/errors/DidExchangeProblemReportError.ts +++ b/packages/didcomm/src/modules/connections/errors/DidExchangeProblemReportError.ts @@ -1,7 +1,7 @@ import type { DidExchangeProblemReportReason } from './DidExchangeProblemReportReason' -import type { ProblemReportErrorOptions } from '../../problem-reports' +import type { ProblemReportErrorOptions } from '../../../errors' -import { ProblemReportError } from '../../problem-reports' +import { ProblemReportError } from '../../../errors' import { DidExchangeProblemReportMessage } from '../messages' interface DidExchangeProblemReportErrorOptions extends ProblemReportErrorOptions { diff --git a/packages/core/src/modules/connections/errors/DidExchangeProblemReportReason.ts b/packages/didcomm/src/modules/connections/errors/DidExchangeProblemReportReason.ts similarity index 100% rename from packages/core/src/modules/connections/errors/DidExchangeProblemReportReason.ts rename to packages/didcomm/src/modules/connections/errors/DidExchangeProblemReportReason.ts diff --git a/packages/core/src/modules/connections/errors/index.ts b/packages/didcomm/src/modules/connections/errors/index.ts similarity index 100% rename from packages/core/src/modules/connections/errors/index.ts rename to packages/didcomm/src/modules/connections/errors/index.ts diff --git a/packages/core/src/modules/connections/handlers/AckMessageHandler.ts b/packages/didcomm/src/modules/connections/handlers/AckMessageHandler.ts similarity index 76% rename from packages/core/src/modules/connections/handlers/AckMessageHandler.ts rename to packages/didcomm/src/modules/connections/handlers/AckMessageHandler.ts index e9c8fafc38..ce66f82969 100644 --- a/packages/core/src/modules/connections/handlers/AckMessageHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/AckMessageHandler.ts @@ -1,7 +1,7 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { ConnectionService } from '../services/ConnectionService' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' +import type { ConnectionService } from '../services' -import { AckMessage } from '../../common' +import { AckMessage } from '../../../messages' export class AckMessageHandler implements MessageHandler { private connectionService: ConnectionService diff --git a/packages/core/src/modules/connections/handlers/ConnectionProblemReportHandler.ts b/packages/didcomm/src/modules/connections/handlers/ConnectionProblemReportHandler.ts similarity index 95% rename from packages/core/src/modules/connections/handlers/ConnectionProblemReportHandler.ts rename to packages/didcomm/src/modules/connections/handlers/ConnectionProblemReportHandler.ts index 5f464a531c..ef87bccd96 100644 --- a/packages/core/src/modules/connections/handlers/ConnectionProblemReportHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/ConnectionProblemReportHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { ConnectionService } from '../services' import { ConnectionProblemReportMessage } from '../messages' diff --git a/packages/core/src/modules/connections/handlers/ConnectionRequestHandler.ts b/packages/didcomm/src/modules/connections/handlers/ConnectionRequestHandler.ts similarity index 91% rename from packages/core/src/modules/connections/handlers/ConnectionRequestHandler.ts rename to packages/didcomm/src/modules/connections/handlers/ConnectionRequestHandler.ts index b70ec36ab7..862c129d9f 100644 --- a/packages/core/src/modules/connections/handlers/ConnectionRequestHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/ConnectionRequestHandler.ts @@ -1,14 +1,14 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { DidRepository } from '../../dids/repository' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { OutOfBandService } from '../../oob/OutOfBandService' import type { RoutingService } from '../../routing/services/RoutingService' import type { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' -import type { ConnectionService } from '../services/ConnectionService' +import type { ConnectionService } from '../services' +import type { DidRepository } from '@credo-ts/core' -import { TransportService } from '../../../agent/TransportService' -import { OutboundMessageContext } from '../../../agent/models' -import { CredoError } from '../../../error/CredoError' -import { tryParseDid } from '../../dids/domain/parse' +import { CredoError, tryParseDid } from '@credo-ts/core' + +import { TransportService } from '../../../TransportService' +import { OutboundMessageContext } from '../../../models' import { ConnectionRequestMessage } from '../messages' import { HandshakeProtocol } from '../models' diff --git a/packages/core/src/modules/connections/handlers/ConnectionResponseHandler.ts b/packages/didcomm/src/modules/connections/handlers/ConnectionResponseHandler.ts similarity index 93% rename from packages/core/src/modules/connections/handlers/ConnectionResponseHandler.ts rename to packages/didcomm/src/modules/connections/handlers/ConnectionResponseHandler.ts index fd3ec2ac29..576d0e2466 100644 --- a/packages/core/src/modules/connections/handlers/ConnectionResponseHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/ConnectionResponseHandler.ts @@ -1,12 +1,13 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { DidResolverService } from '../../dids' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { OutOfBandService } from '../../oob/OutOfBandService' import type { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' -import type { ConnectionService } from '../services/ConnectionService' +import type { ConnectionService } from '../services' +import type { DidResolverService } from '@credo-ts/core' + +import { CredoError } from '@credo-ts/core' -import { OutboundMessageContext } from '../../../agent/models' import { ReturnRouteTypes } from '../../../decorators/transport/TransportDecorator' -import { CredoError } from '../../../error' +import { OutboundMessageContext } from '../../../models' import { ConnectionResponseMessage } from '../messages' import { DidExchangeRole } from '../models' diff --git a/packages/core/src/modules/connections/handlers/DidExchangeCompleteHandler.ts b/packages/didcomm/src/modules/connections/handlers/DidExchangeCompleteHandler.ts similarity index 94% rename from packages/core/src/modules/connections/handlers/DidExchangeCompleteHandler.ts rename to packages/didcomm/src/modules/connections/handlers/DidExchangeCompleteHandler.ts index 3b83f51112..5f7a9dd8e2 100644 --- a/packages/core/src/modules/connections/handlers/DidExchangeCompleteHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/DidExchangeCompleteHandler.ts @@ -1,9 +1,9 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { OutOfBandService } from '../../oob/OutOfBandService' import type { DidExchangeProtocol } from '../DidExchangeProtocol' -import { CredoError } from '../../../error' -import { tryParseDid } from '../../dids/domain/parse' +import { CredoError, tryParseDid } from '@credo-ts/core' + import { OutOfBandState } from '../../oob/domain/OutOfBandState' import { DidExchangeCompleteMessage } from '../messages' import { HandshakeProtocol } from '../models' diff --git a/packages/core/src/modules/connections/handlers/DidExchangeRequestHandler.ts b/packages/didcomm/src/modules/connections/handlers/DidExchangeRequestHandler.ts similarity index 93% rename from packages/core/src/modules/connections/handlers/DidExchangeRequestHandler.ts rename to packages/didcomm/src/modules/connections/handlers/DidExchangeRequestHandler.ts index fcd8429540..e96a4eb21c 100644 --- a/packages/core/src/modules/connections/handlers/DidExchangeRequestHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/DidExchangeRequestHandler.ts @@ -1,14 +1,14 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { DidRepository } from '../../dids/repository' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { OutOfBandService } from '../../oob/OutOfBandService' import type { RoutingService } from '../../routing/services/RoutingService' import type { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' import type { DidExchangeProtocol } from '../DidExchangeProtocol' +import type { DidRepository } from '@credo-ts/core' -import { TransportService } from '../../../agent/TransportService' -import { OutboundMessageContext } from '../../../agent/models' -import { CredoError } from '../../../error/CredoError' -import { tryParseDid } from '../../dids/domain/parse' +import { CredoError, tryParseDid } from '@credo-ts/core' + +import { TransportService } from '../../../TransportService' +import { OutboundMessageContext } from '../../../models' import { OutOfBandState } from '../../oob/domain/OutOfBandState' import { DidExchangeRequestMessage } from '../messages' import { HandshakeProtocol } from '../models' diff --git a/packages/core/src/modules/connections/handlers/DidExchangeResponseHandler.ts b/packages/didcomm/src/modules/connections/handlers/DidExchangeResponseHandler.ts similarity index 93% rename from packages/core/src/modules/connections/handlers/DidExchangeResponseHandler.ts rename to packages/didcomm/src/modules/connections/handlers/DidExchangeResponseHandler.ts index 24b0ba892e..199acf167b 100644 --- a/packages/core/src/modules/connections/handlers/DidExchangeResponseHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/DidExchangeResponseHandler.ts @@ -1,13 +1,13 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { DidResolverService } from '../../dids' +import type { ConnectionsModuleConfig, DidExchangeProtocol } from '..' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { OutOfBandService } from '../../oob/OutOfBandService' -import type { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' -import type { DidExchangeProtocol } from '../DidExchangeProtocol' import type { ConnectionService } from '../services' +import type { DidResolverService } from '@credo-ts/core' + +import { CredoError } from '@credo-ts/core' -import { OutboundMessageContext } from '../../../agent/models' import { ReturnRouteTypes } from '../../../decorators/transport/TransportDecorator' -import { CredoError } from '../../../error' +import { OutboundMessageContext } from '../../../models' import { OutOfBandState } from '../../oob/domain/OutOfBandState' import { DidExchangeResponseMessage } from '../messages' import { DidExchangeRole, HandshakeProtocol } from '../models' diff --git a/packages/core/src/modules/connections/handlers/DidRotateAckHandler.ts b/packages/didcomm/src/modules/connections/handlers/DidRotateAckHandler.ts similarity index 94% rename from packages/core/src/modules/connections/handlers/DidRotateAckHandler.ts rename to packages/didcomm/src/modules/connections/handlers/DidRotateAckHandler.ts index ec05c71e8e..83bcce4dd8 100644 --- a/packages/core/src/modules/connections/handlers/DidRotateAckHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/DidRotateAckHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { DidRotateService } from '../services' import { DidRotateAckMessage } from '../messages' diff --git a/packages/core/src/modules/connections/handlers/DidRotateHandler.ts b/packages/didcomm/src/modules/connections/handlers/DidRotateHandler.ts similarity index 80% rename from packages/core/src/modules/connections/handlers/DidRotateHandler.ts rename to packages/didcomm/src/modules/connections/handlers/DidRotateHandler.ts index 458f5bdb86..c069303f17 100644 --- a/packages/core/src/modules/connections/handlers/DidRotateHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/DidRotateHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { DidRotateService } from '../services' -import type { ConnectionService } from '../services/ConnectionService' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' +import type { ConnectionService, DidRotateService } from '../services' + +import { CredoError } from '@credo-ts/core' -import { CredoError } from '../../../error' import { DidRotateMessage } from '../messages' export class DidRotateHandler implements MessageHandler { diff --git a/packages/core/src/modules/connections/handlers/DidRotateProblemReportHandler.ts b/packages/didcomm/src/modules/connections/handlers/DidRotateProblemReportHandler.ts similarity index 94% rename from packages/core/src/modules/connections/handlers/DidRotateProblemReportHandler.ts rename to packages/didcomm/src/modules/connections/handlers/DidRotateProblemReportHandler.ts index 2f68e748bd..2f7f1e6d41 100644 --- a/packages/core/src/modules/connections/handlers/DidRotateProblemReportHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/DidRotateProblemReportHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { DidRotateService } from '../services' import { DidRotateProblemReportMessage } from '../messages' diff --git a/packages/core/src/modules/connections/handlers/HangupHandler.ts b/packages/didcomm/src/modules/connections/handlers/HangupHandler.ts similarity index 94% rename from packages/core/src/modules/connections/handlers/HangupHandler.ts rename to packages/didcomm/src/modules/connections/handlers/HangupHandler.ts index 5e66ee2944..e294bd9d12 100644 --- a/packages/core/src/modules/connections/handlers/HangupHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/HangupHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { DidRotateService } from '../services' import { HangupMessage } from '../messages' diff --git a/packages/core/src/modules/connections/handlers/TrustPingMessageHandler.ts b/packages/didcomm/src/modules/connections/handlers/TrustPingMessageHandler.ts similarity index 85% rename from packages/core/src/modules/connections/handlers/TrustPingMessageHandler.ts rename to packages/didcomm/src/modules/connections/handlers/TrustPingMessageHandler.ts index 37b36d1929..c96ec3dae5 100644 --- a/packages/core/src/modules/connections/handlers/TrustPingMessageHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/TrustPingMessageHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { ConnectionService } from '../services/ConnectionService' -import type { TrustPingService } from '../services/TrustPingService' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' +import type { ConnectionService, TrustPingService } from '../services' + +import { CredoError } from '@credo-ts/core' -import { CredoError } from '../../../error' import { TrustPingMessage } from '../messages' import { DidExchangeState } from '../models' diff --git a/packages/core/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts b/packages/didcomm/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts similarity index 84% rename from packages/core/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts rename to packages/didcomm/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts index 27e0bff533..e093caaf28 100644 --- a/packages/core/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts +++ b/packages/didcomm/src/modules/connections/handlers/TrustPingResponseMessageHandler.ts @@ -1,5 +1,5 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' -import type { TrustPingService } from '../services/TrustPingService' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' +import type { TrustPingService } from '../services' import { TrustPingResponseMessage } from '../messages' diff --git a/packages/core/src/modules/connections/handlers/index.ts b/packages/didcomm/src/modules/connections/handlers/index.ts similarity index 100% rename from packages/core/src/modules/connections/handlers/index.ts rename to packages/didcomm/src/modules/connections/handlers/index.ts diff --git a/packages/core/src/modules/connections/index.ts b/packages/didcomm/src/modules/connections/index.ts similarity index 86% rename from packages/core/src/modules/connections/index.ts rename to packages/didcomm/src/modules/connections/index.ts index e9dd5862d9..b595d2e57f 100644 --- a/packages/core/src/modules/connections/index.ts +++ b/packages/didcomm/src/modules/connections/index.ts @@ -1,5 +1,7 @@ -export * from './messages' export * from './models' +export * from './errors' +export * from './handlers' +export * from './messages' export * from './repository' export * from './services' export * from './ConnectionEvents' diff --git a/packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts b/packages/didcomm/src/modules/connections/messages/ConnectionInvitationMessage.ts similarity index 94% rename from packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts rename to packages/didcomm/src/modules/connections/messages/ConnectionInvitationMessage.ts index 420a1ea8f3..4c9a22647c 100644 --- a/packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/ConnectionInvitationMessage.ts @@ -1,14 +1,12 @@ import type { Attachment } from '../../../decorators/attachment/Attachment' +import { CredoError, JsonEncoder, JsonTransformer } from '@credo-ts/core' import { Transform } from 'class-transformer' import { ArrayNotEmpty, IsArray, IsOptional, IsString, IsUrl, ValidateIf } from 'class-validator' import { parseUrl } from 'query-string' -import { AgentMessage } from '../../../agent/AgentMessage' -import { CredoError } from '../../../error' -import { JsonEncoder } from '../../../utils/JsonEncoder' -import { JsonTransformer } from '../../../utils/JsonTransformer' -import { IsValidMessageType, parseMessageType, replaceLegacyDidSovPrefix } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType, replaceLegacyDidSovPrefix } from '../../../util/messageType' export interface BaseInvitationOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts b/packages/didcomm/src/modules/connections/messages/ConnectionProblemReportMessage.ts similarity index 78% rename from packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts rename to packages/didcomm/src/modules/connections/messages/ConnectionProblemReportMessage.ts index d6d84dcb0f..ba22892f5f 100644 --- a/packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/ConnectionProblemReportMessage.ts @@ -1,7 +1,7 @@ -import type { ProblemReportMessageOptions } from '../../problem-reports/messages/ProblemReportMessage' +import type { ProblemReportMessageOptions } from '../../../messages' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' -import { ProblemReportMessage } from '../../problem-reports/messages/ProblemReportMessage' +import { ProblemReportMessage } from '../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export type ConnectionProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts b/packages/didcomm/src/modules/connections/messages/ConnectionRequestMessage.ts similarity index 95% rename from packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts rename to packages/didcomm/src/modules/connections/messages/ConnectionRequestMessage.ts index 46a33fa221..696fa8f4de 100644 --- a/packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/ConnectionRequestMessage.ts @@ -3,8 +3,8 @@ import type { DidDoc } from '../models' import { Type } from 'class-transformer' import { IsInstance, IsOptional, IsString, IsUrl, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' import { Connection } from '../models' export interface ConnectionRequestMessageOptions { diff --git a/packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts b/packages/didcomm/src/modules/connections/messages/ConnectionResponseMessage.ts similarity index 94% rename from packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts rename to packages/didcomm/src/modules/connections/messages/ConnectionResponseMessage.ts index 08e22a166b..654dc9faa1 100644 --- a/packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/ConnectionResponseMessage.ts @@ -1,9 +1,9 @@ import { Type, Expose } from 'class-transformer' import { IsInstance, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' +import { AgentMessage } from '../../../AgentMessage' import { SignatureDecorator } from '../../../decorators/signature/SignatureDecorator' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface ConnectionResponseMessageOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/DidExchangeCompleteMessage.ts b/packages/didcomm/src/modules/connections/messages/DidExchangeCompleteMessage.ts similarity index 91% rename from packages/core/src/modules/connections/messages/DidExchangeCompleteMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidExchangeCompleteMessage.ts index 754f049a71..ed8f5acc2b 100644 --- a/packages/core/src/modules/connections/messages/DidExchangeCompleteMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidExchangeCompleteMessage.ts @@ -1,5 +1,5 @@ -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface DidExchangeCompleteMessageOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/DidExchangeProblemReportMessage.ts b/packages/didcomm/src/modules/connections/messages/DidExchangeProblemReportMessage.ts similarity index 75% rename from packages/core/src/modules/connections/messages/DidExchangeProblemReportMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidExchangeProblemReportMessage.ts index 3f948aa768..7fa76c963e 100644 --- a/packages/core/src/modules/connections/messages/DidExchangeProblemReportMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidExchangeProblemReportMessage.ts @@ -1,7 +1,7 @@ -import type { ProblemReportMessageOptions } from '../../problem-reports/messages/ProblemReportMessage' +import type { ProblemReportMessageOptions } from '../../../messages' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' -import { ProblemReportMessage } from '../../problem-reports/messages/ProblemReportMessage' +import { ProblemReportMessage } from '../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export type DidExchangeProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/core/src/modules/connections/messages/DidExchangeRequestMessage.ts b/packages/didcomm/src/modules/connections/messages/DidExchangeRequestMessage.ts similarity index 95% rename from packages/core/src/modules/connections/messages/DidExchangeRequestMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidExchangeRequestMessage.ts index 353ac079a2..f073b8be49 100644 --- a/packages/core/src/modules/connections/messages/DidExchangeRequestMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidExchangeRequestMessage.ts @@ -1,9 +1,9 @@ import { Expose, Type } from 'class-transformer' import { IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' +import { AgentMessage } from '../../../AgentMessage' import { Attachment } from '../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface DidExchangeRequestMessageOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/DidExchangeResponseMessage.ts b/packages/didcomm/src/modules/connections/messages/DidExchangeResponseMessage.ts similarity index 95% rename from packages/core/src/modules/connections/messages/DidExchangeResponseMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidExchangeResponseMessage.ts index fe62a6393a..325bc787db 100644 --- a/packages/core/src/modules/connections/messages/DidExchangeResponseMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidExchangeResponseMessage.ts @@ -1,9 +1,9 @@ import { Type, Expose } from 'class-transformer' import { IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' +import { AgentMessage } from '../../../AgentMessage' import { Attachment } from '../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface DidExchangeResponseMessageOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/DidRotateAckMessage.ts b/packages/didcomm/src/modules/connections/messages/DidRotateAckMessage.ts similarity index 78% rename from packages/core/src/modules/connections/messages/DidRotateAckMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidRotateAckMessage.ts index 363c7b1e45..87938a2bb0 100644 --- a/packages/core/src/modules/connections/messages/DidRotateAckMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidRotateAckMessage.ts @@ -1,7 +1,7 @@ -import type { AckMessageOptions } from '../../common/messages/AckMessage' +import type { AckMessageOptions } from '../../../messages' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' -import { AckMessage } from '../../common/messages/AckMessage' +import { AckMessage } from '../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export type DidRotateAckMessageOptions = AckMessageOptions diff --git a/packages/core/src/modules/connections/messages/DidRotateMessage.ts b/packages/didcomm/src/modules/connections/messages/DidRotateMessage.ts similarity index 92% rename from packages/core/src/modules/connections/messages/DidRotateMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidRotateMessage.ts index a33db94a71..79f41cfd5f 100644 --- a/packages/core/src/modules/connections/messages/DidRotateMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidRotateMessage.ts @@ -1,8 +1,8 @@ import { Expose } from 'class-transformer' import { IsString } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface DidRotateMessageOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/DidRotateProblemReportMessage.ts b/packages/didcomm/src/modules/connections/messages/DidRotateProblemReportMessage.ts similarity index 75% rename from packages/core/src/modules/connections/messages/DidRotateProblemReportMessage.ts rename to packages/didcomm/src/modules/connections/messages/DidRotateProblemReportMessage.ts index 2eaf0c027d..f5715c63fa 100644 --- a/packages/core/src/modules/connections/messages/DidRotateProblemReportMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/DidRotateProblemReportMessage.ts @@ -1,7 +1,7 @@ -import type { ProblemReportMessageOptions } from '../../problem-reports/messages/ProblemReportMessage' +import type { ProblemReportMessageOptions } from '../../../messages' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' -import { ProblemReportMessage } from '../../problem-reports/messages/ProblemReportMessage' +import { ProblemReportMessage } from '../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export type DidRotateProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/core/src/modules/connections/messages/HangupMessage.ts b/packages/didcomm/src/modules/connections/messages/HangupMessage.ts similarity index 91% rename from packages/core/src/modules/connections/messages/HangupMessage.ts rename to packages/didcomm/src/modules/connections/messages/HangupMessage.ts index b9ab2bd510..7ab16a3048 100644 --- a/packages/core/src/modules/connections/messages/HangupMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/HangupMessage.ts @@ -1,5 +1,5 @@ -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface HangupMessageOptions { id?: string diff --git a/packages/core/src/modules/connections/messages/TrustPingMessage.ts b/packages/didcomm/src/modules/connections/messages/TrustPingMessage.ts similarity index 95% rename from packages/core/src/modules/connections/messages/TrustPingMessage.ts rename to packages/didcomm/src/modules/connections/messages/TrustPingMessage.ts index a8719f0b34..5f5b6827b3 100644 --- a/packages/core/src/modules/connections/messages/TrustPingMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/TrustPingMessage.ts @@ -3,8 +3,8 @@ import type { TimingDecorator } from '../../../decorators/timing/TimingDecorator import { Expose } from 'class-transformer' import { IsString, IsBoolean, IsOptional } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface TrustPingMessageOptions { comment?: string diff --git a/packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts b/packages/didcomm/src/modules/connections/messages/TrustPingResponseMessage.ts similarity index 95% rename from packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts rename to packages/didcomm/src/modules/connections/messages/TrustPingResponseMessage.ts index 9fa465a836..e5bc6e7fd0 100644 --- a/packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts +++ b/packages/didcomm/src/modules/connections/messages/TrustPingResponseMessage.ts @@ -2,8 +2,8 @@ import type { TimingDecorator } from '../../../decorators/timing/TimingDecorator import { IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface TrustPingResponseMessageOptions { comment?: string diff --git a/packages/core/src/modules/connections/messages/index.ts b/packages/didcomm/src/modules/connections/messages/index.ts similarity index 100% rename from packages/core/src/modules/connections/messages/index.ts rename to packages/didcomm/src/modules/connections/messages/index.ts diff --git a/packages/core/src/modules/connections/models/Connection.ts b/packages/didcomm/src/modules/connections/models/Connection.ts similarity index 100% rename from packages/core/src/modules/connections/models/Connection.ts rename to packages/didcomm/src/modules/connections/models/Connection.ts diff --git a/packages/core/src/modules/connections/models/ConnectionRole.ts b/packages/didcomm/src/modules/connections/models/ConnectionRole.ts similarity index 100% rename from packages/core/src/modules/connections/models/ConnectionRole.ts rename to packages/didcomm/src/modules/connections/models/ConnectionRole.ts diff --git a/packages/core/src/modules/connections/models/ConnectionState.ts b/packages/didcomm/src/modules/connections/models/ConnectionState.ts similarity index 100% rename from packages/core/src/modules/connections/models/ConnectionState.ts rename to packages/didcomm/src/modules/connections/models/ConnectionState.ts diff --git a/packages/core/src/modules/connections/models/ConnectionType.ts b/packages/didcomm/src/modules/connections/models/ConnectionType.ts similarity index 100% rename from packages/core/src/modules/connections/models/ConnectionType.ts rename to packages/didcomm/src/modules/connections/models/ConnectionType.ts diff --git a/packages/core/src/modules/connections/models/DidExchangeRole.ts b/packages/didcomm/src/modules/connections/models/DidExchangeRole.ts similarity index 100% rename from packages/core/src/modules/connections/models/DidExchangeRole.ts rename to packages/didcomm/src/modules/connections/models/DidExchangeRole.ts diff --git a/packages/core/src/modules/connections/models/DidExchangeState.ts b/packages/didcomm/src/modules/connections/models/DidExchangeState.ts similarity index 100% rename from packages/core/src/modules/connections/models/DidExchangeState.ts rename to packages/didcomm/src/modules/connections/models/DidExchangeState.ts diff --git a/packages/core/src/modules/connections/models/DidRotateRole.ts b/packages/didcomm/src/modules/connections/models/DidRotateRole.ts similarity index 100% rename from packages/core/src/modules/connections/models/DidRotateRole.ts rename to packages/didcomm/src/modules/connections/models/DidRotateRole.ts diff --git a/packages/core/src/modules/connections/models/HandshakeProtocol.ts b/packages/didcomm/src/modules/connections/models/HandshakeProtocol.ts similarity index 100% rename from packages/core/src/modules/connections/models/HandshakeProtocol.ts rename to packages/didcomm/src/modules/connections/models/HandshakeProtocol.ts diff --git a/packages/core/src/modules/connections/models/InvitationDetails.ts b/packages/didcomm/src/modules/connections/models/InvitationDetails.ts similarity index 100% rename from packages/core/src/modules/connections/models/InvitationDetails.ts rename to packages/didcomm/src/modules/connections/models/InvitationDetails.ts diff --git a/packages/core/src/modules/connections/models/__tests__/ConnectionState.test.ts b/packages/didcomm/src/modules/connections/models/__tests__/ConnectionState.test.ts similarity index 100% rename from packages/core/src/modules/connections/models/__tests__/ConnectionState.test.ts rename to packages/didcomm/src/modules/connections/models/__tests__/ConnectionState.test.ts diff --git a/packages/core/src/modules/connections/models/did/DidDoc.ts b/packages/didcomm/src/modules/connections/models/did/DidDoc.ts similarity index 96% rename from packages/core/src/modules/connections/models/did/DidDoc.ts rename to packages/didcomm/src/modules/connections/models/did/DidDoc.ts index d40a4aaeca..8ea9d4e061 100644 --- a/packages/core/src/modules/connections/models/did/DidDoc.ts +++ b/packages/didcomm/src/modules/connections/models/did/DidDoc.ts @@ -1,12 +1,11 @@ import type { Authentication } from './authentication' import type { PublicKey } from './publicKey' -import type { DidDocumentService } from '../../../dids/domain/service' +import type { DidDocumentService } from '@credo-ts/core' +import { ServiceTransformer, DidCommV1Service, IndyAgentService } from '@credo-ts/core' import { Expose } from 'class-transformer' import { Equals, IsArray, IsString, ValidateNested } from 'class-validator' -import { ServiceTransformer, DidCommV1Service, IndyAgentService } from '../../../dids/domain/service' - import { AuthenticationTransformer } from './authentication' import { PublicKeyTransformer } from './publicKey' diff --git a/packages/core/src/modules/connections/models/did/__tests__/Authentication.test.ts b/packages/didcomm/src/modules/connections/models/did/__tests__/Authentication.test.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/__tests__/Authentication.test.ts rename to packages/didcomm/src/modules/connections/models/did/__tests__/Authentication.test.ts diff --git a/packages/core/src/modules/connections/models/did/__tests__/DidDoc.test.ts b/packages/didcomm/src/modules/connections/models/did/__tests__/DidDoc.test.ts similarity index 99% rename from packages/core/src/modules/connections/models/did/__tests__/DidDoc.test.ts rename to packages/didcomm/src/modules/connections/models/did/__tests__/DidDoc.test.ts index 59e301acaa..650e16dadd 100644 --- a/packages/core/src/modules/connections/models/did/__tests__/DidDoc.test.ts +++ b/packages/didcomm/src/modules/connections/models/did/__tests__/DidDoc.test.ts @@ -1,6 +1,6 @@ import { instanceToPlain, plainToInstance } from 'class-transformer' -import { DidCommV1Service, DidDocumentService, IndyAgentService } from '../../../../dids' +import { DidCommV1Service, DidDocumentService, IndyAgentService } from '../../../../../../../core/src/modules/dids' import { DidDoc } from '../DidDoc' import { ReferencedAuthentication, EmbeddedAuthentication } from '../authentication' import { Ed25119Sig2018, EddsaSaSigSecp256k1, RsaSig2018 } from '../publicKey' diff --git a/packages/core/src/modules/connections/models/did/__tests__/PublicKey.test.ts b/packages/didcomm/src/modules/connections/models/did/__tests__/PublicKey.test.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/__tests__/PublicKey.test.ts rename to packages/didcomm/src/modules/connections/models/did/__tests__/PublicKey.test.ts diff --git a/packages/core/src/modules/connections/models/did/__tests__/diddoc.json b/packages/didcomm/src/modules/connections/models/did/__tests__/diddoc.json similarity index 100% rename from packages/core/src/modules/connections/models/did/__tests__/diddoc.json rename to packages/didcomm/src/modules/connections/models/did/__tests__/diddoc.json diff --git a/packages/core/src/modules/connections/models/did/authentication/Authentication.ts b/packages/didcomm/src/modules/connections/models/did/authentication/Authentication.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/authentication/Authentication.ts rename to packages/didcomm/src/modules/connections/models/did/authentication/Authentication.ts diff --git a/packages/core/src/modules/connections/models/did/authentication/EmbeddedAuthentication.ts b/packages/didcomm/src/modules/connections/models/did/authentication/EmbeddedAuthentication.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/authentication/EmbeddedAuthentication.ts rename to packages/didcomm/src/modules/connections/models/did/authentication/EmbeddedAuthentication.ts diff --git a/packages/core/src/modules/connections/models/did/authentication/ReferencedAuthentication.ts b/packages/didcomm/src/modules/connections/models/did/authentication/ReferencedAuthentication.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/authentication/ReferencedAuthentication.ts rename to packages/didcomm/src/modules/connections/models/did/authentication/ReferencedAuthentication.ts diff --git a/packages/core/src/modules/connections/models/did/authentication/index.ts b/packages/didcomm/src/modules/connections/models/did/authentication/index.ts similarity index 98% rename from packages/core/src/modules/connections/models/did/authentication/index.ts rename to packages/didcomm/src/modules/connections/models/did/authentication/index.ts index 989e4d12ef..4f42537c9c 100644 --- a/packages/core/src/modules/connections/models/did/authentication/index.ts +++ b/packages/didcomm/src/modules/connections/models/did/authentication/index.ts @@ -1,8 +1,8 @@ import type { ClassConstructor } from 'class-transformer' +import { CredoError } from '@credo-ts/core' import { Transform, TransformationType, plainToInstance, instanceToPlain } from 'class-transformer' -import { CredoError } from '../../../../../error' import { PublicKey, publicKeyTypes } from '../publicKey' import { Authentication } from './Authentication' diff --git a/packages/core/src/modules/connections/models/did/index.ts b/packages/didcomm/src/modules/connections/models/did/index.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/index.ts rename to packages/didcomm/src/modules/connections/models/did/index.ts diff --git a/packages/core/src/modules/connections/models/did/publicKey/Ed25119Sig2018.ts b/packages/didcomm/src/modules/connections/models/did/publicKey/Ed25119Sig2018.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/publicKey/Ed25119Sig2018.ts rename to packages/didcomm/src/modules/connections/models/did/publicKey/Ed25119Sig2018.ts diff --git a/packages/core/src/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.ts b/packages/didcomm/src/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.ts rename to packages/didcomm/src/modules/connections/models/did/publicKey/EddsaSaSigSecp256k1.ts diff --git a/packages/core/src/modules/connections/models/did/publicKey/PublicKey.ts b/packages/didcomm/src/modules/connections/models/did/publicKey/PublicKey.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/publicKey/PublicKey.ts rename to packages/didcomm/src/modules/connections/models/did/publicKey/PublicKey.ts diff --git a/packages/core/src/modules/connections/models/did/publicKey/RsaSig2018.ts b/packages/didcomm/src/modules/connections/models/did/publicKey/RsaSig2018.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/publicKey/RsaSig2018.ts rename to packages/didcomm/src/modules/connections/models/did/publicKey/RsaSig2018.ts diff --git a/packages/core/src/modules/connections/models/did/publicKey/index.ts b/packages/didcomm/src/modules/connections/models/did/publicKey/index.ts similarity index 100% rename from packages/core/src/modules/connections/models/did/publicKey/index.ts rename to packages/didcomm/src/modules/connections/models/did/publicKey/index.ts diff --git a/packages/core/src/modules/connections/models/index.ts b/packages/didcomm/src/modules/connections/models/index.ts similarity index 100% rename from packages/core/src/modules/connections/models/index.ts rename to packages/didcomm/src/modules/connections/models/index.ts diff --git a/packages/core/src/modules/connections/repository/ConnectionMetadataTypes.ts b/packages/didcomm/src/modules/connections/repository/ConnectionMetadataTypes.ts similarity index 100% rename from packages/core/src/modules/connections/repository/ConnectionMetadataTypes.ts rename to packages/didcomm/src/modules/connections/repository/ConnectionMetadataTypes.ts diff --git a/packages/core/src/modules/connections/repository/ConnectionRecord.ts b/packages/didcomm/src/modules/connections/repository/ConnectionRecord.ts similarity index 94% rename from packages/core/src/modules/connections/repository/ConnectionRecord.ts rename to packages/didcomm/src/modules/connections/repository/ConnectionRecord.ts index beb7154be4..aa7649fb99 100644 --- a/packages/core/src/modules/connections/repository/ConnectionRecord.ts +++ b/packages/didcomm/src/modules/connections/repository/ConnectionRecord.ts @@ -1,12 +1,10 @@ import type { ConnectionMetadata } from './ConnectionMetadataTypes' -import type { TagsBase } from '../../../storage/BaseRecord' -import type { ConnectionType } from '../models/ConnectionType' +import type { ConnectionType } from '../models' +import type { TagsBase } from '@credo-ts/core' +import { BaseRecord, CredoError, utils } from '@credo-ts/core' import { Transform } from 'class-transformer' -import { CredoError } from '../../../error' -import { BaseRecord } from '../../../storage/BaseRecord' -import { uuid } from '../../../utils/uuid' import { rfc0160StateFromDidExchangeState, DidExchangeRole, DidExchangeState, HandshakeProtocol } from '../models' export interface ConnectionRecordProps { @@ -90,7 +88,7 @@ export class ConnectionRecord extends BaseRecord { message: MessageType connectionRecord: ConnectionRecord diff --git a/packages/core/src/modules/connections/services/DidRotateService.ts b/packages/didcomm/src/modules/connections/services/DidRotateService.ts similarity index 94% rename from packages/core/src/modules/connections/services/DidRotateService.ts rename to packages/didcomm/src/modules/connections/services/DidRotateService.ts index e797b19b02..1da7407634 100644 --- a/packages/core/src/modules/connections/services/DidRotateService.ts +++ b/packages/didcomm/src/modules/connections/services/DidRotateService.ts @@ -1,24 +1,25 @@ -import type { Routing } from './ConnectionService' -import type { AgentContext } from '../../../agent' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { InboundMessageContext, Routing } from '../../../models' import type { ConnectionDidRotatedEvent } from '../ConnectionEvents' -import type { ConnectionRecord } from '../repository/ConnectionRecord' - -import { EventEmitter } from '../../../agent/EventEmitter' -import { OutboundMessageContext } from '../../../agent/models' -import { InjectionSymbols } from '../../../constants' -import { CredoError } from '../../../error' -import { Logger } from '../../../logger' -import { inject, injectable } from '../../../plugins' -import { AckStatus } from '../../common' +import type { ConnectionRecord } from '../repository' +import type { AgentContext } from '@credo-ts/core' + import { + EventEmitter, + InjectionSymbols, + CredoError, DidRepository, DidResolverService, PeerDidNumAlgo, getAlternativeDidsForPeerDid, getNumAlgoFromPeerDid, isValidPeerDid, -} from '../../dids' + inject, + injectable, + Logger, +} from '@credo-ts/core' + +import { AckStatus } from '../../../messages' +import { OutboundMessageContext } from '../../../models' import { getMediationRecordForDidDocument } from '../../routing/services/helpers' import { ConnectionEventTypes } from '../ConnectionEvents' import { ConnectionsModuleConfig } from '../ConnectionsModuleConfig' diff --git a/packages/core/src/modules/connections/services/TrustPingService.ts b/packages/didcomm/src/modules/connections/services/TrustPingService.ts similarity index 81% rename from packages/core/src/modules/connections/services/TrustPingService.ts rename to packages/didcomm/src/modules/connections/services/TrustPingService.ts index 5236a2c83d..e957cf4b30 100644 --- a/packages/core/src/modules/connections/services/TrustPingService.ts +++ b/packages/didcomm/src/modules/connections/services/TrustPingService.ts @@ -1,11 +1,11 @@ -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { InboundMessageContext } from '../../../models' import type { TrustPingReceivedEvent, TrustPingResponseReceivedEvent } from '../TrustPingEvents' import type { TrustPingMessage } from '../messages' -import type { ConnectionRecord } from '../repository/ConnectionRecord' +import type { ConnectionRecord } from '../repository' -import { EventEmitter } from '../../../agent/EventEmitter' -import { OutboundMessageContext } from '../../../agent/models' -import { injectable } from '../../../plugins' +import { EventEmitter, injectable } from '@credo-ts/core' + +import { OutboundMessageContext } from '../../../models' import { TrustPingEventTypes } from '../TrustPingEvents' import { TrustPingResponseMessage } from '../messages' diff --git a/packages/core/src/modules/connections/services/helpers.ts b/packages/didcomm/src/modules/connections/services/helpers.ts similarity index 94% rename from packages/core/src/modules/connections/services/helpers.ts rename to packages/didcomm/src/modules/connections/services/helpers.ts index 0b9efbac74..b4e9886e67 100644 --- a/packages/core/src/modules/connections/services/helpers.ts +++ b/packages/didcomm/src/modules/connections/services/helpers.ts @@ -1,12 +1,11 @@ -import type { Routing } from './ConnectionService' -import type { AgentContext } from '../../../agent' -import type { ResolvedDidCommService } from '../../didcomm' -import type { DidDocument, PeerDidNumAlgo } from '../../dids' +import type { Routing } from '../../../models' import type { DidDoc, PublicKey } from '../models' +import type { AgentContext, DidDocument, PeerDidNumAlgo, ResolvedDidCommService } from '@credo-ts/core' -import { Key, KeyType } from '../../../crypto' -import { CredoError } from '../../../error' import { + Key, + KeyType, + CredoError, IndyAgentService, DidCommV1Service, DidDocumentBuilder, @@ -15,8 +14,9 @@ import { DidsApi, createPeerDidDocumentFromServices, DidDocumentRole, -} from '../../dids' -import { didDocumentJsonToNumAlgo1Did } from '../../dids/methods/peer/peerDidNumAlgo1' + didDocumentJsonToNumAlgo1Did, +} from '@credo-ts/core' + import { EmbeddedAuthentication } from '../models' export function convertToNewDidDocument(didDoc: DidDoc): DidDocument { diff --git a/packages/core/src/modules/connections/services/index.ts b/packages/didcomm/src/modules/connections/services/index.ts similarity index 100% rename from packages/core/src/modules/connections/services/index.ts rename to packages/didcomm/src/modules/connections/services/index.ts diff --git a/packages/core/src/modules/credentials/CredentialEvents.ts b/packages/didcomm/src/modules/credentials/CredentialEvents.ts similarity index 93% rename from packages/core/src/modules/credentials/CredentialEvents.ts rename to packages/didcomm/src/modules/credentials/CredentialEvents.ts index 2a60193d51..b8a6621eb5 100644 --- a/packages/core/src/modules/credentials/CredentialEvents.ts +++ b/packages/didcomm/src/modules/credentials/CredentialEvents.ts @@ -1,6 +1,6 @@ import type { CredentialState } from './models/CredentialState' import type { CredentialExchangeRecord } from './repository/CredentialExchangeRecord' -import type { BaseEvent } from '../../agent/Events' +import type { BaseEvent } from '@credo-ts/core' export enum CredentialEventTypes { CredentialStateChanged = 'CredentialStateChanged', diff --git a/packages/core/src/modules/credentials/CredentialsApi.ts b/packages/didcomm/src/modules/credentials/CredentialsApi.ts similarity index 97% rename from packages/core/src/modules/credentials/CredentialsApi.ts rename to packages/didcomm/src/modules/credentials/CredentialsApi.ts index 5a5618b4fc..aeac077e4a 100644 --- a/packages/core/src/modules/credentials/CredentialsApi.ts +++ b/packages/didcomm/src/modules/credentials/CredentialsApi.ts @@ -21,18 +21,15 @@ import type { import type { CredentialProtocol } from './protocol/CredentialProtocol' import type { CredentialFormatsFromProtocols } from './protocol/CredentialProtocolOptions' import type { CredentialExchangeRecord } from './repository/CredentialExchangeRecord' -import type { AgentMessage } from '../../agent/AgentMessage' -import type { Query, QueryOptions } from '../../storage/StorageService' - -import { AgentContext } from '../../agent' -import { MessageSender } from '../../agent/MessageSender' -import { getOutboundMessageContext } from '../../agent/getOutboundMessageContext' -import { InjectionSymbols } from '../../constants' -import { CredoError } from '../../error' -import { Logger } from '../../logger' -import { inject, injectable } from '../../plugins' -import { DidCommMessageRepository } from '../../storage/didcomm/DidCommMessageRepository' -import { ConnectionService } from '../connections/services' +import type { Query, QueryOptions } from '@credo-ts/core' + +import { AgentContext, InjectionSymbols, CredoError, Logger, inject, injectable } from '@credo-ts/core' + +import { AgentMessage } from '../../AgentMessage' +import { MessageSender } from '../../MessageSender' +import { getOutboundMessageContext } from '../../getOutboundMessageContext' +import { DidCommMessageRepository } from '../../repository/DidCommMessageRepository' +import { ConnectionService } from '../connections' import { RoutingService } from '../routing/services/RoutingService' import { CredentialsModuleConfig } from './CredentialsModuleConfig' diff --git a/packages/core/src/modules/credentials/CredentialsApiOptions.ts b/packages/didcomm/src/modules/credentials/CredentialsApiOptions.ts similarity index 100% rename from packages/core/src/modules/credentials/CredentialsApiOptions.ts rename to packages/didcomm/src/modules/credentials/CredentialsApiOptions.ts diff --git a/packages/core/src/modules/credentials/CredentialsModule.ts b/packages/didcomm/src/modules/credentials/CredentialsModule.ts similarity index 79% rename from packages/core/src/modules/credentials/CredentialsModule.ts rename to packages/didcomm/src/modules/credentials/CredentialsModule.ts index 043a5bde5a..dc4631ccda 100644 --- a/packages/core/src/modules/credentials/CredentialsModule.ts +++ b/packages/didcomm/src/modules/credentials/CredentialsModule.ts @@ -1,11 +1,10 @@ import type { CredentialsModuleConfigOptions } from './CredentialsModuleConfig' import type { CredentialProtocol } from './protocol/CredentialProtocol' -import type { FeatureRegistry } from '../../agent/FeatureRegistry' -import type { ApiModule, DependencyManager } from '../../plugins' -import type { Constructor } from '../../utils/mixins' -import type { Optional } from '../../utils/type' +import type { AgentContext, ApiModule, DependencyManager, Constructor, Optional } from '@credo-ts/core' -import { Protocol } from '../../agent/models' +import { FeatureRegistry } from '../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../MessageHandlerRegistry' +import { Protocol } from '../../models' import { CredentialsApi } from './CredentialsApi' import { CredentialsModuleConfig } from './CredentialsModuleConfig' @@ -44,7 +43,7 @@ export class CredentialsModule { + const messageHandlerRegistry = agentContext.dependencyManager.resolve(MessageHandlerRegistry) + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) - // Features featureRegistry.register( new Protocol({ id: 'https://didcomm.org/revocation_notification/1.0', @@ -68,7 +71,7 @@ export class CredentialsModule +const featureRegistry = { + register: jest.fn(), +} as unknown as FeatureRegistry -const dependencyManager = new DependencyManagerMock() - -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() +const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + registerContextScoped: jest.fn(), + resolve: () => featureRegistry, +} as unknown as DependencyManager describe('CredentialsModule', () => { test('registers dependencies on the dependency manager', () => { const credentialsModule = new CredentialsModule({ credentialProtocols: [], }) - credentialsModule.register(dependencyManager, featureRegistry) + credentialsModule.register(dependencyManager) expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1) expect(dependencyManager.registerInstance).toHaveBeenCalledWith(CredentialsModuleConfig, credentialsModule.config) @@ -33,18 +36,6 @@ describe('CredentialsModule', () => { expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(RevocationNotificationService) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(CredentialRepository) - - expect(featureRegistry.register).toHaveBeenCalledTimes(1) - expect(featureRegistry.register).toHaveBeenCalledWith( - new Protocol({ - id: 'https://didcomm.org/revocation_notification/1.0', - roles: ['holder'], - }), - new Protocol({ - id: 'https://didcomm.org/revocation_notification/2.0', - roles: ['holder'], - }) - ) }) test('registers V2CredentialProtocol if no credentialProtocols are configured', () => { @@ -53,7 +44,7 @@ describe('CredentialsModule', () => { expect(credentialsModule.config.credentialProtocols).toEqual([expect.any(V2CredentialProtocol)]) }) - test('calls register on the provided CredentialProtocols', () => { + test('calls register on the provided CredentialProtocols', async () => { const registerMock = jest.fn() const credentialProtocol = { register: registerMock, @@ -65,9 +56,28 @@ describe('CredentialsModule', () => { expect(credentialsModule.config.credentialProtocols).toEqual([credentialProtocol]) - credentialsModule.register(dependencyManager, featureRegistry) + const messageHandlerRegistry = new MessageHandlerRegistry() + const agentContext = getAgentContext({ + registerInstances: [ + [MessageHandlerRegistry, messageHandlerRegistry], + [FeatureRegistry, featureRegistry], + ], + }) + await credentialsModule.initialize(agentContext) expect(registerMock).toHaveBeenCalledTimes(1) - expect(registerMock).toHaveBeenCalledWith(dependencyManager, featureRegistry) + expect(registerMock).toHaveBeenCalledWith(messageHandlerRegistry, featureRegistry) + + expect(featureRegistry.register).toHaveBeenCalledTimes(1) + expect(featureRegistry.register).toHaveBeenCalledWith( + new Protocol({ + id: 'https://didcomm.org/revocation_notification/1.0', + roles: ['holder'], + }), + new Protocol({ + id: 'https://didcomm.org/revocation_notification/2.0', + roles: ['holder'], + }) + ) }) }) diff --git a/packages/core/src/modules/credentials/__tests__/CredentialsModuleConfig.test.ts b/packages/didcomm/src/modules/credentials/__tests__/CredentialsModuleConfig.test.ts similarity index 100% rename from packages/core/src/modules/credentials/__tests__/CredentialsModuleConfig.test.ts rename to packages/didcomm/src/modules/credentials/__tests__/CredentialsModuleConfig.test.ts diff --git a/packages/core/src/modules/credentials/__tests__/fixtures.ts b/packages/didcomm/src/modules/credentials/__tests__/fixtures.ts similarity index 100% rename from packages/core/src/modules/credentials/__tests__/fixtures.ts rename to packages/didcomm/src/modules/credentials/__tests__/fixtures.ts diff --git a/packages/core/src/modules/credentials/formats/CredentialFormat.ts b/packages/didcomm/src/modules/credentials/formats/CredentialFormat.ts similarity index 100% rename from packages/core/src/modules/credentials/formats/CredentialFormat.ts rename to packages/didcomm/src/modules/credentials/formats/CredentialFormat.ts diff --git a/packages/core/src/modules/credentials/formats/CredentialFormatService.ts b/packages/didcomm/src/modules/credentials/formats/CredentialFormatService.ts similarity index 98% rename from packages/core/src/modules/credentials/formats/CredentialFormatService.ts rename to packages/didcomm/src/modules/credentials/formats/CredentialFormatService.ts index ac1ffde0a9..12a05ae82f 100644 --- a/packages/core/src/modules/credentials/formats/CredentialFormatService.ts +++ b/packages/didcomm/src/modules/credentials/formats/CredentialFormatService.ts @@ -16,7 +16,7 @@ import type { CredentialFormatAutoRespondRequestOptions, CredentialFormatProcessCredentialOptions, } from './CredentialFormatServiceOptions' -import type { AgentContext } from '../../../agent' +import type { AgentContext } from '@credo-ts/core' export interface CredentialFormatService { formatKey: CF['formatKey'] diff --git a/packages/core/src/modules/credentials/formats/CredentialFormatServiceOptions.ts b/packages/didcomm/src/modules/credentials/formats/CredentialFormatServiceOptions.ts similarity index 100% rename from packages/core/src/modules/credentials/formats/CredentialFormatServiceOptions.ts rename to packages/didcomm/src/modules/credentials/formats/CredentialFormatServiceOptions.ts diff --git a/packages/core/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts b/packages/didcomm/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts similarity index 94% rename from packages/core/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts rename to packages/didcomm/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts index d8be4784b7..8273dd5ee9 100644 --- a/packages/core/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts +++ b/packages/didcomm/src/modules/credentials/formats/dataIntegrity/DataIntegrityCredentialFormat.ts @@ -6,8 +6,8 @@ import type { DidCommSignedAttachmentCredentialRequestOptions as DidCommSignedAttachmentAcceptOfferOptions, W3C_VC_DATA_MODEL_VERSION, } from './dataIntegrityExchange' -import type { CredentialFormat, JsonObject } from '../../../..' -import type { W3cCredential } from '../../../vc' +import type { CredentialFormat } from '../CredentialFormat' +import type { JsonObject, W3cCredential } from '@credo-ts/core' export interface AnonCredsLinkSecretCreateOfferOptions { credentialDefinitionId: string diff --git a/packages/core/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts b/packages/didcomm/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts similarity index 97% rename from packages/core/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts rename to packages/didcomm/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts index c57124b270..73c77b4034 100644 --- a/packages/core/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts +++ b/packages/didcomm/src/modules/credentials/formats/dataIntegrity/dataIntegrityExchange.ts @@ -1,10 +1,7 @@ +import { JsonObject, JsonTransformer, W3cCredential } from '@credo-ts/core' import { Expose, Type } from 'class-transformer' import { ArrayNotEmpty, IsBoolean, IsEnum, IsOptional, IsString, ValidateNested } from 'class-validator' -import { JsonObject } from '../../../../types' -import { JsonTransformer } from '../../../../utils/JsonTransformer' -import { W3cCredential } from '../../../vc' - const SUPPORTED_W3C_VC_DATA_MODEL_VERSIONS = ['1.1', '2.0'] as const export type W3C_VC_DATA_MODEL_VERSION = (typeof SUPPORTED_W3C_VC_DATA_MODEL_VERSIONS)[number] diff --git a/packages/core/src/modules/credentials/formats/dataIntegrity/index.ts b/packages/didcomm/src/modules/credentials/formats/dataIntegrity/index.ts similarity index 100% rename from packages/core/src/modules/credentials/formats/dataIntegrity/index.ts rename to packages/didcomm/src/modules/credentials/formats/dataIntegrity/index.ts diff --git a/packages/core/src/modules/credentials/formats/index.ts b/packages/didcomm/src/modules/credentials/formats/index.ts similarity index 100% rename from packages/core/src/modules/credentials/formats/index.ts rename to packages/didcomm/src/modules/credentials/formats/index.ts diff --git a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts similarity index 91% rename from packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts rename to packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts index 734fc6366c..6097f4ee2b 100644 --- a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts +++ b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialDetail.ts @@ -1,7 +1,6 @@ +import { W3cCredential } from '@credo-ts/core' import { Expose, Type } from 'class-transformer' -import { W3cCredential } from '../../../vc/models/credential/W3cCredential' - import { JsonLdCredentialDetailOptions } from './JsonLdCredentialDetailOptions' export interface JsonLdCredentialDetailInputOptions { diff --git a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialDetailOptions.ts b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialDetailOptions.ts similarity index 100% rename from packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialDetailOptions.ts rename to packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialDetailOptions.ts diff --git a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts similarity index 93% rename from packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts rename to packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts index 298961370a..ef612a6bdb 100644 --- a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts +++ b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialFormat.ts @@ -1,7 +1,5 @@ -import type { JsonObject } from '../../../../types' -import type { SingleOrArray } from '../../../../utils' -import type { W3cIssuerOptions } from '../../../vc/models/credential/W3cIssuer' import type { CredentialFormat } from '../CredentialFormat' +import type { JsonObject, SingleOrArray, W3cIssuerOptions } from '@credo-ts/core' export interface JsonCredential { '@context': Array | JsonObject diff --git a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts similarity index 95% rename from packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts rename to packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts index 3829d4b7cb..75c1a5b188 100644 --- a/packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts +++ b/packages/didcomm/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts @@ -4,7 +4,6 @@ import type { JsonLdFormatDataCredentialDetail, JsonLdFormatDataVerifiableCredential, } from './JsonLdCredentialFormat' -import type { AgentContext } from '../../../../agent' import type { CredentialFormatService } from '../CredentialFormatService' import type { CredentialFormatAcceptOfferOptions, @@ -23,15 +22,23 @@ import type { CredentialFormatProcessOptions, CredentialFormatAutoRespondCredentialOptions, } from '../CredentialFormatServiceOptions' +import type { AgentContext } from '@credo-ts/core' + +import { + CredoError, + JsonEncoder, + utils, + JsonTransformer, + findVerificationMethodByKeyType, + DidResolverService, + W3cJsonLdCredentialService, + ClaimFormat, + W3cCredential, + W3cCredentialService, + W3cJsonLdVerifiableCredential, +} from '@credo-ts/core' import { Attachment, AttachmentData } from '../../../../decorators/attachment/Attachment' -import { CredoError } from '../../../../error' -import { JsonEncoder, areObjectsEqual } from '../../../../utils' -import { JsonTransformer } from '../../../../utils/JsonTransformer' -import { findVerificationMethodByKeyType } from '../../../dids/domain/DidDocument' -import { DidResolverService } from '../../../dids/services/DidResolverService' -import { ClaimFormat, W3cCredential, W3cCredentialService, W3cJsonLdVerifiableCredential } from '../../../vc' -import { W3cJsonLdCredentialService } from '../../../vc/data-integrity/W3cJsonLdCredentialService' import { CredentialFormatSpec } from '../../models/CredentialFormatSpec' import { JsonLdCredentialDetail } from './JsonLdCredentialDetail' @@ -362,7 +369,7 @@ export class JsonLdCredentialFormatService implements CredentialFormatService const W3cJsonLdCredentialServiceMock = W3cJsonLdCredentialService as jest.Mock diff --git a/packages/core/src/modules/credentials/formats/jsonld/index.ts b/packages/didcomm/src/modules/credentials/formats/jsonld/index.ts similarity index 100% rename from packages/core/src/modules/credentials/formats/jsonld/index.ts rename to packages/didcomm/src/modules/credentials/formats/jsonld/index.ts diff --git a/packages/core/src/modules/credentials/index.ts b/packages/didcomm/src/modules/credentials/index.ts similarity index 100% rename from packages/core/src/modules/credentials/index.ts rename to packages/didcomm/src/modules/credentials/index.ts diff --git a/packages/core/src/modules/credentials/models/CredentialAutoAcceptType.ts b/packages/didcomm/src/modules/credentials/models/CredentialAutoAcceptType.ts similarity index 100% rename from packages/core/src/modules/credentials/models/CredentialAutoAcceptType.ts rename to packages/didcomm/src/modules/credentials/models/CredentialAutoAcceptType.ts diff --git a/packages/core/src/modules/credentials/models/CredentialFormatSpec.ts b/packages/didcomm/src/modules/credentials/models/CredentialFormatSpec.ts similarity index 81% rename from packages/core/src/modules/credentials/models/CredentialFormatSpec.ts rename to packages/didcomm/src/modules/credentials/models/CredentialFormatSpec.ts index 621b0f54b4..9f27958ff0 100644 --- a/packages/core/src/modules/credentials/models/CredentialFormatSpec.ts +++ b/packages/didcomm/src/modules/credentials/models/CredentialFormatSpec.ts @@ -1,8 +1,7 @@ +import { utils } from '@credo-ts/core' import { Expose } from 'class-transformer' import { IsString } from 'class-validator' -import { uuid } from '../../../utils/uuid' - export interface CredentialFormatSpecOptions { attachmentId?: string format: string @@ -11,7 +10,7 @@ export interface CredentialFormatSpecOptions { export class CredentialFormatSpec { public constructor(options: CredentialFormatSpecOptions) { if (options) { - this.attachmentId = options.attachmentId ?? uuid() + this.attachmentId = options.attachmentId ?? utils.uuid() this.format = options.format } } diff --git a/packages/core/src/modules/credentials/models/CredentialPreviewAttribute.ts b/packages/didcomm/src/modules/credentials/models/CredentialPreviewAttribute.ts similarity index 92% rename from packages/core/src/modules/credentials/models/CredentialPreviewAttribute.ts rename to packages/didcomm/src/modules/credentials/models/CredentialPreviewAttribute.ts index 0f341785c4..fb1c1930f0 100644 --- a/packages/core/src/modules/credentials/models/CredentialPreviewAttribute.ts +++ b/packages/didcomm/src/modules/credentials/models/CredentialPreviewAttribute.ts @@ -1,8 +1,7 @@ +import { JsonTransformer } from '@credo-ts/core' import { Expose } from 'class-transformer' import { IsMimeType, IsOptional, IsString } from 'class-validator' -import { JsonTransformer } from '../../../utils/JsonTransformer' - export interface CredentialPreviewAttributeOptions { name: string mimeType?: string diff --git a/packages/core/src/modules/credentials/models/CredentialProblemReportReason.ts b/packages/didcomm/src/modules/credentials/models/CredentialProblemReportReason.ts similarity index 100% rename from packages/core/src/modules/credentials/models/CredentialProblemReportReason.ts rename to packages/didcomm/src/modules/credentials/models/CredentialProblemReportReason.ts diff --git a/packages/core/src/modules/credentials/models/CredentialRole.ts b/packages/didcomm/src/modules/credentials/models/CredentialRole.ts similarity index 100% rename from packages/core/src/modules/credentials/models/CredentialRole.ts rename to packages/didcomm/src/modules/credentials/models/CredentialRole.ts diff --git a/packages/core/src/modules/credentials/models/CredentialState.ts b/packages/didcomm/src/modules/credentials/models/CredentialState.ts similarity index 100% rename from packages/core/src/modules/credentials/models/CredentialState.ts rename to packages/didcomm/src/modules/credentials/models/CredentialState.ts diff --git a/packages/core/src/modules/credentials/models/RevocationNotification.ts b/packages/didcomm/src/modules/credentials/models/RevocationNotification.ts similarity index 100% rename from packages/core/src/modules/credentials/models/RevocationNotification.ts rename to packages/didcomm/src/modules/credentials/models/RevocationNotification.ts diff --git a/packages/core/src/modules/credentials/models/__tests__/CredentialState.test.ts b/packages/didcomm/src/modules/credentials/models/__tests__/CredentialState.test.ts similarity index 100% rename from packages/core/src/modules/credentials/models/__tests__/CredentialState.test.ts rename to packages/didcomm/src/modules/credentials/models/__tests__/CredentialState.test.ts diff --git a/packages/core/src/modules/credentials/models/index.ts b/packages/didcomm/src/modules/credentials/models/index.ts similarity index 100% rename from packages/core/src/modules/credentials/models/index.ts rename to packages/didcomm/src/modules/credentials/models/index.ts diff --git a/packages/core/src/modules/credentials/protocol/BaseCredentialProtocol.ts b/packages/didcomm/src/modules/credentials/protocol/BaseCredentialProtocol.ts similarity index 94% rename from packages/core/src/modules/credentials/protocol/BaseCredentialProtocol.ts rename to packages/didcomm/src/modules/credentials/protocol/BaseCredentialProtocol.ts index 488b372ea7..32e1c7e84e 100644 --- a/packages/core/src/modules/credentials/protocol/BaseCredentialProtocol.ts +++ b/packages/didcomm/src/modules/credentials/protocol/BaseCredentialProtocol.ts @@ -14,20 +14,20 @@ import type { GetCredentialFormatDataReturn, CreateCredentialProblemReportOptions, } from './CredentialProtocolOptions' -import type { AgentContext } from '../../../agent' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../agent/FeatureRegistry' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../plugins' -import type { Query, QueryOptions } from '../../../storage/StorageService' -import type { ProblemReportMessage } from '../../problem-reports' +import type { AgentMessage } from '../../../AgentMessage' +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../MessageHandlerRegistry' +import type { ProblemReportMessage } from '../../../messages' +import type { InboundMessageContext } from '../../../models' import type { CredentialStateChangedEvent } from '../CredentialEvents' import type { CredentialFormatService, ExtractCredentialFormats } from '../formats' import type { CredentialRole } from '../models' import type { CredentialExchangeRecord } from '../repository' +import type { Query, QueryOptions, AgentContext } from '@credo-ts/core' -import { EventEmitter } from '../../../agent/EventEmitter' -import { DidCommMessageRepository } from '../../../storage/didcomm' +import { EventEmitter } from '@credo-ts/core' + +import { DidCommMessageRepository } from '../../../repository' import { ConnectionService } from '../../connections' import { CredentialEventTypes } from '../CredentialEvents' import { CredentialState } from '../models/CredentialState' @@ -126,7 +126,7 @@ export abstract class BaseCredentialProtocol>> - public abstract register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void + public abstract register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void /** * Process a received credential {@link ProblemReportMessage}. diff --git a/packages/core/src/modules/credentials/protocol/CredentialProtocol.ts b/packages/didcomm/src/modules/credentials/protocol/CredentialProtocol.ts similarity index 90% rename from packages/core/src/modules/credentials/protocol/CredentialProtocol.ts rename to packages/didcomm/src/modules/credentials/protocol/CredentialProtocol.ts index a5c8024681..b3a9840b07 100644 --- a/packages/core/src/modules/credentials/protocol/CredentialProtocol.ts +++ b/packages/didcomm/src/modules/credentials/protocol/CredentialProtocol.ts @@ -13,17 +13,16 @@ import type { GetCredentialFormatDataReturn, CreateCredentialProblemReportOptions, } from './CredentialProtocolOptions' -import type { AgentContext } from '../../../agent' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../agent/FeatureRegistry' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../plugins' -import type { Query, QueryOptions } from '../../../storage/StorageService' -import type { ProblemReportMessage } from '../../problem-reports' +import type { AgentMessage } from '../../../AgentMessage' +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../MessageHandlerRegistry' +import type { ProblemReportMessage } from '../../../messages' +import type { InboundMessageContext } from '../../../models' import type { CredentialFormatService, ExtractCredentialFormats } from '../formats' import type { CredentialRole } from '../models' import type { CredentialState } from '../models/CredentialState' import type { CredentialExchangeRecord } from '../repository' +import type { AgentContext, Query, QueryOptions } from '@credo-ts/core' export interface CredentialProtocol { readonly version: string @@ -132,5 +131,5 @@ export interface CredentialProtocol update(agentContext: AgentContext, credentialRecord: CredentialExchangeRecord): Promise - register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void + register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void } diff --git a/packages/core/src/modules/credentials/protocol/CredentialProtocolOptions.ts b/packages/didcomm/src/modules/credentials/protocol/CredentialProtocolOptions.ts similarity index 97% rename from packages/core/src/modules/credentials/protocol/CredentialProtocolOptions.ts rename to packages/didcomm/src/modules/credentials/protocol/CredentialProtocolOptions.ts index 1d571511a8..56d6d4669a 100644 --- a/packages/core/src/modules/credentials/protocol/CredentialProtocolOptions.ts +++ b/packages/didcomm/src/modules/credentials/protocol/CredentialProtocolOptions.ts @@ -1,6 +1,6 @@ import type { CredentialProtocol } from './CredentialProtocol' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { ConnectionRecord } from '../../connections/repository/ConnectionRecord' +import type { AgentMessage } from '../../../AgentMessage' +import type { ConnectionRecord } from '../../connections' import type { CredentialFormat, CredentialFormatPayload, diff --git a/packages/core/src/modules/credentials/protocol/index.ts b/packages/didcomm/src/modules/credentials/protocol/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/index.ts rename to packages/didcomm/src/modules/credentials/protocol/index.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts similarity index 94% rename from packages/core/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts index 36a41caf16..c4afd8cf35 100644 --- a/packages/core/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/V1RevocationNotificationHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { RevocationNotificationService } from '../services' import { V1RevocationNotificationMessage } from '../messages/V1RevocationNotificationMessage' diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts similarity index 94% rename from packages/core/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts index 2057a49d14..c3e8418f68 100644 --- a/packages/core/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/V2RevocationNotificationHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { RevocationNotificationService } from '../services' import { V2RevocationNotificationMessage } from '../messages/V2RevocationNotificationMessage' diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/handlers/index.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/handlers/index.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/handlers/index.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/index.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/index.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/index.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts similarity index 86% rename from packages/core/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts index c0af69539d..9fcd58317c 100644 --- a/packages/core/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/V1RevocationNotificationMessage.ts @@ -1,10 +1,9 @@ -import type { AckDecorator } from '../../../../../decorators/ack/AckDecorator' - import { Expose } from 'class-transformer' import { IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { AckDecorator } from '../../../../../decorators/ack/AckDecorator' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface RevocationNotificationMessageV1Options { issueThread: string diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts similarity index 87% rename from packages/core/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts index a0d19ba5a3..c0eab4f246 100644 --- a/packages/core/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/V2RevocationNotificationMessage.ts @@ -1,10 +1,9 @@ -import type { AckDecorator } from '../../../../../decorators/ack/AckDecorator' - import { Expose } from 'class-transformer' import { IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { AckDecorator } from '../../../../../decorators/ack/AckDecorator' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface RevocationNotificationMessageV2Options { revocationFormat: string diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/messages/index.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/messages/index.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/messages/index.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts similarity index 92% rename from packages/core/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts index ff0a1dd4b0..579a65a0ac 100644 --- a/packages/core/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts +++ b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationService.ts @@ -1,16 +1,13 @@ import type { V2CreateRevocationNotificationMessageOptions } from './RevocationNotificationServiceOptions' -import type { AgentContext } from '../../../../../agent' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' -import type { ConnectionRecord } from '../../../../connections' +import type { InboundMessageContext } from '../../../../../models' import type { RevocationNotificationReceivedEvent } from '../../../CredentialEvents' import type { V1RevocationNotificationMessage } from '../messages/V1RevocationNotificationMessage' +import type { AgentContext } from '@credo-ts/core' -import { EventEmitter } from '../../../../../agent/EventEmitter' -import { MessageHandlerRegistry } from '../../../../../agent/MessageHandlerRegistry' -import { InjectionSymbols } from '../../../../../constants' -import { CredoError } from '../../../../../error/CredoError' -import { Logger } from '../../../../../logger' -import { inject, injectable } from '../../../../../plugins' +import { EventEmitter, InjectionSymbols, CredoError, Logger, inject, injectable } from '@credo-ts/core' + +import { MessageHandlerRegistry } from '../../../../../MessageHandlerRegistry' +import { ConnectionRecord } from '../../../../connections' import { CredentialEventTypes } from '../../../CredentialEvents' import { RevocationNotification } from '../../../models/RevocationNotification' import { CredentialRepository } from '../../../repository' diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationServiceOptions.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationServiceOptions.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationServiceOptions.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/RevocationNotificationServiceOptions.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts similarity index 93% rename from packages/core/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts index d8c545a0fc..87b90581ef 100644 --- a/packages/core/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/__tests__/RevocationNotificationService.test.ts @@ -1,15 +1,22 @@ -import type { AgentContext } from '../../../../../../agent' +import type { AnonCredsCredentialMetadata } from '../../../../../../../../anoncreds' +import type { AgentContext } from '../../../../../../../../core/src/agent' import type { RevocationNotificationReceivedEvent } from '../../../../CredentialEvents' -import type { AnonCredsCredentialMetadata } from '@credo-ts/anoncreds' import { Subject } from 'rxjs' -import { CredentialExchangeRecord, CredentialRole, CredentialState, InboundMessageContext } from '../../../../../..' -import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../../../tests/helpers' -import { EventEmitter } from '../../../../../../agent/EventEmitter' -import { MessageHandlerRegistry } from '../../../../../../agent/MessageHandlerRegistry' +import { EventEmitter } from '../../../../../../../../core/src/agent/EventEmitter' +import { + getAgentConfig, + getAgentContext, + getMockConnection, + mockFunction, +} from '../../../../../../../../core/tests/helpers' +import { MessageHandlerRegistry } from '../../../../../../MessageHandlerRegistry' +import { InboundMessageContext } from '../../../../../../models' import { DidExchangeState } from '../../../../../connections' import { CredentialEventTypes } from '../../../../CredentialEvents' +import { CredentialState, CredentialRole } from '../../../../models' +import { CredentialExchangeRecord } from '../../../../repository' import { CredentialRepository } from '../../../../repository/CredentialRepository' import { V1RevocationNotificationMessage, V2RevocationNotificationMessage } from '../../messages' import { RevocationNotificationService } from '../RevocationNotificationService' @@ -18,7 +25,7 @@ jest.mock('../../../../repository/CredentialRepository') const CredentialRepositoryMock = CredentialRepository as jest.Mock const credentialRepository = new CredentialRepositoryMock() -jest.mock('../../../../../../agent/MessageHandlerRegistry') +jest.mock('../../../../../../MessageHandlerRegistry') const MessageHandlerRegistryMock = MessageHandlerRegistry as jest.Mock const messageHandlerRegistry = new MessageHandlerRegistryMock() diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/services/index.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/services/index.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/services/index.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/util/__tests__/revocationIdentifier.test.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/util/__tests__/revocationIdentifier.test.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/util/__tests__/revocationIdentifier.test.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/util/__tests__/revocationIdentifier.test.ts diff --git a/packages/core/src/modules/credentials/protocol/revocation-notification/util/revocationIdentifier.ts b/packages/didcomm/src/modules/credentials/protocol/revocation-notification/util/revocationIdentifier.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/revocation-notification/util/revocationIdentifier.ts rename to packages/didcomm/src/modules/credentials/protocol/revocation-notification/util/revocationIdentifier.ts diff --git a/packages/core/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts b/packages/didcomm/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts similarity index 99% rename from packages/core/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts index d97c14bc72..945fd17f76 100644 --- a/packages/core/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/CredentialFormatCoordinator.ts @@ -1,11 +1,12 @@ -import type { AgentContext } from '../../../../agent' import type { Attachment } from '../../../../decorators/attachment/Attachment' import type { CredentialFormatPayload, CredentialFormatService, ExtractCredentialFormats } from '../../formats' import type { CredentialFormatSpec } from '../../models' import type { CredentialExchangeRecord } from '../../repository/CredentialExchangeRecord' +import type { AgentContext } from '@credo-ts/core' -import { CredoError } from '../../../../error/CredoError' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../../storage/didcomm' +import { CredoError } from '@credo-ts/core' + +import { DidCommMessageRepository, DidCommMessageRole } from '../../../../repository' import { V2IssueCredentialMessage, diff --git a/packages/core/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts b/packages/didcomm/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts similarity index 98% rename from packages/core/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts index a3e855cb0f..735051959c 100644 --- a/packages/core/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts @@ -1,10 +1,9 @@ -import type { AgentContext } from '../../../../agent' -import type { AgentMessage } from '../../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../../agent/FeatureRegistry' -import type { MessageHandlerInboundMessage } from '../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../../plugins' -import type { ProblemReportMessage } from '../../../problem-reports' +import type { AgentMessage } from '../../../../AgentMessage' +import type { FeatureRegistry } from '../../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../../MessageHandlerRegistry' +import type { MessageHandlerInboundMessage } from '../../../../handlers' +import type { ProblemReportMessage } from '../../../../messages' +import type { InboundMessageContext } from '../../../../models' import type { CredentialFormat, CredentialFormatPayload, @@ -28,12 +27,13 @@ import type { NegotiateCredentialOfferOptions, NegotiateCredentialProposalOptions, } from '../CredentialProtocolOptions' +import type { AgentContext } from '@credo-ts/core' -import { Protocol } from '../../../../agent/models/features/Protocol' -import { CredoError } from '../../../../error' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../../storage/didcomm' -import { uuid } from '../../../../utils/uuid' -import { AckStatus } from '../../../common' +import { CredoError, utils } from '@credo-ts/core' + +import { AckStatus } from '../../../../messages' +import { Protocol } from '../../../../models' +import { DidCommMessageRepository, DidCommMessageRole } from '../../../../repository' import { ConnectionService } from '../../../connections' import { CredentialsModuleConfig } from '../../CredentialsModuleConfig' import { AutoAcceptCredential, CredentialProblemReportReason, CredentialRole, CredentialState } from '../../models' @@ -85,9 +85,9 @@ export class V2CredentialProtocol diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts similarity index 91% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts index 84d0a05779..bb3955d1c7 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts @@ -1,20 +1,24 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import type { AgentContext } from '../../../../../agent' +import type { AgentContext } from '../../../../../../../core/src/agent' import type { CredentialStateChangedEvent } from '../../../CredentialEvents' import type { CredentialFormat, CredentialFormatCreateOfferOptions, CredentialFormatService } from '../../../formats' import type { CreateCredentialOfferOptions } from '../../CredentialProtocolOptions' import { Subject } from 'rxjs' -import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../../tests/helpers' -import { Dispatcher } from '../../../../../agent/Dispatcher' -import { EventEmitter } from '../../../../../agent/EventEmitter' -import { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import { EventEmitter } from '../../../../../../../core/src/agent/EventEmitter' +import { JsonTransformer } from '../../../../../../../core/src/utils' +import { + getAgentConfig, + getAgentContext, + getMockConnection, + mockFunction, +} from '../../../../../../../core/tests/helpers' +import { Dispatcher } from '../../../../../Dispatcher' import { Attachment, AttachmentData } from '../../../../../decorators/attachment/Attachment' -import { DidCommMessageRepository } from '../../../../../storage' -import { JsonTransformer } from '../../../../../utils' -import { DidExchangeState } from '../../../../connections' -import { ConnectionService } from '../../../../connections/services/ConnectionService' +import { InboundMessageContext } from '../../../../../models' +import { DidCommMessageRepository } from '../../../../../repository' +import { ConnectionService, DidExchangeState } from '../../../../connections' import { RoutingService } from '../../../../routing/services/RoutingService' import { CredentialEventTypes } from '../../../CredentialEvents' import { CredentialFormatSpec } from '../../../models' @@ -79,10 +83,10 @@ export const testCredentialFormatService = { // Mock classes jest.mock('../../../repository/CredentialRepository') -jest.mock('../../../../../storage/didcomm/DidCommMessageRepository') +jest.mock('../../../../../repository/DidCommMessageRepository') jest.mock('../../../../routing/services/RoutingService') jest.mock('../../../../connections/services/ConnectionService') -jest.mock('../../../../../agent/Dispatcher') +jest.mock('../../../../../Dispatcher') // Mock typed object const CredentialRepositoryMock = CredentialRepository as jest.Mock diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts similarity index 85% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts index 8d8d4a0f86..7cbd49cf12 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-connectionless-credentials.test.ts @@ -12,9 +12,10 @@ import { anoncredsDefinitionFourAttributesNoRevocation, storePreCreatedAnonCredsDefinition, } from '../../../../../../../anoncreds/tests/preCreatedAnonCredsDefinition' -import { waitForCredentialRecordSubject, getInMemoryAgentOptions } from '../../../../../../tests/helpers' -import testLogger from '../../../../../../tests/logger' -import { Agent } from '../../../../../agent/Agent' +import { Agent } from '../../../../../../../core/src/agent/Agent' +import { waitForCredentialRecordSubject, getInMemoryAgentOptions } from '../../../../../../../core/tests/helpers' +import testLogger from '../../../../../../../core/tests/logger' +import { MessageReceiver } from '../../../../../MessageReceiver' import { CredentialEventTypes } from '../../../CredentialEvents' import { AutoAcceptCredential } from '../../../models/CredentialAutoAcceptType' import { CredentialState } from '../../../models/CredentialState' @@ -26,6 +27,7 @@ const faberAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:faber'], }, + {}, getAnonCredsIndyModules() ) @@ -34,6 +36,7 @@ const aliceAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, getAnonCredsIndyModules() ) @@ -59,13 +62,13 @@ describe('V2 Connectionless Credentials', () => { 'rxjs:alice': aliceMessages, } faberAgent = new Agent(faberAgentOptions) - faberAgent.registerInboundTransport(new SubjectInboundTransport(faberMessages)) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(faberMessages)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() aliceAgent = new Agent(aliceAgentOptions) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() // Make sure the pre-created credential definition is in the wallet @@ -93,7 +96,7 @@ describe('V2 Connectionless Credentials', () => { testLogger.test('Faber sends credential offer to Alice') // eslint-disable-next-line prefer-const - let { message, credentialRecord: faberCredentialRecord } = await faberAgent.credentials.createOffer({ + let { message, credentialRecord: faberCredentialRecord } = await faberAgent.modules.credentials.createOffer({ comment: 'V2 Out of Band offer', credentialFormats: { anoncreds: { @@ -104,13 +107,13 @@ describe('V2 Connectionless Credentials', () => { protocolVersion: 'v2', }) - const { message: offerMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: offerMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberCredentialRecord.id, message, domain: 'https://a-domain.com', }) - await aliceAgent.receiveMessage(offerMessage.toJSON()) + await aliceAgent.dependencyManager.resolve(MessageReceiver).receiveMessage(offerMessage.toJSON()) let aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { threadId: faberCredentialRecord.threadId, @@ -121,7 +124,7 @@ describe('V2 Connectionless Credentials', () => { const acceptOfferOptions: AcceptCredentialOfferOptions = { credentialRecordId: aliceCredentialRecord.id, } - const credentialRecord = await aliceAgent.credentials.acceptOffer(acceptOfferOptions) + const credentialRecord = await aliceAgent.modules.credentials.acceptOffer(acceptOfferOptions) testLogger.test('Faber waits for credential request from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -134,7 +137,7 @@ describe('V2 Connectionless Credentials', () => { credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', } - faberCredentialRecord = await faberAgent.credentials.acceptRequest(options) + faberCredentialRecord = await faberAgent.modules.credentials.acceptRequest(options) testLogger.test('Alice waits for credential from Faber') aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { @@ -143,7 +146,7 @@ describe('V2 Connectionless Credentials', () => { }) testLogger.test('Alice sends credential ack to Faber') - aliceCredentialRecord = await aliceAgent.credentials.acceptCredential({ + aliceCredentialRecord = await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) @@ -192,7 +195,7 @@ describe('V2 Connectionless Credentials', () => { test('Faber starts with connection-less credential offer to Alice with auto-accept enabled', async () => { // eslint-disable-next-line prefer-const - let { message, credentialRecord: faberCredentialRecord } = await faberAgent.credentials.createOffer({ + let { message, credentialRecord: faberCredentialRecord } = await faberAgent.modules.credentials.createOffer({ comment: 'V2 Out of Band offer', credentialFormats: { anoncreds: { @@ -204,14 +207,14 @@ describe('V2 Connectionless Credentials', () => { autoAcceptCredential: AutoAcceptCredential.ContentApproved, }) - const { message: offerMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: offerMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberCredentialRecord.id, message, domain: 'https://a-domain.com', }) // Receive Message - await aliceAgent.receiveMessage(offerMessage.toJSON()) + await aliceAgent.context.dependencyManager.resolve(MessageReceiver).receiveMessage(offerMessage.toJSON()) // Wait for it to be processed let aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { @@ -219,7 +222,7 @@ describe('V2 Connectionless Credentials', () => { state: CredentialState.OfferReceived, }) - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, autoAcceptCredential: AutoAcceptCredential.ContentApproved, }) diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts similarity index 94% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts index 4d6058c5ef..80f5ed379b 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-credentials-auto-accept.test.ts @@ -1,5 +1,5 @@ import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { setupAnonCredsTests } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' import { anoncredsDefinitionFourAttributesNoRevocation } from '../../../../../../../anoncreds/tests/preCreatedAnonCredsDefinition' @@ -7,8 +7,8 @@ import { waitForCredentialRecord, waitForCredentialRecordSubject, waitForAgentMessageProcessedEventSubject, -} from '../../../../../../tests/helpers' -import testLogger from '../../../../../../tests/logger' +} from '../../../../../../../core/tests/helpers' +import testLogger from '../../../../../../../core/tests/logger' import { CredentialRole } from '../../../models' import { AutoAcceptCredential } from '../../../models/CredentialAutoAcceptType' import { CredentialState } from '../../../models/CredentialState' @@ -67,7 +67,7 @@ describe('V2 Credentials Auto Accept', () => { test("Alice starts with V2 credential proposal to Faber, both with autoAcceptCredential on 'always'", async () => { testLogger.test('Alice sends credential proposal to Faber') - let aliceCredentialRecord = await aliceAgent.credentials.proposeCredential({ + let aliceCredentialRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -109,7 +109,7 @@ describe('V2 Credentials Auto Accept', () => { test("Faber starts with V2 credential offer to Alice, both with autoAcceptCredential on 'always'", async () => { testLogger.test('Faber sends credential offer to Alice') - let faberCredentialRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -193,7 +193,7 @@ describe('V2 Credentials Auto Accept', () => { test("Alice starts with V2 credential proposal to Faber, both with autoAcceptCredential on 'contentApproved'", async () => { testLogger.test('Alice sends credential proposal to Faber') - let aliceCredentialRecord = await aliceAgent.credentials.proposeCredential({ + let aliceCredentialRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -211,7 +211,7 @@ describe('V2 Credentials Auto Accept', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Offer', credentialFormats: { @@ -273,7 +273,7 @@ describe('V2 Credentials Auto Accept', () => { test("Faber starts with V2 credential offer to Alice, both with autoAcceptCredential on 'contentApproved'", async () => { testLogger.test('Faber sends credential offer to Alice') - let faberCredentialRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -303,7 +303,7 @@ describe('V2 Credentials Auto Accept', () => { testLogger.test('Alice received credential offer from Faber') testLogger.test('alice sends credential request to faber') - await aliceAgent.credentials.acceptOffer({ + await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -352,7 +352,7 @@ describe('V2 Credentials Auto Accept', () => { test("Alice starts with V2 credential proposal to Faber, both have autoAcceptCredential on 'contentApproved' and attributes did change", async () => { testLogger.test('Alice sends credential proposal to Faber') - let aliceCredentialRecord = await aliceAgent.credentials.proposeCredential({ + let aliceCredentialRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -372,7 +372,7 @@ describe('V2 Credentials Auto Accept', () => { }) testLogger.test('Faber negotiated proposal, sending credential offer to Alice') - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { anoncreds: { @@ -401,7 +401,7 @@ describe('V2 Credentials Auto Accept', () => { test("Faber starts with V2 credential offer to Alice, both have autoAcceptCredential on 'contentApproved' and attributes did change", async () => { testLogger.test('Faber sends credential offer to Alice') - const faberCredentialRecord = await faberAgent.credentials.offerCredential({ + const faberCredentialRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -430,7 +430,7 @@ describe('V2 Credentials Auto Accept', () => { }) testLogger.test('Alice sends credential request to Faber') - await aliceAgent.credentials.negotiateOffer({ + await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { anoncreds: { diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts similarity index 87% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts index 5eb7bc2d18..fe5efe412a 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2-credentials.e2e.test.ts @@ -1,17 +1,17 @@ import type { AnonCredsHolderService } from '../../../../../../../anoncreds/src' import type { LegacyIndyProposeCredentialFormat } from '../../../../../../../anoncreds/src/formats/LegacyIndyCredentialFormat' import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { AnonCredsHolderServiceSymbol } from '../../../../../../../anoncreds/src' import { issueLegacyAnonCredsCredential, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForCredentialRecord, waitForCredentialRecordSubject } from '../../../../../../tests' -import testLogger from '../../../../../../tests/logger' -import { DidCommMessageRepository } from '../../../../../storage' -import { JsonTransformer } from '../../../../../utils' +import { JsonTransformer } from '../../../../../../../core/src/utils' +import { waitForCredentialRecord, waitForCredentialRecordSubject } from '../../../../../../../core/tests' +import testLogger from '../../../../../../../core/tests/logger' +import { DidCommMessageRepository } from '../../../../../repository' import { CredentialRole } from '../../../models' import { CredentialState } from '../../../models/CredentialState' import { CredentialExchangeRecord } from '../../../repository/CredentialExchangeRecord' @@ -84,7 +84,7 @@ describe('v2 credentials', () => { test('Alice starts with V2 credential proposal to Faber', async () => { testLogger.test('Alice sends (v2) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -115,7 +115,7 @@ describe('v2 credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Proposal', credentialFormats: { @@ -186,7 +186,7 @@ describe('v2 credentials', () => { credentialIds: [], }) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -204,7 +204,7 @@ describe('v2 credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', }) @@ -215,7 +215,7 @@ describe('v2 credentials', () => { state: CredentialState.CredentialReceived, }) - await aliceAgent.credentials.acceptCredential({ + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) @@ -245,7 +245,7 @@ describe('v2 credentials', () => { const holderService = aliceAgent.dependencyManager.resolve(AnonCredsHolderServiceSymbol) const deleteCredentialSpy = jest.spyOn(holderService, 'deleteCredential') - await aliceAgent.credentials.deleteById(holderCredentialExchangeRecord.id, { + await aliceAgent.modules.credentials.deleteById(holderCredentialExchangeRecord.id, { deleteAssociatedCredentials: true, deleteAssociatedDidCommMessages: true, }) @@ -255,7 +255,7 @@ describe('v2 credentials', () => { holderCredentialExchangeRecord.credentials[0].credentialRecordId ) - return expect(aliceAgent.credentials.getById(holderCredentialExchangeRecord.id)).rejects.toThrowError( + return expect(aliceAgent.modules.credentials.getById(holderCredentialExchangeRecord.id)).rejects.toThrowError( `CredentialRecord: record with id ${holderCredentialExchangeRecord.id} not found.` ) }) @@ -268,7 +268,7 @@ describe('v2 credentials', () => { }) testLogger.test('Alice sends credential proposal to Faber') - let aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + let aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -289,7 +289,7 @@ describe('v2 credentials', () => { state: CredentialState.OfferReceived, }) - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { indy: { @@ -303,10 +303,10 @@ describe('v2 credentials', () => { let aliceCredentialRecord = await aliceCredentialRecordPromise // Check if the state of the credential records did not change - faberCredentialRecord = await faberAgent.credentials.getById(faberCredentialRecord.id) + faberCredentialRecord = await faberAgent.modules.credentials.getById(faberCredentialRecord.id) faberCredentialRecord.assertState(CredentialState.OfferSent) - aliceCredentialRecord = await aliceAgent.credentials.getById(aliceCredentialRecord.id) + aliceCredentialRecord = await aliceAgent.modules.credentials.getById(aliceCredentialRecord.id) aliceCredentialRecord.assertState(CredentialState.OfferReceived) faberCredentialRecordPromise = waitForCredentialRecord(faberAgent, { @@ -315,7 +315,7 @@ describe('v2 credentials', () => { }) // second proposal - aliceCredentialExchangeRecord = await aliceAgent.credentials.negotiateOffer({ + aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { indy: { @@ -335,7 +335,7 @@ describe('v2 credentials', () => { state: CredentialState.OfferReceived, }) - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { indy: { @@ -349,7 +349,7 @@ describe('v2 credentials', () => { aliceCredentialRecord = await aliceCredentialRecordPromise - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialExchangeRecord.id, }) @@ -367,7 +367,7 @@ describe('v2 credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', }) @@ -379,7 +379,7 @@ describe('v2 credentials', () => { }) // testLogger.test('Alice sends credential ack to Faber') - await aliceAgent.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) testLogger.test('Faber waits for credential ack from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -402,7 +402,7 @@ describe('v2 credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - let faberCredentialRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -422,7 +422,7 @@ describe('v2 credentials', () => { state: CredentialState.ProposalReceived, }) - aliceCredentialRecord = await aliceAgent.credentials.negotiateOffer({ + aliceCredentialRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { indy: { @@ -441,7 +441,7 @@ describe('v2 credentials', () => { threadId: faberCredentialRecord.threadId, state: CredentialState.OfferReceived, }) - faberCredentialRecord = await faberAgent.credentials.negotiateProposal({ + faberCredentialRecord = await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { indy: { @@ -460,7 +460,7 @@ describe('v2 credentials', () => { state: CredentialState.ProposalReceived, }) - aliceCredentialRecord = await aliceAgent.credentials.negotiateOffer({ + aliceCredentialRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { indy: { @@ -481,7 +481,7 @@ describe('v2 credentials', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Proposal', credentialFormats: { @@ -500,7 +500,7 @@ describe('v2 credentials', () => { state: CredentialState.RequestReceived, }) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -519,7 +519,7 @@ describe('v2 credentials', () => { }) testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', }) @@ -527,17 +527,17 @@ describe('v2 credentials', () => { testLogger.test('Alice waits for credential from Faber') aliceCredentialRecord = await aliceCredentialRecordPromise - const proposalMessage = await aliceAgent.credentials.findProposalMessage(aliceCredentialRecord.id) - const offerMessage = await aliceAgent.credentials.findOfferMessage(aliceCredentialRecord.id) - const requestMessage = await aliceAgent.credentials.findRequestMessage(aliceCredentialRecord.id) - const credentialMessage = await aliceAgent.credentials.findCredentialMessage(aliceCredentialRecord.id) + const proposalMessage = await aliceAgent.modules.credentials.findProposalMessage(aliceCredentialRecord.id) + const offerMessage = await aliceAgent.modules.credentials.findOfferMessage(aliceCredentialRecord.id) + const requestMessage = await aliceAgent.modules.credentials.findRequestMessage(aliceCredentialRecord.id) + const credentialMessage = await aliceAgent.modules.credentials.findCredentialMessage(aliceCredentialRecord.id) expect(proposalMessage).toBeInstanceOf(V2ProposeCredentialMessage) expect(offerMessage).toBeInstanceOf(V2OfferCredentialMessage) expect(requestMessage).toBeInstanceOf(V2RequestCredentialMessage) expect(credentialMessage).toBeInstanceOf(V2IssueCredentialMessage) - const formatData = await aliceAgent.credentials.getFormatData(aliceCredentialRecord.id) + const formatData = await aliceAgent.modules.credentials.getFormatData(aliceCredentialRecord.id) expect(formatData).toMatchObject({ proposalAttributes: [ { @@ -641,7 +641,7 @@ describe('v2 credentials', () => { test('Faber starts with V2 offer, alice declines the offer', async () => { testLogger.test('Faber sends credential offer to Alice') - const faberCredentialExchangeRecord = await faberAgent.credentials.offerCredential({ + const faberCredentialExchangeRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -665,7 +665,7 @@ describe('v2 credentials', () => { }) testLogger.test('Alice declines offer') - aliceCredentialRecord = await aliceAgent.credentials.declineOffer(aliceCredentialRecord.id) + aliceCredentialRecord = await aliceAgent.modules.credentials.declineOffer(aliceCredentialRecord.id) expect(aliceCredentialRecord.state).toBe(CredentialState.Declined) }) diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts similarity index 84% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts index 7472cca215..eb23a2278f 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.connectionless-credentials.test.ts @@ -1,11 +1,12 @@ -import type { EventReplaySubject, JsonLdTestsAgent } from '../../../../../../tests' +import type { EventReplaySubject, JsonLdTestsAgent } from '../../../../../../../core/tests' import type { V2OfferCredentialMessage } from '../messages/V2OfferCredentialMessage' -import { setupJsonLdTests, waitForCredentialRecordSubject } from '../../../../../../tests' -import testLogger from '../../../../../../tests/logger' -import { KeyType } from '../../../../../crypto' -import { TypedArrayEncoder } from '../../../../../utils' -import { CREDENTIALS_CONTEXT_V1_URL } from '../../../../vc/constants' +import { KeyType } from '../../../../../../../core/src/crypto' +import { CREDENTIALS_CONTEXT_V1_URL } from '../../../../../../../core/src/modules/vc/constants' +import { TypedArrayEncoder } from '../../../../../../../core/src/utils' +import { setupJsonLdTests, waitForCredentialRecordSubject } from '../../../../../../../core/tests' +import testLogger from '../../../../../../../core/tests/logger' +import { MessageReceiver } from '../../../../../MessageReceiver' import { CredentialState } from '../../../models' import { CredentialExchangeRecord } from '../../../repository' @@ -63,7 +64,7 @@ describe('credentials', () => { testLogger.test('Faber sends credential offer to Alice') // eslint-disable-next-line prefer-const - let { message, credentialRecord: faberCredentialRecord } = await faberAgent.credentials.createOffer({ + let { message, credentialRecord: faberCredentialRecord } = await faberAgent.modules.credentials.createOffer({ comment: 'V2 Out of Band offer (W3C)', credentialFormats: { jsonld: signCredentialOptions, @@ -93,12 +94,14 @@ describe('credentials', () => { }, }) - const { message: connectionlessOfferMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: connectionlessOfferMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberCredentialRecord.id, message, domain: 'https://a-domain.com', }) - await aliceAgent.receiveMessage(connectionlessOfferMessage.toJSON()) + await aliceAgent.context.dependencyManager + .resolve(MessageReceiver) + .receiveMessage(connectionlessOfferMessage.toJSON()) let aliceCredentialRecord = await waitForCredentialRecordSubject(aliceReplay, { threadId: faberCredentialRecord.threadId, @@ -107,7 +110,7 @@ describe('credentials', () => { testLogger.test('Alice sends credential request to Faber') - const credentialRecord = await aliceAgent.credentials.acceptOffer({ + const credentialRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -118,7 +121,7 @@ describe('credentials', () => { }) testLogger.test('Faber sends credential to Alice') - faberCredentialRecord = await faberAgent.credentials.acceptRequest({ + faberCredentialRecord = await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', }) @@ -130,7 +133,7 @@ describe('credentials', () => { }) testLogger.test('Alice sends credential ack to Faber') - aliceCredentialRecord = await aliceAgent.credentials.acceptCredential({ + aliceCredentialRecord = await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id, }) diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts similarity index 85% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts index cacd194c61..feedf5d1a1 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials-auto-accept.test.ts @@ -1,12 +1,12 @@ -import type { JsonLdTestsAgent } from '../../../../../../tests' - -import { setupJsonLdTests } from '../../../../../../tests' -import { waitForCredentialRecord } from '../../../../../../tests/helpers' -import testLogger from '../../../../../../tests/logger' -import { KeyType } from '../../../../../crypto' -import { CredoError } from '../../../../../error/CredoError' -import { TypedArrayEncoder } from '../../../../../utils' -import { CREDENTIALS_CONTEXT_V1_URL } from '../../../../vc/constants' +import type { JsonLdTestsAgent } from '../../../../../../../core/tests' + +import { KeyType } from '../../../../../../../core/src/crypto' +import { CredoError } from '../../../../../../../core/src/error/CredoError' +import { CREDENTIALS_CONTEXT_V1_URL } from '../../../../../../../core/src/modules/vc/constants' +import { TypedArrayEncoder } from '../../../../../../../core/src/utils' +import { setupJsonLdTests } from '../../../../../../../core/tests' +import { waitForCredentialRecord } from '../../../../../../../core/tests/helpers' +import testLogger from '../../../../../../../core/tests/logger' import { AutoAcceptCredential, CredentialRole, CredentialState } from '../../../models' import { CredentialExchangeRecord } from '../../../repository/CredentialExchangeRecord' @@ -64,7 +64,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { test("Alice starts with V2 credential proposal to Faber, both with autoAcceptCredential on 'always'", async () => { testLogger.test('Alice sends credential proposal to Faber') - const aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -96,14 +96,15 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { test("Faber starts with V2 credential offer to Alice, both with autoAcceptCredential on 'always'", async () => { testLogger.test('Faber sends V2 credential offer to Alice as start of protocol process') - const faberCredentialExchangeRecord: CredentialExchangeRecord = await faberAgent.credentials.offerCredential({ - comment: 'some comment about credential', - connectionId: faberConnectionId, - credentialFormats: { - jsonld: signCredentialOptions, - }, - protocolVersion: 'v2', - }) + const faberCredentialExchangeRecord: CredentialExchangeRecord = + await faberAgent.modules.credentials.offerCredential({ + comment: 'some comment about credential', + connectionId: faberConnectionId, + credentialFormats: { + jsonld: signCredentialOptions, + }, + protocolVersion: 'v2', + }) testLogger.test('Alice waits for credential from Faber') let aliceCredentialRecord = await waitForCredentialRecord(aliceAgent, { threadId: faberCredentialExchangeRecord.threadId, @@ -164,7 +165,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { test("Alice starts with V2 credential proposal to Faber, both with autoAcceptCredential on 'contentApproved'", async () => { testLogger.test('Alice sends credential proposal to Faber') - const aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -180,7 +181,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { }) testLogger.test('Faber sends credential offer to Alice') - const faberCredentialExchangeRecord = await faberAgent.credentials.acceptProposal({ + const faberCredentialExchangeRecord = await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 JsonLd Offer', }) @@ -217,7 +218,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { test("Faber starts with V2 credential offer to Alice, both with autoAcceptCredential on 'contentApproved'", async () => { testLogger.test('Faber sends credential offer to Alice') - let faberCredentialExchangeRecord = await faberAgent.credentials.offerCredential({ + let faberCredentialExchangeRecord = await faberAgent.modules.credentials.offerCredential({ comment: 'some comment about credential', connectionId: faberConnectionId, credentialFormats: { @@ -249,7 +250,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { // we do not need to specify connection id in this object // it is either connectionless or included in the offer message testLogger.test('Alice sends credential request to faber') - faberCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + faberCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -284,14 +285,15 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { test("Faber starts with V2 credential offer to Alice, both have autoAcceptCredential on 'contentApproved' and attributes did change", async () => { testLogger.test('Faber sends credential offer to Alice') - const faberCredentialExchangeRecord: CredentialExchangeRecord = await faberAgent.credentials.offerCredential({ - comment: 'some comment about credential', - connectionId: faberConnectionId, - credentialFormats: { - jsonld: signCredentialOptions, - }, - protocolVersion: 'v2', - }) + const faberCredentialExchangeRecord: CredentialExchangeRecord = + await faberAgent.modules.credentials.offerCredential({ + comment: 'some comment about credential', + connectionId: faberConnectionId, + credentialFormats: { + jsonld: signCredentialOptions, + }, + protocolVersion: 'v2', + }) testLogger.test('Alice waits for credential from Faber') let aliceCredentialRecord = await waitForCredentialRecord(aliceAgent, { threadId: faberCredentialExchangeRecord.threadId, @@ -311,7 +313,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { testLogger.test('Alice sends credential request to Faber') - const aliceExchangeCredentialRecord = await aliceAgent.credentials.negotiateOffer({ + const aliceExchangeCredentialRecord = await aliceAgent.modules.credentials.negotiateOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { // Send a different object @@ -336,16 +338,16 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { }) // Check if the state of faber credential record did not change - const faberRecord = await faberAgent.credentials.getById(faberCredentialRecord.id) + const faberRecord = await faberAgent.modules.credentials.getById(faberCredentialRecord.id) faberRecord.assertState(CredentialState.ProposalReceived) - aliceCredentialRecord = await aliceAgent.credentials.getById(aliceCredentialRecord.id) + aliceCredentialRecord = await aliceAgent.modules.credentials.getById(aliceCredentialRecord.id) aliceCredentialRecord.assertState(CredentialState.ProposalSent) }) test("Alice starts with V2 credential proposal to Faber, both have autoAcceptCredential on 'contentApproved' and attributes did change", async () => { testLogger.test('Alice sends credential proposal to Faber') - const aliceCredentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const aliceCredentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -360,7 +362,7 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { state: CredentialState.ProposalReceived, }) - await faberAgent.credentials.negotiateProposal({ + await faberAgent.modules.credentials.negotiateProposal({ credentialRecordId: faberCredentialRecord.id, credentialFormats: { // Send a different object @@ -396,10 +398,10 @@ describe('V2 Credentials - JSON-LD - Auto Accept Always', () => { expect(record.type).toBe(CredentialExchangeRecord.type) // Check if the state of the credential records did not change - faberCredentialRecord = await faberAgent.credentials.getById(faberCredentialRecord.id) + faberCredentialRecord = await faberAgent.modules.credentials.getById(faberCredentialRecord.id) faberCredentialRecord.assertState(CredentialState.OfferSent) - const aliceRecord = await aliceAgent.credentials.getById(record.id) + const aliceRecord = await aliceAgent.modules.credentials.getById(record.id) aliceRecord.assertState(CredentialState.OfferReceived) }) }) diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts similarity index 89% rename from packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts index bde3f9def5..ec8a5bcf74 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.e2e.test.ts @@ -1,4 +1,5 @@ -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' +import type { DefaultAgentModulesInput } from '../../../../../../../didcomm/src/util/modules' import { LegacyIndyCredentialFormatService, @@ -10,6 +11,13 @@ import { getAnonCredsIndyModules, prepareForAnonCredsIssuance, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' +import { Agent } from '../../../../../../../core/src/agent/Agent' +import { KeyType } from '../../../../../../../core/src/crypto' +import { CacheModule, InMemoryLruCache } from '../../../../../../../core/src/modules/cache' +import { W3cCredentialsModule } from '../../../../../../../core/src/modules/vc' +import { customDocumentLoader } from '../../../../../../../core/src/modules/vc/data-integrity/__tests__/documentLoader' +import { TypedArrayEncoder } from '../../../../../../../core/src/utils' +import { JsonTransformer } from '../../../../../../../core/src/utils/JsonTransformer' import { getInMemoryAgentOptions, setupEventReplaySubjects, @@ -17,15 +25,8 @@ import { waitForCredentialRecordSubject, testLogger, makeConnection, -} from '../../../../../../tests' -import { Agent } from '../../../../../agent/Agent' -import { KeyType } from '../../../../../crypto' -import { TypedArrayEncoder } from '../../../../../utils' -import { JsonTransformer } from '../../../../../utils/JsonTransformer' -import { CacheModule, InMemoryLruCache } from '../../../../cache' +} from '../../../../../../../core/tests' import { ProofEventTypes, ProofsModule, V2ProofProtocol } from '../../../../proofs' -import { W3cCredentialsModule } from '../../../../vc' -import { customDocumentLoader } from '../../../../vc/data-integrity/__tests__/documentLoader' import { CredentialEventTypes } from '../../../CredentialEvents' import { CredentialsModule } from '../../../CredentialsModule' import { JsonLdCredentialFormatService } from '../../../formats' @@ -103,9 +104,9 @@ const getIndyJsonLdModules = () => // TODO: extract these very specific tests to the jsonld format describe('V2 Credentials - JSON-LD - Ed25519', () => { - let faberAgent: Agent> + let faberAgent: Agent & DefaultAgentModulesInput> let faberReplay: EventReplaySubject - let aliceAgent: Agent> + let aliceAgent: Agent & DefaultAgentModulesInput> let aliceReplay: EventReplaySubject let aliceConnectionId: string let credentialDefinitionId: string @@ -117,6 +118,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { { endpoints: ['rxjs:faber'], }, + {}, getIndyJsonLdModules() ) ) @@ -126,6 +128,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { { endpoints: ['rxjs:alice'], }, + {}, getIndyJsonLdModules() ) ) @@ -160,7 +163,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { test('Alice starts with V2 (ld format, Ed25519 signature) credential proposal to Faber', async () => { testLogger.test('Alice sends (v2 jsonld) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -181,7 +184,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { }) testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 W3C Offer', }) @@ -192,7 +195,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { state: CredentialState.OfferReceived, }) - const offerMessage = await aliceAgent.credentials.findOfferMessage(aliceCredentialRecord.id) + const offerMessage = await aliceAgent.modules.credentials.findOfferMessage(aliceCredentialRecord.id) expect(JsonTransformer.toJSON(offerMessage)).toMatchObject({ '@type': 'https://didcomm.org/issue-credential/2.0/offer-credential', '@id': expect.any(String), @@ -230,7 +233,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { expect(aliceCredentialRecord.id).not.toBeNull() expect(aliceCredentialRecord.type).toBe(CredentialExchangeRecord.type) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, credentialFormats: { jsonld: {}, @@ -250,7 +253,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', }) @@ -262,7 +265,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { }) testLogger.test('Alice sends credential ack to Faber') - await aliceAgent.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) testLogger.test('Faber waits for credential ack from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -278,7 +281,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { state: CredentialState.CredentialReceived, }) - const credentialMessage = await faberAgent.credentials.findCredentialMessage(faberCredentialRecord.id) + const credentialMessage = await faberAgent.modules.credentials.findCredentialMessage(faberCredentialRecord.id) expect(JsonTransformer.toJSON(credentialMessage)).toMatchObject({ '@type': 'https://didcomm.org/issue-credential/2.0/issue-credential', '@id': expect.any(String), @@ -325,7 +328,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { testLogger.test('Alice sends (v2, Indy) credential proposal to Faber') - const credentialExchangeRecord = await aliceAgent.credentials.proposeCredential({ + const credentialExchangeRecord = await aliceAgent.modules.credentials.proposeCredential({ connectionId: aliceConnectionId, protocolVersion: 'v2', credentialFormats: { @@ -356,7 +359,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { testLogger.test('Faber sends credential offer to Alice') - await faberAgent.credentials.acceptProposal({ + await faberAgent.modules.credentials.acceptProposal({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 W3C & INDY Proposals', credentialFormats: { @@ -374,7 +377,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { state: CredentialState.OfferReceived, }) - const offerMessage = await faberAgent.credentials.findOfferMessage(faberCredentialRecord.id) + const offerMessage = await faberAgent.modules.credentials.findOfferMessage(faberCredentialRecord.id) const credentialOfferJson = offerMessage?.offerAttachments[1].getDataAsJson() expect(credentialOfferJson).toMatchObject({ credential: { @@ -462,7 +465,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { expect(aliceCredentialRecord.id).not.toBeNull() expect(aliceCredentialRecord.type).toBe(CredentialExchangeRecord.type) - const offerCredentialExchangeRecord = await aliceAgent.credentials.acceptOffer({ + const offerCredentialExchangeRecord = await aliceAgent.modules.credentials.acceptOffer({ credentialRecordId: aliceCredentialRecord.id, }) @@ -479,7 +482,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { testLogger.test('Faber sends credential to Alice') - await faberAgent.credentials.acceptRequest({ + await faberAgent.modules.credentials.acceptRequest({ credentialRecordId: faberCredentialRecord.id, comment: 'V2 Indy Credential', }) @@ -491,7 +494,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { }) testLogger.test('Alice sends credential ack to Faber') - await aliceAgent.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) + await aliceAgent.modules.credentials.acceptCredential({ credentialRecordId: aliceCredentialRecord.id }) testLogger.test('Faber waits for credential ack from Alice') faberCredentialRecord = await waitForCredentialRecordSubject(faberReplay, { @@ -507,7 +510,7 @@ describe('V2 Credentials - JSON-LD - Ed25519', () => { state: CredentialState.CredentialReceived, }) - const credentialMessage = await faberAgent.credentials.findCredentialMessage(faberCredentialRecord.id) + const credentialMessage = await faberAgent.modules.credentials.findCredentialMessage(faberCredentialRecord.id) const w3cCredential = credentialMessage?.credentialAttachments[1].getDataAsJson() expect(w3cCredential).toMatchObject({ '@context': [ diff --git a/packages/core/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts b/packages/didcomm/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts similarity index 81% rename from packages/core/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts index 0db9672621..8abbf01bfb 100644 --- a/packages/core/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/errors/V2CredentialProblemReportError.ts @@ -1,7 +1,7 @@ -import type { ProblemReportErrorOptions } from '../../../../problem-reports' +import type { ProblemReportErrorOptions } from '../../../../../errors' import type { CredentialProblemReportReason } from '../../../models/CredentialProblemReportReason' -import { ProblemReportError } from '../../../../problem-reports/errors/ProblemReportError' +import { ProblemReportError } from '../../../../../errors' import { V2CredentialProblemReportMessage } from '../messages/V2CredentialProblemReportMessage' export interface V2CredentialProblemReportErrorOptions extends ProblemReportErrorOptions { diff --git a/packages/core/src/modules/credentials/protocol/v2/errors/index.ts b/packages/didcomm/src/modules/credentials/protocol/v2/errors/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/v2/errors/index.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/errors/index.ts diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts similarity index 94% rename from packages/core/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts index 8fdf0b2a40..865b96f740 100644 --- a/packages/core/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2CredentialAckHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V2CredentialProtocol } from '../V2CredentialProtocol' import { V2CredentialAckMessage } from '../messages/V2CredentialAckMessage' diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts similarity index 94% rename from packages/core/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts index f3b7b60bf0..af8b702b4c 100644 --- a/packages/core/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2CredentialProblemReportHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V2CredentialProtocol } from '../V2CredentialProtocol' import { V2CredentialProblemReportMessage } from '../messages/V2CredentialProblemReportMessage' diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts similarity index 88% rename from packages/core/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts index f4217183bb..f400bd6faf 100644 --- a/packages/core/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2IssueCredentialHandler.ts @@ -1,10 +1,11 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { CredentialExchangeRecord } from '../../../repository/CredentialExchangeRecord' import type { V2CredentialProtocol } from '../V2CredentialProtocol' -import { getOutboundMessageContext } from '../../../../../agent/getOutboundMessageContext' -import { CredoError } from '../../../../../error' +import { CredoError } from '@credo-ts/core' + +import { getOutboundMessageContext } from '../../../../../getOutboundMessageContext' import { V2IssueCredentialMessage } from '../messages/V2IssueCredentialMessage' export class V2IssueCredentialHandler implements MessageHandler { diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts similarity index 88% rename from packages/core/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts index ff2d08716a..705904c7de 100644 --- a/packages/core/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2OfferCredentialHandler.ts @@ -1,9 +1,9 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { CredentialExchangeRecord } from '../../../repository/CredentialExchangeRecord' import type { V2CredentialProtocol } from '../V2CredentialProtocol' -import { getOutboundMessageContext } from '../../../../../agent/getOutboundMessageContext' +import { getOutboundMessageContext } from '../../../../../getOutboundMessageContext' import { V2OfferCredentialMessage } from '../messages/V2OfferCredentialMessage' export class V2OfferCredentialHandler implements MessageHandler { diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts similarity index 90% rename from packages/core/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts index c28a77c608..ea72bfb695 100644 --- a/packages/core/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2ProposeCredentialHandler.ts @@ -1,9 +1,9 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { CredentialExchangeRecord } from '../../../repository/CredentialExchangeRecord' import type { V2CredentialProtocol } from '../V2CredentialProtocol' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V2ProposeCredentialMessage } from '../messages/V2ProposeCredentialMessage' export class V2ProposeCredentialHandler implements MessageHandler { diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts similarity index 86% rename from packages/core/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts index 757598f4cf..79667f3f80 100644 --- a/packages/core/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/V2RequestCredentialHandler.ts @@ -1,10 +1,11 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { CredentialExchangeRecord } from '../../../repository' import type { V2CredentialProtocol } from '../V2CredentialProtocol' -import { getOutboundMessageContext } from '../../../../../agent/getOutboundMessageContext' -import { CredoError } from '../../../../../error' +import { CredoError } from '@credo-ts/core' + +import { getOutboundMessageContext } from '../../../../../getOutboundMessageContext' import { V2RequestCredentialMessage } from '../messages/V2RequestCredentialMessage' export class V2RequestCredentialHandler implements MessageHandler { diff --git a/packages/core/src/modules/credentials/protocol/v2/handlers/index.ts b/packages/didcomm/src/modules/credentials/protocol/v2/handlers/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/v2/handlers/index.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/handlers/index.ts diff --git a/packages/core/src/modules/credentials/protocol/v2/index.ts b/packages/didcomm/src/modules/credentials/protocol/v2/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/v2/index.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/index.ts diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts similarity index 83% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts index d8549225f9..62caa7eeed 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialAckMessage.ts @@ -1,7 +1,5 @@ -import type { AckMessageOptions } from '../../../../common' - -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { AckMessage } from '../../../../common' +import { AckMessageOptions, AckMessage } from '../../../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export type V2CredentialAckMessageOptions = AckMessageOptions diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts similarity index 91% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts index ea78448593..02a75be96b 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialPreview.ts @@ -1,10 +1,10 @@ import type { CredentialPreviewOptions } from '../../../models/CredentialPreviewAttribute' +import { JsonTransformer } from '@credo-ts/core' import { Expose, Transform, Type } from 'class-transformer' import { IsInstance, ValidateNested } from 'class-validator' -import { JsonTransformer } from '../../../../../utils/JsonTransformer' -import { IsValidMessageType, parseMessageType, replaceLegacyDidSovPrefix } from '../../../../../utils/messageType' +import { IsValidMessageType, replaceLegacyDidSovPrefix, parseMessageType } from '../../../../../util/messageType' import { CredentialPreviewAttribute } from '../../../models/CredentialPreviewAttribute' /** diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts similarity index 76% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts index 44ef462474..02dbf8f43b 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2CredentialProblemReportMessage.ts @@ -1,7 +1,7 @@ -import type { ProblemReportMessageOptions } from '../../../../problem-reports/messages/ProblemReportMessage' +import type { ProblemReportMessageOptions } from '../../../../../messages/problem-reports/ProblemReportMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { ProblemReportMessage } from '../../../../problem-reports/messages/ProblemReportMessage' +import { ProblemReportMessage } from '../../../../../messages/problem-reports/ProblemReportMessage' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export type V2CredentialProblemReportMessageOptions = ProblemReportMessageOptions diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts similarity index 95% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts index 737879c6c0..7a9e3bec97 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts @@ -1,9 +1,9 @@ import { Expose, Type } from 'class-transformer' import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { CredentialFormatSpec } from '../../../models' export interface V2IssueCredentialMessageOptions { diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts similarity index 96% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts index 49a3ed51e9..8f76e7bf60 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts @@ -1,9 +1,9 @@ import { Expose, Type } from 'class-transformer' import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { CredentialFormatSpec } from '../../../models' import { V2CredentialPreview } from './V2CredentialPreview' diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts similarity index 96% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts index 121e15f5b2..dec570f21c 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts @@ -1,9 +1,9 @@ import { Expose, Type } from 'class-transformer' import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { CredentialFormatSpec } from '../../../models' import { V2CredentialPreview } from './V2CredentialPreview' diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts similarity index 96% rename from packages/core/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts index 58ebce4651..6f6fca962a 100644 --- a/packages/core/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts +++ b/packages/didcomm/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts @@ -1,9 +1,9 @@ import { Expose, Type } from 'class-transformer' import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { CredentialFormatSpec } from '../../../models' export interface V2RequestCredentialMessageOptions { diff --git a/packages/core/src/modules/credentials/protocol/v2/messages/index.ts b/packages/didcomm/src/modules/credentials/protocol/v2/messages/index.ts similarity index 100% rename from packages/core/src/modules/credentials/protocol/v2/messages/index.ts rename to packages/didcomm/src/modules/credentials/protocol/v2/messages/index.ts diff --git a/packages/core/src/modules/credentials/repository/CredentialExchangeRecord.ts b/packages/didcomm/src/modules/credentials/repository/CredentialExchangeRecord.ts similarity index 94% rename from packages/core/src/modules/credentials/repository/CredentialExchangeRecord.ts rename to packages/didcomm/src/modules/credentials/repository/CredentialExchangeRecord.ts index 4bf8aff890..bfc0301882 100644 --- a/packages/core/src/modules/credentials/repository/CredentialExchangeRecord.ts +++ b/packages/didcomm/src/modules/credentials/repository/CredentialExchangeRecord.ts @@ -1,15 +1,13 @@ -import type { TagsBase } from '../../../storage/BaseRecord' import type { CredentialRole } from '../models' import type { AutoAcceptCredential } from '../models/CredentialAutoAcceptType' import type { CredentialState } from '../models/CredentialState' import type { RevocationNotification } from '../models/RevocationNotification' +import type { TagsBase } from '@credo-ts/core' +import { CredoError, BaseRecord, utils } from '@credo-ts/core' import { Type } from 'class-transformer' import { Attachment } from '../../../decorators/attachment/Attachment' -import { CredoError } from '../../../error' -import { BaseRecord } from '../../../storage/BaseRecord' -import { uuid } from '../../../utils/uuid' import { CredentialPreviewAttribute } from '../models/CredentialPreviewAttribute' export interface CredentialExchangeRecordProps { @@ -71,7 +69,7 @@ export class CredentialExchangeRecord extends BaseRecord { // Features + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) + featureRegistry.register( new Protocol({ id: 'https://didcomm.org/discover-features/1.0', diff --git a/packages/core/src/modules/discover-features/DiscoverFeaturesModuleConfig.ts b/packages/didcomm/src/modules/discover-features/DiscoverFeaturesModuleConfig.ts similarity index 100% rename from packages/core/src/modules/discover-features/DiscoverFeaturesModuleConfig.ts rename to packages/didcomm/src/modules/discover-features/DiscoverFeaturesModuleConfig.ts diff --git a/packages/core/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts b/packages/didcomm/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts similarity index 72% rename from packages/core/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts rename to packages/didcomm/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts index 5dcbb04bdc..a2dd6359eb 100644 --- a/packages/core/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts +++ b/packages/didcomm/src/modules/discover-features/DiscoverFeaturesServiceOptions.ts @@ -1,5 +1,5 @@ -import type { AgentMessage } from '../../agent/AgentMessage' -import type { FeatureQueryOptions } from '../../agent/models' +import type { AgentMessage } from '../../AgentMessage' +import type { FeatureQueryOptions } from '../../models' export interface CreateQueryOptions { queries: FeatureQueryOptions[] diff --git a/packages/didcomm/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts b/packages/didcomm/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts new file mode 100644 index 0000000000..d50a11329a --- /dev/null +++ b/packages/didcomm/src/modules/discover-features/__tests__/DiscoverFeaturesModule.test.ts @@ -0,0 +1,41 @@ +import type { DependencyManager } from '../../../../../core' + +import { getAgentContext } from '../../../../../core/tests' +import { FeatureRegistry } from '../../../FeatureRegistry' +import { Protocol } from '../../../models' +import { DiscoverFeaturesModule } from '../DiscoverFeaturesModule' +import { V1DiscoverFeaturesService } from '../protocol/v1' +import { V2DiscoverFeaturesService } from '../protocol/v2' + +describe('DiscoverFeaturesModule', () => { + test('registers dependencies on the dependency manager', () => { + const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + registerContextScoped: jest.fn(), + } as unknown as DependencyManager + + new DiscoverFeaturesModule().register(dependencyManager) + + expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(V1DiscoverFeaturesService) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(V2DiscoverFeaturesService) + }) + + test('registers features on the feature registry', async () => { + const featureRegistry = new FeatureRegistry() + const agentContext = getAgentContext({ registerInstances: [[FeatureRegistry, featureRegistry]] }) + await new DiscoverFeaturesModule().initialize(agentContext) + + expect(featureRegistry.query({ featureType: 'protocol', match: '*' })).toEqual([ + new Protocol({ + id: 'https://didcomm.org/discover-features/1.0', + roles: ['requester', 'responder'], + }), + new Protocol({ + id: 'https://didcomm.org/discover-features/2.0', + roles: ['requester', 'responder'], + }), + ]) + }) +}) diff --git a/packages/core/src/modules/discover-features/__tests__/FeatureRegistry.test.ts b/packages/didcomm/src/modules/discover-features/__tests__/FeatureRegistry.test.ts similarity index 90% rename from packages/core/src/modules/discover-features/__tests__/FeatureRegistry.test.ts rename to packages/didcomm/src/modules/discover-features/__tests__/FeatureRegistry.test.ts index f353b36752..a2d74a2a42 100644 --- a/packages/core/src/modules/discover-features/__tests__/FeatureRegistry.test.ts +++ b/packages/didcomm/src/modules/discover-features/__tests__/FeatureRegistry.test.ts @@ -1,6 +1,6 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { Feature, GoalCode, Protocol } from '../../../agent/models' -import { JsonTransformer } from '../../../utils/JsonTransformer' +import { JsonTransformer } from '../../../../../core/src/utils/JsonTransformer' +import { FeatureRegistry } from '../../../FeatureRegistry' +import { GoalCode, Feature, Protocol } from '../../../models' describe('Feature Registry', () => { test('register goal codes', () => { diff --git a/packages/core/src/modules/discover-features/__tests__/helpers.ts b/packages/didcomm/src/modules/discover-features/__tests__/helpers.ts similarity index 100% rename from packages/core/src/modules/discover-features/__tests__/helpers.ts rename to packages/didcomm/src/modules/discover-features/__tests__/helpers.ts diff --git a/packages/core/src/modules/discover-features/__tests__/v1-discover-features.test.ts b/packages/didcomm/src/modules/discover-features/__tests__/v1-discover-features.test.ts similarity index 91% rename from packages/core/src/modules/discover-features/__tests__/v1-discover-features.test.ts rename to packages/didcomm/src/modules/discover-features/__tests__/v1-discover-features.test.ts index 9ca14efd37..d7fed05750 100644 --- a/packages/core/src/modules/discover-features/__tests__/v1-discover-features.test.ts +++ b/packages/didcomm/src/modules/discover-features/__tests__/v1-discover-features.test.ts @@ -6,9 +6,9 @@ import type { import { ReplaySubject } from 'rxjs' -import { setupSubjectTransports } from '../../../../tests' -import { getInMemoryAgentOptions, makeConnection } from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' +import { Agent } from '../../../../../core/src/agent/Agent' +import { setupSubjectTransports } from '../../../../../core/tests' +import { getInMemoryAgentOptions, makeConnection } from '../../../../../core/tests/helpers' import { DiscoverFeaturesEventTypes } from '../DiscoverFeaturesEvents' import { waitForDisclosureSubject, waitForQuerySubject } from './helpers' @@ -55,7 +55,7 @@ describe('v1 discover features', () => { .observable(DiscoverFeaturesEventTypes.QueryReceived) .subscribe(aliceReplay) - await faberAgent.discovery.queryFeatures({ + await faberAgent.modules.discovery.queryFeatures({ connectionId: faberConnection.id, protocolVersion: 'v1', queries: [{ featureType: 'protocol', match: 'https://didcomm.org/revocation_notification/*' }], @@ -80,7 +80,7 @@ describe('v1 discover features', () => { }) test('Faber asks Alice for revocation notification protocol support synchronously', async () => { - const matchingFeatures = await faberAgent.discovery.queryFeatures({ + const matchingFeatures = await faberAgent.modules.discovery.queryFeatures({ connectionId: faberConnection.id, protocolVersion: 'v1', queries: [{ featureType: 'protocol', match: 'https://didcomm.org/revocation_notification/*' }], diff --git a/packages/core/src/modules/discover-features/__tests__/v2-discover-features.test.ts b/packages/didcomm/src/modules/discover-features/__tests__/v2-discover-features.test.ts similarity index 89% rename from packages/core/src/modules/discover-features/__tests__/v2-discover-features.test.ts rename to packages/didcomm/src/modules/discover-features/__tests__/v2-discover-features.test.ts index c76a574992..b8c33ddffd 100644 --- a/packages/core/src/modules/discover-features/__tests__/v2-discover-features.test.ts +++ b/packages/didcomm/src/modules/discover-features/__tests__/v2-discover-features.test.ts @@ -6,10 +6,10 @@ import type { import { ReplaySubject } from 'rxjs' -import { setupSubjectTransports } from '../../../../tests' -import { getInMemoryAgentOptions, makeConnection } from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' -import { GoalCode, Feature } from '../../../agent/models' +import { Agent } from '../../../../../core/src/agent/Agent' +import { setupSubjectTransports } from '../../../../../core/tests' +import { getInMemoryAgentOptions, makeConnection } from '../../../../../core/tests/helpers' +import { Feature, GoalCode } from '../../../models' import { DiscoverFeaturesEventTypes } from '../DiscoverFeaturesEvents' import { waitForDisclosureSubject, waitForQuerySubject } from './helpers' @@ -49,7 +49,7 @@ describe('v2 discover features', () => { const faberReplay = new ReplaySubject() const aliceReplay = new ReplaySubject() - faberAgent.discovery.config.autoAcceptQueries + faberAgent.modules.discovery.config.autoAcceptQueries faberAgent.events .observable(DiscoverFeaturesEventTypes.DisclosureReceived) .subscribe(faberReplay) @@ -57,7 +57,7 @@ describe('v2 discover features', () => { .observable(DiscoverFeaturesEventTypes.QueryReceived) .subscribe(aliceReplay) - await faberAgent.discovery.queryFeatures({ + await faberAgent.modules.discovery.queryFeatures({ connectionId: faberConnection.id, protocolVersion: 'v2', queries: [{ featureType: 'protocol', match: 'https://didcomm.org/revocation_notification/*' }], @@ -93,9 +93,12 @@ describe('v2 discover features', () => { .subscribe(faberReplay) // Register some goal codes - faberAgent.features.register(new GoalCode({ id: 'faber.vc.issuance' }), new GoalCode({ id: 'faber.vc.query' })) + faberAgent.modules.didcomm.features.register( + new GoalCode({ id: 'faber.vc.issuance' }), + new GoalCode({ id: 'faber.vc.query' }) + ) - await aliceAgent.discovery.queryFeatures({ + await aliceAgent.modules.discovery.queryFeatures({ connectionId: aliceConnection.id, protocolVersion: 'v2', queries: [{ featureType: 'goal-code', match: '*' }], @@ -141,9 +144,11 @@ describe('v2 discover features', () => { } // Register a custom feature - faberAgent.features.register(new GenericFeature({ id: 'custom-feature', genericField: 'custom-field' })) + faberAgent.modules.didcomm.features.register( + new GenericFeature({ id: 'custom-feature', genericField: 'custom-field' }) + ) - await aliceAgent.discovery.queryFeatures({ + await aliceAgent.modules.discovery.queryFeatures({ connectionId: aliceConnection.id, protocolVersion: 'v2', queries: [{ featureType: 'generic', match: 'custom-feature' }], @@ -182,13 +187,13 @@ describe('v2 discover features', () => { .subscribe(faberReplay) // Register a custom feature - faberAgent.features.register( + faberAgent.modules.didcomm.features.register( new Feature({ id: 'AIP2.0', type: 'aip' }), new Feature({ id: 'AIP2.0/INDYCRED', type: 'aip' }), new Feature({ id: 'AIP2.0/MEDIATE', type: 'aip' }) ) - await faberAgent.discovery.discloseFeatures({ + await faberAgent.modules.discovery.discloseFeatures({ connectionId: faberConnection.id, protocolVersion: 'v2', disclosureQueries: [{ featureType: 'aip', match: '*' }], @@ -207,7 +212,7 @@ describe('v2 discover features', () => { }) test('Faber asks Alice for issue credential protocol support synchronously', async () => { - const matchingFeatures = await faberAgent.discovery.queryFeatures({ + const matchingFeatures = await faberAgent.modules.discovery.queryFeatures({ connectionId: faberConnection.id, protocolVersion: 'v2', queries: [{ featureType: 'protocol', match: 'https://didcomm.org/revocation_notification/*' }], diff --git a/packages/core/src/modules/discover-features/index.ts b/packages/didcomm/src/modules/discover-features/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/index.ts rename to packages/didcomm/src/modules/discover-features/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/index.ts b/packages/didcomm/src/modules/discover-features/protocol/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts similarity index 87% rename from packages/core/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts index 8a7c830d1b..ad714f79f3 100644 --- a/packages/core/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v1/V1DiscoverFeaturesService.ts @@ -1,5 +1,5 @@ -import type { AgentMessage } from '../../../../agent/AgentMessage' -import type { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' +import type { AgentMessage } from '../../../../AgentMessage' +import type { InboundMessageContext } from '../../../../models' import type { DiscoverFeaturesDisclosureReceivedEvent, DiscoverFeaturesQueryReceivedEvent, @@ -10,14 +10,11 @@ import type { DiscoverFeaturesProtocolMsgReturnType, } from '../../DiscoverFeaturesServiceOptions' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { FeatureRegistry } from '../../../../agent/FeatureRegistry' -import { MessageHandlerRegistry } from '../../../../agent/MessageHandlerRegistry' -import { Protocol } from '../../../../agent/models' -import { InjectionSymbols } from '../../../../constants' -import { CredoError } from '../../../../error' -import { Logger } from '../../../../logger' -import { inject, injectable } from '../../../../plugins' +import { EventEmitter, InjectionSymbols, CredoError, Logger, inject, injectable } from '@credo-ts/core' + +import { FeatureRegistry } from '../../../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../../../MessageHandlerRegistry' +import { Protocol } from '../../../../models' import { DiscoverFeaturesEventTypes } from '../../DiscoverFeaturesEvents' import { DiscoverFeaturesModuleConfig } from '../../DiscoverFeaturesModuleConfig' import { DiscoverFeaturesService } from '../../services' diff --git a/packages/core/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts similarity index 94% rename from packages/core/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts index 03db2cf74a..5926d50e65 100644 --- a/packages/core/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v1/__tests__/V1DiscoverFeaturesService.test.ts @@ -6,20 +6,19 @@ import type { DiscoverFeaturesProtocolMsgReturnType } from '../../../DiscoverFea import { Subject } from 'rxjs' -import { agentDependencies, getAgentContext, getMockConnection } from '../../../../../../tests/helpers' -import { EventEmitter } from '../../../../../agent/EventEmitter' -import { FeatureRegistry } from '../../../../../agent/FeatureRegistry' -import { MessageHandlerRegistry } from '../../../../../agent/MessageHandlerRegistry' -import { Protocol } from '../../../../../agent/models' -import { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' -import { ConsoleLogger } from '../../../../../logger/ConsoleLogger' -import { DidExchangeState } from '../../../../../modules/connections' +import { EventEmitter } from '../../../../../../../core/src/agent/EventEmitter' +import { ConsoleLogger } from '../../../../../../../core/src/logger' +import { agentDependencies, getAgentContext, getMockConnection } from '../../../../../../../core/tests/helpers' +import { FeatureRegistry } from '../../../../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../../../../MessageHandlerRegistry' +import { Protocol, InboundMessageContext } from '../../../../../models' +import { DidExchangeState } from '../../../../connections' import { DiscoverFeaturesEventTypes } from '../../../DiscoverFeaturesEvents' import { DiscoverFeaturesModuleConfig } from '../../../DiscoverFeaturesModuleConfig' import { V1DiscoverFeaturesService } from '../V1DiscoverFeaturesService' import { V1DiscloseMessage, V1QueryMessage } from '../messages' -jest.mock('../../../../../agent/MessageHandlerRegistry') +jest.mock('../../../../../MessageHandlerRegistry') const MessageHandlerRegistryMock = MessageHandlerRegistry as jest.Mock const eventEmitter = new EventEmitter(agentDependencies, new Subject()) const featureRegistry = new FeatureRegistry() @@ -27,7 +26,7 @@ featureRegistry.register(new Protocol({ id: 'https://didcomm.org/connections/1.0 featureRegistry.register(new Protocol({ id: 'https://didcomm.org/notification/1.0', roles: ['role-1', 'role-2'] })) featureRegistry.register(new Protocol({ id: 'https://didcomm.org/issue-credential/1.0' })) -jest.mock('../../../../../logger/Logger') +jest.mock('../../../../../../../core/src/logger') const LoggerMock = ConsoleLogger as jest.Mock describe('V1DiscoverFeaturesService - auto accept queries', () => { diff --git a/packages/core/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts similarity index 94% rename from packages/core/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts index 5a66a4a527..6a85b67ae3 100644 --- a/packages/core/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v1/handlers/V1DiscloseMessageHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V1DiscoverFeaturesService } from '../V1DiscoverFeaturesService' import { V1DiscloseMessage } from '../messages' diff --git a/packages/core/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts similarity index 89% rename from packages/core/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts index cd1db2d885..f958f228a3 100644 --- a/packages/core/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v1/handlers/V1QueryMessageHandler.ts @@ -1,7 +1,7 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V1DiscoverFeaturesService } from '../V1DiscoverFeaturesService' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V1QueryMessage } from '../messages' export class V1QueryMessageHandler implements MessageHandler { diff --git a/packages/core/src/modules/discover-features/protocol/v1/handlers/index.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/handlers/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/v1/handlers/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/handlers/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/v1/index.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/v1/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts similarity index 94% rename from packages/core/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts index 800900424b..a1395f9188 100644 --- a/packages/core/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v1/messages/DiscloseMessage.ts @@ -1,8 +1,8 @@ import { Expose, Type } from 'class-transformer' import { IsInstance, IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface DiscloseProtocolOptions { protocolId: string diff --git a/packages/core/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts similarity index 90% rename from packages/core/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts index 7b8d5e26b4..8df1bfeddb 100644 --- a/packages/core/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v1/messages/QueryMessage.ts @@ -1,7 +1,7 @@ import { IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface DiscoverFeaturesQueryMessageOptions { id?: string diff --git a/packages/core/src/modules/discover-features/protocol/v1/messages/index.ts b/packages/didcomm/src/modules/discover-features/protocol/v1/messages/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/v1/messages/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/v1/messages/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts similarity index 88% rename from packages/core/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts index 0196a351c4..5220010701 100644 --- a/packages/core/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v2/V2DiscoverFeaturesService.ts @@ -1,4 +1,4 @@ -import type { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' +import type { InboundMessageContext } from '../../../../models' import type { DiscoverFeaturesDisclosureReceivedEvent, DiscoverFeaturesQueryReceivedEvent, @@ -9,12 +9,10 @@ import type { CreateDisclosureOptions, } from '../../DiscoverFeaturesServiceOptions' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { FeatureRegistry } from '../../../../agent/FeatureRegistry' -import { MessageHandlerRegistry } from '../../../../agent/MessageHandlerRegistry' -import { InjectionSymbols } from '../../../../constants' -import { Logger } from '../../../../logger' -import { inject, injectable } from '../../../../plugins' +import { EventEmitter, InjectionSymbols, Logger, inject, injectable } from '@credo-ts/core' + +import { FeatureRegistry } from '../../../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../../../MessageHandlerRegistry' import { DiscoverFeaturesEventTypes } from '../../DiscoverFeaturesEvents' import { DiscoverFeaturesModuleConfig } from '../../DiscoverFeaturesModuleConfig' import { DiscoverFeaturesService } from '../../services' diff --git a/packages/core/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts similarity index 95% rename from packages/core/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts index 897fe5d1b4..daa6c0fa18 100644 --- a/packages/core/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v2/__tests__/V2DiscoverFeaturesService.test.ts @@ -6,19 +6,19 @@ import type { DiscoverFeaturesProtocolMsgReturnType } from '../../../DiscoverFea import { Subject } from 'rxjs' -import { agentDependencies, getAgentContext, getMockConnection } from '../../../../../../tests/helpers' -import { EventEmitter } from '../../../../../agent/EventEmitter' -import { FeatureRegistry } from '../../../../../agent/FeatureRegistry' -import { MessageHandlerRegistry } from '../../../../../agent/MessageHandlerRegistry' -import { InboundMessageContext, Protocol, GoalCode } from '../../../../../agent/models' -import { ConsoleLogger } from '../../../../../logger/ConsoleLogger' +import { EventEmitter } from '../../../../../../../core/src/agent/EventEmitter' +import { ConsoleLogger } from '../../../../../../../core/src/logger' +import { agentDependencies, getAgentContext, getMockConnection } from '../../../../../../../core/tests/helpers' +import { FeatureRegistry } from '../../../../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../../../../MessageHandlerRegistry' +import { Protocol, InboundMessageContext, GoalCode } from '../../../../../models' import { DidExchangeState } from '../../../../connections' import { DiscoverFeaturesEventTypes } from '../../../DiscoverFeaturesEvents' import { DiscoverFeaturesModuleConfig } from '../../../DiscoverFeaturesModuleConfig' import { V2DiscoverFeaturesService } from '../V2DiscoverFeaturesService' import { V2DisclosuresMessage, V2QueriesMessage } from '../messages' -jest.mock('../../../../../agent/MessageHandlerRegistry') +jest.mock('../../../../../MessageHandlerRegistry') const MessageHandlerRegistryMock = MessageHandlerRegistry as jest.Mock const eventEmitter = new EventEmitter(agentDependencies, new Subject()) const featureRegistry = new FeatureRegistry() @@ -29,7 +29,7 @@ featureRegistry.register(new GoalCode({ id: 'aries.vc.1' })) featureRegistry.register(new GoalCode({ id: 'aries.vc.2' })) featureRegistry.register(new GoalCode({ id: 'caries.vc.3' })) -jest.mock('../../../../../logger/Logger') +jest.mock('../../../../../../../core/src/logger') const LoggerMock = ConsoleLogger as jest.Mock describe('V2DiscoverFeaturesService - auto accept queries', () => { diff --git a/packages/core/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts similarity index 94% rename from packages/core/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts index 1691e7a5a8..fee31dfb13 100644 --- a/packages/core/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v2/handlers/V2DisclosuresMessageHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V2DiscoverFeaturesService } from '../V2DiscoverFeaturesService' import { V2DisclosuresMessage } from '../messages' diff --git a/packages/core/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts similarity index 89% rename from packages/core/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts index 45798397be..30835287b7 100644 --- a/packages/core/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v2/handlers/V2QueriesMessageHandler.ts @@ -1,7 +1,7 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V2DiscoverFeaturesService } from '../V2DiscoverFeaturesService' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V2QueriesMessage } from '../messages' export class V2QueriesMessageHandler implements MessageHandler { diff --git a/packages/core/src/modules/discover-features/protocol/v2/handlers/index.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/handlers/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/v2/handlers/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/handlers/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/v2/index.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/v2/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/index.ts diff --git a/packages/core/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts similarity index 86% rename from packages/core/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts index de029d7b29..239f705452 100644 --- a/packages/core/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v2/messages/V2DisclosuresMessage.ts @@ -1,9 +1,9 @@ import { Type } from 'class-transformer' import { IsInstance } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { Feature } from '../../../../../agent/models' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { Feature } from '../../../../../models' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2DisclosuresMessageOptions { id?: string diff --git a/packages/core/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts similarity index 80% rename from packages/core/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts index b5de37fa20..68b37599d9 100644 --- a/packages/core/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts +++ b/packages/didcomm/src/modules/discover-features/protocol/v2/messages/V2QueriesMessage.ts @@ -1,11 +1,11 @@ -import type { FeatureQueryOptions } from '../../../../../agent/models' +import type { FeatureQueryOptions } from '../../../../../models' import { Type } from 'class-transformer' import { ArrayNotEmpty, IsInstance } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { FeatureQuery } from '../../../../../agent/models' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { FeatureQuery } from '../../../../../models' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2DiscoverFeaturesQueriesMessageOptions { id?: string diff --git a/packages/core/src/modules/discover-features/protocol/v2/messages/index.ts b/packages/didcomm/src/modules/discover-features/protocol/v2/messages/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/protocol/v2/messages/index.ts rename to packages/didcomm/src/modules/discover-features/protocol/v2/messages/index.ts diff --git a/packages/core/src/modules/discover-features/services/DiscoverFeaturesService.ts b/packages/didcomm/src/modules/discover-features/services/DiscoverFeaturesService.ts similarity index 80% rename from packages/core/src/modules/discover-features/services/DiscoverFeaturesService.ts rename to packages/didcomm/src/modules/discover-features/services/DiscoverFeaturesService.ts index c9e532b4c7..5857128459 100644 --- a/packages/core/src/modules/discover-features/services/DiscoverFeaturesService.ts +++ b/packages/didcomm/src/modules/discover-features/services/DiscoverFeaturesService.ts @@ -1,14 +1,13 @@ -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { EventEmitter } from '../../../agent/EventEmitter' -import type { FeatureRegistry } from '../../../agent/FeatureRegistry' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import type { Logger } from '../../../logger' +import type { AgentMessage } from '../../../AgentMessage' +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { InboundMessageContext } from '../../../models' import type { DiscoverFeaturesModuleConfig } from '../DiscoverFeaturesModuleConfig' import type { CreateDisclosureOptions, CreateQueryOptions, DiscoverFeaturesProtocolMsgReturnType, } from '../DiscoverFeaturesServiceOptions' +import type { Logger, EventEmitter } from '@credo-ts/core' export abstract class DiscoverFeaturesService { protected featureRegistry: FeatureRegistry diff --git a/packages/core/src/modules/discover-features/services/index.ts b/packages/didcomm/src/modules/discover-features/services/index.ts similarity index 100% rename from packages/core/src/modules/discover-features/services/index.ts rename to packages/didcomm/src/modules/discover-features/services/index.ts diff --git a/packages/didcomm/src/modules/index.ts b/packages/didcomm/src/modules/index.ts new file mode 100644 index 0000000000..f03b2b14bb --- /dev/null +++ b/packages/didcomm/src/modules/index.ts @@ -0,0 +1,8 @@ +export * from './basic-messages' +export * from './connections' +export * from './credentials' +export * from './discover-features' +export * from './message-pickup' +export * from './oob' +export * from './proofs' +export * from './routing' diff --git a/packages/core/src/modules/message-pickup/MessagePickupApi.ts b/packages/didcomm/src/modules/message-pickup/MessagePickupApi.ts similarity index 95% rename from packages/core/src/modules/message-pickup/MessagePickupApi.ts rename to packages/didcomm/src/modules/message-pickup/MessagePickupApi.ts index e0d4de87d9..004c266eeb 100644 --- a/packages/core/src/modules/message-pickup/MessagePickupApi.ts +++ b/packages/didcomm/src/modules/message-pickup/MessagePickupApi.ts @@ -16,16 +16,11 @@ import type { V1MessagePickupProtocol, V2MessagePickupProtocol } from './protoco import type { MessagePickupProtocol } from './protocol/MessagePickupProtocol' import type { MessagePickupRepository } from './storage/MessagePickupRepository' +import { AgentContext, EventEmitter, InjectionSymbols, CredoError, Logger, inject, injectable } from '@credo-ts/core' import { ReplaySubject, Subject, filter, first, firstValueFrom, takeUntil, timeout } from 'rxjs' -import { AgentContext } from '../../agent' -import { EventEmitter } from '../../agent/EventEmitter' -import { MessageSender } from '../../agent/MessageSender' -import { OutboundMessageContext } from '../../agent/models' -import { InjectionSymbols } from '../../constants' -import { CredoError } from '../../error' -import { Logger } from '../../logger/Logger' -import { inject, injectable } from '../../plugins' +import { MessageSender } from '../../MessageSender' +import { OutboundMessageContext } from '../../models' import { ConnectionService } from '../connections/services' import { MessagePickupEventTypes } from './MessagePickupEvents' @@ -78,10 +73,6 @@ export class MessagePickupApi(protocolVersion: MPP): MessagePickupProtocol { const protocol = this.config.protocols.find((protocol) => protocol.version === protocolVersion) diff --git a/packages/core/src/modules/message-pickup/MessagePickupApiOptions.ts b/packages/didcomm/src/modules/message-pickup/MessagePickupApiOptions.ts similarity index 100% rename from packages/core/src/modules/message-pickup/MessagePickupApiOptions.ts rename to packages/didcomm/src/modules/message-pickup/MessagePickupApiOptions.ts diff --git a/packages/core/src/modules/message-pickup/MessagePickupEvents.ts b/packages/didcomm/src/modules/message-pickup/MessagePickupEvents.ts similarity index 87% rename from packages/core/src/modules/message-pickup/MessagePickupEvents.ts rename to packages/didcomm/src/modules/message-pickup/MessagePickupEvents.ts index bc95e70d29..f7efe05f68 100644 --- a/packages/core/src/modules/message-pickup/MessagePickupEvents.ts +++ b/packages/didcomm/src/modules/message-pickup/MessagePickupEvents.ts @@ -1,6 +1,6 @@ import type { MessagePickupSession } from './MessagePickupSession' -import type { BaseEvent } from '../../agent/Events' -import type { ConnectionRecord } from '../connections' +import type { ConnectionRecord } from '../connections/repository' +import type { BaseEvent } from '@credo-ts/core' export enum MessagePickupEventTypes { LiveSessionSaved = 'LiveSessionSaved', diff --git a/packages/core/src/modules/message-pickup/MessagePickupModule.ts b/packages/didcomm/src/modules/message-pickup/MessagePickupModule.ts similarity index 75% rename from packages/core/src/modules/message-pickup/MessagePickupModule.ts rename to packages/didcomm/src/modules/message-pickup/MessagePickupModule.ts index a108392287..11db0cfee0 100644 --- a/packages/core/src/modules/message-pickup/MessagePickupModule.ts +++ b/packages/didcomm/src/modules/message-pickup/MessagePickupModule.ts @@ -1,11 +1,11 @@ import type { MessagePickupModuleConfigOptions } from './MessagePickupModuleConfig' import type { MessagePickupProtocol } from './protocol/MessagePickupProtocol' -import type { FeatureRegistry } from '../../agent/FeatureRegistry' -import type { ApiModule, DependencyManager } from '../../plugins' -import type { Optional } from '../../utils' -import type { Constructor } from '../../utils/mixins' +import type { ApiModule, DependencyManager, AgentContext, Constructor, Optional } from '@credo-ts/core' -import { InjectionSymbols } from '../../constants' +import { InjectionSymbols } from '@credo-ts/core' + +import { FeatureRegistry } from '../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../MessageHandlerRegistry' import { MessagePickupApi } from './MessagePickupApi' import { MessagePickupModuleConfig } from './MessagePickupModuleConfig' @@ -42,7 +42,7 @@ export class MessagePickupModule { // Protocol needs to register feature registry items and handlers + const messageHandlerRegistry = agentContext.dependencyManager.resolve(MessageHandlerRegistry) + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) + for (const protocol of this.config.protocols) { - protocol.register(dependencyManager, featureRegistry) + protocol.register(messageHandlerRegistry, featureRegistry) } + + const messagePickupSessionService = agentContext.dependencyManager.resolve(MessagePickupSessionService) + + messagePickupSessionService.start(agentContext) } } diff --git a/packages/core/src/modules/message-pickup/MessagePickupModuleConfig.ts b/packages/didcomm/src/modules/message-pickup/MessagePickupModuleConfig.ts similarity index 100% rename from packages/core/src/modules/message-pickup/MessagePickupModuleConfig.ts rename to packages/didcomm/src/modules/message-pickup/MessagePickupModuleConfig.ts diff --git a/packages/core/src/modules/message-pickup/MessagePickupSession.ts b/packages/didcomm/src/modules/message-pickup/MessagePickupSession.ts similarity index 100% rename from packages/core/src/modules/message-pickup/MessagePickupSession.ts rename to packages/didcomm/src/modules/message-pickup/MessagePickupSession.ts diff --git a/packages/didcomm/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts b/packages/didcomm/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts new file mode 100644 index 0000000000..e2affbc4cf --- /dev/null +++ b/packages/didcomm/src/modules/message-pickup/__tests__/MessagePickupModule.test.ts @@ -0,0 +1,71 @@ +import type { DependencyManager } from '../../../../../core/src/plugins' +import type { MessagePickupProtocol } from '../protocol/MessagePickupProtocol' + +import { MessageHandlerRegistry } from '../../..//MessageHandlerRegistry' +import { InjectionSymbols } from '../../../../../core' +import { getAgentContext } from '../../../../../core/tests' +import { FeatureRegistry } from '../../../FeatureRegistry' +import { MessagePickupModule } from '../MessagePickupModule' +import { MessagePickupModuleConfig } from '../MessagePickupModuleConfig' +import { MessagePickupSessionService } from '../services' +import { InMemoryMessagePickupRepository } from '../storage' + +describe('MessagePickupModule', () => { + test('registers dependencies on the dependency manager', () => { + const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + isRegistered: () => { + return false + }, + } as unknown as DependencyManager + + const module = new MessagePickupModule() + module.register(dependencyManager) + + expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1) + expect(dependencyManager.registerInstance).toHaveBeenCalledWith(MessagePickupModuleConfig, module.config) + + expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith( + InjectionSymbols.MessagePickupRepository, + InMemoryMessagePickupRepository + ) + expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(MessagePickupSessionService) + }) + + test('calls register on the provided ProofProtocols', async () => { + const messagePickupProtocol = { + register: jest.fn(), + } as unknown as MessagePickupProtocol + + const messagePickupModule = new MessagePickupModule({ + protocols: [messagePickupProtocol], + }) + + expect(messagePickupModule.config.protocols).toEqual([messagePickupProtocol]) + + const messagePickupSessionSessionService = { + start: jest.fn(), + } as unknown as MessagePickupSessionService + + const messageHandlerRegistry = new MessageHandlerRegistry() + const featureRegistry = new FeatureRegistry() + + const agentContext = getAgentContext({ + registerInstances: [ + [MessagePickupSessionService, messagePickupSessionSessionService], + [MessageHandlerRegistry, messageHandlerRegistry], + [FeatureRegistry, featureRegistry], + ], + }) + await messagePickupModule.initialize(agentContext) + + expect(messagePickupProtocol.register).toHaveBeenCalledTimes(1) + expect(messagePickupProtocol.register).toHaveBeenCalledWith(messageHandlerRegistry, featureRegistry) + + expect(messagePickupSessionSessionService.start).toHaveBeenCalledTimes(1) + + // TODO: add test in each protocol to verify that it is properly registered in the feature registry + }) +}) diff --git a/packages/core/src/modules/message-pickup/__tests__/pickup.test.ts b/packages/didcomm/src/modules/message-pickup/__tests__/pickup.test.ts similarity index 68% rename from packages/core/src/modules/message-pickup/__tests__/pickup.test.ts rename to packages/didcomm/src/modules/message-pickup/__tests__/pickup.test.ts index c54b4a6184..fd4d567609 100644 --- a/packages/core/src/modules/message-pickup/__tests__/pickup.test.ts +++ b/packages/didcomm/src/modules/message-pickup/__tests__/pickup.test.ts @@ -5,12 +5,12 @@ import { Subject } from 'rxjs' import { SubjectInboundTransport } from '../../../../../../tests/transport/SubjectInboundTransport' import { SubjectOutboundTransport } from '../../../../../../tests/transport/SubjectOutboundTransport' +import { Agent } from '../../../../../core/src/agent/Agent' import { getInMemoryAgentOptions, waitForAgentMessageProcessedEvent, waitForBasicMessage, -} from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' +} from '../../../../../core/tests/helpers' import { HandshakeProtocol } from '../../connections' import { MediatorModule } from '../../routing' import { MessageForwardingStrategy } from '../../routing/MessageForwardingStrategy' @@ -22,6 +22,7 @@ const mediatorOptions = getInMemoryAgentOptions( { endpoints: ['wss://mediator'], }, + {}, { mediator: new MediatorModule({ autoAcceptMediationRequests: true, @@ -35,7 +36,7 @@ describe('E2E Pick Up protocol', () => { let mediatorAgent: Agent afterEach(async () => { - await recipientAgent.mediationRecipient.stopMessagePickup() + await recipientAgent.modules.mediationRecipient.stopMessagePickup() await recipientAgent.shutdown() await recipientAgent.wallet.delete() @@ -52,12 +53,12 @@ describe('E2E Pick Up protocol', () => { // Initialize mediatorReceived message mediatorAgent = new Agent(mediatorOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Create connection to use for recipient - const mediatorOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const mediatorOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.DidExchange], @@ -65,32 +66,36 @@ describe('E2E Pick Up protocol', () => { // Initialize recipient recipientAgent = new Agent(recipientOptions) - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await recipientAgent.initialize() // Connect const mediatorInvitation = mediatorOutOfBandRecord.outOfBandInvitation - let { connectionRecord: recipientMediatorConnection } = await recipientAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: recipientMediatorConnection } = await recipientAgent.modules.oob.receiveInvitationFromUrl( mediatorInvitation.toUrl({ domain: 'https://example.com/ssi' }) ) - recipientMediatorConnection = await recipientAgent.connections.returnWhenIsConnected( + recipientMediatorConnection = await recipientAgent.modules.connections.returnWhenIsConnected( recipientMediatorConnection!.id ) - let [mediatorRecipientConnection] = await mediatorAgent.connections.findAllByOutOfBandId(mediatorOutOfBandRecord.id) + let [mediatorRecipientConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( + mediatorOutOfBandRecord.id + ) - mediatorRecipientConnection = await mediatorAgent.connections.returnWhenIsConnected(mediatorRecipientConnection!.id) + mediatorRecipientConnection = await mediatorAgent.modules.connections.returnWhenIsConnected( + mediatorRecipientConnection!.id + ) // Now they are connected, reinitialize recipient agent in order to lose the session (as with SubjectTransport it remains open) await recipientAgent.shutdown() await recipientAgent.initialize() const message = 'hello pickup V1' - await mediatorAgent.basicMessages.sendMessage(mediatorRecipientConnection.id, message) + await mediatorAgent.modules.basicMessages.sendMessage(mediatorRecipientConnection.id, message) - await recipientAgent.messagePickup.pickupMessages({ + await recipientAgent.modules.messagePickup.pickupMessages({ connectionId: recipientMediatorConnection.id, protocolVersion: 'v1', }) @@ -111,12 +116,12 @@ describe('E2E Pick Up protocol', () => { // Initialize mediatorReceived message mediatorAgent = new Agent(mediatorOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Create connection to use for recipient - const mediatorOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const mediatorOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.DidExchange], @@ -124,35 +129,39 @@ describe('E2E Pick Up protocol', () => { // Initialize recipient recipientAgent = new Agent(recipientOptions) - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await recipientAgent.initialize() // Connect const mediatorInvitation = mediatorOutOfBandRecord.outOfBandInvitation - let { connectionRecord: recipientMediatorConnection } = await recipientAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: recipientMediatorConnection } = await recipientAgent.modules.oob.receiveInvitationFromUrl( mediatorInvitation.toUrl({ domain: 'https://example.com/ssi' }) ) - recipientMediatorConnection = await recipientAgent.connections.returnWhenIsConnected( + recipientMediatorConnection = await recipientAgent.modules.connections.returnWhenIsConnected( recipientMediatorConnection!.id ) - let [mediatorRecipientConnection] = await mediatorAgent.connections.findAllByOutOfBandId(mediatorOutOfBandRecord.id) + let [mediatorRecipientConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( + mediatorOutOfBandRecord.id + ) - mediatorRecipientConnection = await mediatorAgent.connections.returnWhenIsConnected(mediatorRecipientConnection!.id) + mediatorRecipientConnection = await mediatorAgent.modules.connections.returnWhenIsConnected( + mediatorRecipientConnection!.id + ) // Now they are connected, reinitialize recipient agent in order to lose the session (as with SubjectTransport it remains open) await recipientAgent.shutdown() await recipientAgent.initialize() const message = 'hello pickup V1' - await mediatorAgent.basicMessages.sendMessage(mediatorRecipientConnection.id, message) + await mediatorAgent.modules.basicMessages.sendMessage(mediatorRecipientConnection.id, message) const basicMessagePromise = waitForBasicMessage(recipientAgent, { content: message, }) - await recipientAgent.messagePickup.pickupMessages({ + await recipientAgent.modules.messagePickup.pickupMessages({ connectionId: recipientMediatorConnection.id, protocolVersion: 'v1', awaitCompletion: true, @@ -175,12 +184,12 @@ describe('E2E Pick Up protocol', () => { // Initialize mediatorReceived message mediatorAgent = new Agent(mediatorOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Create connection to use for recipient - const mediatorOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const mediatorOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.DidExchange], @@ -188,23 +197,27 @@ describe('E2E Pick Up protocol', () => { // Initialize recipient recipientAgent = new Agent(recipientOptions) - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await recipientAgent.initialize() // Connect const mediatorInvitation = mediatorOutOfBandRecord.outOfBandInvitation - let { connectionRecord: recipientMediatorConnection } = await recipientAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: recipientMediatorConnection } = await recipientAgent.modules.oob.receiveInvitationFromUrl( mediatorInvitation.toUrl({ domain: 'https://example.com/ssi' }) ) - recipientMediatorConnection = await recipientAgent.connections.returnWhenIsConnected( + recipientMediatorConnection = await recipientAgent.modules.connections.returnWhenIsConnected( recipientMediatorConnection!.id ) - let [mediatorRecipientConnection] = await mediatorAgent.connections.findAllByOutOfBandId(mediatorOutOfBandRecord.id) + let [mediatorRecipientConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( + mediatorOutOfBandRecord.id + ) - mediatorRecipientConnection = await mediatorAgent.connections.returnWhenIsConnected(mediatorRecipientConnection!.id) + mediatorRecipientConnection = await mediatorAgent.modules.connections.returnWhenIsConnected( + mediatorRecipientConnection!.id + ) // Now they are connected, reinitialize recipient agent in order to lose the session (as with SubjectTransport it remains open) await recipientAgent.shutdown() @@ -212,12 +225,12 @@ describe('E2E Pick Up protocol', () => { const message = 'hello pickup V2' - await mediatorAgent.basicMessages.sendMessage(mediatorRecipientConnection.id, message) + await mediatorAgent.modules.basicMessages.sendMessage(mediatorRecipientConnection.id, message) const basicMessagePromise = waitForBasicMessage(recipientAgent, { content: message, }) - await recipientAgent.messagePickup.pickupMessages({ + await recipientAgent.modules.messagePickup.pickupMessages({ connectionId: recipientMediatorConnection.id, protocolVersion: 'v2', }) @@ -256,12 +269,12 @@ describe('E2E Pick Up protocol', () => { // Initialize mediatorReceived message mediatorAgent = new Agent(mediatorOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Create connection to use for recipient - const mediatorOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const mediatorOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.DidExchange], @@ -269,23 +282,27 @@ describe('E2E Pick Up protocol', () => { // Initialize recipient recipientAgent = new Agent(recipientOptions) - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await recipientAgent.initialize() // Connect const mediatorInvitation = mediatorOutOfBandRecord.outOfBandInvitation - let { connectionRecord: recipientMediatorConnection } = await recipientAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: recipientMediatorConnection } = await recipientAgent.modules.oob.receiveInvitationFromUrl( mediatorInvitation.toUrl({ domain: 'https://example.com/ssi' }) ) - recipientMediatorConnection = await recipientAgent.connections.returnWhenIsConnected( + recipientMediatorConnection = await recipientAgent.modules.connections.returnWhenIsConnected( recipientMediatorConnection!.id ) - let [mediatorRecipientConnection] = await mediatorAgent.connections.findAllByOutOfBandId(mediatorOutOfBandRecord.id) + let [mediatorRecipientConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( + mediatorOutOfBandRecord.id + ) - mediatorRecipientConnection = await mediatorAgent.connections.returnWhenIsConnected(mediatorRecipientConnection!.id) + mediatorRecipientConnection = await mediatorAgent.modules.connections.returnWhenIsConnected( + mediatorRecipientConnection!.id + ) // Now they are connected, reinitialize recipient agent in order to lose the session (as with SubjectTransport it remains open) await recipientAgent.shutdown() @@ -293,12 +310,12 @@ describe('E2E Pick Up protocol', () => { const message = 'hello pickup V2' - await mediatorAgent.basicMessages.sendMessage(mediatorRecipientConnection.id, message) + await mediatorAgent.modules.basicMessages.sendMessage(mediatorRecipientConnection.id, message) const basicMessagePromise = waitForBasicMessage(recipientAgent, { content: message, }) - await recipientAgent.messagePickup.pickupMessages({ + await recipientAgent.modules.messagePickup.pickupMessages({ connectionId: recipientMediatorConnection.id, protocolVersion: 'v2', awaitCompletion: true, diff --git a/packages/core/src/modules/message-pickup/index.ts b/packages/didcomm/src/modules/message-pickup/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/index.ts rename to packages/didcomm/src/modules/message-pickup/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts b/packages/didcomm/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts similarity index 76% rename from packages/core/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts rename to packages/didcomm/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts index 686cdccc90..5c9811eb98 100644 --- a/packages/core/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/BaseMessagePickupProtocol.ts @@ -7,10 +7,10 @@ import type { SetLiveDeliveryModeProtocolOptions, SetLiveDeliveryModeProtocolReturnType, } from './MessagePickupProtocolOptions' -import type { AgentContext } from '../../../agent' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../agent/FeatureRegistry' -import type { DependencyManager } from '../../../plugins' +import type { AgentMessage } from '../../../AgentMessage' +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../MessageHandlerRegistry' +import type { AgentContext } from '@credo-ts/core' /** * Base implementation of the MessagePickupProtocol that can be used as a foundation for implementing @@ -34,5 +34,5 @@ export abstract class BaseMessagePickupProtocol implements MessagePickupProtocol options: SetLiveDeliveryModeProtocolOptions ): Promise> - public abstract register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void + public abstract register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void } diff --git a/packages/core/src/modules/message-pickup/protocol/MessagePickupProtocol.ts b/packages/didcomm/src/modules/message-pickup/protocol/MessagePickupProtocol.ts similarity index 70% rename from packages/core/src/modules/message-pickup/protocol/MessagePickupProtocol.ts rename to packages/didcomm/src/modules/message-pickup/protocol/MessagePickupProtocol.ts index df11b80547..3040b8c953 100644 --- a/packages/core/src/modules/message-pickup/protocol/MessagePickupProtocol.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/MessagePickupProtocol.ts @@ -6,10 +6,10 @@ import type { SetLiveDeliveryModeProtocolOptions, SetLiveDeliveryModeProtocolReturnType, } from './MessagePickupProtocolOptions' -import type { AgentContext } from '../../../agent' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../agent/FeatureRegistry' -import type { DependencyManager } from '../../../plugins' +import type { AgentMessage } from '../../../AgentMessage' +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../MessageHandlerRegistry' +import type { AgentContext } from '@credo-ts/core' export interface MessagePickupProtocol { readonly version: string @@ -29,5 +29,5 @@ export interface MessagePickupProtocol { options: SetLiveDeliveryModeProtocolOptions ): Promise> - register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void + register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void } diff --git a/packages/core/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts b/packages/didcomm/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts similarity index 86% rename from packages/core/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts rename to packages/didcomm/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts index 4f4409c501..0e4528f8a3 100644 --- a/packages/core/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/MessagePickupProtocolOptions.ts @@ -1,5 +1,5 @@ -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { ConnectionRecord } from '../../connections' +import type { AgentMessage } from '../../../AgentMessage' +import type { ConnectionRecord } from '../../connections/repository' import type { QueuedMessage } from '../storage' export interface PickupMessagesProtocolOptions { diff --git a/packages/core/src/modules/message-pickup/protocol/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts similarity index 84% rename from packages/core/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts index f661b04ba2..62d1b38e46 100644 --- a/packages/core/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.ts @@ -1,9 +1,8 @@ -import type { AgentContext } from '../../../../agent' -import type { AgentMessage } from '../../../../agent/AgentMessage' -import type { AgentMessageReceivedEvent } from '../../../../agent/Events' -import type { FeatureRegistry } from '../../../../agent/FeatureRegistry' -import type { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../../plugins' +import type { AgentMessage } from '../../../../AgentMessage' +import type { AgentMessageReceivedEvent } from '../../../../Events' +import type { FeatureRegistry } from '../../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../../MessageHandlerRegistry' +import type { InboundMessageContext } from '../../../../models' import type { MessagePickupCompletedEvent } from '../../MessagePickupEvents' import type { MessagePickupRepository } from '../../storage/MessagePickupRepository' import type { @@ -13,13 +12,12 @@ import type { PickupMessagesProtocolReturnType, SetLiveDeliveryModeProtocolReturnType, } from '../MessagePickupProtocolOptions' +import type { AgentContext } from '@credo-ts/core' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { AgentEventTypes } from '../../../../agent/Events' -import { OutboundMessageContext, Protocol } from '../../../../agent/models' -import { InjectionSymbols } from '../../../../constants' -import { CredoError } from '../../../../error' -import { injectable } from '../../../../plugins' +import { EventEmitter, InjectionSymbols, CredoError, injectable } from '@credo-ts/core' + +import { AgentEventTypes } from '../../../../Events' +import { Protocol, OutboundMessageContext } from '../../../../models' import { MessagePickupEventTypes } from '../../MessagePickupEvents' import { MessagePickupModuleConfig } from '../../MessagePickupModuleConfig' import { BaseMessagePickupProtocol } from '../BaseMessagePickupProtocol' @@ -37,8 +35,8 @@ export class V1MessagePickupProtocol extends BaseMessagePickupProtocol { /** * Registers the protocol implementation (handlers, feature registry) on the agent. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void { - dependencyManager.registerMessageHandlers([new V1BatchPickupHandler(this), new V1BatchHandler(this)]) + public register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void { + messageHandlerRegistry.registerMessageHandlers([new V1BatchPickupHandler(this), new V1BatchHandler(this)]) featureRegistry.register( new Protocol({ diff --git a/packages/core/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts similarity index 89% rename from packages/core/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts index f49e8130d1..9747389758 100644 --- a/packages/core/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/V1BatchHandler.ts @@ -1,7 +1,7 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V1MessagePickupProtocol } from '../V1MessagePickupProtocol' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V1BatchMessage } from '../messages' export class V1BatchHandler implements MessageHandler { diff --git a/packages/core/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts similarity index 94% rename from packages/core/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts index d9eee7c4d9..812b641010 100644 --- a/packages/core/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/V1BatchPickupHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V1MessagePickupProtocol } from '../V1MessagePickupProtocol' import { V1BatchPickupMessage } from '../messages' diff --git a/packages/core/src/modules/message-pickup/protocol/v1/handlers/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/v1/handlers/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/handlers/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/v1/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/v1/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts similarity index 86% rename from packages/core/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts index 37b8c775e2..466f97b9e6 100644 --- a/packages/core/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v1/messages/V1BatchMessage.ts @@ -1,16 +1,16 @@ +import { utils } from '@credo-ts/core' import { Type, Expose } from 'class-transformer' import { Matches, IsArray, ValidateNested, IsObject, IsInstance } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { MessageIdRegExp } from '../../../../../agent/BaseMessage' +import { AgentMessage } from '../../../../../AgentMessage' +import { MessageIdRegExp } from '../../../../../BaseMessage' import { EncryptedMessage } from '../../../../../types' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { uuid } from '../../../../../utils/uuid' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export class BatchMessageMessage { public constructor(options: { id?: string; message: EncryptedMessage }) { if (options) { - this.id = options.id || uuid() + this.id = options.id || utils.uuid() this.message = options.message } } diff --git a/packages/core/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts similarity index 92% rename from packages/core/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts index 950c700b3d..d6d9dc68d9 100644 --- a/packages/core/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v1/messages/V1BatchPickupMessage.ts @@ -1,8 +1,8 @@ import { Expose } from 'class-transformer' import { IsInt } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface BatchPickupMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v1/messages/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/v1/messages/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/v1/messages/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v1/messages/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts similarity index 91% rename from packages/core/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts index 3c2470c34a..46e2153979 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.ts @@ -1,9 +1,8 @@ -import type { AgentContext } from '../../../../agent' -import type { AgentMessage } from '../../../../agent/AgentMessage' -import type { AgentMessageReceivedEvent } from '../../../../agent/Events' -import type { FeatureRegistry } from '../../../../agent/FeatureRegistry' -import type { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../../plugins' +import type { AgentMessage } from '../../../../AgentMessage' +import type { AgentMessageReceivedEvent } from '../../../../Events' +import type { FeatureRegistry } from '../../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../../MessageHandlerRegistry' +import type { InboundMessageContext } from '../../../../models' import type { EncryptedMessage } from '../../../../types' import type { MessagePickupCompletedEvent } from '../../MessagePickupEvents' import type { MessagePickupRepository } from '../../storage/MessagePickupRepository' @@ -15,15 +14,14 @@ import type { SetLiveDeliveryModeProtocolOptions, SetLiveDeliveryModeProtocolReturnType, } from '../MessagePickupProtocolOptions' +import type { AgentContext } from '@credo-ts/core' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { AgentEventTypes } from '../../../../agent/Events' -import { OutboundMessageContext, Protocol } from '../../../../agent/models' -import { InjectionSymbols } from '../../../../constants' +import { EventEmitter, InjectionSymbols, injectable, verkeyToDidKey } from '@credo-ts/core' + +import { AgentEventTypes } from '../../../../Events' import { Attachment } from '../../../../decorators/attachment/Attachment' -import { injectable } from '../../../../plugins' -import { verkeyToDidKey } from '../../../dids/helpers' -import { ProblemReportError } from '../../../problem-reports' +import { ProblemReportError } from '../../../../errors' +import { OutboundMessageContext, Protocol } from '../../../../models' import { RoutingProblemReportReason } from '../../../routing/error' import { MessagePickupEventTypes } from '../../MessagePickupEvents' import { MessagePickupModuleConfig } from '../../MessagePickupModuleConfig' @@ -58,8 +56,8 @@ export class V2MessagePickupProtocol extends BaseMessagePickupProtocol { /** * Registers the protocol implementation (handlers, feature registry) on the agent. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void { - dependencyManager.registerMessageHandlers([ + public register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void { + messageHandlerRegistry.registerMessageHandlers([ new V2StatusRequestHandler(this), new V2DeliveryRequestHandler(this), new V2MessagesReceivedHandler(this), diff --git a/packages/core/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts similarity index 94% rename from packages/core/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts index 7a4bc3dc22..2083581902 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/__tests__/V2MessagePickupProtocol.test.ts @@ -1,17 +1,16 @@ import type { EncryptedMessage } from '../../../../../types' -import { getAgentContext, getMockConnection, mockFunction } from '../../../../../../tests/helpers' -import { EventEmitter } from '../../../../../agent/EventEmitter' -import { AgentEventTypes } from '../../../../../agent/Events' -import { MessageSender } from '../../../../../agent/MessageSender' -import { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' -import { InjectionSymbols } from '../../../../../constants' +import { EventEmitter } from '../../../../../../../core/src/agent/EventEmitter' +import { InjectionSymbols } from '../../../../../../../core/src/constants' +import { CredoError } from '../../../../../../../core/src/error' +import { verkeyToDidKey } from '../../../../../../../core/src/modules/dids/helpers' +import { uuid } from '../../../../../../../core/src/utils/uuid' +import { getAgentContext, getMockConnection, mockFunction } from '../../../../../../../core/tests/helpers' +import { AgentEventTypes } from '../../../../../Events' +import { MessageSender } from '../../../../../MessageSender' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { CredoError } from '../../../../../error' -import { uuid } from '../../../../../utils/uuid' -import { DidExchangeState, TrustPingMessage } from '../../../../connections' -import { ConnectionService } from '../../../../connections/services/ConnectionService' -import { verkeyToDidKey } from '../../../../dids/helpers' +import { InboundMessageContext } from '../../../../../models' +import { TrustPingMessage, ConnectionService, DidExchangeState } from '../../../../connections' import { MessagePickupModuleConfig } from '../../../MessagePickupModuleConfig' import { InMemoryMessagePickupRepository } from '../../../storage/InMemoryMessagePickupRepository' import { V1MessagePickupProtocol } from '../../v1' @@ -30,8 +29,8 @@ const mockConnection = getMockConnection({ // Mock classes jest.mock('../../../storage/InMemoryMessagePickupRepository') -jest.mock('../../../../../agent/EventEmitter') -jest.mock('../../../../../agent/MessageSender') +jest.mock('../../../../../../../core/src/agent/EventEmitter') +jest.mock('../../../../../MessageSender') jest.mock('../../../../connections/services/ConnectionService') // Mock typed object diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts similarity index 79% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts index b935dcd512..5c326d9e87 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2DeliveryRequestHandler.ts @@ -1,5 +1,5 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { V2MessagePickupProtocol } from '../V2MessagePickupProtocol' import { V2DeliveryRequestMessage } from '../messages' diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts similarity index 79% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts index 30eeaf035f..1b808c670f 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2LiveDeliveryChangeHandler.ts @@ -1,5 +1,5 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { V2MessagePickupProtocol } from '../V2MessagePickupProtocol' import { V2LiveDeliveryChangeMessage } from '../messages' diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts similarity index 79% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts index 918b3f37b8..79b436a296 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2MessageDeliveryHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { V2MessagePickupProtocol } from '../V2MessagePickupProtocol' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V2MessageDeliveryMessage } from '../messages/V2MessageDeliveryMessage' export class V2MessageDeliveryHandler implements MessageHandler { diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts similarity index 79% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts index 5820c4878c..f01c88a532 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2MessagesReceivedHandler.ts @@ -1,5 +1,5 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { V2MessagePickupProtocol } from '../V2MessagePickupProtocol' import { V2MessagesReceivedMessage } from '../messages' diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts similarity index 78% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts index 598c4a447f..aa94ae17f9 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2StatusHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { V2MessagePickupProtocol } from '../V2MessagePickupProtocol' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V2StatusMessage } from '../messages' export class V2StatusHandler implements MessageHandler { diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts similarity index 79% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts index b9e365b8a4..19bd9a7448 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/V2StatusRequestHandler.ts @@ -1,5 +1,5 @@ -import type { MessageHandler } from '../../../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../../../handlers' +import type { InboundMessageContext } from '../../../../../models' import type { V2MessagePickupProtocol } from '../V2MessagePickupProtocol' import { V2StatusRequestMessage } from '../messages' diff --git a/packages/core/src/modules/message-pickup/protocol/v2/handlers/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/v2/handlers/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/handlers/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/v2/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/v2/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/index.ts diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts similarity index 92% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts index 2a1e73f867..1589f3ee1c 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2DeliveryRequestMessage.ts @@ -1,9 +1,9 @@ import { Expose } from 'class-transformer' import { IsInt, IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { ReturnRouteTypes } from '../../../../../decorators/transport/TransportDecorator' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2DeliveryRequestMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts similarity index 92% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts index 3b14501f6b..dd888cb2f3 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2LiveDeliveryChangeMessage.ts @@ -1,9 +1,9 @@ import { Expose } from 'class-transformer' import { IsBoolean } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { ReturnRouteTypes } from '../../../../../decorators/transport/TransportDecorator' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2LiveDeliveryChangeMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts similarity index 93% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts index 4523c5d54b..0f5d655ce0 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2MessageDeliveryMessage.ts @@ -3,9 +3,9 @@ import type { Attachment } from '../../../../../decorators/attachment/Attachment import { Expose } from 'class-transformer' import { IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { ReturnRouteTypes } from '../../../../../decorators/transport/TransportDecorator' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2MessageDeliveryMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts similarity index 91% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts index 889e08853c..e9af9f0cb4 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2MessagesReceivedMessage.ts @@ -1,9 +1,9 @@ import { Expose } from 'class-transformer' import { IsArray } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { ReturnRouteTypes } from '../../../../../decorators/transport/TransportDecorator' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2MessagesReceivedMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts similarity index 93% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts index 46d3a8c226..55c284280f 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2StatusMessage.ts @@ -1,10 +1,10 @@ import { Expose, Transform } from 'class-transformer' import { IsBoolean, IsDate, IsInt, IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { ReturnRouteTypes } from '../../../../../decorators/transport/TransportDecorator' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { DateParser } from '../../../../../utils/transformers' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' +import { DateParser } from '../../../../../util/transformers' export interface V2StatusMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts similarity index 90% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts index c10acf8b75..182f4af851 100644 --- a/packages/core/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts +++ b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/V2StatusRequestMessage.ts @@ -1,8 +1,8 @@ import { Expose } from 'class-transformer' import { IsOptional, IsString } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' +import { AgentMessage } from '../../../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export interface V2StatusRequestMessageOptions { id?: string diff --git a/packages/core/src/modules/message-pickup/protocol/v2/messages/index.ts b/packages/didcomm/src/modules/message-pickup/protocol/v2/messages/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/protocol/v2/messages/index.ts rename to packages/didcomm/src/modules/message-pickup/protocol/v2/messages/index.ts diff --git a/packages/core/src/modules/message-pickup/services/MessagePickupSessionService.ts b/packages/didcomm/src/modules/message-pickup/services/MessagePickupSessionService.ts similarity index 92% rename from packages/core/src/modules/message-pickup/services/MessagePickupSessionService.ts rename to packages/didcomm/src/modules/message-pickup/services/MessagePickupSessionService.ts index 7e726c7c8a..8d8b2d2091 100644 --- a/packages/core/src/modules/message-pickup/services/MessagePickupSessionService.ts +++ b/packages/didcomm/src/modules/message-pickup/services/MessagePickupSessionService.ts @@ -1,15 +1,12 @@ -import type { AgentContext } from '../../../agent' import type { TransportSessionRemovedEvent } from '../../../transport' import type { MessagePickupLiveSessionRemovedEvent, MessagePickupLiveSessionSavedEvent } from '../MessagePickupEvents' import type { MessagePickupSession, MessagePickupSessionRole } from '../MessagePickupSession' +import type { AgentContext } from '@credo-ts/core' +import { EventEmitter, InjectionSymbols, injectable, utils } from '@credo-ts/core' import { takeUntil, type Subject } from 'rxjs' -import { EventEmitter } from '../../../agent/EventEmitter' -import { InjectionSymbols } from '../../../constants' -import { injectable } from '../../../plugins' import { TransportEventTypes } from '../../../transport' -import { uuid } from '../../../utils/uuid' import { MessagePickupEventTypes } from '../MessagePickupEvents' /** @@ -68,7 +65,7 @@ export class MessagePickupSessionService { this.removeLiveSession(agentContext, { connectionId }) const session = { - id: uuid(), + id: utils.uuid(), connectionId, protocolVersion, role, diff --git a/packages/core/src/modules/message-pickup/services/index.ts b/packages/didcomm/src/modules/message-pickup/services/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/services/index.ts rename to packages/didcomm/src/modules/message-pickup/services/index.ts diff --git a/packages/core/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts b/packages/didcomm/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts similarity index 92% rename from packages/core/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts rename to packages/didcomm/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts index f066899369..21941d7115 100644 --- a/packages/core/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts +++ b/packages/didcomm/src/modules/message-pickup/storage/InMemoryMessagePickupRepository.ts @@ -7,10 +7,7 @@ import type { } from './MessagePickupRepositoryOptions' import type { QueuedMessage } from './QueuedMessage' -import { InjectionSymbols } from '../../../constants' -import { Logger } from '../../../logger' -import { injectable, inject } from '../../../plugins' -import { uuid } from '../../../utils/uuid' +import { InjectionSymbols, Logger, injectable, inject, utils } from '@credo-ts/core' interface InMemoryQueuedMessage extends QueuedMessage { connectionId: string @@ -72,7 +69,7 @@ export class InMemoryMessagePickupRepository implements MessagePickupRepository public addMessage(options: AddMessageOptions) { const { connectionId, recipientDids, payload } = options - const id = uuid() + const id = utils.uuid() this.messages.push({ id, connectionId, diff --git a/packages/core/src/modules/message-pickup/storage/MessagePickupRepository.ts b/packages/didcomm/src/modules/message-pickup/storage/MessagePickupRepository.ts similarity index 100% rename from packages/core/src/modules/message-pickup/storage/MessagePickupRepository.ts rename to packages/didcomm/src/modules/message-pickup/storage/MessagePickupRepository.ts diff --git a/packages/core/src/modules/message-pickup/storage/MessagePickupRepositoryOptions.ts b/packages/didcomm/src/modules/message-pickup/storage/MessagePickupRepositoryOptions.ts similarity index 100% rename from packages/core/src/modules/message-pickup/storage/MessagePickupRepositoryOptions.ts rename to packages/didcomm/src/modules/message-pickup/storage/MessagePickupRepositoryOptions.ts diff --git a/packages/core/src/modules/message-pickup/storage/QueuedMessage.ts b/packages/didcomm/src/modules/message-pickup/storage/QueuedMessage.ts similarity index 100% rename from packages/core/src/modules/message-pickup/storage/QueuedMessage.ts rename to packages/didcomm/src/modules/message-pickup/storage/QueuedMessage.ts diff --git a/packages/core/src/modules/message-pickup/storage/index.ts b/packages/didcomm/src/modules/message-pickup/storage/index.ts similarity index 100% rename from packages/core/src/modules/message-pickup/storage/index.ts rename to packages/didcomm/src/modules/message-pickup/storage/index.ts diff --git a/packages/core/src/modules/oob/OutOfBandApi.ts b/packages/didcomm/src/modules/oob/OutOfBandApi.ts similarity index 96% rename from packages/core/src/modules/oob/OutOfBandApi.ts rename to packages/didcomm/src/modules/oob/OutOfBandApi.ts index b29e2db3bd..883f23a6e5 100644 --- a/packages/core/src/modules/oob/OutOfBandApi.ts +++ b/packages/didcomm/src/modules/oob/OutOfBandApi.ts @@ -1,47 +1,53 @@ import type { HandshakeReusedEvent } from './domain/OutOfBandEvents' -import type { AgentMessage } from '../../agent/AgentMessage' -import type { AgentMessageReceivedEvent } from '../../agent/Events' +import type { AgentMessage } from '../../AgentMessage' import type { Attachment } from '../../decorators/attachment/Attachment' -import type { Query, QueryOptions } from '../../storage/StorageService' +import type { Routing } from '../../models' import type { PlaintextMessage } from '../../types' -import type { ConnectionInvitationMessage, ConnectionRecord, Routing } from '../connections' +import type { Query, QueryOptions } from '@credo-ts/core' +import { + AgentContext, + EventEmitter, + filterContextCorrelationId, + InjectionSymbols, + Key, + CredoError, + Logger, + inject, + injectable, + JsonEncoder, + JsonTransformer, + DidKey, +} from '@credo-ts/core' import { catchError, EmptyError, first, firstValueFrom, map, of, timeout } from 'rxjs' -import { AgentContext } from '../../agent' -import { EventEmitter } from '../../agent/EventEmitter' -import { filterContextCorrelationId, AgentEventTypes } from '../../agent/Events' -import { MessageHandlerRegistry } from '../../agent/MessageHandlerRegistry' -import { MessageSender } from '../../agent/MessageSender' -import { OutboundMessageContext } from '../../agent/models' -import { InjectionSymbols } from '../../constants' -import { Key } from '../../crypto' +import { DidCommModuleConfig } from '../../DidCommModuleConfig' +import { AgentEventTypes, type AgentMessageReceivedEvent } from '../../Events' +import { MessageHandlerRegistry } from '../../MessageHandlerRegistry' +import { MessageSender } from '../../MessageSender' import { ServiceDecorator } from '../../decorators/service/ServiceDecorator' -import { CredoError } from '../../error' -import { Logger } from '../../logger' -import { inject, injectable } from '../../plugins' -import { JsonEncoder, JsonTransformer } from '../../utils' +import { OutboundMessageContext } from '../../models' +import { DidCommDocumentService } from '../../services' import { parseDidCommProtocolUri, - parseMessageType, supportsIncomingDidCommProtocolUri, + parseMessageType, supportsIncomingMessageType, -} from '../../utils/messageType' -import { parseInvitationShortUrl } from '../../utils/parseInvitation' -import { ConnectionsApi, DidExchangeState, HandshakeProtocol } from '../connections' -import { DidCommDocumentService } from '../didcomm' -import { DidKey } from '../dids' -import { outOfBandServiceToInlineKeysNumAlgo2Did } from '../dids/methods/peer/peerDidNumAlgo2' +} from '../../util/messageType' +import { parseInvitationShortUrl } from '../../util/parseInvitation' +import { ConnectionRecord, ConnectionInvitationMessage, HandshakeProtocol, DidExchangeState } from '../connections' +import { ConnectionsApi } from '../connections/ConnectionsApi' import { RoutingService } from '../routing/services/RoutingService' import { OutOfBandService } from './OutOfBandService' +import { convertToNewInvitation, convertToOldInvitation } from './converters' import { OutOfBandDidCommService } from './domain/OutOfBandDidCommService' import { OutOfBandEventTypes } from './domain/OutOfBandEvents' import { OutOfBandRole } from './domain/OutOfBandRole' import { OutOfBandState } from './domain/OutOfBandState' import { HandshakeReuseHandler } from './handlers' import { HandshakeReuseAcceptedHandler } from './handlers/HandshakeReuseAcceptedHandler' -import { convertToNewInvitation, convertToOldInvitation } from './helpers' +import { outOfBandServiceToInlineKeysNumAlgo2Did } from './helpers' import { InvitationType, OutOfBandInvitation } from './messages' import { OutOfBandRepository } from './repository' import { OutOfBandRecord } from './repository/OutOfBandRecord' @@ -157,7 +163,8 @@ export class OutOfBandApi { // We don't want to treat an empty array as messages being provided const messages = config.messages && config.messages.length > 0 ? config.messages : undefined const label = config.label ?? this.agentContext.config.label - const imageUrl = config.imageUrl ?? this.agentContext.config.connectionImageUrl + const didcommConfig = this.agentContext.dependencyManager.resolve(DidCommModuleConfig) + const imageUrl = config.imageUrl ?? didcommConfig.connectionImageUrl const appendedAttachments = config.appendedAttachments && config.appendedAttachments.length > 0 ? config.appendedAttachments : undefined @@ -416,7 +423,8 @@ export class OutOfBandApi { const reuseConnection = config.reuseConnection ?? false const label = config.label ?? this.agentContext.config.label const alias = config.alias - const imageUrl = config.imageUrl ?? this.agentContext.config.connectionImageUrl + const didcommConfig = this.agentContext.dependencyManager.resolve(DidCommModuleConfig) + const imageUrl = config.imageUrl ?? didcommConfig.connectionImageUrl const messages = outOfBandInvitation.getRequests() diff --git a/packages/core/src/modules/oob/OutOfBandModule.ts b/packages/didcomm/src/modules/oob/OutOfBandModule.ts similarity index 63% rename from packages/core/src/modules/oob/OutOfBandModule.ts rename to packages/didcomm/src/modules/oob/OutOfBandModule.ts index c13fc6a150..798374394e 100644 --- a/packages/core/src/modules/oob/OutOfBandModule.ts +++ b/packages/didcomm/src/modules/oob/OutOfBandModule.ts @@ -1,7 +1,7 @@ -import type { FeatureRegistry } from '../../agent/FeatureRegistry' -import type { DependencyManager, Module } from '../../plugins' +import type { DependencyManager, Module, AgentContext } from '@credo-ts/core' -import { Protocol } from '../../agent/models' +import { FeatureRegistry } from '../../FeatureRegistry' +import { Protocol } from '../../models' import { OutOfBandApi } from './OutOfBandApi' import { OutOfBandService } from './OutOfBandService' @@ -13,14 +13,18 @@ export class OutOfBandModule implements Module { /** * Registers the dependencies of the ot of band module on the dependency manager. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Services dependencyManager.registerSingleton(OutOfBandService) // Repositories dependencyManager.registerSingleton(OutOfBandRepository) + } + public async initialize(agentContext: AgentContext): Promise { // Features + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) + featureRegistry.register( new Protocol({ id: 'https://didcomm.org/out-of-band/1.1', diff --git a/packages/core/src/modules/oob/OutOfBandService.ts b/packages/didcomm/src/modules/oob/OutOfBandService.ts similarity index 93% rename from packages/core/src/modules/oob/OutOfBandService.ts rename to packages/didcomm/src/modules/oob/OutOfBandService.ts index be14890049..f37cfbed29 100644 --- a/packages/core/src/modules/oob/OutOfBandService.ts +++ b/packages/didcomm/src/modules/oob/OutOfBandService.ts @@ -1,18 +1,12 @@ import type { OutOfBandDidCommService } from './domain' import type { HandshakeReusedEvent, OutOfBandStateChangedEvent } from './domain/OutOfBandEvents' -import type { AgentContext } from '../../agent' -import type { InboundMessageContext } from '../../agent/models/InboundMessageContext' -import type { Key } from '../../crypto' -import type { Query, QueryOptions } from '../../storage/StorageService' -import type { ConnectionRecord } from '../connections' -import type { HandshakeProtocol } from '../connections/models' - -import { EventEmitter } from '../../agent/EventEmitter' -import { CredoError } from '../../error' -import { injectable } from '../../plugins' -import { DidCommDocumentService } from '../didcomm/services/DidCommDocumentService' -import { DidsApi } from '../dids' -import { parseDid } from '../dids/domain/parse' +import type { InboundMessageContext } from '../../models' +import type { ConnectionRecord, HandshakeProtocol } from '../connections' +import type { AgentContext, Key, Query, QueryOptions } from '@credo-ts/core' + +import { EventEmitter, CredoError, injectable, DidsApi, parseDid } from '@credo-ts/core' + +import { DidCommDocumentService } from '../../services' import { OutOfBandEventTypes } from './domain/OutOfBandEvents' import { OutOfBandRole } from './domain/OutOfBandRole' diff --git a/packages/core/src/modules/oob/__tests__/OutOfBandInvitation.test.ts b/packages/didcomm/src/modules/oob/__tests__/OutOfBandInvitation.test.ts similarity index 97% rename from packages/core/src/modules/oob/__tests__/OutOfBandInvitation.test.ts rename to packages/didcomm/src/modules/oob/__tests__/OutOfBandInvitation.test.ts index a30fe2331e..5d821991fc 100644 --- a/packages/core/src/modules/oob/__tests__/OutOfBandInvitation.test.ts +++ b/packages/didcomm/src/modules/oob/__tests__/OutOfBandInvitation.test.ts @@ -1,9 +1,9 @@ -import type { ClassValidationError } from '../../../error/ClassValidationError' +import type { ClassValidationError } from '../../../../../core/src/error/ClassValidationError' +import { MessageValidator } from '../../../../../core/src/utils' +import { JsonEncoder } from '../../../../../core/src/utils/JsonEncoder' +import { JsonTransformer } from '../../../../../core/src/utils/JsonTransformer' import { Attachment } from '../../../decorators/attachment/Attachment' -import { MessageValidator } from '../../../utils' -import { JsonEncoder } from '../../../utils/JsonEncoder' -import { JsonTransformer } from '../../../utils/JsonTransformer' import { HandshakeProtocol } from '../../connections' import { OutOfBandDidCommService } from '../domain' import { OutOfBandInvitation } from '../messages/OutOfBandInvitation' diff --git a/packages/core/src/modules/oob/__tests__/OutOfBandModule.test.ts b/packages/didcomm/src/modules/oob/__tests__/OutOfBandModule.test.ts similarity index 61% rename from packages/core/src/modules/oob/__tests__/OutOfBandModule.test.ts rename to packages/didcomm/src/modules/oob/__tests__/OutOfBandModule.test.ts index 1f012a8608..da66d1ebb2 100644 --- a/packages/core/src/modules/oob/__tests__/OutOfBandModule.test.ts +++ b/packages/didcomm/src/modules/oob/__tests__/OutOfBandModule.test.ts @@ -1,21 +1,16 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { DependencyManager } from '../../../plugins/DependencyManager' +import { DependencyManager } from '../../../../../core/src/plugins/DependencyManager' import { OutOfBandModule } from '../OutOfBandModule' import { OutOfBandService } from '../OutOfBandService' import { OutOfBandRepository } from '../repository/OutOfBandRepository' -jest.mock('../../../plugins/DependencyManager') +jest.mock('../../../../../core/src/plugins/DependencyManager') const DependencyManagerMock = DependencyManager as jest.Mock const dependencyManager = new DependencyManagerMock() -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() describe('OutOfBandModule', () => { test('registers dependencies on the dependency manager', () => { - new OutOfBandModule().register(dependencyManager, featureRegistry) + new OutOfBandModule().register(dependencyManager) expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(OutOfBandService) diff --git a/packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts b/packages/didcomm/src/modules/oob/__tests__/OutOfBandService.test.ts similarity index 97% rename from packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts rename to packages/didcomm/src/modules/oob/__tests__/OutOfBandService.test.ts index 0bd4facc3a..1a8287e59f 100644 --- a/packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts +++ b/packages/didcomm/src/modules/oob/__tests__/OutOfBandService.test.ts @@ -1,19 +1,19 @@ -import type { DidCommDocumentService } from '../../didcomm' +import type { DidCommDocumentService } from '../../../services' import { Subject } from 'rxjs' +import { EventEmitter } from '../../../../../core/src/agent/EventEmitter' +import { KeyType, Key } from '../../../../../core/src/crypto' +import { CredoError } from '../../../../../core/src/error' import { agentDependencies, getAgentContext, getMockConnection, getMockOutOfBand, mockFunction, -} from '../../../../tests/helpers' -import { EventEmitter } from '../../../agent/EventEmitter' -import { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import { KeyType, Key } from '../../../crypto' -import { CredoError } from '../../../error' -import { DidExchangeState } from '../../connections/models' +} from '../../../../../core/tests/helpers' +import { InboundMessageContext } from '../../../models' +import { DidExchangeState } from '../../connections' import { OutOfBandService } from '../OutOfBandService' import { OutOfBandEventTypes } from '../domain/OutOfBandEvents' import { OutOfBandRole } from '../domain/OutOfBandRole' diff --git a/packages/core/src/modules/oob/__tests__/connect-to-self.test.ts b/packages/didcomm/src/modules/oob/__tests__/connect-to-self.test.ts similarity index 67% rename from packages/core/src/modules/oob/__tests__/connect-to-self.test.ts rename to packages/didcomm/src/modules/oob/__tests__/connect-to-self.test.ts index 2532e9e0af..09915ea359 100644 --- a/packages/core/src/modules/oob/__tests__/connect-to-self.test.ts +++ b/packages/didcomm/src/modules/oob/__tests__/connect-to-self.test.ts @@ -5,12 +5,11 @@ import { Subject } from 'rxjs' import { SubjectInboundTransport } from '../../../../../../tests/transport/SubjectInboundTransport' import { SubjectOutboundTransport } from '../../../../../../tests/transport/SubjectOutboundTransport' -import { getInMemoryAgentOptions } from '../../../../tests/helpers' +import { Agent } from '../../../../../core' +import { getInMemoryAgentOptions } from '../../../../../core/tests/helpers' import { HandshakeProtocol, DidExchangeState } from '../../connections' import { OutOfBandState } from '../domain/OutOfBandState' -import { Agent } from '@credo-ts/core' - const faberAgentOptions = getInMemoryAgentOptions('Faber Agent OOB Connect to Self', { endpoints: ['rxjs:faber'], }) @@ -26,8 +25,8 @@ describe('out of band', () => { faberAgent = new Agent(faberAgentOptions) - faberAgent.registerInboundTransport(new SubjectInboundTransport(faberMessages)) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(faberMessages)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() }) @@ -38,20 +37,22 @@ describe('out of band', () => { describe('connect with self', () => { test(`make a connection with self using ${HandshakeProtocol.DidExchange} protocol`, async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation() + const outOfBandRecord = await faberAgent.modules.oob.createInvitation() const { outOfBandInvitation } = outOfBandRecord const urlMessage = outOfBandInvitation.toUrl({ domain: 'http://example.com' }) // eslint-disable-next-line prefer-const let { outOfBandRecord: receivedOutOfBandRecord, connectionRecord: receiverSenderConnection } = - await faberAgent.oob.receiveInvitationFromUrl(urlMessage) + await faberAgent.modules.oob.receiveInvitationFromUrl(urlMessage) expect(receivedOutOfBandRecord.state).toBe(OutOfBandState.PrepareResponse) - receiverSenderConnection = await faberAgent.connections.returnWhenIsConnected(receiverSenderConnection!.id) + receiverSenderConnection = await faberAgent.modules.connections.returnWhenIsConnected( + receiverSenderConnection!.id + ) expect(receiverSenderConnection.state).toBe(DidExchangeState.Completed) - let [senderReceiverConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - senderReceiverConnection = await faberAgent.connections.returnWhenIsConnected(senderReceiverConnection.id) + let [senderReceiverConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + senderReceiverConnection = await faberAgent.modules.connections.returnWhenIsConnected(senderReceiverConnection.id) expect(senderReceiverConnection.state).toBe(DidExchangeState.Completed) expect(senderReceiverConnection.protocol).toBe(HandshakeProtocol.DidExchange) @@ -60,7 +61,7 @@ describe('out of band', () => { }) test(`make a connection with self using https://didcomm.org/didexchange/1.1 protocol, but invitation using https://didcomm.org/didexchange/1.0`, async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation() + const outOfBandRecord = await faberAgent.modules.oob.createInvitation() const { outOfBandInvitation } = outOfBandRecord outOfBandInvitation.handshakeProtocols = ['https://didcomm.org/didexchange/1.0'] @@ -68,14 +69,16 @@ describe('out of band', () => { // eslint-disable-next-line prefer-const let { outOfBandRecord: receivedOutOfBandRecord, connectionRecord: receiverSenderConnection } = - await faberAgent.oob.receiveInvitationFromUrl(urlMessage) + await faberAgent.modules.oob.receiveInvitationFromUrl(urlMessage) expect(receivedOutOfBandRecord.state).toBe(OutOfBandState.PrepareResponse) - receiverSenderConnection = await faberAgent.connections.returnWhenIsConnected(receiverSenderConnection!.id) + receiverSenderConnection = await faberAgent.modules.connections.returnWhenIsConnected( + receiverSenderConnection!.id + ) expect(receiverSenderConnection.state).toBe(DidExchangeState.Completed) - let [senderReceiverConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - senderReceiverConnection = await faberAgent.connections.returnWhenIsConnected(senderReceiverConnection.id) + let [senderReceiverConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + senderReceiverConnection = await faberAgent.modules.connections.returnWhenIsConnected(senderReceiverConnection.id) expect(senderReceiverConnection.state).toBe(DidExchangeState.Completed) expect(senderReceiverConnection.protocol).toBe(HandshakeProtocol.DidExchange) @@ -84,7 +87,7 @@ describe('out of band', () => { }) test(`make a connection with self using ${HandshakeProtocol.Connections} protocol`, async () => { - const outOfBandRecord = await faberAgent.oob.createInvitation({ + const outOfBandRecord = await faberAgent.modules.oob.createInvitation({ handshakeProtocols: [HandshakeProtocol.Connections], }) const { outOfBandInvitation } = outOfBandRecord @@ -92,14 +95,16 @@ describe('out of band', () => { // eslint-disable-next-line prefer-const let { outOfBandRecord: receivedOutOfBandRecord, connectionRecord: receiverSenderConnection } = - await faberAgent.oob.receiveInvitationFromUrl(urlMessage) + await faberAgent.modules.oob.receiveInvitationFromUrl(urlMessage) expect(receivedOutOfBandRecord.state).toBe(OutOfBandState.PrepareResponse) - receiverSenderConnection = await faberAgent.connections.returnWhenIsConnected(receiverSenderConnection!.id) + receiverSenderConnection = await faberAgent.modules.connections.returnWhenIsConnected( + receiverSenderConnection!.id + ) expect(receiverSenderConnection.state).toBe(DidExchangeState.Completed) - let [senderReceiverConnection] = await faberAgent.connections.findAllByOutOfBandId(outOfBandRecord.id) - senderReceiverConnection = await faberAgent.connections.returnWhenIsConnected(senderReceiverConnection.id) + let [senderReceiverConnection] = await faberAgent.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + senderReceiverConnection = await faberAgent.modules.connections.returnWhenIsConnected(senderReceiverConnection.id) expect(senderReceiverConnection.state).toBe(DidExchangeState.Completed) expect(senderReceiverConnection.protocol).toBe(HandshakeProtocol.Connections) diff --git a/packages/core/src/modules/oob/__tests__/helpers.test.ts b/packages/didcomm/src/modules/oob/__tests__/helpers.test.ts similarity index 98% rename from packages/core/src/modules/oob/__tests__/helpers.test.ts rename to packages/didcomm/src/modules/oob/__tests__/helpers.test.ts index 8ecba2a69a..1ed50c3793 100644 --- a/packages/core/src/modules/oob/__tests__/helpers.test.ts +++ b/packages/didcomm/src/modules/oob/__tests__/helpers.test.ts @@ -1,8 +1,8 @@ +import { JsonTransformer } from '../../../../../core/src/utils' import { Attachment } from '../../../decorators/attachment/Attachment' -import { JsonTransformer } from '../../../utils' import { ConnectionInvitationMessage } from '../../connections' +import { convertToNewInvitation, convertToOldInvitation } from '../converters' import { OutOfBandDidCommService } from '../domain' -import { convertToNewInvitation, convertToOldInvitation } from '../helpers' import { OutOfBandInvitation } from '../messages' describe('convertToNewInvitation', () => { diff --git a/packages/core/src/modules/oob/__tests__/implicit.test.ts b/packages/didcomm/src/modules/oob/__tests__/implicit.test.ts similarity index 77% rename from packages/core/src/modules/oob/__tests__/implicit.test.ts rename to packages/didcomm/src/modules/oob/__tests__/implicit.test.ts index 96eaab7a4c..9aa8b01c08 100644 --- a/packages/core/src/modules/oob/__tests__/implicit.test.ts +++ b/packages/didcomm/src/modules/oob/__tests__/implicit.test.ts @@ -1,11 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { setupSubjectTransports } from '../../../../tests' -import { getInMemoryAgentOptions, waitForConnectionRecord } from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' -import { KeyType } from '../../../crypto' -import { DidExchangeState, HandshakeProtocol } from '../../connections' -import { InMemoryDidRegistry } from '../../connections/__tests__/InMemoryDidRegistry' +import { Agent } from '../../../../../core/src/agent/Agent' +import { KeyType } from '../../../../../core/src/crypto' import { DidCommV1Service, NewDidCommV2Service, @@ -14,7 +10,11 @@ import { getEd25519VerificationKey2018, DidsModule, NewDidCommV2ServiceEndpoint, -} from '../../dids' +} from '../../../../../core/src/modules/dids' +import { setupSubjectTransports } from '../../../../../core/tests' +import { getInMemoryAgentOptions, waitForConnectionRecord } from '../../../../../core/tests/helpers' +import { DidExchangeState, HandshakeProtocol } from '../../connections' +import { InMemoryDidRegistry } from '../../connections/__tests__/InMemoryDidRegistry' const inMemoryDidsRegistry = new InMemoryDidRegistry() @@ -23,6 +23,7 @@ const faberAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:faber'], }, + {}, { dids: new DidsModule({ resolvers: [inMemoryDidsRegistry], @@ -35,6 +36,7 @@ const aliceAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, { dids: new DidsModule({ resolvers: [inMemoryDidsRegistry], @@ -64,9 +66,9 @@ describe('out of band implicit', () => { }) afterEach(async () => { - const connections = await faberAgent.connections.getAll() + const connections = await faberAgent.modules.connections.getAll() for (const connection of connections) { - await faberAgent.connections.deleteById(connection.id) + await faberAgent.modules.connections.deleteById(connection.id) } jest.resetAllMocks() @@ -75,7 +77,7 @@ describe('out of band implicit', () => { test(`make a connection with ${HandshakeProtocol.DidExchange} based on implicit OOB invitation`, async () => { const inMemoryDid = await createInMemoryDid(faberAgent, 'rxjs:faber') - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveImplicitInvitation({ + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveImplicitInvitation({ did: inMemoryDid, alias: 'Faber public', label: 'Alice', @@ -84,12 +86,12 @@ describe('out of band implicit', () => { // Wait for a connection event in faber agent and accept the request let faberAliceConnection = await waitForConnectionRecord(faberAgent, { state: DidExchangeState.RequestReceived }) - await faberAgent.connections.acceptRequest(faberAliceConnection.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + await faberAgent.modules.connections.acceptRequest(faberAliceConnection.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) // Alice should now be connected - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) @@ -99,7 +101,7 @@ describe('out of band implicit', () => { expect(aliceFaberConnection.invitationDid).toBe(inMemoryDid) // It is possible for an agent to check if it has already a connection to a certain public entity - expect(await aliceAgent.connections.findByInvitationDid(inMemoryDid)).toEqual([aliceFaberConnection]) + expect(await aliceAgent.modules.connections.findByInvitationDid(inMemoryDid)).toEqual([aliceFaberConnection]) }) test(`make a connection with ${HandshakeProtocol.DidExchange} based on implicit OOB invitation pointing to specific service`, async () => { @@ -107,7 +109,7 @@ describe('out of band implicit', () => { const inMemoryDidDocument = await faberAgent.dids.resolveDidDocument(inMemoryDid) const serviceUrl = inMemoryDidDocument.service![1].id - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveImplicitInvitation({ + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveImplicitInvitation({ did: serviceUrl, alias: 'Faber public', label: 'Alice', @@ -116,12 +118,12 @@ describe('out of band implicit', () => { // Wait for a connection event in faber agent and accept the request let faberAliceConnection = await waitForConnectionRecord(faberAgent, { state: DidExchangeState.RequestReceived }) - await faberAgent.connections.acceptRequest(faberAliceConnection.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + await faberAgent.modules.connections.acceptRequest(faberAliceConnection.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) // Alice should now be connected - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) @@ -131,13 +133,13 @@ describe('out of band implicit', () => { expect(aliceFaberConnection.invitationDid).toBe(serviceUrl) // It is possible for an agent to check if it has already a connection to a certain public entity - expect(await aliceAgent.connections.findByInvitationDid(serviceUrl)).toEqual([aliceFaberConnection]) + expect(await aliceAgent.modules.connections.findByInvitationDid(serviceUrl)).toEqual([aliceFaberConnection]) }) test(`make a connection with ${HandshakeProtocol.Connections} based on implicit OOB invitation`, async () => { const inMemoryDid = await createInMemoryDid(faberAgent, 'rxjs:faber') - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveImplicitInvitation({ + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveImplicitInvitation({ did: inMemoryDid, alias: 'Faber public', label: 'Alice', @@ -146,12 +148,12 @@ describe('out of band implicit', () => { // Wait for a connection event in faber agent and accept the request let faberAliceConnection = await waitForConnectionRecord(faberAgent, { state: DidExchangeState.RequestReceived }) - await faberAgent.connections.acceptRequest(faberAliceConnection.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + await faberAgent.modules.connections.acceptRequest(faberAliceConnection.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) // Alice should now be connected - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) @@ -161,12 +163,12 @@ describe('out of band implicit', () => { expect(aliceFaberConnection.invitationDid).toBe(inMemoryDid) // It is possible for an agent to check if it has already a connection to a certain public entity - expect(await aliceAgent.connections.findByInvitationDid(inMemoryDid)).toEqual([aliceFaberConnection]) + expect(await aliceAgent.modules.connections.findByInvitationDid(inMemoryDid)).toEqual([aliceFaberConnection]) }) test(`receive an implicit invitation using an unresolvable did`, async () => { await expect( - aliceAgent.oob.receiveImplicitInvitation({ + aliceAgent.modules.oob.receiveImplicitInvitation({ did: 'did:sov:ZSEqSci581BDZCFPa29ScB', alias: 'Faber public', label: 'Alice', @@ -178,7 +180,7 @@ describe('out of band implicit', () => { test(`create two connections using the same implicit invitation`, async () => { const inMemoryDid = await createInMemoryDid(faberAgent, 'rxjs:faber') - let { connectionRecord: aliceFaberConnection } = await aliceAgent.oob.receiveImplicitInvitation({ + let { connectionRecord: aliceFaberConnection } = await aliceAgent.modules.oob.receiveImplicitInvitation({ did: inMemoryDid, alias: 'Faber public', label: 'Alice', @@ -187,12 +189,12 @@ describe('out of band implicit', () => { // Wait for a connection event in faber agent and accept the request let faberAliceConnection = await waitForConnectionRecord(faberAgent, { state: DidExchangeState.RequestReceived }) - await faberAgent.connections.acceptRequest(faberAliceConnection.id) - faberAliceConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceConnection!.id) + await faberAgent.modules.connections.acceptRequest(faberAliceConnection.id) + faberAliceConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceConnection!.id) expect(faberAliceConnection.state).toBe(DidExchangeState.Completed) // Alice should now be connected - aliceFaberConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberConnection!.id) + aliceFaberConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberConnection!.id) expect(aliceFaberConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberConnection).toBeConnectedWith(faberAliceConnection) @@ -202,7 +204,7 @@ describe('out of band implicit', () => { expect(aliceFaberConnection.invitationDid).toBe(inMemoryDid) // Repeat implicit invitation procedure - let { connectionRecord: aliceFaberNewConnection } = await aliceAgent.oob.receiveImplicitInvitation({ + let { connectionRecord: aliceFaberNewConnection } = await aliceAgent.modules.oob.receiveImplicitInvitation({ did: inMemoryDid, alias: 'Faber public New', label: 'Alice New', @@ -211,12 +213,12 @@ describe('out of band implicit', () => { // Wait for a connection event in faber agent let faberAliceNewConnection = await waitForConnectionRecord(faberAgent, { state: DidExchangeState.RequestReceived }) - await faberAgent.connections.acceptRequest(faberAliceNewConnection.id) - faberAliceNewConnection = await faberAgent.connections.returnWhenIsConnected(faberAliceNewConnection!.id) + await faberAgent.modules.connections.acceptRequest(faberAliceNewConnection.id) + faberAliceNewConnection = await faberAgent.modules.connections.returnWhenIsConnected(faberAliceNewConnection!.id) expect(faberAliceNewConnection.state).toBe(DidExchangeState.Completed) // Alice should now be connected - aliceFaberNewConnection = await aliceAgent.connections.returnWhenIsConnected(aliceFaberNewConnection!.id) + aliceFaberNewConnection = await aliceAgent.modules.connections.returnWhenIsConnected(aliceFaberNewConnection!.id) expect(aliceFaberNewConnection.state).toBe(DidExchangeState.Completed) expect(aliceFaberNewConnection).toBeConnectedWith(faberAliceNewConnection) @@ -226,7 +228,7 @@ describe('out of band implicit', () => { expect(aliceFaberNewConnection.invitationDid).toBe(inMemoryDid) // Both connections will be associated to the same invitation did - const connectionsFromFaberPublicDid = await aliceAgent.connections.findByInvitationDid(inMemoryDid) + const connectionsFromFaberPublicDid = await aliceAgent.modules.connections.findByInvitationDid(inMemoryDid) expect(connectionsFromFaberPublicDid).toHaveLength(2) expect(connectionsFromFaberPublicDid).toEqual( expect.arrayContaining([aliceFaberConnection, aliceFaberNewConnection]) diff --git a/packages/core/src/modules/oob/helpers.ts b/packages/didcomm/src/modules/oob/converters.ts similarity index 66% rename from packages/core/src/modules/oob/helpers.ts rename to packages/didcomm/src/modules/oob/converters.ts index 110bbd904c..4b9402baf4 100644 --- a/packages/core/src/modules/oob/helpers.ts +++ b/packages/didcomm/src/modules/oob/converters.ts @@ -1,10 +1,18 @@ import type { OutOfBandInvitationOptions } from './messages' -import { ConnectionInvitationMessage } from '../connections' -import { didKeyToVerkey, verkeyToDidKey } from '../dids/helpers' +import { + DidCommV1Service, + DidDocumentBuilder, + DidKey, + didKeyToVerkey, + verkeyToDidKey, + didDocumentToNumAlgo4Did, +} from '@credo-ts/core' + +import { ConnectionInvitationMessage } from '../connections/messages/ConnectionInvitationMessage' import { OutOfBandDidCommService } from './domain/OutOfBandDidCommService' -import { InvitationType, OutOfBandInvitation } from './messages' +import { InvitationType, OutOfBandInvitation } from './messages/OutOfBandInvitation' export function convertToNewInvitation(oldInvitation: ConnectionInvitationMessage) { let service @@ -69,3 +77,28 @@ export function convertToOldInvitation(newInvitation: OutOfBandInvitation) { const connectionInvitationMessage = new ConnectionInvitationMessage(options) return connectionInvitationMessage } + +export function outOfBandServiceToNumAlgo4Did(service: OutOfBandDidCommService) { + // FIXME: add the key entries for the recipientKeys to the did document. + const didDocument = new DidDocumentBuilder('') + .addService( + new DidCommV1Service({ + id: service.id, + serviceEndpoint: service.serviceEndpoint, + accept: service.accept, + // FIXME: this should actually be local key references, not did:key:123#456 references + recipientKeys: service.recipientKeys.map((recipientKey) => { + const did = DidKey.fromDid(recipientKey) + return `${did.did}#${did.key.fingerprint}` + }), + // Map did:key:xxx to actual did:key:xxx#123 + routingKeys: service.routingKeys?.map((routingKey) => { + const did = DidKey.fromDid(routingKey) + return `${did.did}#${did.key.fingerprint}` + }), + }) + ) + .build() + + return didDocumentToNumAlgo4Did(didDocument) +} diff --git a/packages/core/src/modules/oob/domain/OutOfBandDidCommService.ts b/packages/didcomm/src/modules/oob/domain/OutOfBandDidCommService.ts similarity index 92% rename from packages/core/src/modules/oob/domain/OutOfBandDidCommService.ts rename to packages/didcomm/src/modules/oob/domain/OutOfBandDidCommService.ts index e40759d007..2d239069ed 100644 --- a/packages/core/src/modules/oob/domain/OutOfBandDidCommService.ts +++ b/packages/didcomm/src/modules/oob/domain/OutOfBandDidCommService.ts @@ -1,11 +1,9 @@ -import type { ResolvedDidCommService } from '../../didcomm' +import type { ResolvedDidCommService } from '@credo-ts/core' import type { ValidationOptions } from 'class-validator' +import { DidDocumentService, DidKey, isDid, IsUri } from '@credo-ts/core' import { ArrayNotEmpty, buildMessage, IsOptional, isString, IsString, ValidateBy } from 'class-validator' -import { isDid, IsUri } from '../../../utils' -import { DidDocumentService, DidKey } from '../../dids' - export class OutOfBandDidCommService extends DidDocumentService { public constructor(options: { id: string diff --git a/packages/core/src/modules/oob/domain/OutOfBandEvents.ts b/packages/didcomm/src/modules/oob/domain/OutOfBandEvents.ts similarity index 93% rename from packages/core/src/modules/oob/domain/OutOfBandEvents.ts rename to packages/didcomm/src/modules/oob/domain/OutOfBandEvents.ts index 15561062b5..97bf7015ec 100644 --- a/packages/core/src/modules/oob/domain/OutOfBandEvents.ts +++ b/packages/didcomm/src/modules/oob/domain/OutOfBandEvents.ts @@ -1,7 +1,7 @@ import type { OutOfBandState } from './OutOfBandState' -import type { BaseEvent } from '../../../agent/Events' import type { ConnectionRecord } from '../../connections' import type { OutOfBandRecord } from '../repository' +import type { BaseEvent } from '@credo-ts/core' export enum OutOfBandEventTypes { OutOfBandStateChanged = 'OutOfBandStateChanged', diff --git a/packages/core/src/modules/oob/domain/OutOfBandRole.ts b/packages/didcomm/src/modules/oob/domain/OutOfBandRole.ts similarity index 100% rename from packages/core/src/modules/oob/domain/OutOfBandRole.ts rename to packages/didcomm/src/modules/oob/domain/OutOfBandRole.ts diff --git a/packages/core/src/modules/oob/domain/OutOfBandState.ts b/packages/didcomm/src/modules/oob/domain/OutOfBandState.ts similarity index 100% rename from packages/core/src/modules/oob/domain/OutOfBandState.ts rename to packages/didcomm/src/modules/oob/domain/OutOfBandState.ts diff --git a/packages/core/src/modules/oob/domain/index.ts b/packages/didcomm/src/modules/oob/domain/index.ts similarity index 100% rename from packages/core/src/modules/oob/domain/index.ts rename to packages/didcomm/src/modules/oob/domain/index.ts diff --git a/packages/core/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts b/packages/didcomm/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts similarity index 80% rename from packages/core/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts rename to packages/didcomm/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts index 07fe48259a..276a901d34 100644 --- a/packages/core/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts +++ b/packages/didcomm/src/modules/oob/handlers/HandshakeReuseAcceptedHandler.ts @@ -1,5 +1,5 @@ -import type { MessageHandler } from '../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../handlers' +import type { InboundMessageContext } from '../../../models' import type { OutOfBandService } from '../OutOfBandService' import { HandshakeReuseAcceptedMessage } from '../messages/HandshakeReuseAcceptedMessage' diff --git a/packages/core/src/modules/oob/handlers/HandshakeReuseHandler.ts b/packages/didcomm/src/modules/oob/handlers/HandshakeReuseHandler.ts similarity index 79% rename from packages/core/src/modules/oob/handlers/HandshakeReuseHandler.ts rename to packages/didcomm/src/modules/oob/handlers/HandshakeReuseHandler.ts index c4db9cdaf4..2a8b6b293c 100644 --- a/packages/core/src/modules/oob/handlers/HandshakeReuseHandler.ts +++ b/packages/didcomm/src/modules/oob/handlers/HandshakeReuseHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler } from '../../../agent/MessageHandler' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' +import type { MessageHandler } from '../../../handlers' +import type { InboundMessageContext } from '../../../models' import type { OutOfBandService } from '../OutOfBandService' -import { OutboundMessageContext } from '../../../agent/models' +import { OutboundMessageContext } from '../../../models' import { HandshakeReuseMessage } from '../messages/HandshakeReuseMessage' export class HandshakeReuseHandler implements MessageHandler { diff --git a/packages/core/src/modules/oob/handlers/index.ts b/packages/didcomm/src/modules/oob/handlers/index.ts similarity index 100% rename from packages/core/src/modules/oob/handlers/index.ts rename to packages/didcomm/src/modules/oob/handlers/index.ts diff --git a/packages/didcomm/src/modules/oob/helpers.ts b/packages/didcomm/src/modules/oob/helpers.ts new file mode 100644 index 0000000000..479a350b04 --- /dev/null +++ b/packages/didcomm/src/modules/oob/helpers.ts @@ -0,0 +1,53 @@ +import type { OutOfBandDidCommService } from './domain/OutOfBandDidCommService' + +import { + DidCommV1Service, + DidDocumentBuilder, + DidKey, + didDocumentToNumAlgo2Did, + createPeerDidDocumentFromServices, + didKeyToInstanceOfKey, +} from '@credo-ts/core' + +// This method is kept to support searching for existing connections created by +// credo-ts <= 0.5.1 +// TODO: Remove in 0.6.0 (when ConnectionRecord.invitationDid will be migrated) +export function outOfBandServiceToInlineKeysNumAlgo2Did(service: OutOfBandDidCommService) { + const didDocument = new DidDocumentBuilder('') + .addService( + new DidCommV1Service({ + id: service.id, + serviceEndpoint: service.serviceEndpoint, + accept: service.accept, + recipientKeys: service.recipientKeys.map((recipientKey) => { + const did = DidKey.fromDid(recipientKey) + return `${did.did}#${did.key.fingerprint}` + }), + // Map did:key:xxx to actual did:key:xxx#123 + routingKeys: service.routingKeys?.map((routingKey) => { + const did = DidKey.fromDid(routingKey) + return `${did.did}#${did.key.fingerprint}` + }), + }) + ) + .build() + + const did = didDocumentToNumAlgo2Did(didDocument) + + return did +} + +export function outOfBandServiceToNumAlgo2Did(service: OutOfBandDidCommService) { + const didDocument = createPeerDidDocumentFromServices([ + { + id: service.id, + recipientKeys: service.recipientKeys.map(didKeyToInstanceOfKey), + serviceEndpoint: service.serviceEndpoint, + routingKeys: service.routingKeys?.map(didKeyToInstanceOfKey) ?? [], + }, + ]) + + const did = didDocumentToNumAlgo2Did(didDocument) + + return did +} diff --git a/packages/core/src/modules/oob/index.ts b/packages/didcomm/src/modules/oob/index.ts similarity index 100% rename from packages/core/src/modules/oob/index.ts rename to packages/didcomm/src/modules/oob/index.ts diff --git a/packages/core/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts b/packages/didcomm/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts similarity index 90% rename from packages/core/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts rename to packages/didcomm/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts index bfffcdab5b..f047fda53d 100644 --- a/packages/core/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts +++ b/packages/didcomm/src/modules/oob/messages/HandshakeReuseAcceptedMessage.ts @@ -1,5 +1,5 @@ -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface HandshakeReuseAcceptedMessageOptions { id?: string diff --git a/packages/core/src/modules/oob/messages/HandshakeReuseMessage.ts b/packages/didcomm/src/modules/oob/messages/HandshakeReuseMessage.ts similarity index 89% rename from packages/core/src/modules/oob/messages/HandshakeReuseMessage.ts rename to packages/didcomm/src/modules/oob/messages/HandshakeReuseMessage.ts index c70e8b2832..54305e5095 100644 --- a/packages/core/src/modules/oob/messages/HandshakeReuseMessage.ts +++ b/packages/didcomm/src/modules/oob/messages/HandshakeReuseMessage.ts @@ -1,5 +1,5 @@ -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface HandshakeReuseMessageOptions { id?: string diff --git a/packages/core/src/modules/oob/messages/OutOfBandInvitation.ts b/packages/didcomm/src/modules/oob/messages/OutOfBandInvitation.ts similarity index 92% rename from packages/core/src/modules/oob/messages/OutOfBandInvitation.ts rename to packages/didcomm/src/modules/oob/messages/OutOfBandInvitation.ts index 6bfc021fe0..a6feed7846 100644 --- a/packages/core/src/modules/oob/messages/OutOfBandInvitation.ts +++ b/packages/didcomm/src/modules/oob/messages/OutOfBandInvitation.ts @@ -1,18 +1,15 @@ import type { PlaintextMessage } from '../../../types' +import { CredoError, JsonEncoder, JsonTransformer, IsStringOrInstance } from '@credo-ts/core' import { Exclude, Expose, Transform, TransformationType, Type } from 'class-transformer' import { ArrayNotEmpty, IsArray, IsInstance, IsOptional, IsUrl, ValidateNested } from 'class-validator' import { parseUrl } from 'query-string' -import { AgentMessage } from '../../../agent/AgentMessage' +import { AgentMessage } from '../../../AgentMessage' import { Attachment, AttachmentData } from '../../../decorators/attachment/Attachment' -import { CredoError } from '../../../error' -import { JsonEncoder } from '../../../utils/JsonEncoder' -import { JsonTransformer } from '../../../utils/JsonTransformer' -import { IsValidMessageType, parseMessageType, replaceLegacyDidSovPrefix } from '../../../utils/messageType' -import { IsStringOrInstance } from '../../../utils/validators' -import { outOfBandServiceToNumAlgo2Did } from '../../dids/methods/peer/peerDidNumAlgo2' +import { replaceLegacyDidSovPrefix, IsValidMessageType, parseMessageType } from '../../../util/messageType' import { OutOfBandDidCommService } from '../domain/OutOfBandDidCommService' +import { outOfBandServiceToNumAlgo2Did } from '../helpers' export interface OutOfBandInvitationOptions { id?: string diff --git a/packages/core/src/modules/oob/messages/index.ts b/packages/didcomm/src/modules/oob/messages/index.ts similarity index 61% rename from packages/core/src/modules/oob/messages/index.ts rename to packages/didcomm/src/modules/oob/messages/index.ts index 1849ee4f54..12288c1975 100644 --- a/packages/core/src/modules/oob/messages/index.ts +++ b/packages/didcomm/src/modules/oob/messages/index.ts @@ -1,2 +1,3 @@ export * from './OutOfBandInvitation' +export * from './HandshakeReuseAcceptedMessage' export * from './HandshakeReuseMessage' diff --git a/packages/core/src/modules/oob/repository/OutOfBandRecord.ts b/packages/didcomm/src/modules/oob/repository/OutOfBandRecord.ts similarity index 90% rename from packages/core/src/modules/oob/repository/OutOfBandRecord.ts rename to packages/didcomm/src/modules/oob/repository/OutOfBandRecord.ts index 1832996478..07141ee695 100644 --- a/packages/core/src/modules/oob/repository/OutOfBandRecord.ts +++ b/packages/didcomm/src/modules/oob/repository/OutOfBandRecord.ts @@ -1,14 +1,12 @@ import type { OutOfBandRecordMetadata } from './outOfBandRecordMetadataTypes' -import type { TagsBase } from '../../../storage/BaseRecord' import type { OutOfBandRole } from '../domain/OutOfBandRole' import type { OutOfBandState } from '../domain/OutOfBandState' +import type { TagsBase } from '@credo-ts/core' +import { CredoError, BaseRecord, utils } from '@credo-ts/core' import { Type } from 'class-transformer' -import { CredoError } from '../../../error' -import { BaseRecord } from '../../../storage/BaseRecord' -import { getThreadIdFromPlainTextMessage } from '../../../utils/thread' -import { uuid } from '../../../utils/uuid' +import { getThreadIdFromPlainTextMessage } from '../../../util/thread' import { OutOfBandInvitation } from '../messages' type DefaultOutOfBandRecordTags = { @@ -65,7 +63,7 @@ export class OutOfBandRecord extends BaseRecord< super() if (props) { - this.id = props.id ?? uuid() + this.id = props.id ?? utils.uuid() this.createdAt = props.createdAt ?? new Date() this.outOfBandInvitation = props.outOfBandInvitation this.role = props.role diff --git a/packages/core/src/modules/oob/repository/OutOfBandRepository.ts b/packages/didcomm/src/modules/oob/repository/OutOfBandRepository.ts similarity index 55% rename from packages/core/src/modules/oob/repository/OutOfBandRepository.ts rename to packages/didcomm/src/modules/oob/repository/OutOfBandRepository.ts index afe979d75a..ed409b169f 100644 --- a/packages/core/src/modules/oob/repository/OutOfBandRepository.ts +++ b/packages/didcomm/src/modules/oob/repository/OutOfBandRepository.ts @@ -1,8 +1,4 @@ -import { EventEmitter } from '../../../agent/EventEmitter' -import { InjectionSymbols } from '../../../constants' -import { inject, injectable } from '../../../plugins' -import { Repository } from '../../../storage/Repository' -import { StorageService } from '../../../storage/StorageService' +import { EventEmitter, InjectionSymbols, inject, injectable, Repository, StorageService } from '@credo-ts/core' import { OutOfBandRecord } from './OutOfBandRecord' diff --git a/packages/core/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts b/packages/didcomm/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts similarity index 97% rename from packages/core/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts rename to packages/didcomm/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts index ce83b30af0..fa99edeb61 100644 --- a/packages/core/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts +++ b/packages/didcomm/src/modules/oob/repository/__tests__/OutOfBandRecord.test.ts @@ -1,4 +1,4 @@ -import { JsonTransformer } from '../../../../utils' +import { JsonTransformer } from '../../../../../../core' import { OutOfBandDidCommService } from '../../domain/OutOfBandDidCommService' import { OutOfBandRole } from '../../domain/OutOfBandRole' import { OutOfBandState } from '../../domain/OutOfBandState' diff --git a/packages/core/src/modules/oob/repository/index.ts b/packages/didcomm/src/modules/oob/repository/index.ts similarity index 100% rename from packages/core/src/modules/oob/repository/index.ts rename to packages/didcomm/src/modules/oob/repository/index.ts diff --git a/packages/core/src/modules/oob/repository/outOfBandRecordMetadataTypes.ts b/packages/didcomm/src/modules/oob/repository/outOfBandRecordMetadataTypes.ts similarity index 100% rename from packages/core/src/modules/oob/repository/outOfBandRecordMetadataTypes.ts rename to packages/didcomm/src/modules/oob/repository/outOfBandRecordMetadataTypes.ts diff --git a/packages/core/src/modules/proofs/ProofEvents.ts b/packages/didcomm/src/modules/proofs/ProofEvents.ts similarity index 88% rename from packages/core/src/modules/proofs/ProofEvents.ts rename to packages/didcomm/src/modules/proofs/ProofEvents.ts index 86b0e7673c..0b488aceb7 100644 --- a/packages/core/src/modules/proofs/ProofEvents.ts +++ b/packages/didcomm/src/modules/proofs/ProofEvents.ts @@ -1,6 +1,6 @@ import type { ProofState } from './models/ProofState' import type { ProofExchangeRecord } from './repository' -import type { BaseEvent } from '../../agent/Events' +import type { BaseEvent } from '@credo-ts/core' export enum ProofEventTypes { ProofStateChanged = 'ProofStateChanged', diff --git a/packages/core/src/modules/proofs/ProofsApi.ts b/packages/didcomm/src/modules/proofs/ProofsApi.ts similarity index 97% rename from packages/core/src/modules/proofs/ProofsApi.ts rename to packages/didcomm/src/modules/proofs/ProofsApi.ts index 8b48972163..3dab56fcf4 100644 --- a/packages/core/src/modules/proofs/ProofsApi.ts +++ b/packages/didcomm/src/modules/proofs/ProofsApi.ts @@ -22,16 +22,14 @@ import type { import type { ProofProtocol } from './protocol/ProofProtocol' import type { ProofFormatsFromProtocols } from './protocol/ProofProtocolOptions' import type { ProofExchangeRecord } from './repository/ProofExchangeRecord' -import type { AgentMessage } from '../../agent/AgentMessage' -import type { Query, QueryOptions } from '../../storage/StorageService' +import type { Query, QueryOptions } from '@credo-ts/core' -import { injectable } from 'tsyringe' +import { AgentContext, CredoError, injectable } from '@credo-ts/core' -import { MessageSender } from '../../agent/MessageSender' -import { AgentContext } from '../../agent/context/AgentContext' -import { getOutboundMessageContext } from '../../agent/getOutboundMessageContext' -import { CredoError } from '../../error' -import { ConnectionService } from '../connections/services/ConnectionService' +import { AgentMessage } from '../../AgentMessage' +import { MessageSender } from '../../MessageSender' +import { getOutboundMessageContext } from '../../getOutboundMessageContext' +import { ConnectionService } from '../connections' import { ProofsModuleConfig } from './ProofsModuleConfig' import { ProofState } from './models/ProofState' diff --git a/packages/core/src/modules/proofs/ProofsApiOptions.ts b/packages/didcomm/src/modules/proofs/ProofsApiOptions.ts similarity index 100% rename from packages/core/src/modules/proofs/ProofsApiOptions.ts rename to packages/didcomm/src/modules/proofs/ProofsApiOptions.ts diff --git a/packages/core/src/modules/proofs/ProofsModule.ts b/packages/didcomm/src/modules/proofs/ProofsModule.ts similarity index 74% rename from packages/core/src/modules/proofs/ProofsModule.ts rename to packages/didcomm/src/modules/proofs/ProofsModule.ts index 483b0ee057..8cda92d21f 100644 --- a/packages/core/src/modules/proofs/ProofsModule.ts +++ b/packages/didcomm/src/modules/proofs/ProofsModule.ts @@ -1,9 +1,9 @@ import type { ProofsModuleConfigOptions } from './ProofsModuleConfig' import type { ProofProtocol } from './protocol/ProofProtocol' -import type { FeatureRegistry } from '../../agent/FeatureRegistry' -import type { ApiModule, DependencyManager } from '../../plugins' -import type { Optional } from '../../utils' -import type { Constructor } from '../../utils/mixins' +import type { AgentContext, ApiModule, DependencyManager, Optional, Constructor } from '@credo-ts/core' + +import { FeatureRegistry } from '../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../MessageHandlerRegistry' import { ProofsApi } from './ProofsApi' import { ProofsModuleConfig } from './ProofsModuleConfig' @@ -38,15 +38,19 @@ export class ProofsModule { + const messageHandlerRegistry = agentContext.dependencyManager.resolve(MessageHandlerRegistry) + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) for (const proofProtocol of this.config.proofProtocols) { - proofProtocol.register(dependencyManager, featureRegistry) + proofProtocol.register(messageHandlerRegistry, featureRegistry) } } } diff --git a/packages/core/src/modules/proofs/ProofsModuleConfig.ts b/packages/didcomm/src/modules/proofs/ProofsModuleConfig.ts similarity index 100% rename from packages/core/src/modules/proofs/ProofsModuleConfig.ts rename to packages/didcomm/src/modules/proofs/ProofsModuleConfig.ts diff --git a/packages/core/src/modules/proofs/__tests__/ProofsModule.test.ts b/packages/didcomm/src/modules/proofs/__tests__/ProofsModule.test.ts similarity index 58% rename from packages/core/src/modules/proofs/__tests__/ProofsModule.test.ts rename to packages/didcomm/src/modules/proofs/__tests__/ProofsModule.test.ts index 6d817c07d5..456a6b20ff 100644 --- a/packages/core/src/modules/proofs/__tests__/ProofsModule.test.ts +++ b/packages/didcomm/src/modules/proofs/__tests__/ProofsModule.test.ts @@ -1,26 +1,26 @@ +import type { DependencyManager } from '../../../../../core' import type { ProofProtocol } from '../protocol/ProofProtocol' -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { DependencyManager } from '../../../plugins/DependencyManager' +import { getAgentContext } from '../../../../../core/tests' +import { FeatureRegistry } from '../../../FeatureRegistry' +import { MessageHandlerRegistry } from '../../../MessageHandlerRegistry' import { ProofsModule } from '../ProofsModule' import { ProofsModuleConfig } from '../ProofsModuleConfig' import { V2ProofProtocol } from '../protocol/v2/V2ProofProtocol' import { ProofRepository } from '../repository' -jest.mock('../../../plugins/DependencyManager') -jest.mock('../../../agent/FeatureRegistry') - -const DependencyManagerMock = DependencyManager as jest.Mock -const dependencyManager = new DependencyManagerMock() -const FeatureRegistryMock = FeatureRegistry as jest.Mock -const featureRegistry = new FeatureRegistryMock() +const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + registerContextScoped: jest.fn(), +} as unknown as DependencyManager describe('ProofsModule', () => { test('registers dependencies on the dependency manager', () => { const proofsModule = new ProofsModule({ proofProtocols: [], }) - proofsModule.register(dependencyManager, featureRegistry) + proofsModule.register(dependencyManager) expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1) expect(dependencyManager.registerInstance).toHaveBeenCalledWith(ProofsModuleConfig, proofsModule.config) @@ -35,7 +35,7 @@ describe('ProofsModule', () => { expect(proofsModule.config.proofProtocols).toEqual([expect.any(V2ProofProtocol)]) }) - test('calls register on the provided ProofProtocols', () => { + test('calls register on the provided ProofProtocols', async () => { const registerMock = jest.fn() const proofProtocol = { register: registerMock, @@ -47,9 +47,17 @@ describe('ProofsModule', () => { expect(proofsModule.config.proofProtocols).toEqual([proofProtocol]) - proofsModule.register(dependencyManager, featureRegistry) + const featureRegistry = new FeatureRegistry() + const messageHandlerRegistry = new MessageHandlerRegistry() + const agentContext = getAgentContext({ + registerInstances: [ + [MessageHandlerRegistry, messageHandlerRegistry], + [FeatureRegistry, featureRegistry], + ], + }) + await proofsModule.initialize(agentContext) expect(registerMock).toHaveBeenCalledTimes(1) - expect(registerMock).toHaveBeenCalledWith(dependencyManager, featureRegistry) + expect(registerMock).toHaveBeenCalledWith(messageHandlerRegistry, featureRegistry) }) }) diff --git a/packages/core/src/modules/proofs/__tests__/ProofsModuleConfig.test.ts b/packages/didcomm/src/modules/proofs/__tests__/ProofsModuleConfig.test.ts similarity index 100% rename from packages/core/src/modules/proofs/__tests__/ProofsModuleConfig.test.ts rename to packages/didcomm/src/modules/proofs/__tests__/ProofsModuleConfig.test.ts diff --git a/packages/core/src/modules/proofs/errors/PresentationProblemReportReason.ts b/packages/didcomm/src/modules/proofs/errors/PresentationProblemReportReason.ts similarity index 100% rename from packages/core/src/modules/proofs/errors/PresentationProblemReportReason.ts rename to packages/didcomm/src/modules/proofs/errors/PresentationProblemReportReason.ts diff --git a/packages/core/src/modules/proofs/errors/index.ts b/packages/didcomm/src/modules/proofs/errors/index.ts similarity index 100% rename from packages/core/src/modules/proofs/errors/index.ts rename to packages/didcomm/src/modules/proofs/errors/index.ts diff --git a/packages/core/src/modules/proofs/formats/ProofFormat.ts b/packages/didcomm/src/modules/proofs/formats/ProofFormat.ts similarity index 100% rename from packages/core/src/modules/proofs/formats/ProofFormat.ts rename to packages/didcomm/src/modules/proofs/formats/ProofFormat.ts diff --git a/packages/core/src/modules/proofs/formats/ProofFormatService.ts b/packages/didcomm/src/modules/proofs/formats/ProofFormatService.ts similarity index 98% rename from packages/core/src/modules/proofs/formats/ProofFormatService.ts rename to packages/didcomm/src/modules/proofs/formats/ProofFormatService.ts index f48db80624..fe5df0ec6b 100644 --- a/packages/core/src/modules/proofs/formats/ProofFormatService.ts +++ b/packages/didcomm/src/modules/proofs/formats/ProofFormatService.ts @@ -15,7 +15,7 @@ import type { ProofFormatAutoRespondRequestOptions, ProofFormatAutoRespondPresentationOptions, } from './ProofFormatServiceOptions' -import type { AgentContext } from '../../../agent' +import type { AgentContext } from '@credo-ts/core' export interface ProofFormatService { formatKey: PF['formatKey'] diff --git a/packages/core/src/modules/proofs/formats/ProofFormatServiceOptions.ts b/packages/didcomm/src/modules/proofs/formats/ProofFormatServiceOptions.ts similarity index 100% rename from packages/core/src/modules/proofs/formats/ProofFormatServiceOptions.ts rename to packages/didcomm/src/modules/proofs/formats/ProofFormatServiceOptions.ts diff --git a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts similarity index 93% rename from packages/core/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts rename to packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts index 98c5df0d4d..6a519438c1 100644 --- a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts +++ b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormat.ts @@ -1,10 +1,10 @@ +import type { ProofFormat } from '../ProofFormat' import type { DifPexInputDescriptorToCredentials, DifPexCredentialsForRequest, DifPresentationExchangeDefinitionV1, -} from '../../../dif-presentation-exchange' -import type { W3cJsonPresentation } from '../../../vc/models/presentation/W3cJsonPresentation' -import type { ProofFormat } from '../ProofFormat' + W3cJsonPresentation, +} from '@credo-ts/core' export type DifPresentationExchangeProposal = DifPresentationExchangeDefinitionV1 diff --git a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts similarity index 96% rename from packages/core/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts rename to packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts index 9010ecfcc7..a5d5719394 100644 --- a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts +++ b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.ts @@ -4,18 +4,6 @@ import type { DifPresentationExchangeProposal, DifPresentationExchangeRequest, } from './DifPresentationExchangeProofFormat' -import type { AgentContext } from '../../../../agent' -import type { JsonValue } from '../../../../types' -import type { - DifPexInputDescriptorToCredentials, - DifPresentationExchangeSubmission, -} from '../../../dif-presentation-exchange' -import type { - IAnonCredsDataIntegrityService, - W3cVerifiablePresentation, - W3cVerifyPresentationResult, -} from '../../../vc' -import type { W3cJsonPresentation } from '../../../vc/models/presentation/W3cJsonPresentation' import type { ProofFormatService } from '../ProofFormatService' import type { ProofFormatCreateProposalOptions, @@ -31,24 +19,35 @@ import type { ProofFormatAutoRespondRequestOptions, ProofFormatAutoRespondPresentationOptions, } from '../ProofFormatServiceOptions' +import type { + AgentContext, + JsonValue, + DifPexInputDescriptorToCredentials, + DifPresentationExchangeSubmission, + IAnonCredsDataIntegrityService, + W3cVerifiablePresentation, + W3cVerifyPresentationResult, + W3cJsonPresentation, +} from '@credo-ts/core' -import { Attachment, AttachmentData } from '../../../../decorators/attachment/Attachment' -import { CredoError } from '../../../../error' -import { deepEquality, JsonTransformer } from '../../../../utils' import { + CredoError, + deepEquality, + JsonTransformer, DifPresentationExchangeService, DifPresentationExchangeSubmissionLocation, -} from '../../../dif-presentation-exchange' -import { MdocDeviceResponse } from '../../../mdoc' -import { + MdocDeviceResponse, ANONCREDS_DATA_INTEGRITY_CRYPTOSUITE, AnonCredsDataIntegrityServiceSymbol, W3cCredentialService, ClaimFormat, W3cJsonLdVerifiablePresentation, W3cJwtVerifiablePresentation, -} from '../../../vc' -import { extractX509CertificatesFromJwt, X509ModuleConfig } from '../../../x509' + extractX509CertificatesFromJwt, + X509ModuleConfig, +} from '@credo-ts/core' + +import { Attachment, AttachmentData } from '../../../../decorators/attachment/Attachment' import { ProofFormatSpec } from '../../models' const PRESENTATION_EXCHANGE_PRESENTATION_PROPOSAL = 'dif/presentation-exchange/definitions@v1.0' diff --git a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts similarity index 94% rename from packages/core/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts rename to packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts index e951708d34..9a24985e1a 100644 --- a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts +++ b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/__tests__/PresentationExchangeProofFormatService.test.ts @@ -1,19 +1,22 @@ -import type { DifPresentationExchangeDefinitionV1 } from '../../../../dif-presentation-exchange' +import type { DifPresentationExchangeDefinitionV1 } from '../../../../../../../core' import type { ProofFormatService } from '../../ProofFormatService' import type { DifPresentationExchangeProofFormat } from '../DifPresentationExchangeProofFormat' import { PresentationSubmissionLocation } from '@animo-id/pex' -import { getInMemoryAgentOptions } from '../../../../../../tests' -import { Agent } from '../../../../../agent/Agent' -import { DifPresentationExchangeModule, DifPresentationExchangeService } from '../../../../dif-presentation-exchange' +import { Agent } from '../../../../../../../core/src/agent/Agent' +import { + DifPresentationExchangeModule, + DifPresentationExchangeService, +} from '../../../../../../../core/src/modules/dif-presentation-exchange' import { W3cJsonLdVerifiableCredential, W3cCredentialRecord, W3cCredentialRepository, CREDENTIALS_CONTEXT_V1_URL, W3cJsonLdVerifiablePresentation, -} from '../../../../vc' +} from '../../../../../../../core/src/modules/vc' +import { getInMemoryAgentOptions } from '../../../../../../../core/tests' import { ProofsModule } from '../../../ProofsModule' import { ProofRole, ProofState } from '../../../models' import { V2ProofProtocol } from '../../../protocol' @@ -96,6 +99,7 @@ describe('Presentation Exchange ProofFormatService', () => { getInMemoryAgentOptions( 'PresentationExchangeProofFormatService', {}, + {}, { pex: new DifPresentationExchangeModule(), proofs: new ProofsModule({ diff --git a/packages/core/src/modules/proofs/formats/dif-presentation-exchange/index.ts b/packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/index.ts similarity index 100% rename from packages/core/src/modules/proofs/formats/dif-presentation-exchange/index.ts rename to packages/didcomm/src/modules/proofs/formats/dif-presentation-exchange/index.ts diff --git a/packages/core/src/modules/proofs/formats/index.ts b/packages/didcomm/src/modules/proofs/formats/index.ts similarity index 100% rename from packages/core/src/modules/proofs/formats/index.ts rename to packages/didcomm/src/modules/proofs/formats/index.ts diff --git a/packages/core/src/modules/proofs/index.ts b/packages/didcomm/src/modules/proofs/index.ts similarity index 100% rename from packages/core/src/modules/proofs/index.ts rename to packages/didcomm/src/modules/proofs/index.ts diff --git a/packages/core/src/modules/proofs/models/ProofAutoAcceptType.ts b/packages/didcomm/src/modules/proofs/models/ProofAutoAcceptType.ts similarity index 100% rename from packages/core/src/modules/proofs/models/ProofAutoAcceptType.ts rename to packages/didcomm/src/modules/proofs/models/ProofAutoAcceptType.ts diff --git a/packages/core/src/modules/proofs/models/ProofFormatSpec.ts b/packages/didcomm/src/modules/proofs/models/ProofFormatSpec.ts similarity index 81% rename from packages/core/src/modules/proofs/models/ProofFormatSpec.ts rename to packages/didcomm/src/modules/proofs/models/ProofFormatSpec.ts index 54c0b40f73..c26b517535 100644 --- a/packages/core/src/modules/proofs/models/ProofFormatSpec.ts +++ b/packages/didcomm/src/modules/proofs/models/ProofFormatSpec.ts @@ -1,8 +1,7 @@ +import { utils } from '@credo-ts/core' import { Expose } from 'class-transformer' import { IsString } from 'class-validator' -import { uuid } from '../../../utils/uuid' - export interface ProofFormatSpecOptions { attachmentId?: string format: string @@ -11,7 +10,7 @@ export interface ProofFormatSpecOptions { export class ProofFormatSpec { public constructor(options: ProofFormatSpecOptions) { if (options) { - this.attachmentId = options.attachmentId ?? uuid() + this.attachmentId = options.attachmentId ?? utils.uuid() this.format = options.format } } diff --git a/packages/core/src/modules/proofs/models/ProofRole.ts b/packages/didcomm/src/modules/proofs/models/ProofRole.ts similarity index 100% rename from packages/core/src/modules/proofs/models/ProofRole.ts rename to packages/didcomm/src/modules/proofs/models/ProofRole.ts diff --git a/packages/core/src/modules/proofs/models/ProofState.ts b/packages/didcomm/src/modules/proofs/models/ProofState.ts similarity index 100% rename from packages/core/src/modules/proofs/models/ProofState.ts rename to packages/didcomm/src/modules/proofs/models/ProofState.ts diff --git a/packages/core/src/modules/proofs/models/__tests__/ProofState.test.ts b/packages/didcomm/src/modules/proofs/models/__tests__/ProofState.test.ts similarity index 100% rename from packages/core/src/modules/proofs/models/__tests__/ProofState.test.ts rename to packages/didcomm/src/modules/proofs/models/__tests__/ProofState.test.ts diff --git a/packages/core/src/modules/proofs/models/index.ts b/packages/didcomm/src/modules/proofs/models/index.ts similarity index 100% rename from packages/core/src/modules/proofs/models/index.ts rename to packages/didcomm/src/modules/proofs/models/index.ts diff --git a/packages/core/src/modules/proofs/protocol/BaseProofProtocol.ts b/packages/didcomm/src/modules/proofs/protocol/BaseProofProtocol.ts similarity index 93% rename from packages/core/src/modules/proofs/protocol/BaseProofProtocol.ts rename to packages/didcomm/src/modules/proofs/protocol/BaseProofProtocol.ts index 0dbc8c206b..1514a35b73 100644 --- a/packages/core/src/modules/proofs/protocol/BaseProofProtocol.ts +++ b/packages/didcomm/src/modules/proofs/protocol/BaseProofProtocol.ts @@ -16,20 +16,20 @@ import type { SelectCredentialsForRequestOptions, SelectCredentialsForRequestReturn, } from './ProofProtocolOptions' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../agent/FeatureRegistry' -import type { AgentContext } from '../../../agent/context/AgentContext' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../plugins' -import type { Query, QueryOptions } from '../../../storage/StorageService' -import type { ProblemReportMessage } from '../../problem-reports' +import type { AgentMessage } from '../../../AgentMessage' +import type { FeatureRegistry } from '../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../MessageHandlerRegistry' +import type { ProblemReportMessage } from '../../../messages' +import type { InboundMessageContext } from '../../../models' import type { ProofStateChangedEvent } from '../ProofEvents' import type { ExtractProofFormats, ProofFormatService } from '../formats' import type { ProofRole } from '../models' import type { ProofExchangeRecord } from '../repository' +import type { AgentContext, Query, QueryOptions } from '@credo-ts/core' -import { EventEmitter } from '../../../agent/EventEmitter' -import { DidCommMessageRepository } from '../../../storage/didcomm' +import { EventEmitter } from '@credo-ts/core' + +import { DidCommMessageRepository } from '../../../repository' import { ConnectionService } from '../../connections' import { ProofEventTypes } from '../ProofEvents' import { ProofState } from '../models/ProofState' @@ -40,7 +40,7 @@ export abstract class BaseProofProtocol { readonly version: string @@ -124,5 +123,5 @@ export interface ProofProtocol update(agentContext: AgentContext, proofRecord: ProofExchangeRecord): Promise - register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry): void + register(messageHandlerRegistry: MessageHandlerRegistry, featureRegistry: FeatureRegistry): void } diff --git a/packages/core/src/modules/proofs/protocol/ProofProtocolOptions.ts b/packages/didcomm/src/modules/proofs/protocol/ProofProtocolOptions.ts similarity index 98% rename from packages/core/src/modules/proofs/protocol/ProofProtocolOptions.ts rename to packages/didcomm/src/modules/proofs/protocol/ProofProtocolOptions.ts index e1860bfe07..e73e7242e4 100644 --- a/packages/core/src/modules/proofs/protocol/ProofProtocolOptions.ts +++ b/packages/didcomm/src/modules/proofs/protocol/ProofProtocolOptions.ts @@ -1,5 +1,5 @@ import type { ProofProtocol } from './ProofProtocol' -import type { AgentMessage } from '../../../agent/AgentMessage' +import type { AgentMessage } from '../../../AgentMessage' import type { ConnectionRecord } from '../../connections' import type { ExtractProofFormats, diff --git a/packages/core/src/modules/proofs/protocol/index.ts b/packages/didcomm/src/modules/proofs/protocol/index.ts similarity index 100% rename from packages/core/src/modules/proofs/protocol/index.ts rename to packages/didcomm/src/modules/proofs/protocol/index.ts diff --git a/packages/core/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts b/packages/didcomm/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts similarity index 99% rename from packages/core/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts index abeb1463cc..de71fb6a3c 100644 --- a/packages/core/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/ProofFormatCoordinator.ts @@ -1,4 +1,3 @@ -import type { AgentContext } from '../../../../agent' import type { Attachment } from '../../../../decorators/attachment/Attachment' import type { ExtractProofFormats, @@ -8,9 +7,11 @@ import type { } from '../../formats' import type { ProofFormatSpec } from '../../models/ProofFormatSpec' import type { ProofExchangeRecord } from '../../repository' +import type { AgentContext } from '@credo-ts/core' -import { CredoError } from '../../../../error' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../../storage/didcomm' +import { CredoError } from '@credo-ts/core' + +import { DidCommMessageRepository, DidCommMessageRole } from '../../../../repository' import { V2PresentationMessage, V2ProposePresentationMessage, V2RequestPresentationMessage } from './messages' diff --git a/packages/core/src/modules/proofs/protocol/v2/V2ProofProtocol.ts b/packages/didcomm/src/modules/proofs/protocol/v2/V2ProofProtocol.ts similarity index 98% rename from packages/core/src/modules/proofs/protocol/v2/V2ProofProtocol.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/V2ProofProtocol.ts index bc48bd8da7..b5d827871e 100644 --- a/packages/core/src/modules/proofs/protocol/v2/V2ProofProtocol.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/V2ProofProtocol.ts @@ -1,9 +1,8 @@ -import type { AgentContext } from '../../../../agent' -import type { AgentMessage } from '../../../../agent/AgentMessage' -import type { FeatureRegistry } from '../../../../agent/FeatureRegistry' -import type { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' -import type { DependencyManager } from '../../../../plugins' -import type { ProblemReportMessage } from '../../../problem-reports' +import type { AgentMessage } from '../../../../AgentMessage' +import type { FeatureRegistry } from '../../../../FeatureRegistry' +import type { MessageHandlerRegistry } from '../../../../MessageHandlerRegistry' +import type { ProblemReportMessage } from '../../../../messages' +import type { InboundMessageContext } from '../../../../models' import type { ExtractProofFormats, ProofFormat, @@ -30,12 +29,13 @@ import type { SelectCredentialsForRequestOptions, SelectCredentialsForRequestReturn, } from '../ProofProtocolOptions' +import type { AgentContext } from '@credo-ts/core' -import { Protocol } from '../../../../agent/models' -import { CredoError } from '../../../../error' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../../storage/didcomm' -import { uuid } from '../../../../utils/uuid' -import { AckStatus } from '../../../common' +import { CredoError, utils } from '@credo-ts/core' + +import { AckStatus } from '../../../../messages' +import { Protocol } from '../../../../models' +import { DidCommMessageRepository, DidCommMessageRole } from '../../../../repository' import { ConnectionService } from '../../../connections' import { ProofsModuleConfig } from '../../ProofsModuleConfig' import { PresentationProblemReportReason } from '../../errors/PresentationProblemReportReason' @@ -78,9 +78,9 @@ export class V2ProofProtocol diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/fixtures.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/fixtures.ts similarity index 100% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/fixtures.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/fixtures.ts diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts similarity index 91% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts index ffa3a81421..aba420ef0a 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-anoncreds-unqualified-proofs.e2e.test.ts @@ -1,15 +1,14 @@ import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { isUnqualifiedCredentialDefinitionId } from '../../../../../../../anoncreds/src/utils/indyIdentifiers' import { issueLegacyAnonCredsCredential, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForProofExchangeRecord } from '../../../../../../tests' -import testLogger from '../../../../../../tests/logger' -import { Attachment, AttachmentData } from '../../../../../decorators/attachment/Attachment' -import { LinkedAttachment } from '../../../../../utils/LinkedAttachment' +import { waitForProofExchangeRecord } from '../../../../../../../core/tests' +import testLogger from '../../../../../../../core/tests/logger' +import { Attachment, AttachmentData, LinkedAttachment } from '../../../../../../../didcomm' import { ProofState } from '../../../models' import { ProofExchangeRecord } from '../../../repository' import { V2ProposePresentationMessage, V2RequestPresentationMessage, V2PresentationMessage } from '../messages' @@ -96,7 +95,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -126,7 +125,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for a presentation proposal from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -159,7 +158,7 @@ describe('Present Proof', () => { // Faber accepts the presentation proposal from Alice testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -167,7 +166,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -194,7 +193,7 @@ describe('Present Proof', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -203,7 +202,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: requestedCredentials.proofFormats.anoncreds }, }) @@ -212,7 +211,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -249,7 +248,7 @@ describe('Present Proof', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') @@ -274,15 +273,15 @@ describe('Present Proof', () => { state: ProofState.Done, }) - const proposalMessage = await aliceAgent.proofs.findProposalMessage(aliceProofExchangeRecord.id) - const requestMessage = await aliceAgent.proofs.findRequestMessage(aliceProofExchangeRecord.id) - const presentationMessage = await aliceAgent.proofs.findPresentationMessage(aliceProofExchangeRecord.id) + const proposalMessage = await aliceAgent.modules.proofs.findProposalMessage(aliceProofExchangeRecord.id) + const requestMessage = await aliceAgent.modules.proofs.findRequestMessage(aliceProofExchangeRecord.id) + const presentationMessage = await aliceAgent.modules.proofs.findPresentationMessage(aliceProofExchangeRecord.id) expect(proposalMessage).toBeInstanceOf(V2ProposePresentationMessage) expect(requestMessage).toBeInstanceOf(V2RequestPresentationMessage) expect(presentationMessage).toBeInstanceOf(V2PresentationMessage) - const formatData = await aliceAgent.proofs.getFormatData(aliceProofExchangeRecord.id) + const formatData = await aliceAgent.modules.proofs.getFormatData(aliceProofExchangeRecord.id) expect(formatData).toMatchObject({ proposal: { @@ -371,7 +370,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -416,7 +415,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -447,7 +446,7 @@ describe('Present Proof', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -456,7 +455,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { anoncreds: requestedCredentials.proofFormats.anoncreds }, }) @@ -465,7 +464,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -502,7 +501,7 @@ describe('Present Proof', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') @@ -535,7 +534,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -568,7 +567,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const retrievedCredentials = await aliceAgent.proofs.getCredentialsForRequest({ + const retrievedCredentials = await aliceAgent.modules.proofs.getCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -631,7 +630,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -658,7 +657,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const retrievedCredentials = await aliceAgent.proofs.getCredentialsForRequest({ + const retrievedCredentials = await aliceAgent.modules.proofs.getCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -702,7 +701,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -747,7 +746,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const retrievedCredentials = await aliceAgent.proofs.getCredentialsForRequest({ + const retrievedCredentials = await aliceAgent.modules.proofs.getCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -833,7 +832,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -878,7 +877,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', @@ -912,7 +911,7 @@ describe('Present Proof', () => { state: ProofState.Abandoned, }) - aliceProofExchangeRecord = await aliceAgent.proofs.sendProblemReport({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.sendProblemReport({ description: 'Problem inside proof request', proofRecordId: aliceProofExchangeRecord.id, }) diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts similarity index 83% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts index 4fecad52ea..084a09f7a3 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-connectionless-proofs.e2e.test.ts @@ -12,6 +12,8 @@ import { prepareForAnonCredsIssuance, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' +import { Agent } from '../../../../../../../core' +import { uuid } from '../../../../../../../core/src/utils/uuid' import { waitForProofExchangeRecordSubject, makeConnection, @@ -19,16 +21,21 @@ import { setupEventReplaySubjects, waitForProofExchangeRecord, getInMemoryAgentOptions, -} from '../../../../../../tests' -import { Agent } from '../../../../../agent/Agent' -import { Attachment, AttachmentData } from '../../../../../decorators/attachment/Attachment' -import { LinkedAttachment } from '../../../../../utils/LinkedAttachment' -import { uuid } from '../../../../../utils/uuid' -import { HandshakeProtocol } from '../../../../connections' -import { CredentialEventTypes } from '../../../../credentials' -import { MediatorModule, MediatorPickupStrategy, MediationRecipientModule } from '../../../../routing' -import { ProofEventTypes } from '../../../ProofEvents' -import { AutoAcceptProof, ProofState } from '../../../models' +} from '../../../../../../../core/tests' +import { + Attachment, + AttachmentData, + AutoAcceptProof, + CredentialEventTypes, + HandshakeProtocol, + LinkedAttachment, + MediationRecipientModule, + MediatorModule, + MediatorPickupStrategy, + MessageReceiver, + ProofEventTypes, + ProofState, +} from '../../../../../../src' describe('V2 Connectionless Proofs - Indy', () => { let agents: Agent[] @@ -80,7 +87,7 @@ describe('V2 Connectionless Proofs - Indy', () => { testLogger.test('Faber sends presentation request to Alice') // eslint-disable-next-line prefer-const - let { proofRecord: faberProofExchangeRecord, message } = await faberAgent.proofs.createRequest({ + let { proofRecord: faberProofExchangeRecord, message } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v2', proofFormats: { indy: { @@ -112,13 +119,13 @@ describe('V2 Connectionless Proofs - Indy', () => { }, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'https://a-domain.com', }) - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) testLogger.test('Alice waits for presentation request from Faber') let aliceProofExchangeRecord = await waitForProofExchangeRecordSubject(aliceReplay, { @@ -126,11 +133,11 @@ describe('V2 Connectionless Proofs - Indy', () => { }) testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - aliceProofExchangeRecord = await aliceAgent.proofs.acceptRequest({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, useReturnRoute: returnRoute, proofFormats: { indy: requestedCredentials.proofFormats.indy }, @@ -142,13 +149,13 @@ describe('V2 Connectionless Proofs - Indy', () => { state: ProofState.PresentationReceived, }) - const sentPresentationMessage = aliceAgent.proofs.findPresentationMessage(aliceProofExchangeRecord.id) + const sentPresentationMessage = aliceAgent.modules.proofs.findPresentationMessage(aliceProofExchangeRecord.id) // assert presentation is valid expect(faberProofExchangeRecord.isVerified).toBe(true) // Faber accepts presentation - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until it receives presentation ack aliceProofExchangeRecord = await waitForProofExchangeRecordSubject(aliceReplay, { @@ -203,7 +210,7 @@ describe('V2 Connectionless Proofs - Indy', () => { agents = [aliceAgent, faberAgent] // eslint-disable-next-line prefer-const - let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.proofs.createRequest({ + let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v2', proofFormats: { indy: { @@ -236,13 +243,13 @@ describe('V2 Connectionless Proofs - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'https://a-domain.com', }) - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Done, @@ -270,6 +277,7 @@ describe('V2 Connectionless Proofs - Indy', () => { { endpoints: ['rxjs:mediator'], }, + {}, { ...getAnonCredsIndyModules({ autoAcceptProofs: AutoAcceptProof.Always, @@ -285,16 +293,16 @@ describe('V2 Connectionless Proofs - Indy', () => { // Initialize mediator const mediatorAgent = new Agent(mediatorOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() - const faberMediationOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const faberMediationOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'faber invitation', handshakeProtocols: [HandshakeProtocol.Connections], }) - const aliceMediationOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const aliceMediationOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'alice invitation', handshakeProtocols: [HandshakeProtocol.Connections], }) @@ -302,6 +310,7 @@ describe('V2 Connectionless Proofs - Indy', () => { const faberOptions = getInMemoryAgentOptions( `Connectionless proofs with mediator Faber-${unique}`, {}, + {}, { ...getAnonCredsIndyModules({ autoAcceptProofs: AutoAcceptProof.Always, @@ -318,6 +327,7 @@ describe('V2 Connectionless Proofs - Indy', () => { const aliceOptions = getInMemoryAgentOptions( `Connectionless proofs with mediator Alice-${unique}`, {}, + {}, { ...getAnonCredsIndyModules({ autoAcceptProofs: AutoAcceptProof.Always, @@ -332,12 +342,14 @@ describe('V2 Connectionless Proofs - Indy', () => { ) const faberAgent = new Agent(faberOptions) - faberAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + faberAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await faberAgent.initialize() + await faberAgent.modules.mediationRecipient.initialize() const aliceAgent = new Agent(aliceOptions) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() + await aliceAgent.modules.mediationRecipient.initialize() const [faberReplay, aliceReplay] = setupEventReplaySubjects( [faberAgent, aliceAgent], @@ -381,7 +393,7 @@ describe('V2 Connectionless Proofs - Indy', () => { }) // eslint-disable-next-line prefer-const - let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.proofs.createRequest({ + let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v2', proofFormats: { indy: { @@ -414,13 +426,13 @@ describe('V2 Connectionless Proofs - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'https://a-domain.com', }) - const mediationRecord = await faberAgent.mediationRecipient.findDefaultMediator() + const mediationRecord = await faberAgent.modules.mediationRecipient.findDefaultMediator() if (!mediationRecord) throw new Error('Faber agent has no default mediator') expect(requestMessage).toMatchObject({ @@ -431,7 +443,7 @@ describe('V2 Connectionless Proofs - Indy', () => { }, }) - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Done, @@ -485,7 +497,7 @@ describe('V2 Connectionless Proofs - Indy', () => { agents = [aliceAgent, faberAgent] // eslint-disable-next-line prefer-const - let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.proofs.createRequest({ + let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v2', proofFormats: { indy: { @@ -518,17 +530,17 @@ describe('V2 Connectionless Proofs - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'rxjs:faber', }) - for (const transport of faberAgent.outboundTransports) { - await faberAgent.unregisterOutboundTransport(transport) + for (const transport of faberAgent.modules.didcomm.outboundTransports) { + await faberAgent.modules.didcomm.unregisterOutboundTransport(transport) } - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Done, threadId: requestMessage.threadId, @@ -582,7 +594,7 @@ describe('V2 Connectionless Proofs - Indy', () => { // eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const - let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.proofs.createRequest({ + let { message, proofRecord: faberProofExchangeRecord } = await faberAgent.modules.proofs.createRequest({ protocolVersion: 'v2', proofFormats: { indy: { @@ -604,24 +616,27 @@ describe('V2 Connectionless Proofs - Indy', () => { autoAcceptProof: AutoAcceptProof.ContentApproved, }) - const { message: requestMessage } = await faberAgent.oob.createLegacyConnectionlessInvitation({ + const { message: requestMessage } = await faberAgent.modules.oob.createLegacyConnectionlessInvitation({ recordId: faberProofExchangeRecord.id, message, domain: 'rxjs:faber', }) - for (const transport of faberAgent.outboundTransports) { - await faberAgent.unregisterOutboundTransport(transport) + for (const transport of faberAgent.modules.didcomm.outboundTransports) { + await faberAgent.modules.didcomm.unregisterOutboundTransport(transport) } const aliceProofExchangeRecordPromise = waitForProofExchangeRecord(aliceAgent, { state: ProofState.RequestReceived, }) - await aliceAgent.receiveMessage(requestMessage.toJSON()) + await aliceAgent.dependencyManager.resolve(MessageReceiver).receiveMessage(requestMessage.toJSON()) const aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - await aliceAgent.proofs.declineRequest({ proofRecordId: aliceProofExchangeRecord.id, sendProblemReport: true }) + await aliceAgent.modules.proofs.declineRequest({ + proofRecordId: aliceProofExchangeRecord.id, + sendProblemReport: true, + }) await waitForProofExchangeRecordSubject(aliceReplay, { state: ProofState.Declined, diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts similarity index 90% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts index 6bed06c5ab..5b91217896 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-negotiation.e2e.test.ts @@ -1,6 +1,6 @@ import type { AnonCredsProofRequest } from '../../../../../../../anoncreds/src/models/exchange' import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import type { V2ProposePresentationMessage, V2RequestPresentationMessage } from '../messages' import { AnonCredsProofRequest as AnonCredsProofRequestClass } from '../../../../../../../anoncreds/src/models/AnonCredsProofRequest' @@ -8,8 +8,8 @@ import { issueLegacyAnonCredsCredential, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForProofExchangeRecordSubject, testLogger } from '../../../../../../tests' -import { JsonTransformer } from '../../../../../utils/JsonTransformer' +import { JsonTransformer } from '../../../../../../../core/src/utils/JsonTransformer' +import { waitForProofExchangeRecordSubject, testLogger } from '../../../../../../../core/tests' import { ProofState } from '../../../models/ProofState' describe('V2 Proofs Negotiation - Indy', () => { @@ -71,7 +71,7 @@ describe('V2 Proofs Negotiation - Indy', () => { test(`Proof negotiation between Alice and Faber`, async () => { testLogger.test('Alice sends proof proposal to Faber') - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -98,7 +98,7 @@ describe('V2 Proofs Negotiation - Indy', () => { threadId: aliceProofExchangeRecord.threadId, }) - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -148,7 +148,7 @@ describe('V2 Proofs Negotiation - Indy', () => { }) testLogger.test('Faber sends new proof request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.negotiateProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.negotiateProposal({ proofRecordId: faberProofExchangeRecord.id, proofFormats: { indy: { @@ -186,7 +186,7 @@ describe('V2 Proofs Negotiation - Indy', () => { state: ProofState.RequestReceived, }) - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', id: expect.any(String), @@ -212,7 +212,7 @@ describe('V2 Proofs Negotiation - Indy', () => { testLogger.test('Alice sends proof proposal to Faber') - aliceProofExchangeRecord = await aliceAgent.proofs.negotiateRequest({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.negotiateRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: { @@ -240,7 +240,7 @@ describe('V2 Proofs Negotiation - Indy', () => { count: 2, }) - const proposal2 = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal2 = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal2).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -289,7 +289,7 @@ describe('V2 Proofs Negotiation - Indy', () => { // Accept Proposal testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -301,7 +301,7 @@ describe('V2 Proofs Negotiation - Indy', () => { count: 2, }) - const request2 = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request2 = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request2).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -331,7 +331,7 @@ describe('V2 Proofs Negotiation - Indy', () => { protocolVersion: 'v2', }) - const proposalMessage = await aliceAgent.proofs.findProposalMessage(aliceProofExchangeRecord.id) + const proposalMessage = await aliceAgent.modules.proofs.findProposalMessage(aliceProofExchangeRecord.id) expect(proposalMessage).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -372,7 +372,7 @@ describe('V2 Proofs Negotiation - Indy', () => { }, }) - const proofRequestMessage = (await aliceAgent.proofs.findRequestMessage( + const proofRequestMessage = (await aliceAgent.modules.proofs.findRequestMessage( aliceProofExchangeRecord.id )) as V2RequestPresentationMessage diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts similarity index 89% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts index ee4d3cd44b..79734d73bb 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-presentation.e2e.test.ts @@ -1,11 +1,11 @@ import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { setupAnonCredsTests, issueLegacyAnonCredsCredential, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForProofExchangeRecordSubject, testLogger } from '../../../../../../tests' +import { waitForProofExchangeRecordSubject, testLogger } from '../../../../../../../core/tests' import { ProofState } from '../../../models/ProofState' import { ProofExchangeRecord } from '../../../repository/ProofExchangeRecord' @@ -68,7 +68,7 @@ describe('V2 Proofs - Indy', () => { test(`Alice Creates and sends Proof Proposal to Faber`, async () => { testLogger.test('Alice sends proof proposal to Faber') - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -100,7 +100,7 @@ describe('V2 Proofs - Indy', () => { state: ProofState.ProposalReceived, }) - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -130,7 +130,7 @@ describe('V2 Proofs - Indy', () => { // Accept Proposal testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -140,7 +140,7 @@ describe('V2 Proofs - Indy', () => { state: ProofState.RequestReceived, }) - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -173,11 +173,11 @@ describe('V2 Proofs - Indy', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: requestedCredentials.proofFormats.indy }, }) @@ -190,7 +190,7 @@ describe('V2 Proofs - Indy', () => { // Faber waits for the presentation from Alice testLogger.test('Faber waits for presentation from Alice') - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -227,7 +227,7 @@ describe('V2 Proofs - Indy', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts similarity index 89% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts index afe41e9417..b771066b73 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proof-request.e2e.test.ts @@ -1,12 +1,12 @@ import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { issueLegacyAnonCredsCredential, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForProofExchangeRecordSubject } from '../../../../../../tests' -import testLogger from '../../../../../../tests/logger' +import { waitForProofExchangeRecordSubject } from '../../../../../../../core/tests' +import testLogger from '../../../../../../../core/tests/logger' import { ProofState } from '../../../models/ProofState' describe('V2 Proofs - Indy', () => { @@ -68,7 +68,7 @@ describe('V2 Proofs - Indy', () => { test(`Alice Creates and sends Proof Proposal to Faber`, async () => { testLogger.test('Alice sends proof proposal to Faber') - let aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + let aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -100,7 +100,7 @@ describe('V2 Proofs - Indy', () => { state: ProofState.ProposalReceived, }) - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -130,7 +130,7 @@ describe('V2 Proofs - Indy', () => { // Accept Proposal testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -140,7 +140,7 @@ describe('V2 Proofs - Indy', () => { state: ProofState.RequestReceived, }) - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts similarity index 95% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts index 06ddf5cc34..63f4a40c07 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs-auto-accept.e2e.test.ts @@ -1,11 +1,11 @@ import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { issueLegacyAnonCredsCredential, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForProofExchangeRecord, testLogger } from '../../../../../../tests' +import { waitForProofExchangeRecord, testLogger } from '../../../../../../../core/tests' import { AutoAcceptProof, ProofState } from '../../../models' describe('Auto accept present proof', () => { @@ -66,7 +66,7 @@ describe('Auto accept present proof', () => { test("Alice starts with proof proposal to Faber, both with autoAcceptProof on 'always'", async () => { testLogger.test('Alice sends presentation proposal to Faber') - await aliceAgent.proofs.proposeProof({ + await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -103,7 +103,7 @@ describe('Auto accept present proof', () => { test("Faber starts with proof requests to Alice, both with autoAcceptProof on 'always'", async () => { testLogger.test('Faber sends presentation request to Alice') - await faberAgent.proofs.requestProof({ + await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -200,7 +200,7 @@ describe('Auto accept present proof', () => { state: ProofState.ProposalReceived, }) - await aliceAgent.proofs.proposeProof({ + await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -227,7 +227,7 @@ describe('Auto accept present proof', () => { }) const faberProofExchangeRecord = await faberProofExchangeRecordPromise - await faberAgent.proofs.acceptProposal({ + await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -244,7 +244,7 @@ describe('Auto accept present proof', () => { state: ProofState.RequestReceived, }) - await faberAgent.proofs.requestProof({ + await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -278,7 +278,7 @@ describe('Auto accept present proof', () => { }) const aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, }) diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts similarity index 90% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts index f2eada74a6..0bc9551ab4 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-indy-proofs.e2e.test.ts @@ -1,14 +1,13 @@ import type { AnonCredsTestsAgent } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import type { EventReplaySubject } from '../../../../../../tests' +import type { EventReplaySubject } from '../../../../../../../core/tests' import { issueLegacyAnonCredsCredential, setupAnonCredsTests, } from '../../../../../../../anoncreds/tests/legacyAnonCredsSetup' -import { waitForProofExchangeRecord } from '../../../../../../tests' -import testLogger from '../../../../../../tests/logger' -import { Attachment, AttachmentData } from '../../../../../decorators/attachment/Attachment' -import { LinkedAttachment } from '../../../../../utils/LinkedAttachment' +import { waitForProofExchangeRecord } from '../../../../../../../core/tests' +import testLogger from '../../../../../../../core/tests/logger' +import { Attachment, AttachmentData, LinkedAttachment } from '../../../../../../../didcomm' import { ProofState } from '../../../models' import { ProofExchangeRecord } from '../../../repository' import { V2ProposePresentationMessage, V2RequestPresentationMessage, V2PresentationMessage } from '../messages' @@ -95,7 +94,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - aliceProofExchangeRecord = await aliceAgent.proofs.proposeProof({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.proposeProof({ connectionId: aliceConnectionId, protocolVersion: 'v2', proofFormats: { @@ -125,7 +124,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for a presentation proposal from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const proposal = await faberAgent.proofs.findProposalMessage(faberProofExchangeRecord.id) + const proposal = await faberAgent.modules.proofs.findProposalMessage(faberProofExchangeRecord.id) expect(proposal).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/propose-presentation', formats: [ @@ -158,7 +157,7 @@ describe('Present Proof', () => { // Faber accepts the presentation proposal from Alice testLogger.test('Faber accepts presentation proposal from Alice') - faberProofExchangeRecord = await faberAgent.proofs.acceptProposal({ + faberProofExchangeRecord = await faberAgent.modules.proofs.acceptProposal({ proofRecordId: faberProofExchangeRecord.id, }) @@ -166,7 +165,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -193,7 +192,7 @@ describe('Present Proof', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -202,7 +201,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: requestedCredentials.proofFormats.indy }, }) @@ -211,7 +210,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -248,7 +247,7 @@ describe('Present Proof', () => { // Faber accepts the presentation provided by Alice testLogger.test('Faber accepts the presentation provided by Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she received a presentation acknowledgement testLogger.test('Alice waits until she receives a presentation acknowledgement') @@ -273,15 +272,15 @@ describe('Present Proof', () => { state: ProofState.Done, }) - const proposalMessage = await aliceAgent.proofs.findProposalMessage(aliceProofExchangeRecord.id) - const requestMessage = await aliceAgent.proofs.findRequestMessage(aliceProofExchangeRecord.id) - const presentationMessage = await aliceAgent.proofs.findPresentationMessage(aliceProofExchangeRecord.id) + const proposalMessage = await aliceAgent.modules.proofs.findProposalMessage(aliceProofExchangeRecord.id) + const requestMessage = await aliceAgent.modules.proofs.findRequestMessage(aliceProofExchangeRecord.id) + const presentationMessage = await aliceAgent.modules.proofs.findPresentationMessage(aliceProofExchangeRecord.id) expect(proposalMessage).toBeInstanceOf(V2ProposePresentationMessage) expect(requestMessage).toBeInstanceOf(V2RequestPresentationMessage) expect(presentationMessage).toBeInstanceOf(V2PresentationMessage) - const formatData = await aliceAgent.proofs.getFormatData(aliceProofExchangeRecord.id) + const formatData = await aliceAgent.modules.proofs.getFormatData(aliceProofExchangeRecord.id) expect(formatData).toMatchObject({ proposal: { @@ -370,7 +369,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -415,7 +414,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', formats: [ @@ -446,7 +445,7 @@ describe('Present Proof', () => { // Alice retrieves the requested credentials and accepts the presentation request testLogger.test('Alice accepts presentation request from Faber') - const requestedCredentials = await aliceAgent.proofs.selectCredentialsForRequest({ + const requestedCredentials = await aliceAgent.modules.proofs.selectCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -455,7 +454,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await aliceAgent.proofs.acceptRequest({ + await aliceAgent.modules.proofs.acceptRequest({ proofRecordId: aliceProofExchangeRecord.id, proofFormats: { indy: requestedCredentials.proofFormats.indy }, }) @@ -464,7 +463,7 @@ describe('Present Proof', () => { testLogger.test('Faber waits for presentation from Alice') faberProofExchangeRecord = await faberProofExchangeRecordPromise - const presentation = await faberAgent.proofs.findPresentationMessage(faberProofExchangeRecord.id) + const presentation = await faberAgent.modules.proofs.findPresentationMessage(faberProofExchangeRecord.id) expect(presentation).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/presentation', formats: [ @@ -501,7 +500,7 @@ describe('Present Proof', () => { // Faber accepts the presentation testLogger.test('Faber accept the presentation from Alice') - await faberAgent.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) + await faberAgent.modules.proofs.acceptPresentation({ proofRecordId: faberProofExchangeRecord.id }) // Alice waits until she receives a presentation acknowledgement testLogger.test('Alice waits for acceptance by Faber') @@ -534,7 +533,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -579,7 +578,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const retrievedCredentials = await aliceAgent.proofs.getCredentialsForRequest({ + const retrievedCredentials = await aliceAgent.modules.proofs.getCredentialsForRequest({ proofRecordId: aliceProofExchangeRecord.id, }) @@ -658,7 +657,7 @@ describe('Present Proof', () => { // Faber sends a presentation request to Alice testLogger.test('Faber sends a presentation request to Alice') - faberProofExchangeRecord = await faberAgent.proofs.requestProof({ + faberProofExchangeRecord = await faberAgent.modules.proofs.requestProof({ protocolVersion: 'v2', connectionId: faberConnectionId, proofFormats: { @@ -703,7 +702,7 @@ describe('Present Proof', () => { testLogger.test('Alice waits for presentation request from Faber') aliceProofExchangeRecord = await aliceProofExchangeRecordPromise - const request = await faberAgent.proofs.findRequestMessage(faberProofExchangeRecord.id) + const request = await faberAgent.modules.proofs.findRequestMessage(faberProofExchangeRecord.id) expect(request).toMatchObject({ type: 'https://didcomm.org/present-proof/2.0/request-presentation', @@ -737,7 +736,7 @@ describe('Present Proof', () => { state: ProofState.Abandoned, }) - aliceProofExchangeRecord = await aliceAgent.proofs.sendProblemReport({ + aliceProofExchangeRecord = await aliceAgent.modules.proofs.sendProblemReport({ description: 'Problem inside proof request', proofRecordId: aliceProofExchangeRecord.id, }) diff --git a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts similarity index 92% rename from packages/core/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts index fdea6b6698..ce0efec2fd 100644 --- a/packages/core/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/__tests__/v2-presentation-exchange-presentation.test.ts @@ -1,13 +1,11 @@ -import type { getJsonLdModules } from '../../../../../../tests' -import type { Agent } from '../../../../../agent/Agent' - -import { waitForCredentialRecord, setupJsonLdTests, waitForProofExchangeRecord } from '../../../../../../tests' -import testLogger from '../../../../../../tests/logger' -import { KeyType } from '../../../../../crypto' -import { DidCommMessageRepository } from '../../../../../storage' -import { TypedArrayEncoder } from '../../../../../utils' +import type { Agent } from '../../../../../../../core' +import type { getJsonLdModules } from '../../../../../../../core/tests' + +import { KeyType, TypedArrayEncoder, CREDENTIALS_CONTEXT_V1_URL } from '../../../../../../../core' +import { waitForCredentialRecord, setupJsonLdTests, waitForProofExchangeRecord } from '../../../../../../../core/tests' +import testLogger from '../../../../../../../core/tests/logger' +import { DidCommMessageRepository } from '../../../../../repository' import { AutoAcceptCredential, CredentialState } from '../../../../credentials' -import { CREDENTIALS_CONTEXT_V1_URL } from '../../../../vc' import { ProofState } from '../../../models/ProofState' import { V2PresentationMessage, V2RequestPresentationMessage } from '../messages' import { V2ProposePresentationMessage } from '../messages/V2ProposePresentationMessage' @@ -68,7 +66,7 @@ describe('Present Proof', () => { keyType: KeyType.Ed25519, }) - await issuerAgent.credentials.offerCredential({ + await issuerAgent.modules.credentials.offerCredential({ connectionId: issuerProverConnectionId, protocolVersion: 'v2', credentialFormats: { jsonld }, @@ -92,7 +90,7 @@ describe('Present Proof', () => { state: ProofState.ProposalReceived, }) - await proverAgent.proofs.proposeProof({ + await proverAgent.modules.proofs.proposeProof({ connectionId: proverVerifierConnectionId, protocolVersion: 'v2', proofFormats: { @@ -150,7 +148,7 @@ describe('Present Proof', () => { test(`Verifier accepts the Proposal send by the Prover`, async () => { testLogger.test('Prover sends proof proposal to a Verifier') - let proverProofExchangeRecord = await proverAgent.proofs.proposeProof({ + let proverProofExchangeRecord = await proverAgent.modules.proofs.proposeProof({ connectionId: proverVerifierConnectionId, protocolVersion: 'v2', proofFormats: { @@ -175,7 +173,7 @@ describe('Present Proof', () => { testLogger.test('Verifier accepts presentation proposal from the Prover') let verifierProofExchangeRecord = await verifierPresentationRecordPromise - verifierProofExchangeRecord = await verifierAgent.proofs.acceptProposal({ + verifierProofExchangeRecord = await verifierAgent.modules.proofs.acceptProposal({ proofRecordId: verifierProofExchangeRecord.id, }) @@ -233,7 +231,7 @@ describe('Present Proof', () => { test(`Prover accepts presentation request from the Verifier`, async () => { testLogger.test('Prover sends proof proposal to a Verifier') - let proverProofExchangeRecord = await proverAgent.proofs.proposeProof({ + let proverProofExchangeRecord = await proverAgent.modules.proofs.proposeProof({ connectionId: proverVerifierConnectionId, protocolVersion: 'v2', proofFormats: { @@ -258,7 +256,7 @@ describe('Present Proof', () => { testLogger.test('Verifier accepts presentation proposal from the Prover') let verifierProofExchangeRecord = await verifierProposalReceivedPresentationRecordPromise - verifierProofExchangeRecord = await verifierAgent.proofs.acceptProposal({ + verifierProofExchangeRecord = await verifierAgent.modules.proofs.acceptProposal({ proofRecordId: verifierProofExchangeRecord.id, }) @@ -273,7 +271,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await proverAgent.proofs.acceptRequest({ + await proverAgent.modules.proofs.acceptRequest({ proofRecordId: proverProofExchangeRecord.id, }) @@ -370,7 +368,7 @@ describe('Present Proof', () => { test(`Verifier accepts the presentation provided by the Prover`, async () => { testLogger.test('Prover sends proof proposal to a Verifier') - let proverProofExchangeRecord = await proverAgent.proofs.proposeProof({ + let proverProofExchangeRecord = await proverAgent.modules.proofs.proposeProof({ connectionId: proverVerifierConnectionId, protocolVersion: 'v2', proofFormats: { @@ -395,7 +393,7 @@ describe('Present Proof', () => { testLogger.test('Verifier accepts presentation proposal from the Prover') let verifierProofExchangeRecord = await verifierProposalReceivedPresentationRecordPromise - verifierProofExchangeRecord = await verifierAgent.proofs.acceptProposal({ + verifierProofExchangeRecord = await verifierAgent.modules.proofs.acceptProposal({ proofRecordId: verifierProofExchangeRecord.id, }) @@ -410,7 +408,7 @@ describe('Present Proof', () => { state: ProofState.PresentationReceived, }) - await proverAgent.proofs.acceptRequest({ + await proverAgent.modules.proofs.acceptRequest({ proofRecordId: proverProofExchangeRecord.id, }) @@ -425,7 +423,7 @@ describe('Present Proof', () => { // Verifier accepts the presentation provided by by the Prover testLogger.test('Verifier accepts the presentation provided by the Prover') - await verifierAgent.proofs.acceptPresentation({ proofRecordId: verifierProofExchangeRecord.id }) + await verifierAgent.modules.proofs.acceptPresentation({ proofRecordId: verifierProofExchangeRecord.id }) // Prover waits until she received a presentation acknowledgement testLogger.test('Prover waits until she receives a presentation acknowledgement') diff --git a/packages/core/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts b/packages/didcomm/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts similarity index 81% rename from packages/core/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts index 76fa789a6e..835e4f3fd5 100644 --- a/packages/core/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/errors/V2PresentationProblemReportError.ts @@ -1,7 +1,7 @@ -import type { ProblemReportErrorOptions } from '../../../../problem-reports' +import type { ProblemReportErrorOptions } from '../../../../../errors' import type { PresentationProblemReportReason } from '../../../errors/PresentationProblemReportReason' -import { ProblemReportError } from '../../../../problem-reports/errors/ProblemReportError' +import { ProblemReportError } from '../../../../../errors' import { V2PresentationProblemReportMessage } from '../messages' interface V2PresentationProblemReportErrorOptions extends ProblemReportErrorOptions { diff --git a/packages/core/src/modules/proofs/protocol/v2/errors/index.ts b/packages/didcomm/src/modules/proofs/protocol/v2/errors/index.ts similarity index 100% rename from packages/core/src/modules/proofs/protocol/v2/errors/index.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/errors/index.ts diff --git a/packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts similarity index 93% rename from packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts index 43b9e15a69..e45f67f70d 100644 --- a/packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationAckHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { ProofProtocol } from '../../ProofProtocol' import { V2PresentationAckMessage } from '../messages' diff --git a/packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts similarity index 92% rename from packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts index b57fc5733e..42be50f525 100644 --- a/packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationHandler.ts @@ -1,9 +1,9 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { ProofExchangeRecord } from '../../../repository' import type { V2ProofProtocol } from '../V2ProofProtocol' -import { getOutboundMessageContext } from '../../../../../agent/getOutboundMessageContext' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../../../storage/didcomm' +import { getOutboundMessageContext } from '../../../../../getOutboundMessageContext' +import { DidCommMessageRepository, DidCommMessageRole } from '../../../../../repository' import { V2PresentationMessage, V2RequestPresentationMessage } from '../messages' export class V2PresentationHandler implements MessageHandler { diff --git a/packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts similarity index 94% rename from packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts index 5d9512d824..5b86a4d11c 100644 --- a/packages/core/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2PresentationProblemReportHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { V2ProofProtocol } from '../V2ProofProtocol' import { V2PresentationProblemReportMessage } from '../messages' diff --git a/packages/core/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts similarity index 94% rename from packages/core/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts index 589ff6db3e..c75a3bb35b 100644 --- a/packages/core/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2ProposePresentationHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { ProofExchangeRecord } from '../../../repository/ProofExchangeRecord' import type { V2ProofProtocol } from '../V2ProofProtocol' -import { OutboundMessageContext } from '../../../../../agent/models' +import { OutboundMessageContext } from '../../../../../models' import { V2ProposePresentationMessage } from '../messages/V2ProposePresentationMessage' export class V2ProposePresentationHandler implements MessageHandler { diff --git a/packages/core/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts similarity index 93% rename from packages/core/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts index 394a4ff2a9..892d47d916 100644 --- a/packages/core/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/handlers/V2RequestPresentationHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../../../handlers' import type { ProofExchangeRecord } from '../../../repository/ProofExchangeRecord' import type { V2ProofProtocol } from '../V2ProofProtocol' -import { getOutboundMessageContext } from '../../../../../agent/getOutboundMessageContext' +import { getOutboundMessageContext } from '../../../../../getOutboundMessageContext' import { V2RequestPresentationMessage } from '../messages/V2RequestPresentationMessage' export class V2RequestPresentationHandler implements MessageHandler { diff --git a/packages/core/src/modules/proofs/protocol/v2/index.ts b/packages/didcomm/src/modules/proofs/protocol/v2/index.ts similarity index 100% rename from packages/core/src/modules/proofs/protocol/v2/index.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/index.ts diff --git a/packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts similarity index 78% rename from packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts index 19e602b71d..eb34a67f3d 100644 --- a/packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationAckMessage.ts @@ -1,5 +1,5 @@ -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { AckMessage } from '../../../../common/messages/AckMessage' +import { AckMessage } from '../../../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' export class V2PresentationAckMessage extends AckMessage { @IsValidMessageType(V2PresentationAckMessage.type) diff --git a/packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts similarity index 92% rename from packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts index fee3467dfc..d65a5b1578 100644 --- a/packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts @@ -1,10 +1,10 @@ +import { utils } from '@credo-ts/core' import { Expose, Type } from 'class-transformer' import { IsArray, IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { uuid } from '../../../../../utils/uuid' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { ProofFormatSpec } from '../../../models/ProofFormatSpec' export interface V2PresentationMessageOptions { @@ -24,7 +24,7 @@ export class V2PresentationMessage extends AgentMessage { if (options) { this.formats = [] this.presentationAttachments = [] - this.id = options.id ?? uuid() + this.id = options.id ?? utils.uuid() this.comment = options.comment this.goalCode = options.goalCode this.goal = options.goal diff --git a/packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts similarity index 80% rename from packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts index ed97f72319..b68386629b 100644 --- a/packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts @@ -1,5 +1,5 @@ -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { ProblemReportMessage } from '../../../../problem-reports/messages/ProblemReportMessage' +import { ProblemReportMessage } from '../../../../../messages' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' /** * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0035-report-problem/README.md diff --git a/packages/core/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts similarity index 91% rename from packages/core/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts index 1683b0ef90..3c8d24eff3 100644 --- a/packages/core/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2ProposePresentationMessage.ts @@ -1,10 +1,10 @@ +import { utils } from '@credo-ts/core' import { Expose, Type } from 'class-transformer' import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { uuid } from '../../../../../utils/uuid' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { ProofFormatSpec } from '../../../models/ProofFormatSpec' export interface V2ProposePresentationMessageOptions { @@ -23,7 +23,7 @@ export class V2ProposePresentationMessage extends AgentMessage { if (options) { this.formats = [] this.proposalAttachments = [] - this.id = options.id ?? uuid() + this.id = options.id ?? utils.uuid() this.comment = options.comment this.goalCode = options.goalCode this.goal = options.goal diff --git a/packages/core/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts similarity index 93% rename from packages/core/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts index 10f6806c38..07295ce0c0 100644 --- a/packages/core/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts +++ b/packages/didcomm/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts @@ -1,10 +1,10 @@ +import { utils } from '@credo-ts/core' import { Expose, Type } from 'class-transformer' import { IsArray, IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../../../agent/AgentMessage' +import { AgentMessage } from '../../../../../AgentMessage' import { Attachment } from '../../../../../decorators/attachment/Attachment' -import { IsValidMessageType, parseMessageType } from '../../../../../utils/messageType' -import { uuid } from '../../../../../utils/uuid' +import { IsValidMessageType, parseMessageType } from '../../../../../util/messageType' import { ProofFormatSpec } from '../../../models/ProofFormatSpec' export interface V2RequestPresentationMessageOptions { @@ -25,7 +25,7 @@ export class V2RequestPresentationMessage extends AgentMessage { if (options) { this.formats = [] this.requestAttachments = [] - this.id = options.id ?? uuid() + this.id = options.id ?? utils.uuid() this.comment = options.comment this.goal = options.goal this.goalCode = options.goalCode diff --git a/packages/core/src/modules/proofs/protocol/v2/messages/index.ts b/packages/didcomm/src/modules/proofs/protocol/v2/messages/index.ts similarity index 100% rename from packages/core/src/modules/proofs/protocol/v2/messages/index.ts rename to packages/didcomm/src/modules/proofs/protocol/v2/messages/index.ts diff --git a/packages/core/src/modules/proofs/repository/ProofExchangeRecord.ts b/packages/didcomm/src/modules/proofs/repository/ProofExchangeRecord.ts similarity index 92% rename from packages/core/src/modules/proofs/repository/ProofExchangeRecord.ts rename to packages/didcomm/src/modules/proofs/repository/ProofExchangeRecord.ts index 67487b6b1f..58d19b1dbb 100644 --- a/packages/core/src/modules/proofs/repository/ProofExchangeRecord.ts +++ b/packages/didcomm/src/modules/proofs/repository/ProofExchangeRecord.ts @@ -1,10 +1,8 @@ -import type { TagsBase } from '../../../storage/BaseRecord' import type { ProofRole, ProofState } from '../models' import type { AutoAcceptProof } from '../models/ProofAutoAcceptType' +import type { TagsBase } from '@credo-ts/core' -import { CredoError } from '../../../error' -import { BaseRecord } from '../../../storage/BaseRecord' -import { uuid } from '../../../utils/uuid' +import { CredoError, BaseRecord, utils } from '@credo-ts/core' export interface ProofExchangeRecordProps { id?: string @@ -48,7 +46,7 @@ export class ProofExchangeRecord extends BaseRecord { + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) - // Features featureRegistry.register( new Protocol({ id: 'https://didcomm.org/coordinate-mediation/1.0', diff --git a/packages/core/src/modules/routing/MediationRecipientModuleConfig.ts b/packages/didcomm/src/modules/routing/MediationRecipientModuleConfig.ts similarity index 100% rename from packages/core/src/modules/routing/MediationRecipientModuleConfig.ts rename to packages/didcomm/src/modules/routing/MediationRecipientModuleConfig.ts diff --git a/packages/core/src/modules/routing/MediatorApi.ts b/packages/didcomm/src/modules/routing/MediatorApi.ts similarity index 70% rename from packages/core/src/modules/routing/MediatorApi.ts rename to packages/didcomm/src/modules/routing/MediatorApi.ts index 62c456b31c..e6cf804f48 100644 --- a/packages/core/src/modules/routing/MediatorApi.ts +++ b/packages/didcomm/src/modules/routing/MediatorApi.ts @@ -1,11 +1,11 @@ import type { MediationRecord } from './repository' -import { AgentContext } from '../../agent' -import { MessageHandlerRegistry } from '../../agent/MessageHandlerRegistry' -import { MessageSender } from '../../agent/MessageSender' -import { OutboundMessageContext } from '../../agent/models' -import { injectable } from '../../plugins' -import { ConnectionService } from '../connections/services' +import { AgentContext, injectable } from '@credo-ts/core' + +import { MessageHandlerRegistry } from '../../MessageHandlerRegistry' +import { MessageSender } from '../../MessageSender' +import { OutboundMessageContext } from '../../models' +import { ConnectionService } from '../connections' import { MediatorModuleConfig } from './MediatorModuleConfig' import { ForwardHandler, KeylistUpdateHandler } from './handlers' @@ -37,19 +37,6 @@ export class MediatorApi { this.registerMessageHandlers(messageHandlerRegistry) } - public async initialize() { - this.agentContext.config.logger.debug('Mediator routing record not loaded yet, retrieving from storage') - const routingRecord = await this.mediatorService.findMediatorRoutingRecord(this.agentContext) - - // If we don't have a routing record yet for this tenant, create it - if (!routingRecord) { - this.agentContext.config.logger.debug( - 'Mediator routing record does not exist yet, creating routing keys and record' - ) - await this.mediatorService.createMediatorRoutingRecord(this.agentContext) - } - } - public async grantRequestedMediation(mediationRecordId: string): Promise { const record = await this.mediatorService.getById(this.agentContext, mediationRecordId) const connectionRecord = await this.connectionService.getById(this.agentContext, record.connectionId) diff --git a/packages/core/src/modules/routing/MediatorModule.ts b/packages/didcomm/src/modules/routing/MediatorModule.ts similarity index 55% rename from packages/core/src/modules/routing/MediatorModule.ts rename to packages/didcomm/src/modules/routing/MediatorModule.ts index afcfdd05b3..2d4134e50b 100644 --- a/packages/core/src/modules/routing/MediatorModule.ts +++ b/packages/didcomm/src/modules/routing/MediatorModule.ts @@ -1,8 +1,8 @@ import type { MediatorModuleConfigOptions } from './MediatorModuleConfig' -import type { FeatureRegistry } from '../../agent/FeatureRegistry' -import type { DependencyManager, Module } from '../../plugins' +import type { AgentContext, DependencyManager, Module } from '@credo-ts/core' -import { Protocol } from '../../agent/models' +import { FeatureRegistry } from '../../FeatureRegistry' +import { Protocol } from '../../models' import { MediatorApi } from './MediatorApi' import { MediatorModuleConfig } from './MediatorModuleConfig' @@ -21,7 +21,7 @@ export class MediatorModule implements Module { /** * Registers the dependencies of the question answer module on the dependency manager. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Config dependencyManager.registerInstance(MediatorModuleConfig, this.config) @@ -31,13 +31,26 @@ export class MediatorModule implements Module { // Repositories dependencyManager.registerSingleton(MediationRepository) dependencyManager.registerSingleton(MediatorRoutingRepository) + } + + public async initialize(agentContext: AgentContext): Promise { + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) - // Features featureRegistry.register( new Protocol({ id: 'https://didcomm.org/coordinate-mediation/1.0', roles: [MediationRole.Mediator], }) ) + + const mediatorService = agentContext.dependencyManager.resolve(MediatorService) + agentContext.config.logger.debug('Mediator routing record not loaded yet, retrieving from storage') + const routingRecord = await mediatorService.findMediatorRoutingRecord(agentContext) + + // If we don't have a routing record yet for this tenant, create it + if (!routingRecord) { + agentContext.config.logger.debug('Mediator routing record does not exist yet, creating routing keys and record') + await mediatorService.createMediatorRoutingRecord(agentContext) + } } } diff --git a/packages/core/src/modules/routing/MediatorModuleConfig.ts b/packages/didcomm/src/modules/routing/MediatorModuleConfig.ts similarity index 100% rename from packages/core/src/modules/routing/MediatorModuleConfig.ts rename to packages/didcomm/src/modules/routing/MediatorModuleConfig.ts diff --git a/packages/core/src/modules/routing/MediatorPickupStrategy.ts b/packages/didcomm/src/modules/routing/MediatorPickupStrategy.ts similarity index 100% rename from packages/core/src/modules/routing/MediatorPickupStrategy.ts rename to packages/didcomm/src/modules/routing/MediatorPickupStrategy.ts diff --git a/packages/core/src/modules/routing/MessageForwardingStrategy.ts b/packages/didcomm/src/modules/routing/MessageForwardingStrategy.ts similarity index 100% rename from packages/core/src/modules/routing/MessageForwardingStrategy.ts rename to packages/didcomm/src/modules/routing/MessageForwardingStrategy.ts diff --git a/packages/core/src/modules/routing/RoutingEvents.ts b/packages/didcomm/src/modules/routing/RoutingEvents.ts similarity index 90% rename from packages/core/src/modules/routing/RoutingEvents.ts rename to packages/didcomm/src/modules/routing/RoutingEvents.ts index 86a151abff..63bf3c45a5 100644 --- a/packages/core/src/modules/routing/RoutingEvents.ts +++ b/packages/didcomm/src/modules/routing/RoutingEvents.ts @@ -1,8 +1,8 @@ import type { KeylistUpdate } from './messages/KeylistUpdateMessage' import type { MediationState } from './models/MediationState' import type { MediationRecord } from './repository/MediationRecord' -import type { BaseEvent } from '../../agent/Events' -import type { Routing } from '../connections' +import type { Routing } from '../../models' +import type { BaseEvent } from '@credo-ts/core' export enum RoutingEventTypes { MediationStateChanged = 'MediationStateChanged', diff --git a/packages/core/src/modules/routing/__tests__/MediationRecipientModule.test.ts b/packages/didcomm/src/modules/routing/__tests__/MediationRecipientModule.test.ts similarity index 64% rename from packages/core/src/modules/routing/__tests__/MediationRecipientModule.test.ts rename to packages/didcomm/src/modules/routing/__tests__/MediationRecipientModule.test.ts index 4dcba55a5f..96a46c3109 100644 --- a/packages/core/src/modules/routing/__tests__/MediationRecipientModule.test.ts +++ b/packages/didcomm/src/modules/routing/__tests__/MediationRecipientModule.test.ts @@ -1,22 +1,16 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { DependencyManager } from '../../../plugins/DependencyManager' +import { DependencyManager } from '../../../../../core/src/plugins/DependencyManager' import { MediationRecipientModule } from '../MediationRecipientModule' import { MediationRepository } from '../repository' import { MediationRecipientService, RoutingService } from '../services' -jest.mock('../../../plugins/DependencyManager') +jest.mock('../../../../../core/src/plugins/DependencyManager') const DependencyManagerMock = DependencyManager as jest.Mock const dependencyManager = new DependencyManagerMock() -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() - describe('MediationRecipientModule', () => { test('registers dependencies on the dependency manager', () => { - new MediationRecipientModule().register(dependencyManager, featureRegistry) + new MediationRecipientModule().register(dependencyManager) expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(3) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(MediationRecipientService) diff --git a/packages/core/src/modules/routing/__tests__/MediatorModule.test.ts b/packages/didcomm/src/modules/routing/__tests__/MediatorModule.test.ts similarity index 64% rename from packages/core/src/modules/routing/__tests__/MediatorModule.test.ts rename to packages/didcomm/src/modules/routing/__tests__/MediatorModule.test.ts index 6161857475..27d1953b13 100644 --- a/packages/core/src/modules/routing/__tests__/MediatorModule.test.ts +++ b/packages/didcomm/src/modules/routing/__tests__/MediatorModule.test.ts @@ -1,21 +1,16 @@ -import { FeatureRegistry } from '../../../agent/FeatureRegistry' -import { DependencyManager } from '../../../plugins/DependencyManager' +import { DependencyManager } from '../../../../../core/src/plugins/DependencyManager' import { MediatorModule } from '../MediatorModule' import { MediationRepository, MediatorRoutingRepository } from '../repository' import { MediatorService } from '../services' -jest.mock('../../../plugins/DependencyManager') +jest.mock('../../../../../core/src/plugins/DependencyManager') const DependencyManagerMock = DependencyManager as jest.Mock const dependencyManager = new DependencyManagerMock() -jest.mock('../../../agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() describe('MediatorModule', () => { test('registers dependencies on the dependency manager', () => { - new MediatorModule().register(dependencyManager, featureRegistry) + new MediatorModule().register(dependencyManager) expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(3) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(MediatorService) diff --git a/packages/core/src/modules/routing/__tests__/mediation.test.ts b/packages/didcomm/src/modules/routing/__tests__/mediation.test.ts similarity index 62% rename from packages/core/src/modules/routing/__tests__/mediation.test.ts rename to packages/didcomm/src/modules/routing/__tests__/mediation.test.ts index cd5b284cdf..0afe3d71d5 100644 --- a/packages/core/src/modules/routing/__tests__/mediation.test.ts +++ b/packages/didcomm/src/modules/routing/__tests__/mediation.test.ts @@ -1,34 +1,40 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { SubjectMessage } from '../../../../../../tests/transport/SubjectInboundTransport' -import type { AgentDependencies } from '../../../agent/AgentDependencies' -import type { AgentModulesInput } from '../../../agent/AgentModules' -import type { InitConfig } from '../../../types' +import type { AgentDependencies } from '../../../../../core/src/agent/AgentDependencies' +import type { AgentModulesInput } from '../../../../../core/src/agent/AgentModules' +import type { InitConfig } from '../../../../../core/src/types' import { Subject } from 'rxjs' import { SubjectInboundTransport } from '../../../../../../tests/transport/SubjectInboundTransport' import { SubjectOutboundTransport } from '../../../../../../tests/transport/SubjectOutboundTransport' -import { getInMemoryAgentOptions, waitForBasicMessage } from '../../../../tests/helpers' -import { Agent } from '../../../agent/Agent' -import { sleep } from '../../../utils/sleep' +import { Agent } from '../../../../../core/src/agent/Agent' +import { sleep } from '../../../../../core/src/utils/sleep' +import { getInMemoryAgentOptions, waitForBasicMessage } from '../../../../../core/tests/helpers' import { ConnectionRecord, HandshakeProtocol } from '../../connections' import { MediationRecipientModule } from '../MediationRecipientModule' import { MediatorModule } from '../MediatorModule' import { MediatorPickupStrategy } from '../MediatorPickupStrategy' import { MediationState } from '../models/MediationState' -const recipientAgentOptions = getInMemoryAgentOptions('Mediation: Recipient') -const mediatorAgentOptions = getInMemoryAgentOptions( - 'Mediation: Mediator', - { - endpoints: ['rxjs:mediator'], - }, - { - mediator: new MediatorModule({ - autoAcceptMediationRequests: true, - }), - } -) +const getRecipientAgentOptions = (useDidKeyInProtocols: boolean = true) => + getInMemoryAgentOptions('Mediation: Recipient', { + useDidKeyInProtocols, + }) +const getMediatorAgentOptions = (useDidKeyInProtocols: boolean = true) => + getInMemoryAgentOptions( + 'Mediation: Mediator', + { + endpoints: ['rxjs:mediator'], + useDidKeyInProtocols, + }, + {}, + { + mediator: new MediatorModule({ + autoAcceptMediationRequests: true, + }), + } + ) const senderAgentOptions = getInMemoryAgentOptions('Mediation: Sender', { endpoints: ['rxjs:sender'], @@ -71,12 +77,12 @@ describe('mediator establishment', () => { // Initialize mediatorReceived message mediatorAgent = new Agent(mediatorAgentOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Create connection to use for recipient - const mediatorOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const mediatorOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.Connections], @@ -95,18 +101,21 @@ describe('mediator establishment', () => { }), }, }) - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - recipientAgent.registerInboundTransport(new SubjectInboundTransport(recipientMessages)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(recipientMessages)) await recipientAgent.initialize() + await recipientAgent.modules.mediationRecipient.initialize() - const recipientMediator = await recipientAgent.mediationRecipient.findDefaultMediator() + const recipientMediator = await recipientAgent.modules.mediationRecipient.findDefaultMediator() // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain, @typescript-eslint/no-non-null-assertion - const recipientMediatorConnection = await recipientAgent.connections.getById(recipientMediator!.connectionId) + const recipientMediatorConnection = await recipientAgent.modules.connections.getById( + recipientMediator!.connectionId + ) expect(recipientMediatorConnection).toBeInstanceOf(ConnectionRecord) expect(recipientMediatorConnection?.isReady).toBe(true) - const [mediatorRecipientConnection] = await mediatorAgent.connections.findAllByOutOfBandId( + const [mediatorRecipientConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( mediatorOutOfBandRecord.id ) expect(mediatorRecipientConnection!.isReady).toBe(true) @@ -118,40 +127,46 @@ describe('mediator establishment', () => { // Initialize sender agent senderAgent = new Agent(senderAgentOptions) - senderAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - senderAgent.registerInboundTransport(new SubjectInboundTransport(senderMessages)) + senderAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + senderAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(senderMessages)) await senderAgent.initialize() - const recipientOutOfBandRecord = await recipientAgent.oob.createInvitation({ + const recipientOutOfBandRecord = await recipientAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.Connections], }) const recipientInvitation = recipientOutOfBandRecord.outOfBandInvitation - let { connectionRecord: senderRecipientConnection } = await senderAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: senderRecipientConnection } = await senderAgent.modules.oob.receiveInvitationFromUrl( recipientInvitation.toUrl({ domain: 'https://example.com/ssi' }) ) - senderRecipientConnection = await senderAgent.connections.returnWhenIsConnected(senderRecipientConnection!.id) + senderRecipientConnection = await senderAgent.modules.connections.returnWhenIsConnected( + senderRecipientConnection!.id + ) - let [recipientSenderConnection] = await recipientAgent.connections.findAllByOutOfBandId(recipientOutOfBandRecord.id) + let [recipientSenderConnection] = await recipientAgent.modules.connections.findAllByOutOfBandId( + recipientOutOfBandRecord.id + ) expect(recipientSenderConnection).toBeConnectedWith(senderRecipientConnection) expect(senderRecipientConnection).toBeConnectedWith(recipientSenderConnection!) expect(recipientSenderConnection!.isReady).toBe(true) expect(senderRecipientConnection.isReady).toBe(true) - recipientSenderConnection = await recipientAgent.connections.returnWhenIsConnected(recipientSenderConnection!.id) + recipientSenderConnection = await recipientAgent.modules.connections.returnWhenIsConnected( + recipientSenderConnection!.id + ) const message = 'hello, world' - await senderAgent.basicMessages.sendMessage(senderRecipientConnection.id, message) + await senderAgent.modules.basicMessages.sendMessage(senderRecipientConnection.id, message) const basicMessage = await waitForBasicMessage(recipientAgent, { content: message, }) // polling interval is 100ms, so 500ms should be enough to make sure no messages are sent - await recipientAgent.mediationRecipient.stopMessagePickup() + await recipientAgent.modules.mediationRecipient.stopMessagePickup() await sleep(500) expect(basicMessage.content).toBe(message) @@ -165,23 +180,11 @@ describe('mediator establishment', () => { 5. Assert endpoint in recipient invitation for sender is mediator endpoint 6. Send basic message from sender to recipient and assert it is received on the recipient side `, async () => { - await e2eMediationTest(mediatorAgentOptions, recipientAgentOptions) + await e2eMediationTest(getMediatorAgentOptions(), getRecipientAgentOptions()) }) test('Mediation end-to-end flow (not using did:key)', async () => { - await e2eMediationTest( - { - ...mediatorAgentOptions, - config: { ...mediatorAgentOptions.config, useDidKeyInProtocols: false }, - }, - { - ...recipientAgentOptions, - config: { - ...recipientAgentOptions.config, - useDidKeyInProtocols: false, - }, - } - ) + await e2eMediationTest(getMediatorAgentOptions(false), getRecipientAgentOptions(false)) }) test('restart recipient agent and create connection through mediator after recipient agent is restarted', async () => { @@ -195,18 +198,19 @@ describe('mediator establishment', () => { } // Initialize mediator - mediatorAgent = new Agent(mediatorAgentOptions) - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent = new Agent(getMediatorAgentOptions()) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Create connection to use for recipient - const mediatorOutOfBandRecord = await mediatorAgent.oob.createInvitation({ + const mediatorOutOfBandRecord = await mediatorAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.Connections], }) + const recipientAgentOptions = getRecipientAgentOptions() // Initialize recipient with mediation connections invitation recipientAgent = new Agent({ ...recipientAgentOptions, @@ -220,15 +224,18 @@ describe('mediator establishment', () => { }), }, }) - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - recipientAgent.registerInboundTransport(new SubjectInboundTransport(recipientMessages)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(recipientMessages)) await recipientAgent.initialize() + await recipientAgent.modules.mediationRecipient.initialize() - const recipientMediator = await recipientAgent.mediationRecipient.findDefaultMediator() - const recipientMediatorConnection = await recipientAgent.connections.getById(recipientMediator!.connectionId) + const recipientMediator = await recipientAgent.modules.mediationRecipient.findDefaultMediator() + const recipientMediatorConnection = await recipientAgent.modules.connections.getById( + recipientMediator!.connectionId + ) expect(recipientMediatorConnection?.isReady).toBe(true) - const [mediatorRecipientConnection] = await mediatorAgent.connections.findAllByOutOfBandId( + const [mediatorRecipientConnection] = await mediatorAgent.modules.connections.findAllByOutOfBandId( mediatorOutOfBandRecord.id ) expect(mediatorRecipientConnection!.isReady).toBe(true) @@ -239,7 +246,7 @@ describe('mediator establishment', () => { expect(recipientMediator?.state).toBe(MediationState.Granted) - await recipientAgent.mediationRecipient.stopMessagePickup() + await recipientAgent.modules.mediationRecipient.stopMessagePickup() // Restart recipient agent await recipientAgent.shutdown() @@ -247,23 +254,25 @@ describe('mediator establishment', () => { // Initialize sender agent senderAgent = new Agent(senderAgentOptions) - senderAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - senderAgent.registerInboundTransport(new SubjectInboundTransport(senderMessages)) + senderAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + senderAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(senderMessages)) await senderAgent.initialize() - const recipientOutOfBandRecord = await recipientAgent.oob.createInvitation({ + const recipientOutOfBandRecord = await recipientAgent.modules.oob.createInvitation({ label: 'mediator invitation', handshake: true, handshakeProtocols: [HandshakeProtocol.Connections], }) const recipientInvitation = recipientOutOfBandRecord.outOfBandInvitation - let { connectionRecord: senderRecipientConnection } = await senderAgent.oob.receiveInvitationFromUrl( + let { connectionRecord: senderRecipientConnection } = await senderAgent.modules.oob.receiveInvitationFromUrl( recipientInvitation.toUrl({ domain: 'https://example.com/ssi' }) ) - senderRecipientConnection = await senderAgent.connections.returnWhenIsConnected(senderRecipientConnection!.id) - const [recipientSenderConnection] = await recipientAgent.connections.findAllByOutOfBandId( + senderRecipientConnection = await senderAgent.modules.connections.returnWhenIsConnected( + senderRecipientConnection!.id + ) + const [recipientSenderConnection] = await recipientAgent.modules.connections.findAllByOutOfBandId( recipientOutOfBandRecord.id ) expect(recipientSenderConnection).toBeConnectedWith(senderRecipientConnection) @@ -273,7 +282,7 @@ describe('mediator establishment', () => { expect(senderRecipientConnection.isReady).toBe(true) const message = 'hello, world' - await senderAgent.basicMessages.sendMessage(senderRecipientConnection.id, message) + await senderAgent.modules.basicMessages.sendMessage(senderRecipientConnection.id, message) const basicMessage = await waitForBasicMessage(recipientAgent, { content: message, @@ -281,6 +290,6 @@ describe('mediator establishment', () => { expect(basicMessage.content).toBe(message) - await recipientAgent.mediationRecipient.stopMessagePickup() + await recipientAgent.modules.mediationRecipient.stopMessagePickup() }) }) diff --git a/packages/core/src/modules/routing/error/RoutingProblemReportReason.ts b/packages/didcomm/src/modules/routing/error/RoutingProblemReportReason.ts similarity index 100% rename from packages/core/src/modules/routing/error/RoutingProblemReportReason.ts rename to packages/didcomm/src/modules/routing/error/RoutingProblemReportReason.ts diff --git a/packages/core/src/modules/routing/error/index.ts b/packages/didcomm/src/modules/routing/error/index.ts similarity index 100% rename from packages/core/src/modules/routing/error/index.ts rename to packages/didcomm/src/modules/routing/error/index.ts diff --git a/packages/core/src/modules/routing/handlers/ForwardHandler.ts b/packages/didcomm/src/modules/routing/handlers/ForwardHandler.ts similarity index 94% rename from packages/core/src/modules/routing/handlers/ForwardHandler.ts rename to packages/didcomm/src/modules/routing/handlers/ForwardHandler.ts index 2ff27a0dae..2f5ce457bb 100644 --- a/packages/core/src/modules/routing/handlers/ForwardHandler.ts +++ b/packages/didcomm/src/modules/routing/handlers/ForwardHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { MediatorService } from '../services' import { ForwardMessage } from '../messages' diff --git a/packages/core/src/modules/routing/handlers/KeylistUpdateHandler.ts b/packages/didcomm/src/modules/routing/handlers/KeylistUpdateHandler.ts similarity index 89% rename from packages/core/src/modules/routing/handlers/KeylistUpdateHandler.ts rename to packages/didcomm/src/modules/routing/handlers/KeylistUpdateHandler.ts index fcc8609512..ab774d1766 100644 --- a/packages/core/src/modules/routing/handlers/KeylistUpdateHandler.ts +++ b/packages/didcomm/src/modules/routing/handlers/KeylistUpdateHandler.ts @@ -1,7 +1,7 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { MediatorService } from '../services/MediatorService' -import { OutboundMessageContext } from '../../../agent/models' +import { OutboundMessageContext } from '../../../models' import { KeylistUpdateMessage } from '../messages' export class KeylistUpdateHandler implements MessageHandler { diff --git a/packages/core/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts b/packages/didcomm/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts similarity index 95% rename from packages/core/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts rename to packages/didcomm/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts index 58fdf301d8..b458e55e63 100644 --- a/packages/core/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts +++ b/packages/didcomm/src/modules/routing/handlers/KeylistUpdateResponseHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { MediationRecipientService } from '../services' import { KeylistUpdateResponseMessage } from '../messages' diff --git a/packages/core/src/modules/routing/handlers/MediationDenyHandler.ts b/packages/didcomm/src/modules/routing/handlers/MediationDenyHandler.ts similarity index 95% rename from packages/core/src/modules/routing/handlers/MediationDenyHandler.ts rename to packages/didcomm/src/modules/routing/handlers/MediationDenyHandler.ts index 83b90da990..86bf99142c 100644 --- a/packages/core/src/modules/routing/handlers/MediationDenyHandler.ts +++ b/packages/didcomm/src/modules/routing/handlers/MediationDenyHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { MediationRecipientService } from '../services' import { MediationDenyMessage } from '../messages' diff --git a/packages/core/src/modules/routing/handlers/MediationGrantHandler.ts b/packages/didcomm/src/modules/routing/handlers/MediationGrantHandler.ts similarity index 95% rename from packages/core/src/modules/routing/handlers/MediationGrantHandler.ts rename to packages/didcomm/src/modules/routing/handlers/MediationGrantHandler.ts index f9b290c934..1d692bbfef 100644 --- a/packages/core/src/modules/routing/handlers/MediationGrantHandler.ts +++ b/packages/didcomm/src/modules/routing/handlers/MediationGrantHandler.ts @@ -1,4 +1,4 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { MediationRecipientService } from '../services/MediationRecipientService' import { MediationGrantMessage } from '../messages' diff --git a/packages/core/src/modules/routing/handlers/MediationRequestHandler.ts b/packages/didcomm/src/modules/routing/handlers/MediationRequestHandler.ts similarity index 93% rename from packages/core/src/modules/routing/handlers/MediationRequestHandler.ts rename to packages/didcomm/src/modules/routing/handlers/MediationRequestHandler.ts index f020c6f9bd..31c3100656 100644 --- a/packages/core/src/modules/routing/handlers/MediationRequestHandler.ts +++ b/packages/didcomm/src/modules/routing/handlers/MediationRequestHandler.ts @@ -1,8 +1,8 @@ -import type { MessageHandler, MessageHandlerInboundMessage } from '../../../agent/MessageHandler' +import type { MessageHandler, MessageHandlerInboundMessage } from '../../../handlers' import type { MediatorModuleConfig } from '../MediatorModuleConfig' import type { MediatorService } from '../services/MediatorService' -import { OutboundMessageContext } from '../../../agent/models' +import { OutboundMessageContext } from '../../../models' import { MediationRequestMessage } from '../messages/MediationRequestMessage' export class MediationRequestHandler implements MessageHandler { diff --git a/packages/core/src/modules/routing/handlers/index.ts b/packages/didcomm/src/modules/routing/handlers/index.ts similarity index 100% rename from packages/core/src/modules/routing/handlers/index.ts rename to packages/didcomm/src/modules/routing/handlers/index.ts diff --git a/packages/core/src/modules/routing/index.ts b/packages/didcomm/src/modules/routing/index.ts similarity index 88% rename from packages/core/src/modules/routing/index.ts rename to packages/didcomm/src/modules/routing/index.ts index 981dbe5207..efe4b2013d 100644 --- a/packages/core/src/modules/routing/index.ts +++ b/packages/didcomm/src/modules/routing/index.ts @@ -5,6 +5,7 @@ export * from './models' export * from './RoutingEvents' export * from './MediatorApi' export * from './MediationRecipientApi' +export * from './MessageForwardingStrategy' export * from './MediatorPickupStrategy' export * from './MediatorModule' export * from './MediationRecipientModule' diff --git a/packages/core/src/modules/routing/messages/ForwardMessage.ts b/packages/didcomm/src/modules/routing/messages/ForwardMessage.ts similarity index 93% rename from packages/core/src/modules/routing/messages/ForwardMessage.ts rename to packages/didcomm/src/modules/routing/messages/ForwardMessage.ts index ea1e45a50c..c819482252 100644 --- a/packages/core/src/modules/routing/messages/ForwardMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/ForwardMessage.ts @@ -1,9 +1,9 @@ import { Expose } from 'class-transformer' import { IsObject, IsString } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' +import { AgentMessage } from '../../../AgentMessage' import { EncryptedMessage } from '../../../types' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface ForwardMessageOptions { id?: string diff --git a/packages/core/src/modules/routing/messages/KeylistMessage.ts b/packages/didcomm/src/modules/routing/messages/KeylistMessage.ts similarity index 92% rename from packages/core/src/modules/routing/messages/KeylistMessage.ts rename to packages/didcomm/src/modules/routing/messages/KeylistMessage.ts index 7e58af9ac4..72ada9370b 100644 --- a/packages/core/src/modules/routing/messages/KeylistMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/KeylistMessage.ts @@ -1,8 +1,8 @@ import { Type } from 'class-transformer' import { IsArray, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface KeylistMessageOptions { id?: string diff --git a/packages/core/src/modules/routing/messages/KeylistUpdateMessage.ts b/packages/didcomm/src/modules/routing/messages/KeylistUpdateMessage.ts similarity index 95% rename from packages/core/src/modules/routing/messages/KeylistUpdateMessage.ts rename to packages/didcomm/src/modules/routing/messages/KeylistUpdateMessage.ts index be83d5b021..80567f2fbf 100644 --- a/packages/core/src/modules/routing/messages/KeylistUpdateMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/KeylistUpdateMessage.ts @@ -1,8 +1,8 @@ import { Expose, Type } from 'class-transformer' import { IsArray, ValidateNested, IsString, IsEnum, IsInstance } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export enum KeylistUpdateAction { add = 'add', diff --git a/packages/core/src/modules/routing/messages/KeylistUpdateResponseMessage.ts b/packages/didcomm/src/modules/routing/messages/KeylistUpdateResponseMessage.ts similarity index 96% rename from packages/core/src/modules/routing/messages/KeylistUpdateResponseMessage.ts rename to packages/didcomm/src/modules/routing/messages/KeylistUpdateResponseMessage.ts index 88b75c694c..6e76cfa79b 100644 --- a/packages/core/src/modules/routing/messages/KeylistUpdateResponseMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/KeylistUpdateResponseMessage.ts @@ -1,8 +1,8 @@ import { Expose, Type } from 'class-transformer' import { IsArray, IsEnum, IsInstance, IsString, ValidateNested } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' import { KeylistUpdateAction } from './KeylistUpdateMessage' diff --git a/packages/core/src/modules/routing/messages/MediationDenyMessage.ts b/packages/didcomm/src/modules/routing/messages/MediationDenyMessage.ts similarity index 90% rename from packages/core/src/modules/routing/messages/MediationDenyMessage.ts rename to packages/didcomm/src/modules/routing/messages/MediationDenyMessage.ts index 30f0868ff7..88e8d1bc07 100644 --- a/packages/core/src/modules/routing/messages/MediationDenyMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/MediationDenyMessage.ts @@ -1,5 +1,5 @@ -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface MediationDenyMessageOptions { id: string diff --git a/packages/core/src/modules/routing/messages/MediationGrantMessage.ts b/packages/didcomm/src/modules/routing/messages/MediationGrantMessage.ts similarity index 94% rename from packages/core/src/modules/routing/messages/MediationGrantMessage.ts rename to packages/didcomm/src/modules/routing/messages/MediationGrantMessage.ts index baebf09913..02be7b95c7 100644 --- a/packages/core/src/modules/routing/messages/MediationGrantMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/MediationGrantMessage.ts @@ -1,8 +1,8 @@ import { Expose } from 'class-transformer' import { IsArray, IsNotEmpty, IsString } from 'class-validator' -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface MediationGrantMessageOptions { id?: string diff --git a/packages/core/src/modules/routing/messages/MediationRequestMessage.ts b/packages/didcomm/src/modules/routing/messages/MediationRequestMessage.ts similarity index 93% rename from packages/core/src/modules/routing/messages/MediationRequestMessage.ts rename to packages/didcomm/src/modules/routing/messages/MediationRequestMessage.ts index 788ebd3044..0e91db8026 100644 --- a/packages/core/src/modules/routing/messages/MediationRequestMessage.ts +++ b/packages/didcomm/src/modules/routing/messages/MediationRequestMessage.ts @@ -1,5 +1,5 @@ -import { AgentMessage } from '../../../agent/AgentMessage' -import { IsValidMessageType, parseMessageType } from '../../../utils/messageType' +import { AgentMessage } from '../../../AgentMessage' +import { IsValidMessageType, parseMessageType } from '../../../util/messageType' export interface MediationRequestMessageOptions { sentTime?: Date diff --git a/packages/core/src/modules/routing/messages/index.ts b/packages/didcomm/src/modules/routing/messages/index.ts similarity index 100% rename from packages/core/src/modules/routing/messages/index.ts rename to packages/didcomm/src/modules/routing/messages/index.ts diff --git a/packages/core/src/modules/routing/models/MediationRole.ts b/packages/didcomm/src/modules/routing/models/MediationRole.ts similarity index 100% rename from packages/core/src/modules/routing/models/MediationRole.ts rename to packages/didcomm/src/modules/routing/models/MediationRole.ts diff --git a/packages/core/src/modules/routing/models/MediationState.ts b/packages/didcomm/src/modules/routing/models/MediationState.ts similarity index 100% rename from packages/core/src/modules/routing/models/MediationState.ts rename to packages/didcomm/src/modules/routing/models/MediationState.ts diff --git a/packages/core/src/modules/routing/models/index.ts b/packages/didcomm/src/modules/routing/models/index.ts similarity index 100% rename from packages/core/src/modules/routing/models/index.ts rename to packages/didcomm/src/modules/routing/models/index.ts diff --git a/packages/core/src/modules/routing/repository/MediationRecord.ts b/packages/didcomm/src/modules/routing/repository/MediationRecord.ts similarity index 94% rename from packages/core/src/modules/routing/repository/MediationRecord.ts rename to packages/didcomm/src/modules/routing/repository/MediationRecord.ts index a672e25087..e89ac47162 100644 --- a/packages/core/src/modules/routing/repository/MediationRecord.ts +++ b/packages/didcomm/src/modules/routing/repository/MediationRecord.ts @@ -1,10 +1,8 @@ import type { MediationRole } from '../models/MediationRole' +import { CredoError, BaseRecord, utils } from '@credo-ts/core' import { Transform } from 'class-transformer' -import { CredoError } from '../../../error' -import { BaseRecord } from '../../../storage/BaseRecord' -import { uuid } from '../../../utils/uuid' import { MediatorPickupStrategy } from '../MediatorPickupStrategy' import { MediationState } from '../models/MediationState' @@ -61,7 +59,7 @@ export class MediationRecord super() if (props) { - this.id = props.id ?? uuid() + this.id = props.id ?? utils.uuid() this.createdAt = props.createdAt ?? new Date() this.connectionId = props.connectionId this.threadId = props.threadId diff --git a/packages/core/src/modules/routing/repository/MediationRepository.ts b/packages/didcomm/src/modules/routing/repository/MediationRepository.ts similarity index 67% rename from packages/core/src/modules/routing/repository/MediationRepository.ts rename to packages/didcomm/src/modules/routing/repository/MediationRepository.ts index e89c04aa11..d2cb27295f 100644 --- a/packages/core/src/modules/routing/repository/MediationRepository.ts +++ b/packages/didcomm/src/modules/routing/repository/MediationRepository.ts @@ -1,10 +1,6 @@ -import type { AgentContext } from '../../../agent' +import type { AgentContext } from '@credo-ts/core' -import { EventEmitter } from '../../../agent/EventEmitter' -import { InjectionSymbols } from '../../../constants' -import { inject, injectable } from '../../../plugins' -import { Repository } from '../../../storage/Repository' -import { StorageService } from '../../../storage/StorageService' +import { EventEmitter, InjectionSymbols, inject, injectable, Repository, StorageService } from '@credo-ts/core' import { MediationRecord } from './MediationRecord' diff --git a/packages/core/src/modules/routing/repository/MediatorRoutingRecord.ts b/packages/didcomm/src/modules/routing/repository/MediatorRoutingRecord.ts similarity index 75% rename from packages/core/src/modules/routing/repository/MediatorRoutingRecord.ts rename to packages/didcomm/src/modules/routing/repository/MediatorRoutingRecord.ts index 8031f0b3f5..434a56d734 100644 --- a/packages/core/src/modules/routing/repository/MediatorRoutingRecord.ts +++ b/packages/didcomm/src/modules/routing/repository/MediatorRoutingRecord.ts @@ -1,7 +1,6 @@ -import type { TagsBase } from '../../../storage/BaseRecord' +import type { TagsBase } from '@credo-ts/core' -import { BaseRecord } from '../../../storage/BaseRecord' -import { uuid } from '../../../utils/uuid' +import { BaseRecord, utils } from '@credo-ts/core' export interface MediatorRoutingRecordProps { id?: string @@ -20,7 +19,7 @@ export class MediatorRoutingRecord extends BaseRecord implements MediatorRouting super() if (props) { - this.id = props.id ?? uuid() + this.id = props.id ?? utils.uuid() this.createdAt = props.createdAt ?? new Date() this.routingKeys = props.routingKeys || [] } diff --git a/packages/core/src/modules/routing/repository/MediatorRoutingRepository.ts b/packages/didcomm/src/modules/routing/repository/MediatorRoutingRepository.ts similarity index 61% rename from packages/core/src/modules/routing/repository/MediatorRoutingRepository.ts rename to packages/didcomm/src/modules/routing/repository/MediatorRoutingRepository.ts index b4197d3d9a..d60f65ce14 100644 --- a/packages/core/src/modules/routing/repository/MediatorRoutingRepository.ts +++ b/packages/didcomm/src/modules/routing/repository/MediatorRoutingRepository.ts @@ -1,8 +1,4 @@ -import { EventEmitter } from '../../../agent/EventEmitter' -import { InjectionSymbols } from '../../../constants' -import { inject, injectable } from '../../../plugins' -import { Repository } from '../../../storage/Repository' -import { StorageService } from '../../../storage/StorageService' +import { EventEmitter, InjectionSymbols, inject, injectable, Repository, StorageService } from '@credo-ts/core' import { MediatorRoutingRecord } from './MediatorRoutingRecord' diff --git a/packages/core/src/modules/routing/repository/index.ts b/packages/didcomm/src/modules/routing/repository/index.ts similarity index 100% rename from packages/core/src/modules/routing/repository/index.ts rename to packages/didcomm/src/modules/routing/repository/index.ts diff --git a/packages/core/src/modules/routing/services/MediationRecipientService.ts b/packages/didcomm/src/modules/routing/services/MediationRecipientService.ts similarity index 93% rename from packages/core/src/modules/routing/services/MediationRecipientService.ts rename to packages/didcomm/src/modules/routing/services/MediationRecipientService.ts index 0b73449c4c..28b9f6f0f2 100644 --- a/packages/core/src/modules/routing/services/MediationRecipientService.ts +++ b/packages/didcomm/src/modules/routing/services/MediationRecipientService.ts @@ -1,28 +1,31 @@ import type { GetRoutingOptions, RemoveRoutingOptions } from './RoutingService' -import type { AgentContext } from '../../../agent' -import type { AgentMessage } from '../../../agent/AgentMessage' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import type { Query, QueryOptions } from '../../../storage/StorageService' -import type { ConnectionRecord } from '../../connections' -import type { Routing } from '../../connections/services/ConnectionService' +import type { AgentMessage } from '../../../AgentMessage' +import type { InboundMessageContext, Routing } from '../../../models' +import type { ConnectionRecord } from '../../connections/repository' import type { MediationStateChangedEvent, KeylistUpdatedEvent } from '../RoutingEvents' import type { MediationDenyMessage } from '../messages' +import type { AgentContext, Query, QueryOptions } from '@credo-ts/core' +import { + EventEmitter, + filterContextCorrelationId, + Key, + KeyType, + CredoError, + injectable, + DidKey, + isDidKey, + didKeyToVerkey, +} from '@credo-ts/core' import { firstValueFrom, ReplaySubject } from 'rxjs' import { filter, first, timeout } from 'rxjs/operators' -import { EventEmitter } from '../../../agent/EventEmitter' -import { filterContextCorrelationId } from '../../../agent/Events' -import { MessageSender } from '../../../agent/MessageSender' -import { OutboundMessageContext } from '../../../agent/models' -import { Key, KeyType } from '../../../crypto' -import { CredoError } from '../../../error' -import { injectable } from '../../../plugins' +import { DidCommModuleConfig } from '../../../DidCommModuleConfig' +import { MessageSender } from '../../../MessageSender' +import { OutboundMessageContext } from '../../../models' import { ConnectionType } from '../../connections/models/ConnectionType' import { ConnectionMetadataKeys } from '../../connections/repository/ConnectionMetadataTypes' import { ConnectionService } from '../../connections/services/ConnectionService' -import { DidKey } from '../../dids' -import { didKeyToVerkey, isDidKey } from '../../dids/helpers' import { RoutingEventTypes } from '../RoutingEvents' import { KeylistUpdateAction, @@ -153,7 +156,9 @@ export class MediationRecipientService { const connection = await this.connectionService.getById(agentContext, mediationRecord.connectionId) // Use our useDidKey configuration unless we know the key formatting other party is using - let useDidKey = agentContext.config.useDidKeyInProtocols + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) + + let useDidKey = didcommConfig.useDidKeyInProtocols const useDidKeysConnectionMetadata = connection.metadata.get(ConnectionMetadataKeys.UseDidKeysForProtocol) if (useDidKeysConnectionMetadata) { diff --git a/packages/core/src/modules/routing/services/MediatorService.ts b/packages/didcomm/src/modules/routing/services/MediatorService.ts similarity index 92% rename from packages/core/src/modules/routing/services/MediatorService.ts rename to packages/didcomm/src/modules/routing/services/MediatorService.ts index 0a585ad8a5..22b1bdec2f 100644 --- a/packages/core/src/modules/routing/services/MediatorService.ts +++ b/packages/didcomm/src/modules/routing/services/MediatorService.ts @@ -1,20 +1,27 @@ -import type { AgentContext } from '../../../agent' -import type { InboundMessageContext } from '../../../agent/models/InboundMessageContext' -import type { Query, QueryOptions } from '../../../storage/StorageService' -import type { ConnectionRecord } from '../../connections' +import type { InboundMessageContext } from '../../../models' +import type { ConnectionRecord } from '../../connections/repository' import type { MediationStateChangedEvent } from '../RoutingEvents' import type { ForwardMessage, MediationRequestMessage } from '../messages' +import type { AgentContext, Query, QueryOptions } from '@credo-ts/core' -import { EventEmitter } from '../../../agent/EventEmitter' -import { MessageSender } from '../../../agent/MessageSender' -import { InjectionSymbols } from '../../../constants' -import { KeyType } from '../../../crypto' -import { CredoError, RecordDuplicateError } from '../../../error' -import { Logger } from '../../../logger' -import { injectable, inject } from '../../../plugins' -import { ConnectionService } from '../../connections' +import { + EventEmitter, + InjectionSymbols, + KeyType, + CredoError, + RecordDuplicateError, + Logger, + injectable, + inject, + didKeyToVerkey, + isDidKey, + verkeyToDidKey, +} from '@credo-ts/core' + +import { DidCommModuleConfig } from '../../../DidCommModuleConfig' +import { MessageSender } from '../../../MessageSender' import { ConnectionMetadataKeys } from '../../connections/repository/ConnectionMetadataTypes' -import { didKeyToVerkey, isDidKey, verkeyToDidKey } from '../../dids/helpers' +import { ConnectionService } from '../../connections/services' import { MessagePickupApi } from '../../message-pickup' import { MessagePickupSessionRole } from '../../message-pickup/MessagePickupSession' import { MediatorModuleConfig } from '../MediatorModuleConfig' @@ -186,10 +193,11 @@ export class MediatorService { await this.updateState(agentContext, mediationRecord, MediationState.Granted) // Use our useDidKey configuration, as this is the first interaction for this protocol - const useDidKey = agentContext.config.useDidKeyInProtocols + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) + const useDidKey = didcommConfig.useDidKeyInProtocols const message = new MediationGrantMessage({ - endpoint: agentContext.config.endpoints[0], + endpoint: didcommConfig.endpoints[0], routingKeys: useDidKey ? (await this.getRoutingKeys(agentContext)).map(verkeyToDidKey) : await this.getRoutingKeys(agentContext), @@ -248,13 +256,14 @@ export class MediatorService { routingKeys: [routingKey.publicKeyBase58], }) + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) try { await this.mediatorRoutingRepository.save(agentContext, routingRecord) this.eventEmitter.emit(agentContext, { type: RoutingEventTypes.RoutingCreatedEvent, payload: { routing: { - endpoints: agentContext.config.endpoints, + endpoints: didcommConfig.endpoints, routingKeys: [], recipientKey: routingKey, }, diff --git a/packages/core/src/modules/routing/services/RoutingService.ts b/packages/didcomm/src/modules/routing/services/RoutingService.ts similarity index 84% rename from packages/core/src/modules/routing/services/RoutingService.ts rename to packages/didcomm/src/modules/routing/services/RoutingService.ts index 94224c58a5..52f2b10cf7 100644 --- a/packages/core/src/modules/routing/services/RoutingService.ts +++ b/packages/didcomm/src/modules/routing/services/RoutingService.ts @@ -1,11 +1,10 @@ -import type { AgentContext } from '../../../agent' -import type { Key } from '../../../crypto' -import type { Routing } from '../../connections' +import type { Routing } from '../../../models' import type { RoutingCreatedEvent } from '../RoutingEvents' +import type { AgentContext, Key } from '@credo-ts/core' -import { EventEmitter } from '../../../agent/EventEmitter' -import { KeyType } from '../../../crypto' -import { injectable } from '../../../plugins' +import { EventEmitter, KeyType, injectable } from '@credo-ts/core' + +import { DidCommModuleConfig } from '../../../DidCommModuleConfig' import { RoutingEventTypes } from '../RoutingEvents' import { MediationRecipientService } from './MediationRecipientService' @@ -28,9 +27,10 @@ export class RoutingService { ): Promise { // Create and store new key const recipientKey = await agentContext.wallet.createKey({ keyType: KeyType.Ed25519 }) + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) let routing: Routing = { - endpoints: agentContext.config.endpoints, + endpoints: didcommConfig.endpoints, routingKeys: [], recipientKey, } diff --git a/packages/core/src/modules/routing/services/__tests__/MediationRecipientService.test.ts b/packages/didcomm/src/modules/routing/services/__tests__/MediationRecipientService.test.ts similarity index 91% rename from packages/core/src/modules/routing/services/__tests__/MediationRecipientService.test.ts rename to packages/didcomm/src/modules/routing/services/__tests__/MediationRecipientService.test.ts index 15831a8a54..20075ad282 100644 --- a/packages/core/src/modules/routing/services/__tests__/MediationRecipientService.test.ts +++ b/packages/didcomm/src/modules/routing/services/__tests__/MediationRecipientService.test.ts @@ -1,17 +1,17 @@ -import type { AgentContext } from '../../../../agent' -import type { Routing } from '../../../connections/services/ConnectionService' - -import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../tests/helpers' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { MessageSender } from '../../../../agent/MessageSender' -import { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' -import { Key } from '../../../../crypto' -import { uuid } from '../../../../utils/uuid' +import type { AgentContext } from '../../../../../../core/src/agent' +import type { Routing } from '../../../../models' + +import { EventEmitter } from '../../../../../../core/src/agent/EventEmitter' +import { Key } from '../../../../../../core/src/crypto' +import { DidRepository } from '../../../../../../core/src/modules/dids/repository/DidRepository' +import { uuid } from '../../../../../../core/src/utils/uuid' +import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../../core/tests/helpers' +import { MessageSender } from '../../../../MessageSender' +import { InboundMessageContext } from '../../../../models/InboundMessageContext' import { DidExchangeState } from '../../../connections' import { ConnectionMetadataKeys } from '../../../connections/repository/ConnectionMetadataTypes' import { ConnectionRepository } from '../../../connections/repository/ConnectionRepository' import { ConnectionService } from '../../../connections/services/ConnectionService' -import { DidRepository } from '../../../dids/repository/DidRepository' import { RoutingEventTypes } from '../../RoutingEvents' import { KeylistUpdateAction, @@ -30,13 +30,13 @@ const MediationRepositoryMock = MediationRepository as jest.Mock -jest.mock('../../../dids/repository/DidRepository') +jest.mock('../../../../../../core/src/modules/dids/repository/DidRepository') const DidRepositoryMock = DidRepository as jest.Mock -jest.mock('../../../../agent/EventEmitter') +jest.mock('../../../../../../core/src/agent/EventEmitter') const EventEmitterMock = EventEmitter as jest.Mock -jest.mock('../../../../agent/MessageSender') +jest.mock('../../../../MessageSender') const MessageSenderMock = MessageSender as jest.Mock const connectionImageUrl = 'https://example.com/image.png' diff --git a/packages/core/src/modules/routing/services/__tests__/MediatorService.test.ts b/packages/didcomm/src/modules/routing/services/__tests__/MediatorService.test.ts similarity index 93% rename from packages/core/src/modules/routing/services/__tests__/MediatorService.test.ts rename to packages/didcomm/src/modules/routing/services/__tests__/MediatorService.test.ts index a2741fc29a..98b04fdf51 100644 --- a/packages/core/src/modules/routing/services/__tests__/MediatorService.test.ts +++ b/packages/didcomm/src/modules/routing/services/__tests__/MediatorService.test.ts @@ -1,10 +1,11 @@ import { Subject } from 'rxjs' -import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../tests/helpers' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { InboundMessageContext } from '../../../../agent/models/InboundMessageContext' +import { EventEmitter } from '../../../../../../core/src/agent/EventEmitter' +import { isDidKey } from '../../../../../../core/src/modules/dids/helpers' +import { getAgentConfig, getAgentContext, getMockConnection, mockFunction } from '../../../../../../core/tests/helpers' +import { DidCommModuleConfig } from '../../../../DidCommModuleConfig' +import { InboundMessageContext } from '../../../../models/InboundMessageContext' import { ConnectionService, DidExchangeState } from '../../../connections' -import { isDidKey } from '../../../dids/helpers' import { MessagePickupApi } from '../../../message-pickup' import { KeylistUpdateAction, KeylistUpdateMessage, KeylistUpdateResult } from '../../messages' import { MediationRole, MediationState } from '../../models' @@ -39,6 +40,7 @@ describe('MediatorService - default config', () => { const agentContext = getAgentContext({ agentConfig, + registerInstances: [[DidCommModuleConfig, new DidCommModuleConfig()]], }) const mediatorService = new MediatorService( @@ -166,6 +168,7 @@ describe('MediatorService - useDidKeyInProtocols set to false', () => { const agentContext = getAgentContext({ agentConfig, + registerInstances: [[DidCommModuleConfig, new DidCommModuleConfig({ useDidKeyInProtocols: false })]], }) const mediatorService = new MediatorService( diff --git a/packages/core/src/modules/routing/services/__tests__/RoutingService.test.ts b/packages/didcomm/src/modules/routing/services/__tests__/RoutingService.test.ts similarity index 85% rename from packages/core/src/modules/routing/services/__tests__/RoutingService.test.ts rename to packages/didcomm/src/modules/routing/services/__tests__/RoutingService.test.ts index 14ec7c22b8..fe50fdbc7a 100644 --- a/packages/core/src/modules/routing/services/__tests__/RoutingService.test.ts +++ b/packages/didcomm/src/modules/routing/services/__tests__/RoutingService.test.ts @@ -1,10 +1,11 @@ -import type { Wallet } from '../../../../wallet' +import type { Wallet } from '../../../../../../core/src/wallet' import { Subject } from 'rxjs' -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../tests/helpers' -import { EventEmitter } from '../../../../agent/EventEmitter' -import { Key } from '../../../../crypto' +import { EventEmitter } from '../../../../../../core/src/agent/EventEmitter' +import { Key } from '../../../../../../core/src/crypto' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../core/tests/helpers' +import { DidCommModuleConfig } from '../../../../DidCommModuleConfig' import { RoutingEventTypes } from '../../RoutingEvents' import { MediationRecipientService } from '../MediationRecipientService' import { RoutingService } from '../RoutingService' @@ -24,6 +25,7 @@ const wallet = { const agentContext = getAgentContext({ wallet: wallet as unknown as Wallet, agentConfig, + registerInstances: [[DidCommModuleConfig, new DidCommModuleConfig({ endpoints: ['http://endpoint.com'] })]], }) const mediationRecipientService = new MediationRecipientServiceMock() const routingService = new RoutingService(mediationRecipientService, eventEmitter) diff --git a/packages/core/src/modules/routing/services/helpers.ts b/packages/didcomm/src/modules/routing/services/helpers.ts similarity index 82% rename from packages/core/src/modules/routing/services/helpers.ts rename to packages/didcomm/src/modules/routing/services/helpers.ts index 0a3bb4fe42..ca375c886c 100644 --- a/packages/core/src/modules/routing/services/helpers.ts +++ b/packages/didcomm/src/modules/routing/services/helpers.ts @@ -1,5 +1,4 @@ -import type { AgentContext } from '../../../agent' -import type { DidDocument } from '../../dids' +import type { AgentContext, DidDocument } from '@credo-ts/core' import { MediationRecipientService } from './MediationRecipientService' diff --git a/packages/core/src/modules/routing/services/index.ts b/packages/didcomm/src/modules/routing/services/index.ts similarity index 100% rename from packages/core/src/modules/routing/services/index.ts rename to packages/didcomm/src/modules/routing/services/index.ts diff --git a/packages/core/src/storage/didcomm/DidCommMessageRecord.ts b/packages/didcomm/src/repository/DidCommMessageRecord.ts similarity index 84% rename from packages/core/src/storage/didcomm/DidCommMessageRecord.ts rename to packages/didcomm/src/repository/DidCommMessageRecord.ts index 28d5d05949..3c09eb1594 100644 --- a/packages/core/src/storage/didcomm/DidCommMessageRecord.ts +++ b/packages/didcomm/src/repository/DidCommMessageRecord.ts @@ -1,13 +1,10 @@ import type { DidCommMessageRole } from './DidCommMessageRole' -import type { ConstructableAgentMessage } from '../../agent/AgentMessage' -import type { PlaintextMessage } from '../../types' +import type { ConstructableAgentMessage } from '../AgentMessage' +import type { PlaintextMessage } from '../types' -import { CredoError } from '../../error' -import { JsonTransformer } from '../../utils/JsonTransformer' -import { canHandleMessageType, parseMessageType } from '../../utils/messageType' -import { isJsonObject } from '../../utils/type' -import { uuid } from '../../utils/uuid' -import { BaseRecord } from '../BaseRecord' +import { CredoError, BaseRecord, JsonTransformer, isJsonObject, utils } from '@credo-ts/core' + +import { canHandleMessageType, parseMessageType } from '../util/messageType' export type DefaultDidCommMessageTags = { role: DidCommMessageRole @@ -50,7 +47,7 @@ export class DidCommMessageRecord extends BaseRecord super() if (props) { - this.id = props.id ?? uuid() + this.id = props.id ?? utils.uuid() this.createdAt = props.createdAt ?? new Date() this.associatedRecordId = props.associatedRecordId this.role = props.role diff --git a/packages/core/src/storage/didcomm/DidCommMessageRepository.ts b/packages/didcomm/src/repository/DidCommMessageRepository.ts similarity index 88% rename from packages/core/src/storage/didcomm/DidCommMessageRepository.ts rename to packages/didcomm/src/repository/DidCommMessageRepository.ts index a13a70f4fd..a37fd918a5 100644 --- a/packages/core/src/storage/didcomm/DidCommMessageRepository.ts +++ b/packages/didcomm/src/repository/DidCommMessageRepository.ts @@ -1,13 +1,10 @@ import type { DidCommMessageRole } from './DidCommMessageRole' -import type { AgentContext } from '../../agent' -import type { AgentMessage, ConstructableAgentMessage } from '../../agent/AgentMessage' +import type { AgentMessage, ConstructableAgentMessage } from '../AgentMessage' +import type { AgentContext } from '@credo-ts/core' -import { EventEmitter } from '../../agent/EventEmitter' -import { InjectionSymbols } from '../../constants' -import { inject, injectable } from '../../plugins' -import { parseMessageType } from '../../utils/messageType' -import { Repository } from '../Repository' -import { StorageService } from '../StorageService' +import { EventEmitter, InjectionSymbols, inject, injectable, Repository, StorageService } from '@credo-ts/core' + +import { parseMessageType } from '../util/messageType' import { DidCommMessageRecord } from './DidCommMessageRecord' diff --git a/packages/core/src/storage/didcomm/DidCommMessageRole.ts b/packages/didcomm/src/repository/DidCommMessageRole.ts similarity index 100% rename from packages/core/src/storage/didcomm/DidCommMessageRole.ts rename to packages/didcomm/src/repository/DidCommMessageRole.ts diff --git a/packages/core/src/storage/__tests__/DidCommMessageRecord.test.ts b/packages/didcomm/src/repository/__tests__/DidCommMessageRecord.test.ts similarity index 91% rename from packages/core/src/storage/__tests__/DidCommMessageRecord.test.ts rename to packages/didcomm/src/repository/__tests__/DidCommMessageRecord.test.ts index 30198e7f00..beeb79800d 100644 --- a/packages/core/src/storage/__tests__/DidCommMessageRecord.test.ts +++ b/packages/didcomm/src/repository/__tests__/DidCommMessageRecord.test.ts @@ -1,5 +1,6 @@ -import { ConnectionInvitationMessage } from '../../modules/connections' -import { DidCommMessageRecord, DidCommMessageRole } from '../didcomm' +import { ConnectionInvitationMessage } from '../../modules' +import { DidCommMessageRecord } from '../DidCommMessageRecord' +import { DidCommMessageRole } from '../DidCommMessageRole' describe('DidCommMessageRecord', () => { it('correctly computes message type tags', () => { diff --git a/packages/core/src/storage/__tests__/DidCommMessageRepository.test.ts b/packages/didcomm/src/repository/__tests__/DidCommMessageRepository.test.ts similarity index 94% rename from packages/core/src/storage/__tests__/DidCommMessageRepository.test.ts rename to packages/didcomm/src/repository/__tests__/DidCommMessageRepository.test.ts index 804b3f7f0d..65b13a3ce1 100644 --- a/packages/core/src/storage/__tests__/DidCommMessageRepository.test.ts +++ b/packages/didcomm/src/repository/__tests__/DidCommMessageRepository.test.ts @@ -1,13 +1,14 @@ -import type { StorageService } from '../StorageService' +import type { StorageService } from '@credo-ts/core' +import { EventEmitter, JsonTransformer } from '@credo-ts/core' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../../../tests/InMemoryStorageService' -import { getAgentConfig, getAgentContext, mockFunction } from '../../../tests/helpers' -import { EventEmitter } from '../../agent/EventEmitter' -import { ConnectionInvitationMessage } from '../../modules/connections' -import { JsonTransformer } from '../../utils/JsonTransformer' -import { DidCommMessageRecord, DidCommMessageRepository, DidCommMessageRole } from '../didcomm' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../core/tests' +import { ConnectionInvitationMessage } from '../../modules' +import { DidCommMessageRecord } from '../DidCommMessageRecord' +import { DidCommMessageRepository } from '../DidCommMessageRepository' +import { DidCommMessageRole } from '../DidCommMessageRole' jest.mock('../../../../../tests/InMemoryStorageService') diff --git a/packages/core/src/storage/didcomm/index.ts b/packages/didcomm/src/repository/index.ts similarity index 100% rename from packages/core/src/storage/didcomm/index.ts rename to packages/didcomm/src/repository/index.ts index a658508c7b..409b4d4297 100644 --- a/packages/core/src/storage/didcomm/index.ts +++ b/packages/didcomm/src/repository/index.ts @@ -1,3 +1,3 @@ export * from './DidCommMessageRecord' -export * from './DidCommMessageRepository' export * from './DidCommMessageRole' +export * from './DidCommMessageRepository' diff --git a/packages/core/src/modules/didcomm/services/DidCommDocumentService.ts b/packages/didcomm/src/services/DidCommDocumentService.ts similarity index 88% rename from packages/core/src/modules/didcomm/services/DidCommDocumentService.ts rename to packages/didcomm/src/services/DidCommDocumentService.ts index caae5ce46c..a5dbfa948d 100644 --- a/packages/core/src/modules/didcomm/services/DidCommDocumentService.ts +++ b/packages/didcomm/src/services/DidCommDocumentService.ts @@ -1,12 +1,16 @@ -import type { AgentContext } from '../../../agent' -import type { Key } from '../../../crypto' -import type { ResolvedDidCommService } from '../types' +import type { AgentContext, Key, ResolvedDidCommService } from '@credo-ts/core' + +import { + KeyType, + injectable, + DidResolverService, + DidCommV1Service, + getKeyFromVerificationMethod, + IndyAgentService, + parseDid, + verkeyToInstanceOfKey, +} from '@credo-ts/core' -import { KeyType } from '../../../crypto' -import { injectable } from '../../../plugins' -import { DidResolverService } from '../../dids' -import { DidCommV1Service, getKeyFromVerificationMethod, IndyAgentService, parseDid } from '../../dids/domain' -import { verkeyToInstanceOfKey } from '../../dids/helpers' import { findMatchingEd25519Key } from '../util/matchingEd25519Key' @injectable() diff --git a/packages/core/src/modules/didcomm/services/__tests__/DidCommDocumentService.test.ts b/packages/didcomm/src/services/__tests__/DidCommDocumentService.test.ts similarity index 93% rename from packages/core/src/modules/didcomm/services/__tests__/DidCommDocumentService.test.ts rename to packages/didcomm/src/services/__tests__/DidCommDocumentService.test.ts index 422db7f2a5..6bba8b8cb9 100644 --- a/packages/core/src/modules/didcomm/services/__tests__/DidCommDocumentService.test.ts +++ b/packages/didcomm/src/services/__tests__/DidCommDocumentService.test.ts @@ -1,14 +1,14 @@ -import type { AgentContext } from '../../../../agent' -import type { VerificationMethod } from '../../../dids' - -import { getAgentContext, mockFunction } from '../../../../../tests/helpers' -import { Key, KeyType } from '../../../../crypto' -import { DidCommV1Service, DidDocument, IndyAgentService } from '../../../dids' -import { verkeyToInstanceOfKey } from '../../../dids/helpers' -import { DidResolverService } from '../../../dids/services/DidResolverService' +import type { AgentContext } from '../../../..//core/src/agent' +import type { VerificationMethod } from '../../../../core/src/modules/dids' + +import { Key, KeyType } from '../../../../core/src/crypto' +import { DidCommV1Service, DidDocument, IndyAgentService } from '../../../../core/src/modules/dids' +import { verkeyToInstanceOfKey } from '../../../../core/src/modules/dids/helpers' +import { DidResolverService } from '../../../../core/src/modules/dids/services/DidResolverService' +import { getAgentContext, mockFunction } from '../../../../core/tests/helpers' import { DidCommDocumentService } from '../DidCommDocumentService' -jest.mock('../../../dids/services/DidResolverService') +jest.mock('../../../../core/src/modules/dids/services/DidResolverService') const DidResolverServiceMock = DidResolverService as jest.Mock describe('DidCommDocumentService', () => { diff --git a/packages/core/src/modules/didcomm/services/index.ts b/packages/didcomm/src/services/index.ts similarity index 100% rename from packages/core/src/modules/didcomm/services/index.ts rename to packages/didcomm/src/services/index.ts diff --git a/packages/core/src/transport/HttpOutboundTransport.ts b/packages/didcomm/src/transport/HttpOutboundTransport.ts similarity index 77% rename from packages/core/src/transport/HttpOutboundTransport.ts rename to packages/didcomm/src/transport/HttpOutboundTransport.ts index 0d68d21413..01ba279e34 100644 --- a/packages/core/src/transport/HttpOutboundTransport.ts +++ b/packages/didcomm/src/transport/HttpOutboundTransport.ts @@ -1,17 +1,17 @@ import type { OutboundTransport } from './OutboundTransport' -import type { Agent } from '../agent/Agent' -import type { AgentMessageReceivedEvent } from '../agent/Events' -import type { Logger } from '../logger' +import type { AgentMessageReceivedEvent } from '../Events' import type { OutboundPackage } from '../types' +import type { AgentContext, Logger } from '@credo-ts/core' +import { EventEmitter, CredoError, JsonEncoder } from '@credo-ts/core' import { Subject } from 'rxjs' -import { AgentEventTypes } from '../agent/Events' -import { CredoError } from '../error/CredoError' -import { isValidJweStructure, JsonEncoder } from '../utils' +import { DidCommModuleConfig } from '../DidCommModuleConfig' +import { AgentEventTypes } from '../Events' +import { isValidJweStructure } from '../util/JWE' export class HttpOutboundTransport implements OutboundTransport { - private agent!: Agent + private agentContext!: AgentContext private logger!: Logger private fetch!: typeof fetch private isActive = false @@ -21,10 +21,10 @@ export class HttpOutboundTransport implements OutboundTransport { public supportedSchemes = ['http', 'https'] - public async start(agent: Agent): Promise { - this.agent = agent - this.logger = this.agent.config.logger - this.fetch = this.agent.config.agentDependencies.fetch + public async start(agentContext: AgentContext): Promise { + this.agentContext = agentContext + this.logger = this.agentContext.config.logger + this.fetch = this.agentContext.config.agentDependencies.fetch this.isActive = true this.outboundSessionCount = 0 @@ -36,18 +36,22 @@ export class HttpOutboundTransport implements OutboundTransport { this.isActive = false if (this.outboundSessionCount === 0) { - this.agent.config.logger.debug('No open outbound HTTP sessions. Immediately stopping HttpOutboundTransport') + this.agentContext.config.logger.debug( + 'No open outbound HTTP sessions. Immediately stopping HttpOutboundTransport' + ) return } - this.agent.config.logger.debug( + this.agentContext.config.logger.debug( `Still ${this.outboundSessionCount} open outbound HTTP sessions. Waiting for sessions to close before stopping HttpOutboundTransport` ) // Track all 'closed' sessions // TODO: add timeout? -> we have a timeout on the request return new Promise((resolve) => this.outboundSessionsObservable.subscribe(() => { - this.agent.config.logger.debug(`${this.outboundSessionCount} HttpOutboundTransport sessions still active`) + this.agentContext.config.logger.debug( + `${this.outboundSessionCount} HttpOutboundTransport sessions still active` + ) if (this.outboundSessionCount === 0) resolve() }) ) @@ -55,6 +59,7 @@ export class HttpOutboundTransport implements OutboundTransport { public async sendMessage(outboundPackage: OutboundPackage) { const { payload, endpoint } = outboundPackage + const didCommMimeType = this.agentContext.dependencyManager.resolve(DidCommModuleConfig).didCommMimeType if (!this.isActive) { throw new CredoError('Outbound transport is not active. Not sending message.') @@ -79,7 +84,7 @@ export class HttpOutboundTransport implements OutboundTransport { response = await this.fetch(endpoint, { method: 'POST', body: JSON.stringify(payload), - headers: { 'Content-Type': this.agent.config.didCommMimeType }, + headers: { 'Content-Type': didCommMimeType }, signal: abortController.signal as NonNullable, }) clearTimeout(id) @@ -116,7 +121,8 @@ export class HttpOutboundTransport implements OutboundTransport { return } // Emit event with the received agent message. - this.agent.events.emit(this.agent.context, { + const eventEmitter = this.agentContext.dependencyManager.resolve(EventEmitter) + eventEmitter.emit(this.agentContext, { type: AgentEventTypes.AgentMessageReceived, payload: { message: encryptedMessage, @@ -133,7 +139,7 @@ export class HttpOutboundTransport implements OutboundTransport { error, message: error.message, body: payload, - didCommMimeType: this.agent.config.didCommMimeType, + didCommMimeType, }) throw new CredoError(`Error sending message to ${endpoint}: ${error.message}`, { cause: error }) } finally { diff --git a/packages/core/src/transport/InboundTransport.ts b/packages/didcomm/src/transport/InboundTransport.ts similarity index 57% rename from packages/core/src/transport/InboundTransport.ts rename to packages/didcomm/src/transport/InboundTransport.ts index fd744bfcfa..cd1d10c9fd 100644 --- a/packages/core/src/transport/InboundTransport.ts +++ b/packages/didcomm/src/transport/InboundTransport.ts @@ -1,7 +1,7 @@ -import type { Agent } from '../agent/Agent' +import type { AgentContext } from '@credo-ts/core' export interface InboundTransport { // eslint-disable-next-line @typescript-eslint/no-explicit-any - start(agent: Agent): Promise + start(agent: AgentContext): Promise stop(): Promise } diff --git a/packages/core/src/transport/OutboundTransport.ts b/packages/didcomm/src/transport/OutboundTransport.ts similarity index 72% rename from packages/core/src/transport/OutboundTransport.ts rename to packages/didcomm/src/transport/OutboundTransport.ts index 0fa33bbe61..6ee6bc1f82 100644 --- a/packages/core/src/transport/OutboundTransport.ts +++ b/packages/didcomm/src/transport/OutboundTransport.ts @@ -1,5 +1,5 @@ -import type { Agent } from '../agent/Agent' import type { OutboundPackage } from '../types' +import type { AgentContext } from '@credo-ts/core' export interface OutboundTransport { supportedSchemes: string[] @@ -7,6 +7,6 @@ export interface OutboundTransport { sendMessage(outboundPackage: OutboundPackage): Promise // eslint-disable-next-line @typescript-eslint/no-explicit-any - start(agent: Agent): Promise + start(agentContext: AgentContext): Promise stop(): Promise } diff --git a/packages/core/src/transport/TransportEventTypes.ts b/packages/didcomm/src/transport/TransportEventTypes.ts similarity index 89% rename from packages/core/src/transport/TransportEventTypes.ts rename to packages/didcomm/src/transport/TransportEventTypes.ts index 1dd34674d3..b681a05c2b 100644 --- a/packages/core/src/transport/TransportEventTypes.ts +++ b/packages/didcomm/src/transport/TransportEventTypes.ts @@ -1,5 +1,5 @@ -import type { BaseEvent } from '../agent/Events' -import type { TransportSession } from '../agent/TransportService' +import type { TransportSession } from '../TransportService' +import type { BaseEvent } from '@credo-ts/core' export enum TransportEventTypes { OutboundWebSocketClosedEvent = 'OutboundWebSocketClosedEvent', diff --git a/packages/core/src/transport/WsOutboundTransport.ts b/packages/didcomm/src/transport/WsOutboundTransport.ts similarity index 85% rename from packages/core/src/transport/WsOutboundTransport.ts rename to packages/didcomm/src/transport/WsOutboundTransport.ts index 545e675ad2..66b029e826 100644 --- a/packages/core/src/transport/WsOutboundTransport.ts +++ b/packages/didcomm/src/transport/WsOutboundTransport.ts @@ -1,33 +1,32 @@ import type { OutboundTransport } from './OutboundTransport' import type { OutboundWebSocketClosedEvent, OutboundWebSocketOpenedEvent } from './TransportEventTypes' -import type { Agent } from '../agent/Agent' -import type { AgentMessageReceivedEvent } from '../agent/Events' -import type { Logger } from '../logger' +import type { AgentMessageReceivedEvent } from '../Events' import type { OutboundPackage } from '../types' +import type { AgentContext, Logger } from '@credo-ts/core' import type { WebSocket } from 'ws' -import { AgentEventTypes } from '../agent/Events' -import { CredoError } from '../error/CredoError' -import { isValidJweStructure, JsonEncoder } from '../utils' -import { Buffer } from '../utils/buffer' +import { EventEmitter, CredoError, JsonEncoder, Buffer } from '@credo-ts/core' + +import { AgentEventTypes } from '../Events' +import { isValidJweStructure } from '../util/JWE' import { TransportEventTypes } from './TransportEventTypes' export class WsOutboundTransport implements OutboundTransport { private transportTable: Map = new Map() - private agent!: Agent + private agentContext!: AgentContext private logger!: Logger private WebSocketClass!: typeof WebSocket public supportedSchemes = ['ws', 'wss'] private isActive = false - public async start(agent: Agent): Promise { - this.agent = agent + public async start(agentContext: AgentContext): Promise { + this.agentContext = agentContext - this.logger = agent.config.logger + this.logger = agentContext.config.logger this.logger.debug('Starting WS outbound transport') - this.WebSocketClass = agent.config.agentDependencies.WebSocketClass + this.WebSocketClass = agentContext.config.agentDependencies.WebSocketClass this.isActive = true } @@ -137,7 +136,9 @@ export class WsOutboundTransport implements OutboundTransport { } this.logger.debug('Payload received from mediator:', payload) - this.agent.events.emit(this.agent.context, { + const eventEmitter = this.agentContext.dependencyManager.resolve(EventEmitter) + + eventEmitter.emit(this.agentContext, { type: AgentEventTypes.AgentMessageReceived, payload: { message: payload, @@ -161,12 +162,13 @@ export class WsOutboundTransport implements OutboundTransport { return new Promise((resolve, reject) => { this.logger.debug(`Connecting to WebSocket ${endpoint}`) const socket = new this.WebSocketClass(endpoint) + const eventEmitter = this.agentContext.dependencyManager.resolve(EventEmitter) socket.onopen = () => { this.logger.debug(`Successfully connected to WebSocket ${endpoint}`) resolve(socket) - this.agent.events.emit(this.agent.context, { + eventEmitter.emit(this.agentContext, { type: TransportEventTypes.OutboundWebSocketOpenedEvent, payload: { socketId, @@ -187,7 +189,7 @@ export class WsOutboundTransport implements OutboundTransport { socket.removeEventListener('message', this.handleMessageEvent) this.transportTable.delete(socketId) - this.agent.events.emit(this.agent.context, { + eventEmitter.emit(this.agentContext, { type: TransportEventTypes.OutboundWebSocketClosedEvent, payload: { socketId, diff --git a/packages/core/src/transport/index.ts b/packages/didcomm/src/transport/index.ts similarity index 100% rename from packages/core/src/transport/index.ts rename to packages/didcomm/src/transport/index.ts diff --git a/packages/didcomm/src/types.ts b/packages/didcomm/src/types.ts new file mode 100644 index 0000000000..7cf8957834 --- /dev/null +++ b/packages/didcomm/src/types.ts @@ -0,0 +1,52 @@ +export type ProtocolVersion = `${number}.${number}` +export interface PlaintextMessage { + '@type': string + '@id': string + '~thread'?: { + thid?: string + pthid?: string + } + [key: string]: unknown +} + +export type EncryptedMessage = { + /** + * The "protected" member MUST be present and contain the value + * BASE64URL(UTF8(JWE Protected Header)) when the JWE Protected + * Header value is non-empty; otherwise, it MUST be absent. These + * Header Parameter values are integrity protected. + */ + protected: string + + /** + * The "iv" member MUST be present and contain the value + * BASE64URL(JWE Initialization Vector) when the JWE Initialization + * Vector value is non-empty; otherwise, it MUST be absent. + */ + iv: string + + /** + * The "ciphertext" member MUST be present and contain the value + * BASE64URL(JWE Ciphertext). + */ + ciphertext: string + + /** + * The "tag" member MUST be present and contain the value + * BASE64URL(JWE Authentication Tag) when the JWE Authentication Tag + * value is non-empty; otherwise, it MUST be absent. + */ + tag: string +} + +export enum DidCommMimeType { + V0 = 'application/ssi-agent-wire', + V1 = 'application/didcomm-envelope-enc', +} + +export interface OutboundPackage { + payload: EncryptedMessage + responseRequested?: boolean + endpoint?: string + connectionId?: string +} diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/didPeer4kgVt6CidfKgo1MoWMqsQX.json b/packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/didPeer4kgVt6CidfKgo1MoWMqsQX.json similarity index 100% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/didPeer4kgVt6CidfKgo1MoWMqsQX.json rename to packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/didPeer4kgVt6CidfKgo1MoWMqsQX.json diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/didPeerR1xKJw17sUoXhejEpugMYJ.json b/packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/didPeerR1xKJw17sUoXhejEpugMYJ.json similarity index 100% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/didPeerR1xKJw17sUoXhejEpugMYJ.json rename to packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/didPeerR1xKJw17sUoXhejEpugMYJ.json diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeer4kgVt6CidfKgo1MoWMqsQX.json b/packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeer4kgVt6CidfKgo1MoWMqsQX.json similarity index 100% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeer4kgVt6CidfKgo1MoWMqsQX.json rename to packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeer4kgVt6CidfKgo1MoWMqsQX.json diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeerR1xKJw17sUoXhejEpugMYJ.json b/packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeerR1xKJw17sUoXhejEpugMYJ.json similarity index 100% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeerR1xKJw17sUoXhejEpugMYJ.json rename to packages/didcomm/src/updates/0.1-0.2/__tests__/__fixtures__/legacyDidPeerR1xKJw17sUoXhejEpugMYJ.json diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/connection.test.ts b/packages/didcomm/src/updates/0.1-0.2/__tests__/connection.test.ts similarity index 96% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/connection.test.ts rename to packages/didcomm/src/updates/0.1-0.2/__tests__/connection.test.ts index 7002d39535..05fa7406a8 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/connection.test.ts +++ b/packages/didcomm/src/updates/0.1-0.2/__tests__/connection.test.ts @@ -1,21 +1,17 @@ -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests/helpers' -import { Agent } from '../../../../../agent/Agent' +import { Agent, DidDocumentRole, DidRecord, DidRepository, JsonTransformer } from '../../../../../core' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests/helpers' import { + ConnectionRepository, + OutOfBandRepository, ConnectionRecord, - ConnectionRole, - ConnectionState, + OutOfBandRole, + OutOfBandState, + OutOfBandRecord, DidExchangeRole, DidExchangeState, -} from '../../../../../modules/connections' -import { ConnectionRepository } from '../../../../../modules/connections/repository/ConnectionRepository' -import { DidDocumentRole } from '../../../../../modules/dids/domain/DidDocumentRole' -import { DidRecord } from '../../../../../modules/dids/repository' -import { DidRepository } from '../../../../../modules/dids/repository/DidRepository' -import { OutOfBandRole } from '../../../../../modules/oob/domain/OutOfBandRole' -import { OutOfBandState } from '../../../../../modules/oob/domain/OutOfBandState' -import { OutOfBandRecord } from '../../../../../modules/oob/repository' -import { OutOfBandRepository } from '../../../../../modules/oob/repository/OutOfBandRepository' -import { JsonTransformer } from '../../../../../utils' + ConnectionRole, + ConnectionState, +} from '../../../modules' import * as testModule from '../connection' import didPeer4kgVt6CidfKgo1MoWMqsQX from './__fixtures__/didPeer4kgVt6CidfKgo1MoWMqsQX.json' @@ -26,19 +22,19 @@ import legacyDidPeerR1xKJw17sUoXhejEpugMYJ from './__fixtures__/legacyDidPeerR1x const agentConfig = getAgentConfig('Migration ConnectionRecord 0.1-0.2') const agentContext = getAgentContext() -jest.mock('../../../../../modules/connections/repository/ConnectionRepository') +jest.mock('../../../modules/connections/repository/ConnectionRepository') const ConnectionRepositoryMock = ConnectionRepository as jest.Mock const connectionRepository = new ConnectionRepositoryMock() -jest.mock('../../../../../modules/dids/repository/DidRepository') +jest.mock('../../../../../core/src/modules/dids/repository/DidRepository') const DidRepositoryMock = DidRepository as jest.Mock const didRepository = new DidRepositoryMock() -jest.mock('../../../../../modules/oob/repository/OutOfBandRepository') +jest.mock('../../../modules/oob/repository/OutOfBandRepository') const OutOfBandRepositoryMock = OutOfBandRepository as jest.Mock const outOfBandRepository = new OutOfBandRepositoryMock() -jest.mock('../../../../../agent/Agent', () => { +jest.mock('../../../../../core/src/agent/Agent', () => { return { Agent: jest.fn(() => ({ config: agentConfig, diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/credential.test.ts b/packages/didcomm/src/updates/0.1-0.2/__tests__/credential.test.ts similarity index 95% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/credential.test.ts rename to packages/didcomm/src/updates/0.1-0.2/__tests__/credential.test.ts index d7eefe2be7..7d2f91cda5 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/credential.test.ts +++ b/packages/didcomm/src/updates/0.1-0.2/__tests__/credential.test.ts @@ -1,26 +1,26 @@ -import type { CredentialRecordBinding } from '../../../../../../src/modules/credentials' - -import { CredentialExchangeRecord, CredentialState } from '../../../../../../src/modules/credentials' -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests/helpers' -import { Agent } from '../../../../../agent/Agent' -import { CredentialRepository } from '../../../../../modules/credentials/repository/CredentialRepository' -import { JsonTransformer } from '../../../../../utils' -import { DidCommMessageRole } from '../../../../didcomm' -import { DidCommMessageRepository } from '../../../../didcomm/DidCommMessageRepository' +import type { CredentialRecordBinding } from '../../../modules/credentials' + +import { Agent } from '../../../../../core/src/agent/Agent' +import { JsonTransformer } from '../../../../../core/src/utils' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests/helpers' +import { CredentialExchangeRecord, CredentialState } from '../../../modules/credentials' +import { CredentialRepository } from '../../../modules/credentials/repository/CredentialRepository' +import { DidCommMessageRole } from '../../../repository' +import { DidCommMessageRepository } from '../../../repository/DidCommMessageRepository' import * as testModule from '../credential' const agentConfig = getAgentConfig('Migration CredentialRecord 0.1-0.2') const agentContext = getAgentContext() -jest.mock('../../../../../modules/credentials/repository/CredentialRepository') +jest.mock('../../../modules/credentials/repository/CredentialRepository') const CredentialRepositoryMock = CredentialRepository as jest.Mock const credentialRepository = new CredentialRepositoryMock() -jest.mock('../../../../didcomm/DidCommMessageRepository') +jest.mock('../../../repository/DidCommMessageRepository') const DidCommMessageRepositoryMock = DidCommMessageRepository as jest.Mock const didCommMessageRepository = new DidCommMessageRepositoryMock() -jest.mock('../../../../../agent/Agent', () => { +jest.mock('../../../../../core/src/agent/Agent', () => { return { Agent: jest.fn(() => ({ config: agentConfig, diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/mediation.test.ts b/packages/didcomm/src/updates/0.1-0.2/__tests__/mediation.test.ts similarity index 92% rename from packages/core/src/storage/migration/updates/0.1-0.2/__tests__/mediation.test.ts rename to packages/didcomm/src/updates/0.1-0.2/__tests__/mediation.test.ts index b5616578e2..7bb5b57fc2 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/__tests__/mediation.test.ts +++ b/packages/didcomm/src/updates/0.1-0.2/__tests__/mediation.test.ts @@ -1,18 +1,18 @@ -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests/helpers' -import { Agent } from '../../../../../agent/Agent' -import { MediationRole, MediationRecord } from '../../../../../modules/routing' -import { MediationRepository } from '../../../../../modules/routing/repository/MediationRepository' -import { JsonTransformer } from '../../../../../utils' +import { Agent } from '../../../../../core/src/agent/Agent' +import { JsonTransformer } from '../../../../../core/src/utils' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests/helpers' +import { MediationRole, MediationRecord } from '../../../modules/routing' +import { MediationRepository } from '../../../modules/routing/repository/MediationRepository' import * as testModule from '../mediation' const agentConfig = getAgentConfig('Migration MediationRecord 0.1-0.2') const agentContext = getAgentContext() -jest.mock('../../../../../modules/routing/repository/MediationRepository') +jest.mock('../../../modules/routing/repository/MediationRepository') const MediationRepositoryMock = MediationRepository as jest.Mock const mediationRepository = new MediationRepositoryMock() -jest.mock('../../../../../agent/Agent', () => { +jest.mock('../../../../../core/src/agent/Agent', () => { return { Agent: jest.fn(() => ({ config: agentConfig, diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/connection.ts b/packages/didcomm/src/updates/0.1-0.2/connection.ts similarity index 94% rename from packages/core/src/storage/migration/updates/0.1-0.2/connection.ts rename to packages/didcomm/src/updates/0.1-0.2/connection.ts index 266ccce315..59ced9e16c 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/connection.ts +++ b/packages/didcomm/src/updates/0.1-0.2/connection.ts @@ -1,8 +1,16 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { ConnectionRecord } from '../../../../modules/connections' -import type { JsonObject } from '../../../../types' +import type { ConnectionRecord } from '../../modules/connections' +import type { BaseAgent, JsonObject } from '@credo-ts/core' + +import { + DidKey, + DidDocumentRole, + DidRecord, + DidRepository, + DidRecordMetadataKeys, + JsonEncoder, + JsonTransformer, +} from '@credo-ts/core' -import { outOfBandServiceToInlineKeysNumAlgo2Did } from '../../../..//modules/dids/methods/peer/peerDidNumAlgo2' import { DidExchangeState, ConnectionState, @@ -11,17 +19,13 @@ import { DidDoc, ConnectionRepository, DidExchangeRole, -} from '../../../../modules/connections' -import { convertToNewDidDocument } from '../../../../modules/connections/services/helpers' -import { DidKey } from '../../../../modules/dids' -import { DidDocumentRole } from '../../../../modules/dids/domain/DidDocumentRole' -import { DidRecord, DidRepository } from '../../../../modules/dids/repository' -import { DidRecordMetadataKeys } from '../../../../modules/dids/repository/didRecordMetadataTypes' -import { OutOfBandRole } from '../../../../modules/oob/domain/OutOfBandRole' -import { OutOfBandState } from '../../../../modules/oob/domain/OutOfBandState' -import { convertToNewInvitation } from '../../../../modules/oob/helpers' -import { OutOfBandRecord, OutOfBandRepository } from '../../../../modules/oob/repository' -import { JsonEncoder, JsonTransformer } from '../../../../utils' +} from '../../modules/connections' +import { convertToNewDidDocument } from '../../modules/connections/services/helpers' +import { convertToNewInvitation } from '../../modules/oob/converters' +import { OutOfBandRole } from '../../modules/oob/domain/OutOfBandRole' +import { OutOfBandState } from '../../modules/oob/domain/OutOfBandState' +import { outOfBandServiceToInlineKeysNumAlgo2Did } from '../../modules/oob/helpers' +import { OutOfBandRecord, OutOfBandRepository } from '../../modules/oob/repository' /** * Migrates the {@link ConnectionRecord} to 0.2 compatible format. It fetches all records from storage diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/credential.ts b/packages/didcomm/src/updates/0.1-0.2/credential.ts similarity index 94% rename from packages/core/src/storage/migration/updates/0.1-0.2/credential.ts rename to packages/didcomm/src/updates/0.1-0.2/credential.ts index 9003f38456..186764464f 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/credential.ts +++ b/packages/didcomm/src/updates/0.1-0.2/credential.ts @@ -1,11 +1,12 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { CredentialExchangeRecord } from '../../../../modules/credentials' -import type { JsonObject, PlaintextMessage } from '../../../../types' - -import { CredentialState } from '../../../../modules/credentials/models/CredentialState' -import { CredentialRepository } from '../../../../modules/credentials/repository/CredentialRepository' -import { Metadata } from '../../../Metadata' -import { DidCommMessageRepository, DidCommMessageRecord, DidCommMessageRole } from '../../../didcomm' +import type { CredentialExchangeRecord } from '../../modules/credentials' +import type { PlaintextMessage } from '../../types' +import type { BaseAgent, JsonObject } from '@credo-ts/core' + +import { Metadata } from '@credo-ts/core' + +import { CredentialState } from '../../modules/credentials/models/CredentialState' +import { CredentialRepository } from '../../modules/credentials/repository/CredentialRepository' +import { DidCommMessageRole, DidCommMessageRepository, DidCommMessageRecord } from '../../repository' /** * Migrates the {@link CredentialRecord} to 0.2 compatible format. It fetches all records from storage diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/index.ts b/packages/didcomm/src/updates/0.1-0.2/index.ts similarity index 63% rename from packages/core/src/storage/migration/updates/0.1-0.2/index.ts rename to packages/didcomm/src/updates/0.1-0.2/index.ts index 17065705f3..931fc6ae12 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/index.ts +++ b/packages/didcomm/src/updates/0.1-0.2/index.ts @@ -1,14 +1,11 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { UpdateConfig } from '../../updates' +import type { BaseAgent, UpdateConfig } from '@credo-ts/core' import { migrateConnectionRecordToV0_2 } from './connection' import { migrateCredentialRecordToV0_2 } from './credential' import { migrateMediationRecordToV0_2 } from './mediation' -export interface V0_1ToV0_2UpdateConfig { - mediationRoleUpdateStrategy: 'allMediator' | 'allRecipient' | 'recipientIfEndpoint' | 'doNotChange' -} - +// FIXME: Properly support custom configuration parameters in +// module updates export async function updateV0_1ToV0_2(agent: Agent, config: UpdateConfig): Promise { await migrateCredentialRecordToV0_2(agent) await migrateMediationRecordToV0_2(agent, config.v0_1ToV0_2) diff --git a/packages/core/src/storage/migration/updates/0.1-0.2/mediation.ts b/packages/didcomm/src/updates/0.1-0.2/mediation.ts similarity index 93% rename from packages/core/src/storage/migration/updates/0.1-0.2/mediation.ts rename to packages/didcomm/src/updates/0.1-0.2/mediation.ts index c131646507..bf30bb5b6f 100644 --- a/packages/core/src/storage/migration/updates/0.1-0.2/mediation.ts +++ b/packages/didcomm/src/updates/0.1-0.2/mediation.ts @@ -1,8 +1,7 @@ -import type { V0_1ToV0_2UpdateConfig } from './index' -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { MediationRecord } from '../../../../modules/routing' +import type { MediationRecord } from '../../modules/routing' +import type { BaseAgent, V0_1ToV0_2UpdateConfig } from '@credo-ts/core' -import { MediationRepository, MediationRole } from '../../../../modules/routing' +import { MediationRepository, MediationRole } from '../../modules/routing' /** * Migrates the {@link MediationRecord} to 0.2 compatible format. It fetches all records from storage diff --git a/packages/core/src/storage/migration/updates/0.2-0.3/__tests__/connection.test.ts b/packages/didcomm/src/updates/0.2-0.3/__tests__/connection.test.ts similarity index 87% rename from packages/core/src/storage/migration/updates/0.2-0.3/__tests__/connection.test.ts rename to packages/didcomm/src/updates/0.2-0.3/__tests__/connection.test.ts index 64ada8c5d2..025689b995 100644 --- a/packages/core/src/storage/migration/updates/0.2-0.3/__tests__/connection.test.ts +++ b/packages/didcomm/src/updates/0.2-0.3/__tests__/connection.test.ts @@ -1,31 +1,27 @@ -import type { ConnectionRecordProps, CustomConnectionTags } from '../../../../../modules/connections' -import type { MediationRecordProps } from '../../../../../modules/routing' - -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests/helpers' -import { Agent } from '../../../../../agent/Agent' -import { - ConnectionRecord, - ConnectionRepository, - ConnectionType, - DidExchangeRole, - DidExchangeState, -} from '../../../../../modules/connections' -import { MediationRecord, MediationState, MediationRepository, MediationRole } from '../../../../../modules/routing' -import { JsonTransformer } from '../../../../../utils' +import type { MediationRecordProps } from '../../../modules' +import type { ConnectionRecordProps, CustomConnectionTags } from '../../../modules/connections' + +import { Agent } from '../../../../..//core/src/agent/Agent' +import { JsonTransformer } from '../../../../../core/src/utils' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests/helpers' +import { MediationRecord, MediationRole, MediationState } from '../../../modules' +import { ConnectionRecord, ConnectionType, DidExchangeRole, DidExchangeState } from '../../../modules/connections' +import { ConnectionRepository } from '../../../modules/connections/repository/ConnectionRepository' +import { MediationRepository } from '../../../modules/routing/repository/MediationRepository' import * as testModule from '../connection' const agentConfig = getAgentConfig('Migration ConnectionRecord 0.2-0.3') const agentContext = getAgentContext() -jest.mock('../../../../../modules/connections/repository/ConnectionRepository') +jest.mock('../../../modules/connections/repository/ConnectionRepository') const ConnectionRepositoryMock = ConnectionRepository as jest.Mock const connectionRepository = new ConnectionRepositoryMock() -jest.mock('../../../../../modules/routing/repository/MediationRepository') +jest.mock('../../../modules/routing/repository/MediationRepository') const MediationRepositoryMock = MediationRepository as jest.Mock const mediationRepository = new MediationRepositoryMock() -jest.mock('../../../../../agent/Agent', () => { +jest.mock('../../../../../core/src/agent/Agent', () => { return { Agent: jest.fn(() => ({ config: agentConfig, diff --git a/packages/core/src/storage/migration/updates/0.2-0.3/__tests__/proof.test.ts b/packages/didcomm/src/updates/0.2-0.3/__tests__/proof.test.ts similarity index 93% rename from packages/core/src/storage/migration/updates/0.2-0.3/__tests__/proof.test.ts rename to packages/didcomm/src/updates/0.2-0.3/__tests__/proof.test.ts index e35af14c16..938954c441 100644 --- a/packages/core/src/storage/migration/updates/0.2-0.3/__tests__/proof.test.ts +++ b/packages/didcomm/src/updates/0.2-0.3/__tests__/proof.test.ts @@ -1,24 +1,24 @@ -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests/helpers' -import { Agent } from '../../../../../agent/Agent' -import { ProofExchangeRecord, ProofState } from '../../../../../modules/proofs' -import { ProofRepository } from '../../../../../modules/proofs/repository/ProofRepository' -import { JsonTransformer } from '../../../../../utils' -import { DidCommMessageRole } from '../../../../didcomm' -import { DidCommMessageRepository } from '../../../../didcomm/DidCommMessageRepository' +import { Agent } from '../../../../../core/src/agent/Agent' +import { JsonTransformer } from '../../../../../core/src/utils' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests/helpers' +import { ProofExchangeRecord, ProofState } from '../../../modules/proofs' +import { ProofRepository } from '../../../modules/proofs/repository/ProofRepository' +import { DidCommMessageRole } from '../../../repository' +import { DidCommMessageRepository } from '../../../repository/DidCommMessageRepository' import * as testModule from '../proof' const agentConfig = getAgentConfig('Migration ProofExchangeRecord 0.2-0.3') const agentContext = getAgentContext() -jest.mock('../../../../../modules/proofs/repository/ProofRepository') +jest.mock('../../../modules/proofs/repository/ProofRepository') const ProofRepositoryMock = ProofRepository as jest.Mock const proofRepository = new ProofRepositoryMock() -jest.mock('../../../../didcomm/DidCommMessageRepository') +jest.mock('../../../repository/DidCommMessageRepository') const DidCommMessageRepositoryMock = DidCommMessageRepository as jest.Mock const didCommMessageRepository = new DidCommMessageRepositoryMock() -jest.mock('../../../../../agent/Agent', () => { +jest.mock('../../../../../core/src/agent/Agent', () => { return { Agent: jest.fn(() => ({ config: agentConfig, diff --git a/packages/core/src/storage/migration/updates/0.2-0.3/connection.ts b/packages/didcomm/src/updates/0.2-0.3/connection.ts similarity index 89% rename from packages/core/src/storage/migration/updates/0.2-0.3/connection.ts rename to packages/didcomm/src/updates/0.2-0.3/connection.ts index 80ec2fcfae..a9136a2842 100644 --- a/packages/core/src/storage/migration/updates/0.2-0.3/connection.ts +++ b/packages/didcomm/src/updates/0.2-0.3/connection.ts @@ -1,8 +1,8 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { ConnectionRecord } from '../../../../modules/connections' +import type { ConnectionRecord } from '../../modules/connections' +import type { BaseAgent } from '@credo-ts/core' -import { ConnectionType, ConnectionRepository } from '../../../../modules/connections' -import { MediationRepository } from '../../../../modules/routing' +import { ConnectionType, ConnectionRepository } from '../../modules/connections' +import { MediationRepository } from '../../modules/routing' /** * Migrate the {@link ConnectionRecord} to a 0.3 compatible format. diff --git a/packages/core/src/storage/migration/updates/0.2-0.3/index.ts b/packages/didcomm/src/updates/0.2-0.3/index.ts similarity index 83% rename from packages/core/src/storage/migration/updates/0.2-0.3/index.ts rename to packages/didcomm/src/updates/0.2-0.3/index.ts index 60a56fa546..6b82eb7061 100644 --- a/packages/core/src/storage/migration/updates/0.2-0.3/index.ts +++ b/packages/didcomm/src/updates/0.2-0.3/index.ts @@ -1,4 +1,4 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' +import type { BaseAgent } from '@credo-ts/core' import { migrateConnectionRecordToV0_3 } from './connection' import { migrateProofExchangeRecordToV0_3 } from './proof' diff --git a/packages/core/src/storage/migration/updates/0.2-0.3/proof.ts b/packages/didcomm/src/updates/0.2-0.3/proof.ts similarity index 92% rename from packages/core/src/storage/migration/updates/0.2-0.3/proof.ts rename to packages/didcomm/src/updates/0.2-0.3/proof.ts index e92cd73649..082cd322bf 100644 --- a/packages/core/src/storage/migration/updates/0.2-0.3/proof.ts +++ b/packages/didcomm/src/updates/0.2-0.3/proof.ts @@ -1,10 +1,8 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { ProofExchangeRecord } from '../../../../modules/proofs' -import type { JsonObject, PlaintextMessage } from '../../../../types' +import type { PlaintextMessage } from '../../types' +import type { BaseAgent, JsonObject } from '@credo-ts/core' -import { ProofState } from '../../../../modules/proofs/models' -import { ProofRepository } from '../../../../modules/proofs/repository/ProofRepository' -import { DidCommMessageRepository, DidCommMessageRecord, DidCommMessageRole } from '../../../didcomm' +import { ProofRepository, ProofState, type ProofExchangeRecord } from '../../modules/proofs' +import { DidCommMessageRole, DidCommMessageRepository, DidCommMessageRecord } from '../../repository' /** * Migrates the {@link ProofExchangeRecord} to 0.3 compatible format. It fetches all records from storage diff --git a/packages/core/src/storage/migration/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts b/packages/didcomm/src/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts similarity index 90% rename from packages/core/src/storage/migration/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts rename to packages/didcomm/src/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts index 90895c6075..5314fe19cc 100644 --- a/packages/core/src/storage/migration/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts +++ b/packages/didcomm/src/updates/0.4-0.5/__tests__/credentialExchangeRecord.test.ts @@ -1,26 +1,26 @@ -import type { CredentialRecordBinding } from '../../../../../modules/credentials' - -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests' -import { Agent } from '../../../../../agent/Agent' -import { CredentialRole, CredentialState, CredentialExchangeRecord } from '../../../../../modules/credentials' -import { CredentialRepository } from '../../../../../modules/credentials/repository/CredentialRepository' -import { JsonTransformer } from '../../../../../utils' -import { DidCommMessageRecord, DidCommMessageRole } from '../../../../didcomm' -import { DidCommMessageRepository } from '../../../../didcomm/DidCommMessageRepository' +import type { CredentialRecordBinding } from '../../../modules/credentials' + +import { Agent } from '../../../../../core/src/agent/Agent' +import { JsonTransformer } from '../../../../../core/src/utils' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests' +import { CredentialRole, CredentialState, CredentialExchangeRecord } from '../../../modules/credentials' +import { CredentialRepository } from '../../../modules/credentials/repository/CredentialRepository' +import { DidCommMessageRole, DidCommMessageRecord } from '../../../repository' +import { DidCommMessageRepository } from '../../../repository/DidCommMessageRepository' import * as testModule from '../credentialExchangeRecord' const agentConfig = getAgentConfig('Migration - Credential Exchange Record - 0.4-0.5') const agentContext = getAgentContext() -jest.mock('../../../../../modules/credentials/repository/CredentialRepository') +jest.mock('../../../modules/credentials/repository/CredentialRepository') const CredentialRepositoryMock = CredentialRepository as jest.Mock const credentialRepository = new CredentialRepositoryMock() -jest.mock('../../../../didcomm/DidCommMessageRepository') +jest.mock('../../../repository/DidCommMessageRepository') const DidCommMessageRepositoryMock = DidCommMessageRepository as jest.Mock const didCommMessageRepository = new DidCommMessageRepositoryMock() -jest.mock('../../../../../agent/Agent', () => ({ +jest.mock('../../../../../core/src/agent/Agent', () => ({ Agent: jest.fn(() => ({ config: agentConfig, context: agentContext, diff --git a/packages/core/src/storage/migration/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts b/packages/didcomm/src/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts similarity index 90% rename from packages/core/src/storage/migration/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts rename to packages/didcomm/src/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts index be397ffe96..0e26dfdf46 100644 --- a/packages/core/src/storage/migration/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts +++ b/packages/didcomm/src/updates/0.4-0.5/__tests__/proofExchangeRecord.test.ts @@ -1,22 +1,23 @@ -import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../../tests' -import { Agent } from '../../../../../agent/Agent' -import { ProofExchangeRecord, ProofRepository, ProofRole, ProofState } from '../../../../../modules/proofs' -import { JsonTransformer } from '../../../../../utils' -import { DidCommMessageRecord, DidCommMessageRepository, DidCommMessageRole } from '../../../../didcomm' +import { Agent } from '../../../../../core/src/agent/Agent' +import { JsonTransformer } from '../../../../../core/src/utils' +import { getAgentConfig, getAgentContext, mockFunction } from '../../../../../core/tests' +import { ProofExchangeRecord, ProofRepository, ProofRole, ProofState } from '../../../modules/proofs' +import { DidCommMessageRecord, DidCommMessageRole } from '../../../repository' +import { DidCommMessageRepository } from '../../../repository/DidCommMessageRepository' import * as testModule from '../proofExchangeRecord' const agentConfig = getAgentConfig('Migration - Proof Exchange Record - 0.4-0.5') const agentContext = getAgentContext() -jest.mock('../../../../../modules/proofs/repository/ProofRepository') +jest.mock('../../../modules/proofs/repository/ProofRepository') const ProofRepositoryMock = ProofRepository as jest.Mock const proofRepository = new ProofRepositoryMock() -jest.mock('../../../../didcomm/DidCommMessageRepository') +jest.mock('../../../repository/DidCommMessageRepository') const DidCommMessageRepositoryMock = DidCommMessageRepository as jest.Mock const didCommMessageRepository = new DidCommMessageRepositoryMock() -jest.mock('../../../../../agent/Agent', () => ({ +jest.mock('../../../../../core/src/agent/Agent', () => ({ Agent: jest.fn(() => ({ config: agentConfig, context: agentContext, diff --git a/packages/core/src/storage/migration/updates/0.4-0.5/credentialExchangeRecord.ts b/packages/didcomm/src/updates/0.4-0.5/credentialExchangeRecord.ts similarity index 94% rename from packages/core/src/storage/migration/updates/0.4-0.5/credentialExchangeRecord.ts rename to packages/didcomm/src/updates/0.4-0.5/credentialExchangeRecord.ts index e91b4be8f1..8887c2d8bc 100644 --- a/packages/core/src/storage/migration/updates/0.4-0.5/credentialExchangeRecord.ts +++ b/packages/didcomm/src/updates/0.4-0.5/credentialExchangeRecord.ts @@ -1,7 +1,8 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { CredentialExchangeRecord } from '../../../../modules/credentials' +import type { CredentialExchangeRecord } from '../../modules/credentials' +import type { BaseAgent } from '@credo-ts/core' + +import { CredoError } from '@credo-ts/core' -import { CredoError } from '../../../../error' import { V2RequestCredentialMessage, V2ProposeCredentialMessage, @@ -9,9 +10,9 @@ import { CredentialRole, CredentialRepository, CredentialState, -} from '../../../../modules/credentials' -import { parseMessageType } from '../../../../utils/messageType' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../didcomm' +} from '../../modules/credentials' +import { DidCommMessageRepository, DidCommMessageRole } from '../../repository' +import { parseMessageType } from '../../util/messageType' /** * Migrates the {@link CredentialExchangeRecord} to 0.5 compatible format. It fetches all credential exchange records from diff --git a/packages/didcomm/src/updates/0.4-0.5/index.ts b/packages/didcomm/src/updates/0.4-0.5/index.ts new file mode 100644 index 0000000000..65ab7e6763 --- /dev/null +++ b/packages/didcomm/src/updates/0.4-0.5/index.ts @@ -0,0 +1,9 @@ +import type { BaseAgent } from '@credo-ts/core' + +import { migrateCredentialExchangeRecordToV0_5 } from './credentialExchangeRecord' +import { migrateProofExchangeRecordToV0_5 } from './proofExchangeRecord' + +export async function updateV0_4ToV0_5(agent: Agent): Promise { + await migrateCredentialExchangeRecordToV0_5(agent) + await migrateProofExchangeRecordToV0_5(agent) +} diff --git a/packages/core/src/storage/migration/updates/0.4-0.5/proofExchangeRecord.ts b/packages/didcomm/src/updates/0.4-0.5/proofExchangeRecord.ts similarity index 93% rename from packages/core/src/storage/migration/updates/0.4-0.5/proofExchangeRecord.ts rename to packages/didcomm/src/updates/0.4-0.5/proofExchangeRecord.ts index c275d592fc..785f4e98c0 100644 --- a/packages/core/src/storage/migration/updates/0.4-0.5/proofExchangeRecord.ts +++ b/packages/didcomm/src/updates/0.4-0.5/proofExchangeRecord.ts @@ -1,16 +1,17 @@ -import type { BaseAgent } from '../../../../agent/BaseAgent' -import type { ProofExchangeRecord } from '../../../../modules/proofs' +import type { BaseAgent } from '@credo-ts/core' + +import { CredoError } from '@credo-ts/core' -import { CredoError } from '../../../../error' import { - ProofRole, ProofRepository, + ProofRole, ProofState, - V2RequestPresentationMessage, V2ProposePresentationMessage, -} from '../../../../modules/proofs' -import { parseMessageType } from '../../../../utils/messageType' -import { DidCommMessageRepository, DidCommMessageRole } from '../../../didcomm' + V2RequestPresentationMessage, + type ProofExchangeRecord, +} from '../../modules/proofs' +import { DidCommMessageRepository, DidCommMessageRole } from '../../repository' +import { parseMessageType } from '../../util/messageType' /** * Migrates the {@link ProofExchangeExchangeRecord} to 0.5 compatible format. It fetches all proof exchange records from diff --git a/packages/core/src/utils/JWE.ts b/packages/didcomm/src/util/JWE.ts similarity index 100% rename from packages/core/src/utils/JWE.ts rename to packages/didcomm/src/util/JWE.ts diff --git a/packages/core/src/utils/LinkedAttachment.ts b/packages/didcomm/src/util/LinkedAttachment.ts similarity index 100% rename from packages/core/src/utils/LinkedAttachment.ts rename to packages/didcomm/src/util/LinkedAttachment.ts diff --git a/packages/core/src/utils/__tests__/JWE.test.ts b/packages/didcomm/src/util/__tests__/JWE.test.ts similarity index 100% rename from packages/core/src/utils/__tests__/JWE.test.ts rename to packages/didcomm/src/util/__tests__/JWE.test.ts diff --git a/packages/core/src/modules/didcomm/util/__tests__/matchingEd25519Key.test.ts b/packages/didcomm/src/util/__tests__/matchingEd25519Key.test.ts similarity index 95% rename from packages/core/src/modules/didcomm/util/__tests__/matchingEd25519Key.test.ts rename to packages/didcomm/src/util/__tests__/matchingEd25519Key.test.ts index 3987d045e3..78a9d8e04b 100644 --- a/packages/core/src/modules/didcomm/util/__tests__/matchingEd25519Key.test.ts +++ b/packages/didcomm/src/util/__tests__/matchingEd25519Key.test.ts @@ -1,7 +1,7 @@ -import type { VerificationMethod } from '../../../dids' +import type { VerificationMethod } from '@credo-ts/core' + +import { DidDocument, Key, KeyType } from '@credo-ts/core' -import { Key, KeyType } from '../../../../crypto' -import { DidDocument } from '../../../dids' import { findMatchingEd25519Key } from '../matchingEd25519Key' describe('findMatchingEd25519Key', () => { diff --git a/packages/core/src/utils/__tests__/messageType.test.ts b/packages/didcomm/src/util/__tests__/messageType.test.ts similarity index 99% rename from packages/core/src/utils/__tests__/messageType.test.ts rename to packages/didcomm/src/util/__tests__/messageType.test.ts index 904e035eb7..63eeaa73ef 100644 --- a/packages/core/src/utils/__tests__/messageType.test.ts +++ b/packages/didcomm/src/util/__tests__/messageType.test.ts @@ -1,4 +1,4 @@ -import { AgentMessage } from '../../agent/AgentMessage' +import { AgentMessage } from '../../AgentMessage' import { canHandleMessageType, parseDidCommProtocolUri, diff --git a/packages/core/src/utils/__tests__/parseInvitation.test.ts b/packages/didcomm/src/util/__tests__/parseInvitation.test.ts similarity index 97% rename from packages/core/src/utils/__tests__/parseInvitation.test.ts rename to packages/didcomm/src/util/__tests__/parseInvitation.test.ts index b9966f52cd..e825238eeb 100644 --- a/packages/core/src/utils/__tests__/parseInvitation.test.ts +++ b/packages/didcomm/src/util/__tests__/parseInvitation.test.ts @@ -1,10 +1,9 @@ -import { agentDependencies } from '../../../tests' +import { JsonEncoder, JsonTransformer, MessageValidator } from '@credo-ts/core' + +import { agentDependencies } from '../../../../core/tests' import { ConnectionInvitationMessage } from '../../modules/connections' import { InvitationType, OutOfBandInvitation } from '../../modules/oob' -import { convertToNewInvitation } from '../../modules/oob/helpers' -import { JsonEncoder } from '../JsonEncoder' -import { JsonTransformer } from '../JsonTransformer' -import { MessageValidator } from '../MessageValidator' +import { convertToNewInvitation } from '../../modules/oob/converters' import { oobInvitationFromShortUrl, parseInvitationShortUrl } from '../parseInvitation' const mockOobInvite = { diff --git a/packages/core/src/utils/attachment.ts b/packages/didcomm/src/util/attachment.ts similarity index 84% rename from packages/core/src/utils/attachment.ts rename to packages/didcomm/src/util/attachment.ts index 1aa33bec2c..2e904aabf6 100644 --- a/packages/core/src/utils/attachment.ts +++ b/packages/didcomm/src/util/attachment.ts @@ -1,11 +1,7 @@ -import type { BaseName } from './MultiBaseEncoder' -import type { HashName } from '../crypto' import type { Attachment } from '../decorators/attachment/Attachment' +import type { HashName, BaseName } from '@credo-ts/core' -import { CredoError } from '../error/CredoError' - -import { HashlinkEncoder } from './HashlinkEncoder' -import { TypedArrayEncoder } from './TypedArrayEncoder' +import { CredoError, HashlinkEncoder, TypedArrayEncoder } from '@credo-ts/core' /** * Encodes an attachment based on the `data` property diff --git a/packages/core/src/modules/didcomm/util/matchingEd25519Key.ts b/packages/didcomm/src/util/matchingEd25519Key.ts similarity index 83% rename from packages/core/src/modules/didcomm/util/matchingEd25519Key.ts rename to packages/didcomm/src/util/matchingEd25519Key.ts index d261e33d71..8ee3022bf1 100644 --- a/packages/core/src/modules/didcomm/util/matchingEd25519Key.ts +++ b/packages/didcomm/src/util/matchingEd25519Key.ts @@ -1,8 +1,6 @@ -import type { DidDocument, VerificationMethod } from '../../dids' +import type { DidDocument, VerificationMethod } from '@credo-ts/core' -import { Key, KeyType } from '../../../crypto' -import { getKeyFromVerificationMethod } from '../../dids' -import { convertPublicKeyToX25519 } from '../../dids/domain/key-type/ed25519' +import { getKeyFromVerificationMethod, convertPublicKeyToX25519, Key, KeyType } from '@credo-ts/core' /** * Tries to find a matching Ed25519 key to the supplied X25519 key diff --git a/packages/core/src/utils/messageType.ts b/packages/didcomm/src/util/messageType.ts similarity index 100% rename from packages/core/src/utils/messageType.ts rename to packages/didcomm/src/util/messageType.ts diff --git a/packages/didcomm/src/util/modules.ts b/packages/didcomm/src/util/modules.ts new file mode 100644 index 0000000000..79e65f88de --- /dev/null +++ b/packages/didcomm/src/util/modules.ts @@ -0,0 +1,60 @@ +import type { DidCommModuleConfigOptions } from '../DidCommModuleConfig' +import type { Agent, ModulesMap } from '@credo-ts/core' + +import { DidCommModule } from '../DidCommModule' +import { + ConnectionsModule, + CredentialsModule, + ProofsModule, + MediatorModule, + DiscoverFeaturesModule, + MediationRecipientModule, + MessagePickupModule, + BasicMessagesModule, + OutOfBandModule, +} from '../modules' + +/** + * Type that represents the default agent modules. This is the {@link ModulesMap} variant for the default modules in the framework. + * It uses the return type of the {@link getDefaultDidcommModules} method to automatically infer which modules are always available on + * the agent and in the agent. namespace. + */ +export type DefaultDidCommModules = { + [moduleKey in keyof ReturnType]: ReturnType< + typeof getDefaultDidcommModules + >[moduleKey] +} + +export type WithoutDefaultDidCommModules = { + [moduleKey in Exclude]: Modules[moduleKey] +} + +export type AgentModulesInput = Partial & ModulesMap + +/** + * Defines the input type for the default agent modules. This is overwritten as we + * want the input type to allow for generics to be passed in for the credentials module. + */ +export type DefaultAgentModulesInput = Omit & { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + credentials: CredentialsModule + // eslint-disable-next-line @typescript-eslint/no-explicit-any + proofs: ProofsModule +} + +export type DidCommAgent = Agent + +export function getDefaultDidcommModules(didcommModuleConfig?: DidCommModuleConfigOptions) { + return { + connections: new ConnectionsModule(), + credentials: new CredentialsModule(), + proofs: new ProofsModule(), + mediator: new MediatorModule(), + discovery: new DiscoverFeaturesModule(), + mediationRecipient: new MediationRecipientModule(), + messagePickup: new MessagePickupModule(), + basicMessages: new BasicMessagesModule(), + didcomm: new DidCommModule(didcommModuleConfig), + oob: new OutOfBandModule(), + } as const +} diff --git a/packages/core/src/utils/parseInvitation.ts b/packages/didcomm/src/util/parseInvitation.ts similarity index 94% rename from packages/core/src/utils/parseInvitation.ts rename to packages/didcomm/src/util/parseInvitation.ts index 5ba6dcfb81..da4656d0ff 100644 --- a/packages/core/src/utils/parseInvitation.ts +++ b/packages/didcomm/src/util/parseInvitation.ts @@ -1,17 +1,14 @@ -import type { AgentDependencies } from '../agent/AgentDependencies' +import type { AgentDependencies } from '@credo-ts/core' +import { CredoError, JsonEncoder, JsonTransformer, MessageValidator } from '@credo-ts/core' import { parseUrl } from 'query-string' -import { AgentMessage } from '../agent/AgentMessage' -import { CredoError } from '../error' -import { ConnectionInvitationMessage } from '../modules/connections' +import { AgentMessage } from '../AgentMessage' +import { ConnectionInvitationMessage } from '../modules/connections/messages' +import { convertToNewInvitation } from '../modules/oob/converters' import { OutOfBandDidCommService } from '../modules/oob/domain/OutOfBandDidCommService' -import { convertToNewInvitation } from '../modules/oob/helpers' import { InvitationType, OutOfBandInvitation } from '../modules/oob/messages' -import { JsonEncoder } from './JsonEncoder' -import { JsonTransformer } from './JsonTransformer' -import { MessageValidator } from './MessageValidator' import { parseMessageType, supportsIncomingMessageType } from './messageType' const fetchShortUrl = async (invitationUrl: string, dependencies: AgentDependencies) => { diff --git a/packages/core/src/utils/thread.ts b/packages/didcomm/src/util/thread.ts similarity index 100% rename from packages/core/src/utils/thread.ts rename to packages/didcomm/src/util/thread.ts diff --git a/packages/didcomm/src/util/transformers.ts b/packages/didcomm/src/util/transformers.ts new file mode 100644 index 0000000000..35b68d9e24 --- /dev/null +++ b/packages/didcomm/src/util/transformers.ts @@ -0,0 +1,18 @@ +import { DateTime } from 'luxon' + +/* + * Function that parses date from multiple formats + * including SQL formats. + */ + +export function DateParser(value: string): Date { + const parsedDate = new Date(value) + if (parsedDate instanceof Date && !isNaN(parsedDate.getTime())) { + return parsedDate + } + const luxonDate = DateTime.fromSQL(value) + if (luxonDate.isValid) { + return new Date(luxonDate.toString()) + } + return new Date() +} diff --git a/packages/didcomm/tests/setup.ts b/packages/didcomm/tests/setup.ts new file mode 100644 index 0000000000..cd6ef08ee3 --- /dev/null +++ b/packages/didcomm/tests/setup.ts @@ -0,0 +1,25 @@ +import 'reflect-metadata' + +import type { ConnectionRecord } from '../../didcomm/src' + +jest.setTimeout(120000) +expect.extend({ toBeConnectedWith }) + +// Custom matchers which can be used to extend Jest matchers via extend, e. g. `expect.extend({ toBeConnectedWith })`. +function toBeConnectedWith(actual: ConnectionRecord, expected: ConnectionRecord) { + actual.assertReady() + expected.assertReady() + + const pass = actual.theirDid === expected.did + if (pass) { + return { + message: () => `expected connection ${actual.theirDid} not to be connected to with ${expected.did}`, + pass: true, + } + } else { + return { + message: () => `expected connection ${actual.theirDid} to be connected to with ${expected.did}`, + pass: false, + } + } +} diff --git a/packages/didcomm/tsconfig.build.json b/packages/didcomm/tsconfig.build.json new file mode 100644 index 0000000000..2b75d0adab --- /dev/null +++ b/packages/didcomm/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.build.json", + "compilerOptions": { + "outDir": "./build" + }, + "include": ["src/**/*"] +} diff --git a/packages/didcomm/tsconfig.json b/packages/didcomm/tsconfig.json new file mode 100644 index 0000000000..46efe6f721 --- /dev/null +++ b/packages/didcomm/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["jest"] + } +} diff --git a/packages/didcomm/types/jest.d.ts b/packages/didcomm/types/jest.d.ts new file mode 100644 index 0000000000..583838be37 --- /dev/null +++ b/packages/didcomm/types/jest.d.ts @@ -0,0 +1,9 @@ +import type { ConnectionRecord } from '../src' + +declare global { + namespace jest { + interface Matchers { + toBeConnectedWith(connection: ConnectionRecord): R + } + } +} diff --git a/packages/drpc/package.json b/packages/drpc/package.json index b11a6bc259..d59119c91d 100644 --- a/packages/drpc/package.json +++ b/packages/drpc/package.json @@ -27,6 +27,7 @@ }, "dependencies": { "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "class-transformer": "^0.5.1", "class-validator": "0.14.1" }, diff --git a/packages/drpc/src/DrpcApi.ts b/packages/drpc/src/DrpcApi.ts index 08dac02bd7..e7ab67953d 100644 --- a/packages/drpc/src/DrpcApi.ts +++ b/packages/drpc/src/DrpcApi.ts @@ -1,15 +1,9 @@ import type { DrpcRequest, DrpcResponse, DrpcRequestMessage, DrpcResponseMessage } from './messages' import type { DrpcRecord } from './repository/DrpcRecord' -import type { ConnectionRecord } from '@credo-ts/core' +import type { ConnectionRecord } from '@credo-ts/didcomm' -import { - AgentContext, - MessageHandlerRegistry, - MessageSender, - OutboundMessageContext, - injectable, - ConnectionService, -} from '@credo-ts/core' +import { AgentContext, injectable } from '@credo-ts/core' +import { MessageHandlerRegistry, MessageSender, OutboundMessageContext, ConnectionService } from '@credo-ts/didcomm' import { DrpcRequestHandler, DrpcResponseHandler } from './handlers' import { DrpcRole } from './models' diff --git a/packages/drpc/src/DrpcModule.ts b/packages/drpc/src/DrpcModule.ts index 2bf6657bc4..4ae2880547 100644 --- a/packages/drpc/src/DrpcModule.ts +++ b/packages/drpc/src/DrpcModule.ts @@ -1,6 +1,7 @@ -import type { FeatureRegistry, DependencyManager, Module } from '@credo-ts/core' +import type { AgentContext, DependencyManager, Module } from '@credo-ts/core' -import { Protocol, AgentConfig } from '@credo-ts/core' +import { AgentConfig } from '@credo-ts/core' +import { FeatureRegistry, Protocol } from '@credo-ts/didcomm' import { DrpcApi } from './DrpcApi' import { DrpcRole } from './models/DrpcRole' @@ -13,7 +14,7 @@ export class DrpcModule implements Module { /** * Registers the dependencies of the drpc message module on the dependency manager. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Warn about experimental module dependencyManager .resolve(AgentConfig) @@ -26,8 +27,11 @@ export class DrpcModule implements Module { // Repositories dependencyManager.registerSingleton(DrpcRepository) + } + + public async initialize(agentContext: AgentContext): Promise { + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) - // Features featureRegistry.register( new Protocol({ id: 'https://didcomm.org/drpc/1.0', diff --git a/packages/drpc/src/__tests__/DrpcMessageService.test.ts b/packages/drpc/src/__tests__/DrpcMessageService.test.ts index a1f904ab19..90d9201c40 100644 --- a/packages/drpc/src/__tests__/DrpcMessageService.test.ts +++ b/packages/drpc/src/__tests__/DrpcMessageService.test.ts @@ -1,9 +1,8 @@ import type { DrpcRequestObject } from '../messages' -import { DidExchangeState } from '@credo-ts/core' +import { DidExchangeState, InboundMessageContext } from '@credo-ts/didcomm' import { EventEmitter } from '../../../core/src/agent/EventEmitter' -import { InboundMessageContext } from '../../../core/src/agent/models/InboundMessageContext' import { getAgentContext, getMockConnection } from '../../../core/tests/helpers' import { DrpcRequestMessage } from '../messages' import { DrpcRole } from '../models/DrpcRole' diff --git a/packages/drpc/src/__tests__/DrpcMessagesModule.test.ts b/packages/drpc/src/__tests__/DrpcMessagesModule.test.ts index 7b4ce8ae8b..ede949f476 100644 --- a/packages/drpc/src/__tests__/DrpcMessagesModule.test.ts +++ b/packages/drpc/src/__tests__/DrpcMessagesModule.test.ts @@ -1,29 +1,41 @@ import type { DependencyManager } from '../../../core/src/plugins/DependencyManager' -import { FeatureRegistry } from '../../../core/src/agent/FeatureRegistry' +import { FeatureRegistry, Protocol } from '@credo-ts/didcomm' + +import { getAgentConfig, getAgentContext } from '../../../core/tests' import { DrpcModule } from '../DrpcModule' +import { DrpcRole } from '../models' import { DrpcRepository } from '../repository' import { DrpcService } from '../services' -jest.mock('../../../core/src/plugins/DependencyManager') - -jest.mock('../../../core/src/agent/FeatureRegistry') -const FeatureRegistryMock = FeatureRegistry as jest.Mock - -const featureRegistry = new FeatureRegistryMock() - -const dependencyManager = { - registerInstance: jest.fn(), - registerSingleton: jest.fn(), - resolve: jest.fn().mockReturnValue({ logger: { warn: jest.fn() } }), -} as unknown as DependencyManager - describe('DrpcModule', () => { test('registers dependencies on the dependency manager', () => { - new DrpcModule().register(dependencyManager, featureRegistry) + const dependencyManager = { + registerInstance: jest.fn(), + registerSingleton: jest.fn(), + registerContextScoped: jest.fn(), + resolve: () => { + return getAgentConfig('dprc') + }, + } as unknown as DependencyManager + + new DrpcModule().register(dependencyManager) expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(DrpcService) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(DrpcRepository) }) + + test('registers features on the feature registry', async () => { + const featureRegistry = new FeatureRegistry() + const agentContext = getAgentContext({ registerInstances: [[FeatureRegistry, featureRegistry]] }) + await new DrpcModule().initialize(agentContext) + + expect(featureRegistry.query({ featureType: 'protocol', match: '*' })).toEqual([ + new Protocol({ + id: 'https://didcomm.org/drpc/1.0', + roles: [DrpcRole.Client, DrpcRole.Server], + }), + ]) + }) }) diff --git a/packages/drpc/src/handlers/DrpcRequestHandler.ts b/packages/drpc/src/handlers/DrpcRequestHandler.ts index 2e91072055..85da5c2678 100644 --- a/packages/drpc/src/handlers/DrpcRequestHandler.ts +++ b/packages/drpc/src/handlers/DrpcRequestHandler.ts @@ -1,5 +1,5 @@ import type { DrpcService } from '../services/DrpcService' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { DrpcRequestMessage } from '../messages' diff --git a/packages/drpc/src/handlers/DrpcResponseHandler.ts b/packages/drpc/src/handlers/DrpcResponseHandler.ts index 45b92e4de8..71c90d9253 100644 --- a/packages/drpc/src/handlers/DrpcResponseHandler.ts +++ b/packages/drpc/src/handlers/DrpcResponseHandler.ts @@ -1,5 +1,5 @@ import type { DrpcService } from '../services/DrpcService' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { DrpcResponseMessage } from '../messages' diff --git a/packages/drpc/src/messages/DrpcRequestMessage.ts b/packages/drpc/src/messages/DrpcRequestMessage.ts index 6e8ae1ea6a..6eaf5b53e3 100644 --- a/packages/drpc/src/messages/DrpcRequestMessage.ts +++ b/packages/drpc/src/messages/DrpcRequestMessage.ts @@ -1,4 +1,4 @@ -import { IsValidMessageType, parseMessageType, AgentMessage } from '@credo-ts/core' +import { IsValidMessageType, parseMessageType, AgentMessage } from '@credo-ts/didcomm' import { Expose } from 'class-transformer' import { IsValidDrpcRequest } from '../models' diff --git a/packages/drpc/src/messages/DrpcResponseMessage.ts b/packages/drpc/src/messages/DrpcResponseMessage.ts index a148760bfd..8aac213ffb 100644 --- a/packages/drpc/src/messages/DrpcResponseMessage.ts +++ b/packages/drpc/src/messages/DrpcResponseMessage.ts @@ -1,6 +1,6 @@ import type { DrpcErrorCode } from '../models' -import { IsValidMessageType, parseMessageType, AgentMessage } from '@credo-ts/core' +import { IsValidMessageType, parseMessageType, AgentMessage } from '@credo-ts/didcomm' import { Expose } from 'class-transformer' import { IsValidDrpcResponse } from '../models' diff --git a/packages/drpc/src/services/DrpcService.ts b/packages/drpc/src/services/DrpcService.ts index 9f68b58701..040db6ba31 100644 --- a/packages/drpc/src/services/DrpcService.ts +++ b/packages/drpc/src/services/DrpcService.ts @@ -1,7 +1,8 @@ import type { DrpcRequestStateChangedEvent } from '../DrpcRequestEvents' import type { DrpcResponseStateChangedEvent } from '../DrpcResponseEvents' import type { DrpcRequest, DrpcResponse } from '../messages' -import type { AgentContext, InboundMessageContext, Query, QueryOptions } from '@credo-ts/core' +import type { AgentContext, Query, QueryOptions } from '@credo-ts/core' +import type { InboundMessageContext } from '@credo-ts/didcomm' import { EventEmitter, injectable } from '@credo-ts/core' diff --git a/packages/drpc/tests/drpc-messages.e2e.test.ts b/packages/drpc/tests/drpc-messages.e2e.test.ts index 002d8d98d8..bde9c52486 100644 --- a/packages/drpc/tests/drpc-messages.e2e.test.ts +++ b/packages/drpc/tests/drpc-messages.e2e.test.ts @@ -1,5 +1,5 @@ -import type { ConnectionRecord } from '../../core/src/modules/connections' import type { DrpcRequest, DrpcRequestObject, DrpcResponseObject } from '../src/messages' +import type { ConnectionRecord } from '@credo-ts/didcomm' import { Agent } from '../../core/src/agent/Agent' import { setupSubjectTransports } from '../../core/tests' @@ -17,6 +17,7 @@ const faberConfig = getInMemoryAgentOptions( { endpoints: ['rxjs:faber'], }, + {}, modules ) @@ -25,6 +26,7 @@ const aliceConfig = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, modules ) diff --git a/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts index d0647dc599..ca7a9fd044 100644 --- a/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts @@ -23,6 +23,7 @@ const endorser = new Agent( getInMemoryAgentOptions( 'IndyVdrAnonCredsRegistryEndorser', {}, + {}, { indyVdr: new IndyVdrModule({ indyVdr, @@ -40,6 +41,7 @@ const agent = new Agent( getInMemoryAgentOptions( 'IndyVdrAnonCredsRegistryAgent', {}, + {}, { indyVdr: new IndyVdrModule({ indyVdr, diff --git a/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts index dc5521653c..a375ce13b4 100644 --- a/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts @@ -32,6 +32,7 @@ const endorser = new Agent( getInMemoryAgentOptions( 'Indy VDR Indy DID Registrar', {}, + {}, { indyVdr: new IndyVdrModule({ networks: indyVdrModuleConfig.networks, @@ -48,6 +49,7 @@ const agent = new Agent( getInMemoryAgentOptions( 'Indy VDR Indy DID Registrar', {}, + {}, { indyVdr: new IndyVdrModule({ indyVdr, diff --git a/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts index b5386cfe79..c8c518162e 100644 --- a/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts @@ -11,6 +11,7 @@ const agent = new Agent( getInMemoryAgentOptions( 'Indy VDR Indy DID resolver', {}, + {}, { indyVdr: new IndyVdrModule({ indyVdr, diff --git a/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts index 427ff542f0..8a748955aa 100644 --- a/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts @@ -12,6 +12,7 @@ const agent = new Agent( getInMemoryAgentOptions( 'Indy VDR Sov DID resolver', {}, + {}, { indyVdr: new IndyVdrModule({ indyVdr, diff --git a/packages/node/package.json b/packages/node/package.json index e5508f6872..5595bf32c2 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -29,6 +29,7 @@ "@2060.io/ffi-napi": "^4.0.9", "@2060.io/ref-napi": "^3.0.6", "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "@types/express": "^4.17.15", "express": "^4.17.1", "rxjs": "^7.8.0", diff --git a/packages/node/src/transport/HttpInboundTransport.ts b/packages/node/src/transport/HttpInboundTransport.ts index 01a3e5dfee..b103f416ce 100644 --- a/packages/node/src/transport/HttpInboundTransport.ts +++ b/packages/node/src/transport/HttpInboundTransport.ts @@ -1,16 +1,16 @@ +import type { AgentContext } from '@credo-ts/core' import type { InboundTransport, - Agent, TransportSession, EncryptedMessage, - AgentContext, AgentMessageReceivedEvent, AgentMessageProcessedEvent, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import type { Express, Request, Response } from 'express' import type { Server } from 'http' -import { DidCommMimeType, CredoError, TransportService, utils, AgentEventTypes } from '@credo-ts/core' +import { CredoError, utils, EventEmitter } from '@credo-ts/core' +import { DidCommMimeType, TransportService, AgentEventTypes, DidCommModuleConfig } from '@credo-ts/didcomm' import express, { text } from 'express' import { filter, firstValueFrom, ReplaySubject, timeout } from 'rxjs' @@ -48,10 +48,10 @@ export class HttpInboundTransport implements InboundTransport { this.app.use(text({ type: supportedContentTypes, limit: '5mb' })) } - public async start(agent: Agent) { - const transportService = agent.dependencyManager.resolve(TransportService) + public async start(agentContext: AgentContext) { + const transportService = agentContext.dependencyManager.resolve(TransportService) - agent.config.logger.debug(`Starting HTTP inbound transport`, { + agentContext.config.logger.debug(`Starting HTTP inbound transport`, { port: this.port, }) @@ -73,7 +73,8 @@ export class HttpInboundTransport implements InboundTransport { const message = req.body const encryptedMessage = JSON.parse(message) as EncryptedMessage - const observable = agent.events.observable(AgentEventTypes.AgentMessageProcessed) + const eventEmitter = agentContext.dependencyManager.resolve(EventEmitter) + const observable = eventEmitter.observable(AgentEventTypes.AgentMessageProcessed) const subject = new ReplaySubject(1) observable @@ -87,7 +88,7 @@ export class HttpInboundTransport implements InboundTransport { ) .subscribe(subject) - agent.events.emit(agent.context, { + eventEmitter.emit(agentContext, { type: AgentEventTypes.AgentMessageReceived, payload: { message: encryptedMessage, @@ -103,7 +104,7 @@ export class HttpInboundTransport implements InboundTransport { res.status(200).end() } } catch (error) { - agent.config.logger.error(`Error processing inbound message: ${error.message}`, error) + agentContext.config.logger.error(`Error processing inbound message: ${error.message}`, error) if (!res.headersSent) { res.status(500).send('Error processing message') @@ -145,7 +146,8 @@ export class HttpTransportSession implements TransportSession { } // By default we take the agent config's default DIDComm content-type - let responseMimeType = agentContext.config.didCommMimeType as string + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) + let responseMimeType = didcommConfig.didCommMimeType as string // However, if the request mime-type is a mime-type that is supported by us, we use that // to minimize the chance of interoperability issues diff --git a/packages/node/src/transport/WsInboundTransport.ts b/packages/node/src/transport/WsInboundTransport.ts index 11c47c1262..bff09bdc2a 100644 --- a/packages/node/src/transport/WsInboundTransport.ts +++ b/packages/node/src/transport/WsInboundTransport.ts @@ -1,14 +1,8 @@ -import type { - Agent, - InboundTransport, - Logger, - TransportSession, - EncryptedMessage, - AgentContext, - AgentMessageReceivedEvent, -} from '@credo-ts/core' - -import { CredoError, TransportService, utils, AgentEventTypes } from '@credo-ts/core' +import type { Logger, AgentContext } from '@credo-ts/core' +import type { InboundTransport, TransportSession, EncryptedMessage, AgentMessageReceivedEvent } from '@credo-ts/didcomm' + +import { CredoError, utils, EventEmitter } from '@credo-ts/core' +import { TransportService, AgentEventTypes, DidCommModuleConfig } from '@credo-ts/didcomm' // eslint-disable-next-line import/no-named-as-default import WebSocket, { Server } from 'ws' @@ -23,12 +17,13 @@ export class WsInboundTransport implements InboundTransport { this.socketServer = server ?? new Server({ port }) } - public async start(agent: Agent) { - const transportService = agent.dependencyManager.resolve(TransportService) + public async start(agentContext: AgentContext) { + const transportService = agentContext.dependencyManager.resolve(TransportService) - this.logger = agent.config.logger + this.logger = agentContext.config.logger - const wsEndpoint = agent.config.endpoints.find((e) => e.startsWith('ws')) + const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig) + const wsEndpoint = didcommConfig.endpoints.find((e) => e.startsWith('ws')) this.logger.debug(`Starting WS inbound transport`, { endpoint: wsEndpoint, }) @@ -41,7 +36,7 @@ export class WsInboundTransport implements InboundTransport { this.logger.debug(`Saving new socket with id ${socketId}.`) this.socketIds[socketId] = socket const session = new WebSocketTransportSession(socketId, socket, this.logger) - this.listenOnWebSocketMessages(agent, socket, session) + this.listenOnWebSocketMessages(agentContext, socket, session) socket.on('close', () => { this.logger.debug('Socket closed.') transportService.removeSession(session) @@ -65,14 +60,15 @@ export class WsInboundTransport implements InboundTransport { }) } - private listenOnWebSocketMessages(agent: Agent, socket: WebSocket, session: TransportSession) { + private listenOnWebSocketMessages(agentContext: AgentContext, socket: WebSocket, session: TransportSession) { // eslint-disable-next-line @typescript-eslint/no-explicit-any socket.addEventListener('message', async (event: any) => { this.logger.debug('WebSocket message event received.', { url: event.target.url }) try { const encryptedMessage = JSON.parse(event.data) as EncryptedMessage - agent.events.emit(agent.context, { + const eventEmitter = agentContext.dependencyManager.resolve(EventEmitter) + eventEmitter.emit(agentContext, { type: AgentEventTypes.AgentMessageReceived, payload: { message: encryptedMessage, diff --git a/packages/question-answer/package.json b/packages/question-answer/package.json index 60b40c9e0a..32e61e1da9 100644 --- a/packages/question-answer/package.json +++ b/packages/question-answer/package.json @@ -27,6 +27,7 @@ }, "dependencies": { "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "class-transformer": "0.5.1", "class-validator": "0.14.1", "rxjs": "^7.8.0" diff --git a/packages/question-answer/src/QuestionAnswerApi.ts b/packages/question-answer/src/QuestionAnswerApi.ts index 6d2ebefa5f..dba490fc37 100644 --- a/packages/question-answer/src/QuestionAnswerApi.ts +++ b/packages/question-answer/src/QuestionAnswerApi.ts @@ -1,7 +1,8 @@ import type { QuestionAnswerRecord } from './repository' import type { Query, QueryOptions } from '@credo-ts/core' -import { getOutboundMessageContext, AgentContext, ConnectionService, injectable, MessageSender } from '@credo-ts/core' +import { AgentContext, injectable } from '@credo-ts/core' +import { getOutboundMessageContext, ConnectionService, MessageSender, MessageHandlerRegistry } from '@credo-ts/didcomm' import { AnswerMessageHandler, QuestionMessageHandler } from './handlers' import { ValidResponse } from './models' @@ -25,10 +26,12 @@ export class QuestionAnswerApi { this.connectionService = connectionService this.agentContext = agentContext - this.agentContext.dependencyManager.registerMessageHandlers([ - new QuestionMessageHandler(this.questionAnswerService), - new AnswerMessageHandler(this.questionAnswerService), - ]) + this.agentContext.dependencyManager + .resolve(MessageHandlerRegistry) + .registerMessageHandlers([ + new QuestionMessageHandler(this.questionAnswerService), + new AnswerMessageHandler(this.questionAnswerService), + ]) } /** diff --git a/packages/question-answer/src/QuestionAnswerModule.ts b/packages/question-answer/src/QuestionAnswerModule.ts index 5bb6873f2b..05ea9c4f73 100644 --- a/packages/question-answer/src/QuestionAnswerModule.ts +++ b/packages/question-answer/src/QuestionAnswerModule.ts @@ -1,6 +1,6 @@ -import type { DependencyManager, FeatureRegistry, Module } from '@credo-ts/core' +import type { AgentContext, DependencyManager, Module } from '@credo-ts/core' -import { Protocol } from '@credo-ts/core' +import { FeatureRegistry, Protocol } from '@credo-ts/didcomm' import { QuestionAnswerApi } from './QuestionAnswerApi' import { QuestionAnswerRole } from './QuestionAnswerRole' @@ -13,14 +13,17 @@ export class QuestionAnswerModule implements Module { /** * Registers the dependencies of the question answer module on the dependency manager. */ - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Services dependencyManager.registerSingleton(QuestionAnswerService) // Repositories dependencyManager.registerSingleton(QuestionAnswerRepository) + } + public async initialize(agentContext: AgentContext) { // Feature Registry + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) featureRegistry.register( new Protocol({ id: 'https://didcomm.org/questionanswer/1.0', diff --git a/packages/question-answer/src/__tests__/QuestionAnswerModule.test.ts b/packages/question-answer/src/__tests__/QuestionAnswerModule.test.ts index d789f7e114..4bdaa3d47d 100644 --- a/packages/question-answer/src/__tests__/QuestionAnswerModule.test.ts +++ b/packages/question-answer/src/__tests__/QuestionAnswerModule.test.ts @@ -1,6 +1,9 @@ -import type { DependencyManager, FeatureRegistry } from '@credo-ts/core' +import type { DependencyManager } from '@credo-ts/core' +import type { FeatureRegistry } from '@credo-ts/didcomm' -import { Protocol } from '@credo-ts/core' +import { Protocol } from '@credo-ts/didcomm' + +import { getAgentContext } from '../../../core/tests' import { QuestionAnswerModule, @@ -9,25 +12,29 @@ import { QuestionAnswerService, } from '@credo-ts/question-answer' +const featureRegistry = { + register: jest.fn(), +} as unknown as FeatureRegistry + const dependencyManager = { registerInstance: jest.fn(), registerSingleton: jest.fn(), registerContextScoped: jest.fn(), + resolve: () => { + return featureRegistry + }, } as unknown as DependencyManager -const featureRegistry = { - register: jest.fn(), -} as unknown as FeatureRegistry - describe('QuestionAnswerModule', () => { - test('registers dependencies on the dependency manager', () => { + test('registers dependencies on the dependency manager', async () => { const questionAnswerModule = new QuestionAnswerModule() - questionAnswerModule.register(dependencyManager, featureRegistry) + questionAnswerModule.register(dependencyManager) expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(2) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(QuestionAnswerService) expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(QuestionAnswerRepository) + await questionAnswerModule.initialize(getAgentContext({ dependencyManager })) expect(featureRegistry.register).toHaveBeenCalledTimes(1) expect(featureRegistry.register).toHaveBeenCalledWith( new Protocol({ diff --git a/packages/question-answer/src/__tests__/QuestionAnswerService.test.ts b/packages/question-answer/src/__tests__/QuestionAnswerService.test.ts index 1a45b7c173..4bec26b0f7 100644 --- a/packages/question-answer/src/__tests__/QuestionAnswerService.test.ts +++ b/packages/question-answer/src/__tests__/QuestionAnswerService.test.ts @@ -1,7 +1,8 @@ import type { AgentConfig, AgentContext, Repository, Wallet } from '@credo-ts/core' import type { QuestionAnswerStateChangedEvent, ValidResponse } from '@credo-ts/question-answer' -import { EventEmitter, InboundMessageContext, DidExchangeState } from '@credo-ts/core' +import { EventEmitter } from '@credo-ts/core' +import { InboundMessageContext, DidExchangeState } from '@credo-ts/didcomm' import { agentDependencies } from '@credo-ts/node' import { Subject } from 'rxjs' diff --git a/packages/question-answer/src/handlers/AnswerMessageHandler.ts b/packages/question-answer/src/handlers/AnswerMessageHandler.ts index ab9be50dd8..a2cbfe619f 100644 --- a/packages/question-answer/src/handlers/AnswerMessageHandler.ts +++ b/packages/question-answer/src/handlers/AnswerMessageHandler.ts @@ -1,5 +1,5 @@ import type { QuestionAnswerService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { AnswerMessage } from '../messages' diff --git a/packages/question-answer/src/handlers/QuestionMessageHandler.ts b/packages/question-answer/src/handlers/QuestionMessageHandler.ts index 12af8e3f27..faf202579f 100644 --- a/packages/question-answer/src/handlers/QuestionMessageHandler.ts +++ b/packages/question-answer/src/handlers/QuestionMessageHandler.ts @@ -1,5 +1,5 @@ import type { QuestionAnswerService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { QuestionMessage } from '../messages' diff --git a/packages/question-answer/src/messages/AnswerMessage.ts b/packages/question-answer/src/messages/AnswerMessage.ts index 5ae9c157c9..85fa92a128 100644 --- a/packages/question-answer/src/messages/AnswerMessage.ts +++ b/packages/question-answer/src/messages/AnswerMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose } from 'class-transformer' import { IsString } from 'class-validator' diff --git a/packages/question-answer/src/messages/QuestionMessage.ts b/packages/question-answer/src/messages/QuestionMessage.ts index 74897f02c3..0ae6d6c792 100644 --- a/packages/question-answer/src/messages/QuestionMessage.ts +++ b/packages/question-answer/src/messages/QuestionMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' import { Expose, Type } from 'class-transformer' import { IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator' diff --git a/packages/question-answer/src/services/QuestionAnswerService.ts b/packages/question-answer/src/services/QuestionAnswerService.ts index bde0575409..f0b06e225f 100644 --- a/packages/question-answer/src/services/QuestionAnswerService.ts +++ b/packages/question-answer/src/services/QuestionAnswerService.ts @@ -1,6 +1,7 @@ import type { QuestionAnswerStateChangedEvent } from '../QuestionAnswerEvents' import type { ValidResponse } from '../models' -import type { AgentContext, InboundMessageContext, Query, QueryOptions } from '@credo-ts/core' +import type { AgentContext, Query, QueryOptions } from '@credo-ts/core' +import type { InboundMessageContext } from '@credo-ts/didcomm' import { CredoError, EventEmitter, inject, injectable, InjectionSymbols, Logger } from '@credo-ts/core' diff --git a/packages/question-answer/tests/question-answer.test.ts b/packages/question-answer/tests/question-answer.test.ts index dafbc55cdd..5188935290 100644 --- a/packages/question-answer/tests/question-answer.test.ts +++ b/packages/question-answer/tests/question-answer.test.ts @@ -1,4 +1,4 @@ -import type { ConnectionRecord } from '@credo-ts/core' +import type { ConnectionRecord } from '@credo-ts/didcomm' import { Agent } from '@credo-ts/core' @@ -17,6 +17,7 @@ const bobAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:bob'], }, + {}, modules ) @@ -25,12 +26,13 @@ const aliceAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, modules ) describe('Question Answer', () => { - let bobAgent: Agent - let aliceAgent: Agent + let bobAgent: Agent + let aliceAgent: Agent let aliceConnection: ConnectionRecord beforeEach(async () => { diff --git a/packages/tenants/package.json b/packages/tenants/package.json index abe7c46e3c..8b907f56e4 100644 --- a/packages/tenants/package.json +++ b/packages/tenants/package.json @@ -27,6 +27,7 @@ }, "dependencies": { "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "async-mutex": "^0.4.0" }, "devDependencies": { diff --git a/packages/tenants/src/context/TenantAgentContextProvider.ts b/packages/tenants/src/context/TenantAgentContextProvider.ts index 3925179e38..4d6770bcca 100644 --- a/packages/tenants/src/context/TenantAgentContextProvider.ts +++ b/packages/tenants/src/context/TenantAgentContextProvider.ts @@ -1,10 +1,6 @@ import type { TenantRecord } from '../repository' -import type { - AgentContextProvider, - RoutingCreatedEvent, - EncryptedMessage, - UpdateAssistantUpdateOptions, -} from '@credo-ts/core' +import type { AgentContextProvider, UpdateAssistantUpdateOptions } from '@credo-ts/core' +import type { RoutingCreatedEvent, EncryptedMessage } from '@credo-ts/didcomm' import { isStorageUpToDate, @@ -15,14 +11,13 @@ import { EventEmitter, inject, Logger, - RoutingEventTypes, InjectionSymbols, KeyType, Key, - isValidJweStructure, JsonEncoder, isJsonObject, } from '@credo-ts/core' +import { RoutingEventTypes, isValidJweStructure } from '@credo-ts/didcomm' import { TenantAgent } from '../TenantAgent' import { TenantRecordService } from '../services' diff --git a/packages/tenants/src/models/TenantConfig.ts b/packages/tenants/src/models/TenantConfig.ts index 3a6e856c7c..5858f4e236 100644 --- a/packages/tenants/src/models/TenantConfig.ts +++ b/packages/tenants/src/models/TenantConfig.ts @@ -1,5 +1,6 @@ import type { InitConfig, WalletConfig } from '@credo-ts/core' -export type TenantConfig = Pick & { +// FIXME: decide what to do with connectionImageUrl, since this would make this module dependant on didcomm +export type TenantConfig = Pick & { walletConfig: Pick } diff --git a/packages/tenants/src/services/__tests__/TenantService.test.ts b/packages/tenants/src/services/__tests__/TenantService.test.ts index f84454dbbc..da055efb0d 100644 --- a/packages/tenants/src/services/__tests__/TenantService.test.ts +++ b/packages/tenants/src/services/__tests__/TenantService.test.ts @@ -28,18 +28,20 @@ describe('TenantRecordService', () => { jest.clearAllMocks() }) + // FIXME: connectionImageUrl is now part of DIDComm module. Tenants records do not currently + // store data related to module config describe('createTenant', () => { test('creates a tenant record and stores it in the tenant repository', async () => { const tenantRecord = await tenantRecordService.createTenant(agentContext, { label: 'Test Tenant', - connectionImageUrl: 'https://example.com/connection.png', + //connectionImageUrl: 'https://example.com/connection.png', }) expect(tenantRecord).toMatchObject({ id: expect.any(String), config: { label: 'Test Tenant', - connectionImageUrl: 'https://example.com/connection.png', + //connectionImageUrl: 'https://example.com/connection.png', walletConfig: { id: expect.any(String), key: 'walletKey', diff --git a/packages/tenants/src/updates/__tests__/0.4.test.ts b/packages/tenants/src/updates/__tests__/0.4.test.ts index 11af20ab6a..2ca0225661 100644 --- a/packages/tenants/src/updates/__tests__/0.4.test.ts +++ b/packages/tenants/src/updates/__tests__/0.4.test.ts @@ -1,11 +1,5 @@ -import { - DependencyManager, - InjectionSymbols, - Agent, - UpdateAssistant, - utils, - MediatorRoutingRecord, -} from '@credo-ts/core' +import { DependencyManager, InjectionSymbols, Agent, UpdateAssistant, utils } from '@credo-ts/core' +import { MediatorRoutingRecord } from '@credo-ts/didcomm' import { agentDependencies } from '@credo-ts/node' import { readFileSync } from 'fs' import path from 'path' diff --git a/packages/tenants/tests/tenant-sessions.test.ts b/packages/tenants/tests/tenant-sessions.test.ts index a434141bea..e943983156 100644 --- a/packages/tenants/tests/tenant-sessions.test.ts +++ b/packages/tenants/tests/tenant-sessions.test.ts @@ -1,11 +1,13 @@ import type { InitConfig } from '@credo-ts/core' -import { ConnectionsModule, Agent } from '@credo-ts/core' +import { Agent } from '@credo-ts/core' +import { ConnectionsModule } from '@credo-ts/didcomm' import { agentDependencies } from '@credo-ts/node' import { InMemoryWalletModule } from '../../../tests/InMemoryWalletModule' import { uuid } from '../../core/src/utils/uuid' import { testLogger } from '../../core/tests' +import { getDefaultDidcommModules } from '../../didcomm/src/util/modules' import { TenantsModule } from '@credo-ts/tenants' @@ -16,7 +18,6 @@ const agentConfig: InitConfig = { key: `tenant sessions e2e agent 1`, }, logger: testLogger, - endpoints: ['rxjs:tenant-agent1'], } // Create multi-tenant agent @@ -24,6 +25,7 @@ const agent = new Agent({ config: agentConfig, dependencies: agentDependencies, modules: { + ...getDefaultDidcommModules({ endpoints: ['rxjs:tenant-agent1'] }), tenants: new TenantsModule({ sessionAcquireTimeout: 10000 }), inMemory: new InMemoryWalletModule(), connections: new ConnectionsModule({ diff --git a/packages/tenants/tests/tenants-storage-update.test.ts b/packages/tenants/tests/tenants-storage-update.test.ts index 28eb14293f..e443893440 100644 --- a/packages/tenants/tests/tenants-storage-update.test.ts +++ b/packages/tenants/tests/tenants-storage-update.test.ts @@ -1,19 +1,14 @@ import type { InitConfig, FileSystem } from '@credo-ts/core' -import { - UpdateAssistant, - InjectionSymbols, - ConnectionsModule, - Agent, - CacheModule, - InMemoryLruCache, -} from '@credo-ts/core' +import { UpdateAssistant, InjectionSymbols, Agent, CacheModule, InMemoryLruCache } from '@credo-ts/core' +import { ConnectionsModule } from '@credo-ts/didcomm' import { agentDependencies } from '@credo-ts/node' import path from 'path' import { AskarModule, AskarMultiWalletDatabaseScheme } from '../../askar/src' import { ariesAskar } from '../../askar/tests/helpers' import { testLogger } from '../../core/tests' +import { getDefaultDidcommModules } from '../../didcomm/src/util/modules' import { TenantSessionCoordinator } from '../src/context/TenantSessionCoordinator' import { TenantsModule } from '@credo-ts/tenants' @@ -28,6 +23,7 @@ const agentConfig = { } satisfies InitConfig const modules = { + ...getDefaultDidcommModules(), tenants: new TenantsModule(), askar: new AskarModule({ ariesAskar, diff --git a/packages/tenants/tests/tenants.test.ts b/packages/tenants/tests/tenants.test.ts index a30fb2ce46..48408abb45 100644 --- a/packages/tenants/tests/tenants.test.ts +++ b/packages/tenants/tests/tenants.test.ts @@ -1,6 +1,15 @@ +import type { TenantAgent } from '../src/TenantAgent' import type { InitConfig } from '@credo-ts/core' - -import { ConnectionsModule, OutOfBandRecord, Agent, CacheModule, InMemoryLruCache } from '@credo-ts/core' +import type { DidCommModuleConfigOptions } from '@credo-ts/didcomm' + +import { Agent, CacheModule, InMemoryLruCache } from '@credo-ts/core' +import { + ConnectionsModule, + OutOfBandRecord, + DidCommModule, + MessagePickupModule, + OutOfBandModule, +} from '@credo-ts/didcomm' import { agentDependencies } from '@credo-ts/node' import { InMemoryWalletModule } from '../../../tests/InMemoryWalletModule' @@ -17,6 +26,9 @@ const agent1Config: InitConfig = { key: `tenants e2e agent 1`, }, logger: testLogger, +} + +const agent1DidcommConfig: DidCommModuleConfigOptions = { endpoints: ['rxjs:tenant-agent1'], } @@ -27,13 +39,17 @@ const agent2Config: InitConfig = { key: `tenants e2e agent 2`, }, logger: testLogger, +} + +const agent2DidcommConfig: DidCommModuleConfigOptions = { endpoints: ['rxjs:tenant-agent2'], } -// Create multi-tenant agents -const agent1 = new Agent({ - config: agent1Config, - modules: { +const getTenantsAgentModules = (didcommConfig: DidCommModuleConfigOptions) => + ({ + didcomm: new DidCommModule(didcommConfig), + oob: new OutOfBandModule(), + messagePickup: new MessagePickupModule(), tenants: new TenantsModule(), inMemory: new InMemoryWalletModule(), connections: new ConnectionsModule({ @@ -42,22 +58,18 @@ const agent1 = new Agent({ cache: new CacheModule({ cache: new InMemoryLruCache({ limit: 500 }), }), - }, + } as const) + +// Create multi-tenant agents +const agent1 = new Agent({ + config: agent1Config, + modules: getTenantsAgentModules(agent1DidcommConfig), dependencies: agentDependencies, }) const agent2 = new Agent({ config: agent2Config, - modules: { - tenants: new TenantsModule(), - inMemory: new InMemoryWalletModule(), - connections: new ConnectionsModule({ - autoAcceptConnections: true, - }), - cache: new CacheModule({ - cache: new InMemoryLruCache({ limit: 500 }), - }), - }, + modules: getTenantsAgentModules(agent2DidcommConfig), dependencies: agentDependencies, }) @@ -65,16 +77,16 @@ const agent2 = new Agent({ const agent1InboundTransport = new SubjectInboundTransport() const agent2InboundTransport = new SubjectInboundTransport() -agent1.registerInboundTransport(agent1InboundTransport) -agent2.registerInboundTransport(agent2InboundTransport) +agent1.modules.didcomm.registerInboundTransport(agent1InboundTransport) +agent2.modules.didcomm.registerInboundTransport(agent2InboundTransport) -agent1.registerOutboundTransport( +agent1.modules.didcomm.registerOutboundTransport( new SubjectOutboundTransport({ 'rxjs:tenant-agent1': agent1InboundTransport.ourSubject, 'rxjs:tenant-agent2': agent2InboundTransport.ourSubject, }) ) -agent2.registerOutboundTransport( +agent2.modules.didcomm.registerOutboundTransport( new SubjectOutboundTransport({ 'rxjs:tenant-agent1': agent1InboundTransport.ourSubject, 'rxjs:tenant-agent2': agent2InboundTransport.ourSubject, @@ -153,36 +165,36 @@ describe('Tenants E2E', () => { }, }) - const tenantAgent1 = await agent1.modules.tenants.getTenantAgent({ + const tenantAgent1 = (await agent1.modules.tenants.getTenantAgent({ tenantId: tenantRecord1.id, - }) + })) as TenantAgent> - const tenantAgent2 = await agent1.modules.tenants.getTenantAgent({ + const tenantAgent2 = (await agent1.modules.tenants.getTenantAgent({ tenantId: tenantRecord2.id, - }) + })) as TenantAgent> // Create and receive oob invitation in scope of tenants - const outOfBandRecord = await tenantAgent1.oob.createInvitation() - const { connectionRecord: tenant2ConnectionRecord } = await tenantAgent2.oob.receiveInvitation( + const outOfBandRecord = await tenantAgent1.modules.oob.createInvitation() + const { connectionRecord: tenant2ConnectionRecord } = await tenantAgent2.modules.oob.receiveInvitation( outOfBandRecord.outOfBandInvitation ) // Retrieve all oob records for the base and tenant agent, only the // tenant agent should have a record. - const baseAgentOutOfBandRecords = await agent1.oob.getAll() - const tenantAgent1OutOfBandRecords = await tenantAgent1.oob.getAll() - const tenantAgent2OutOfBandRecords = await tenantAgent2.oob.getAll() + const baseAgentOutOfBandRecords = await agent1.modules.oob.getAll() + const tenantAgent1OutOfBandRecords = await tenantAgent1.modules.oob.getAll() + const tenantAgent2OutOfBandRecords = await tenantAgent2.modules.oob.getAll() expect(baseAgentOutOfBandRecords.length).toBe(0) expect(tenantAgent1OutOfBandRecords.length).toBe(1) expect(tenantAgent2OutOfBandRecords.length).toBe(1) if (!tenant2ConnectionRecord) throw new Error('Receive invitation did not return connection record') - await tenantAgent2.connections.returnWhenIsConnected(tenant2ConnectionRecord.id) + await tenantAgent2.modules.connections.returnWhenIsConnected(tenant2ConnectionRecord.id) // Find the connection record for the created oob invitation - const [connectionRecord] = await tenantAgent1.connections.findAllByOutOfBandId(outOfBandRecord.id) - await tenantAgent1.connections.returnWhenIsConnected(connectionRecord.id) + const [connectionRecord] = await tenantAgent1.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + await tenantAgent1.modules.connections.returnWhenIsConnected(connectionRecord.id) await tenantAgent1.endSession() await tenantAgent2.endSession() @@ -199,31 +211,31 @@ describe('Tenants E2E', () => { label: 'Agent 1 Tenant 1', }, }) - const tenantAgent1 = await agent1.modules.tenants.getTenantAgent({ + const tenantAgent1 = (await agent1.modules.tenants.getTenantAgent({ tenantId: tenantRecord1.id, - }) + })) as TenantAgent> const tenantRecord2 = await agent2.modules.tenants.createTenant({ config: { label: 'Agent 2 Tenant 1', }, }) - const tenantAgent2 = await agent2.modules.tenants.getTenantAgent({ + const tenantAgent2 = (await agent2.modules.tenants.getTenantAgent({ tenantId: tenantRecord2.id, - }) + })) as TenantAgent> // Create and receive oob invitation in scope of tenants - const outOfBandRecord = await tenantAgent1.oob.createInvitation() - const { connectionRecord: tenant2ConnectionRecord } = await tenantAgent2.oob.receiveInvitation( + const outOfBandRecord = await tenantAgent1.modules.oob.createInvitation() + const { connectionRecord: tenant2ConnectionRecord } = await tenantAgent2.modules.oob.receiveInvitation( outOfBandRecord.outOfBandInvitation ) if (!tenant2ConnectionRecord) throw new Error('Receive invitation did not return connection record') - await tenantAgent2.connections.returnWhenIsConnected(tenant2ConnectionRecord.id) + await tenantAgent2.modules.connections.returnWhenIsConnected(tenant2ConnectionRecord.id) // Find the connection record for the created oob invitation - const [connectionRecord] = await tenantAgent1.connections.findAllByOutOfBandId(outOfBandRecord.id) - await tenantAgent1.connections.returnWhenIsConnected(connectionRecord.id) + const [connectionRecord] = await tenantAgent1.modules.connections.findAllByOutOfBandId(outOfBandRecord.id) + await tenantAgent1.modules.connections.returnWhenIsConnected(connectionRecord.id) await tenantAgent1.endSession() await tenantAgent2.endSession() @@ -241,7 +253,9 @@ describe('Tenants E2E', () => { }) await agent1.modules.tenants.withTenantAgent({ tenantId: tenantRecord.id }, async (tenantAgent) => { - const outOfBandRecord = await tenantAgent.oob.createInvitation() + const outOfBandRecord = await ( + tenantAgent as TenantAgent> + ).modules.oob.createInvitation() expect(outOfBandRecord).toBeInstanceOf(OutOfBandRecord) expect(tenantAgent.context.contextCorrelationId).toBe(tenantRecord.id) @@ -252,15 +266,15 @@ describe('Tenants E2E', () => { }) test('fallback middleware for the tenant manager propagated to the tenant', async () => { - expect(agent1.dependencyManager.fallbackMessageHandler).toBeUndefined() + expect(agent1.modules.didcomm.fallbackMessageHandler).toBeUndefined() const fallbackFunction = async () => { // empty } - agent1.dependencyManager.setFallbackMessageHandler(fallbackFunction) + agent1.modules.didcomm.setFallbackMessageHandler(fallbackFunction) - expect(agent1.dependencyManager.fallbackMessageHandler).toBe(fallbackFunction) + expect(agent1.modules.didcomm.fallbackMessageHandler).toBe(fallbackFunction) const tenantRecord = await agent1.modules.tenants.createTenant({ config: { @@ -268,11 +282,11 @@ describe('Tenants E2E', () => { }, }) - const tenantAgent = await agent1.modules.tenants.getTenantAgent({ + const tenantAgent = (await agent1.modules.tenants.getTenantAgent({ tenantId: tenantRecord.id, - }) + })) as TenantAgent> - expect(tenantAgent.dependencyManager.fallbackMessageHandler).toBe(fallbackFunction) + expect(tenantAgent.modules.didcomm.fallbackMessageHandler).toBe(fallbackFunction) await tenantAgent.endSession() }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4025e4b884..4f75ea4f7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,13 +14,13 @@ importers: devDependencies: '@babel/core': specifier: ^7.25.8 - version: 7.25.8 + version: 7.26.0 '@babel/preset-env': specifier: ^7.25.8 - version: 7.25.8(@babel/core@7.25.8) + version: 7.26.0(@babel/core@7.26.0) '@changesets/cli': specifier: ^2.27.5 - version: 2.27.7 + version: 2.27.5 '@hyperledger/aries-askar-nodejs': specifier: ^0.2.3 version: 0.2.3 @@ -35,7 +35,7 @@ importers: version: 2.8.17 '@types/eslint': specifier: ^8.21.2 - version: 8.56.11 + version: 8.56.10 '@types/express': specifier: ^4.17.13 version: 4.17.21 @@ -56,7 +56,7 @@ importers: version: 6.0.3 '@types/ws': specifier: ^8.5.4 - version: 8.5.12 + version: 8.5.10 '@typescript-eslint/eslint-plugin': specifier: ^7.14.1 version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) @@ -107,7 +107,7 @@ importers: version: 7.0.0 ts-jest: specifier: ^29.1.2 - version: 29.2.4(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)))(typescript@5.5.4) + version: 29.1.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)))(typescript@5.5.4) ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@18.18.8)(typescript@5.5.4) @@ -119,10 +119,10 @@ importers: version: 5.5.4 undici: specifier: ^6.20.1 - version: 6.20.1 + version: 6.21.0 ws: specifier: ^8.13.0 - version: 8.18.0 + version: 8.17.1 demo: dependencies: @@ -151,6 +151,9 @@ importers: '@credo-ts/core': specifier: workspace:* version: link:../packages/core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../packages/didcomm '@credo-ts/indy-vdr': specifier: workspace:* version: link:../packages/indy-vdr @@ -195,10 +198,10 @@ importers: version: 8.2.6 jose: specifier: ^5.3.0 - version: 5.8.0 + version: 5.9.6 oidc-provider: specifier: ^8.4.6 - version: 8.5.1 + version: 8.6.0 devDependencies: '@credo-ts/askar': specifier: workspace:* @@ -235,13 +238,16 @@ importers: version: 10.9.2(@types/node@18.18.8)(typescript@5.5.4) tsx: specifier: ^4.11.0 - version: 4.19.0 + version: 4.19.2 packages/action-menu: dependencies: '@credo-ts/core': specifier: workspace:* version: link:../core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../didcomm class-transformer: specifier: 0.5.1 version: 0.5.1 @@ -270,9 +276,12 @@ importers: '@credo-ts/core': specifier: workspace:* version: link:../core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../didcomm '@sphereon/pex-models': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 big-integer: specifier: ^1.6.51 version: 1.6.52 @@ -331,7 +340,7 @@ importers: devDependencies: '@animo-id/expo-secure-environment': specifier: ^0.1.0-alpha.11 - version: 0.1.0-alpha.11(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)))(react-native@0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1))(react@18.3.1) + version: 0.1.0-alpha.12(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(react@18.3.1) '@hyperledger/aries-askar-nodejs': specifier: ^0.2.3 version: 0.2.3 @@ -361,7 +370,7 @@ importers: dependencies: '@animo-id/react-native-bbs-signatures': specifier: ^0.1.0 - version: 0.1.0(react-native@0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1))(react@18.3.1) + version: 0.1.0(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(react@18.3.1) '@credo-ts/core': specifier: workspace:* version: link:../core @@ -370,7 +379,7 @@ importers: version: 1.4.0 '@mattrglobal/bls12381-key-pair': specifier: ^1.0.0 - version: 1.2.2 + version: 1.2.1 '@stablelib/random': specifier: ^1.0.2 version: 1.0.2 @@ -391,7 +400,7 @@ importers: packages/cheqd: dependencies: '@cheqd/sdk': - specifier: ^2.5.1 + specifier: 2.5.1 version: 2.5.1 '@cheqd/ts-proto': specifier: ~2.3.2 @@ -447,55 +456,55 @@ importers: version: 1.1.2 '@digitalcredentials/jsonld': specifier: ^6.0.0 - version: 6.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + version: 6.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) '@digitalcredentials/jsonld-signatures': specifier: ^9.4.0 - version: 9.4.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + version: 9.4.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) '@digitalcredentials/vc': specifier: ^6.0.1 - version: 6.0.1(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + version: 6.0.1(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) '@multiformats/base-x': specifier: ^4.0.1 version: 4.0.1 '@noble/curves': specifier: ^1.6.0 - version: 1.6.0 + version: 1.7.0 '@noble/hashes': specifier: ^1.5.0 - version: 1.5.0 + version: 1.6.1 '@peculiar/asn1-ecc': - specifier: ^2.3.8 - version: 2.3.13 + specifier: ^2.3.13 + version: 2.3.14 '@peculiar/asn1-schema': - specifier: ^2.3.8 + specifier: ^2.3.13 version: 2.3.13 '@peculiar/asn1-x509': - specifier: ^2.3.8 + specifier: ^2.3.13 version: 2.3.13 '@peculiar/x509': - specifier: ^1.11.0 - version: 1.12.1 + specifier: ^1.12.1 + version: 1.12.3 '@sd-jwt/core': - specifier: ^0.7.0 + specifier: ^0.7.2 version: 0.7.2 '@sd-jwt/decode': - specifier: ^0.7.0 + specifier: ^0.7.2 version: 0.7.2 '@sd-jwt/jwt-status-list': - specifier: ^0.7.0 + specifier: ^0.7.2 version: 0.7.2 '@sd-jwt/sd-jwt-vc': - specifier: ^0.7.0 + specifier: ^0.7.2 version: 0.7.2 '@sd-jwt/types': - specifier: ^0.7.0 + specifier: ^0.7.2 version: 0.7.2 '@sd-jwt/utils': - specifier: ^0.7.0 + specifier: ^0.7.2 version: 0.7.2 '@sphereon/pex-models': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@sphereon/ssi-types': specifier: 0.30.2-next.135 version: 0.30.2-next.135 @@ -504,7 +513,7 @@ importers: version: 1.0.3 '@types/ws': specifier: ^8.5.4 - version: 8.5.12 + version: 8.5.10 big-integer: specifier: ^1.6.51 version: 1.6.52 @@ -526,18 +535,12 @@ importers: lru_map: specifier: ^0.4.1 version: 0.4.1 - luxon: - specifier: ^3.5.0 - version: 3.5.0 make-error: specifier: ^1.3.6 version: 1.3.6 object-inspect: specifier: ^1.10.3 - version: 1.13.2 - query-string: - specifier: ^7.0.1 - version: 7.1.3 + version: 1.13.1 reflect-metadata: specifier: ^0.1.13 version: 0.1.14 @@ -563,9 +566,6 @@ importers: '@types/events': specifier: ^3.0.0 version: 3.0.3 - '@types/luxon': - specifier: ^3.2.0 - version: 3.4.2 '@types/object-inspect': specifier: ^1.8.0 version: 1.13.0 @@ -588,11 +588,54 @@ importers: specifier: ~5.5.2 version: 5.5.4 + packages/didcomm: + dependencies: + '@credo-ts/core': + specifier: workspace:* + version: link:../core + class-transformer: + specifier: 0.5.1 + version: 0.5.1 + class-validator: + specifier: 0.14.1 + version: 0.14.1 + luxon: + specifier: ^3.5.0 + version: 3.5.0 + query-string: + specifier: ^7.0.1 + version: 7.1.3 + rxjs: + specifier: ^7.8.0 + version: 7.8.1 + devDependencies: + '@animo-id/pex': + specifier: 4.1.1-alpha.0 + version: 4.1.1-alpha.0 + '@sphereon/pex-models': + specifier: ^2.3.1 + version: 2.3.2 + '@types/luxon': + specifier: ^3.2.0 + version: 3.4.2 + reflect-metadata: + specifier: ^0.1.13 + version: 0.1.14 + rimraf: + specifier: ^4.4.0 + version: 4.4.1 + typescript: + specifier: ~5.5.2 + version: 5.5.4 + packages/drpc: dependencies: '@credo-ts/core': specifier: workspace:* version: link:../core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../didcomm class-transformer: specifier: ^0.5.1 version: 0.5.1 @@ -686,6 +729,9 @@ importers: '@credo-ts/core': specifier: workspace:* version: link:../core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../didcomm '@types/express': specifier: ^4.17.15 version: 4.17.21 @@ -697,14 +743,14 @@ importers: version: 7.8.1 ws: specifier: ^8.13.0 - version: 8.18.0 + version: 8.17.1 devDependencies: '@types/node': specifier: 18.18.8 version: 18.18.8 '@types/ws': specifier: ^8.5.4 - version: 8.5.12 + version: 8.5.10 nock: specifier: ^14.0.0-beta.19 version: 14.0.0-beta.19 @@ -769,6 +815,9 @@ importers: '@credo-ts/core': specifier: workspace:* version: link:../core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../didcomm class-transformer: specifier: 0.5.1 version: 0.5.1 @@ -806,13 +855,13 @@ importers: devDependencies: react-native: specifier: ^0.71.4 - version: 0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1) + version: 0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1) react-native-fs: specifier: ^2.20.0 - version: 2.20.0(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + version: 2.20.0(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) react-native-get-random-values: specifier: ^1.8.0 - version: 1.11.0(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + version: 1.11.0(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) rimraf: specifier: ^4.4.0 version: 4.4.1 @@ -825,6 +874,9 @@ importers: '@credo-ts/core': specifier: workspace:* version: link:../core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../didcomm async-mutex: specifier: ^0.4.0 version: 0.4.1 @@ -850,6 +902,9 @@ importers: '@credo-ts/core': specifier: workspace:* version: link:../../packages/core + '@credo-ts/didcomm': + specifier: workspace:* + version: link:../../packages/didcomm '@credo-ts/node': specifier: workspace:* version: link:../../packages/node @@ -871,7 +926,7 @@ importers: version: 9.0.8 '@types/ws': specifier: ^8.5.4 - version: 8.5.12 + version: 8.5.10 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@18.18.8)(typescript@5.5.4) @@ -895,7 +950,7 @@ importers: version: 9.0.8 '@types/ws': specifier: ^8.5.4 - version: 8.5.12 + version: 8.5.10 form-data: specifier: ^4.0.0 version: 4.0.0 @@ -921,8 +976,8 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@animo-id/expo-secure-environment@0.1.0-alpha.11': - resolution: {integrity: sha512-cAwsK8QWZc4ywxH6r0sqrH5yGdp5bKkw3fUr41CSs/TDZ42FIMeIK+tEdc78Bp+szykEywnnZpaAKdoTAd3ebw==} + '@animo-id/expo-secure-environment@0.1.0-alpha.12': + resolution: {integrity: sha512-7bvLSwRWHWs7m4Y7J/ptvmPW9FqmwPkmwaJcOcOwqrM5HPwCU6ZiS7CSQ+b3fRXpvAHhYiMq88SCHNt2DycK1A==} peerDependencies: expo: '*' react: '*' @@ -964,77 +1019,66 @@ packages: resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} - '@babel/code-frame@7.25.7': - resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} - engines: {node: '>=6.9.0'} - - '@babel/compat-data@7.25.2': - resolution: {integrity: sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==} + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.25.8': - resolution: {integrity: sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==} + '@babel/compat-data@7.24.7': + resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} engines: {node: '>=6.9.0'} - '@babel/core@7.25.2': - resolution: {integrity: sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==} + '@babel/compat-data@7.26.3': + resolution: {integrity: sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==} engines: {node: '>=6.9.0'} - '@babel/core@7.25.8': - resolution: {integrity: sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==} + '@babel/core@7.26.0': + resolution: {integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==} engines: {node: '>=6.9.0'} - '@babel/generator@7.2.0': - resolution: {integrity: sha512-BA75MVfRlFQG2EZgFYIwyT1r6xSkwfP2bdkY/kLZusEYWiJs4xCowab/alaEaT0wSvmVuXGqiefeBlP+7V1yKg==} - - '@babel/generator@7.25.0': - resolution: {integrity: sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==} + '@babel/generator@7.24.7': + resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.7': - resolution: {integrity: sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==} + '@babel/generator@7.26.3': + resolution: {integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==} engines: {node: '>=6.9.0'} '@babel/helper-annotate-as-pure@7.24.7': resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.25.7': - resolution: {integrity: sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==} + '@babel/helper-annotate-as-pure@7.25.9': + resolution: {integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==} engines: {node: '>=6.9.0'} - '@babel/helper-builder-binary-assignment-operator-visitor@7.25.7': - resolution: {integrity: sha512-12xfNeKNH7jubQNm7PAkzlLwEmCs1tfuX3UjIw6vP6QXi+leKh6+LyC/+Ed4EIQermwd58wsyh070yjDHFlNGg==} + '@babel/helper-compilation-targets@7.24.7': + resolution: {integrity: sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.2': - resolution: {integrity: sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==} + '@babel/helper-compilation-targets@7.25.9': + resolution: {integrity: sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.25.7': - resolution: {integrity: sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==} - engines: {node: '>=6.9.0'} - - '@babel/helper-create-class-features-plugin@7.25.0': - resolution: {integrity: sha512-GYM6BxeQsETc9mnct+nIIpf63SAyzvyYN7UB/IlTyd+MBg06afFGp0mIeUqGyWgS2mxad6vqbMrHVlaL3m70sQ==} + '@babel/helper-create-class-features-plugin@7.24.7': + resolution: {integrity: sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-class-features-plugin@7.25.7': - resolution: {integrity: sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==} + '@babel/helper-create-class-features-plugin@7.25.9': + resolution: {integrity: sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.25.2': - resolution: {integrity: sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==} + '@babel/helper-create-regexp-features-plugin@7.24.7': + resolution: {integrity: sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.25.7': - resolution: {integrity: sha512-byHhumTj/X47wJ6C6eLpK7wW/WBEcnUeb7D0FNc/jFQnQVw7DOso3Zz5u9x/zLrFVkHa89ZGDbkAa1D54NdrCQ==} + '@babel/helper-create-regexp-features-plugin@7.26.3': + resolution: {integrity: sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1048,30 +1092,38 @@ packages: resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.24.8': - resolution: {integrity: sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==} + '@babel/helper-function-name@7.24.7': + resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-hoist-variables@7.24.7': + resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.25.7': - resolution: {integrity: sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==} + '@babel/helper-member-expression-to-functions@7.24.7': + resolution: {integrity: sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-member-expression-to-functions@7.25.9': + resolution: {integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==} engines: {node: '>=6.9.0'} '@babel/helper-module-imports@7.24.7': resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.25.7': - resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} + '@babel/helper-module-imports@7.25.9': + resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.25.2': - resolution: {integrity: sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==} + '@babel/helper-module-transforms@7.24.7': + resolution: {integrity: sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-module-transforms@7.25.7': - resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} + '@babel/helper-module-transforms@7.26.0': + resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1080,38 +1132,38 @@ packages: resolution: {integrity: sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==} engines: {node: '>=6.9.0'} - '@babel/helper-optimise-call-expression@7.25.7': - resolution: {integrity: sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==} + '@babel/helper-optimise-call-expression@7.25.9': + resolution: {integrity: sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.24.8': - resolution: {integrity: sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==} + '@babel/helper-plugin-utils@7.24.7': + resolution: {integrity: sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.25.7': - resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} + '@babel/helper-plugin-utils@7.25.9': + resolution: {integrity: sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==} engines: {node: '>=6.9.0'} - '@babel/helper-remap-async-to-generator@7.25.0': - resolution: {integrity: sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==} + '@babel/helper-remap-async-to-generator@7.24.7': + resolution: {integrity: sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-remap-async-to-generator@7.25.7': - resolution: {integrity: sha512-kRGE89hLnPfcz6fTrlNU+uhgcwv0mBE4Gv3P9Ke9kLVJYpi4AMVVEElXvB5CabrPZW4nCM8P8UyyjrzCM0O2sw==} + '@babel/helper-remap-async-to-generator@7.25.9': + resolution: {integrity: sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.25.0': - resolution: {integrity: sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==} + '@babel/helper-replace-supers@7.24.7': + resolution: {integrity: sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.25.7': - resolution: {integrity: sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==} + '@babel/helper-replace-supers@7.25.9': + resolution: {integrity: sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1120,102 +1172,94 @@ packages: resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} engines: {node: '>=6.9.0'} - '@babel/helper-simple-access@7.25.7': - resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} - engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.24.7': resolution: {integrity: sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==} engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': - resolution: {integrity: sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==} + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + resolution: {integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.24.8': - resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} + '@babel/helper-split-export-declaration@7.24.7': + resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.7': - resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} + '@babel/helper-string-parser@7.24.7': + resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.24.7': - resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.7': - resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.24.8': - resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.7': - resolution: {integrity: sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==} + '@babel/helper-validator-option@7.24.7': + resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} engines: {node: '>=6.9.0'} - '@babel/helper-wrap-function@7.25.0': - resolution: {integrity: sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==} + '@babel/helper-validator-option@7.25.9': + resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} engines: {node: '>=6.9.0'} - '@babel/helper-wrap-function@7.25.7': - resolution: {integrity: sha512-MA0roW3JF2bD1ptAaJnvcabsVlNQShUaThyJbCDD4bCp8NEgiFvpoqRI2YS22hHlc2thjO/fTg2ShLMC3jygAg==} + '@babel/helper-wrap-function@7.24.7': + resolution: {integrity: sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.25.0': - resolution: {integrity: sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==} + '@babel/helper-wrap-function@7.25.9': + resolution: {integrity: sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.25.7': - resolution: {integrity: sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==} + '@babel/helpers@7.26.0': + resolution: {integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==} engines: {node: '>=6.9.0'} '@babel/highlight@7.24.7': resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.25.7': - resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.25.3': - resolution: {integrity: sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==} + '@babel/parser@7.24.7': + resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@7.25.8': - resolution: {integrity: sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==} + '@babel/parser@7.26.3': + resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.7': - resolution: {integrity: sha512-UV9Lg53zyebzD1DwQoT9mzkEKa922LNUp5YkTJ6Uta0RbyXaQNUgcvSt7qIu1PpPzVb6rd10OVNTzkyBGeVmxQ==} + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9': + resolution: {integrity: sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.7': - resolution: {integrity: sha512-GDDWeVLNxRIkQTnJn2pDOM1pkCgYdSqPeT1a9vh9yIqu2uzzgw1zcqEb+IJOhy+dTBMlNdThrDIksr2o09qrrQ==} + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9': + resolution: {integrity: sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.7': - resolution: {integrity: sha512-wxyWg2RYaSUYgmd9MR0FyRGyeOMQE/Uzr1wzd/g5cf5bwi9A4v6HFdDm7y1MgDtod/fLOSTZY6jDgV0xU9d5bA==} + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9': + resolution: {integrity: sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.7': - resolution: {integrity: sha512-Xwg6tZpLxc4iQjorYsyGMyfJE7nP5MV8t/Ka58BgiA7Jw0fRqQNcANlLfdJ/yvBt9z9LD2We+BEkT7vLqZRWng==} + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9': + resolution: {integrity: sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.13.0 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.7': - resolution: {integrity: sha512-UVATLMidXrnH+GMUIuxq55nejlj02HP7F5ETyBONzP6G87fPBogG4CH6kxrSrdIuAjdwNO9VzyaYsrZPscWUrw==} + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9': + resolution: {integrity: sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1316,12 +1360,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-class-static-block@7.14.5': - resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.24.7': resolution: {integrity: sha512-Ui4uLJJrRV1lb38zg1yYTmRKmiZLiftDEvZN2iq3kd9kUFU+PttmzTbAFC2ucRk/XJmtek6G23gPsuZbhrT8fQ==} engines: {node: '>=6.9.0'} @@ -1350,20 +1388,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-assertions@7.25.7': - resolution: {integrity: sha512-ZvZQRmME0zfJnDQnVBKYzHxXT7lYBB3Revz1GuS7oLXWMgqUPX4G+DDbT30ICClht9WKV34QVrZhSw6WdklwZQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-import-attributes@7.24.7': - resolution: {integrity: sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==} + '@babel/plugin-syntax-import-assertions@7.26.0': + resolution: {integrity: sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-attributes@7.25.7': - resolution: {integrity: sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==} + '@babel/plugin-syntax-import-attributes@7.26.0': + resolution: {integrity: sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1414,12 +1446,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-private-property-in-object@7.14.5': - resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-top-level-await@7.14.5': resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} @@ -1444,14 +1470,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-arrow-functions@7.25.7': - resolution: {integrity: sha512-EJN2mKxDwfOUCPxMO6MUI58RN3ganiRAG/MS/S3HfB6QFNjroAMelQo/gybyYq97WerCBAZoyrAoW8Tzdq2jWg==} + '@babel/plugin-transform-arrow-functions@7.25.9': + resolution: {integrity: sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-async-generator-functions@7.25.8': - resolution: {integrity: sha512-9ypqkozyzpG+HxlH4o4gdctalFGIjjdufzo7I2XPda0iBnZ6a+FO0rIEQcdSPXp02CkvGsII1exJhmROPQd5oA==} + '@babel/plugin-transform-async-generator-functions@7.25.9': + resolution: {integrity: sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1462,8 +1488,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-async-to-generator@7.25.7': - resolution: {integrity: sha512-ZUCjAavsh5CESCmi/xCpX1qcCaAglzs/7tmuvoFnJgA1dM7gQplsguljoTg+Ru8WENpX89cQyAtWoaE0I3X3Pg==} + '@babel/plugin-transform-async-to-generator@7.25.9': + resolution: {integrity: sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1474,44 +1500,44 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoped-functions@7.25.7': - resolution: {integrity: sha512-xHttvIM9fvqW+0a3tZlYcZYSBpSWzGBFIt/sYG3tcdSzBB8ZeVgz2gBP7Df+sM0N1850jrviYSSeUuc+135dmQ==} + '@babel/plugin-transform-block-scoped-functions@7.25.9': + resolution: {integrity: sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoping@7.25.0': - resolution: {integrity: sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==} + '@babel/plugin-transform-block-scoping@7.24.7': + resolution: {integrity: sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoping@7.25.7': - resolution: {integrity: sha512-ZEPJSkVZaeTFG/m2PARwLZQ+OG0vFIhPlKHK/JdIMy8DbRJ/htz6LRrTFtdzxi9EHmcwbNPAKDnadpNSIW+Aow==} + '@babel/plugin-transform-block-scoping@7.25.9': + resolution: {integrity: sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.25.7': - resolution: {integrity: sha512-mhyfEW4gufjIqYFo9krXHJ3ElbFLIze5IDp+wQTxoPd+mwFb1NxatNAwmv8Q8Iuxv7Zc+q8EkiMQwc9IhyGf4g==} + '@babel/plugin-transform-class-properties@7.25.9': + resolution: {integrity: sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-static-block@7.25.8': - resolution: {integrity: sha512-e82gl3TCorath6YLf9xUwFehVvjvfqFhdOo4+0iVIVju+6XOi5XHkqB3P2AXnSwoeTX0HBoXq5gJFtvotJzFnQ==} + '@babel/plugin-transform-class-static-block@7.26.0': + resolution: {integrity: sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.12.0 - '@babel/plugin-transform-classes@7.25.0': - resolution: {integrity: sha512-xyi6qjr/fYU304fiRwFbekzkqVJZ6A7hOjWZd+89FVcBqPV3S9Wuozz82xdpLspckeaafntbzglaW4pqpzvtSw==} + '@babel/plugin-transform-classes@7.24.7': + resolution: {integrity: sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-classes@7.25.7': - resolution: {integrity: sha512-9j9rnl+YCQY0IGoeipXvnk3niWicIB6kCsWRGLwX241qSXpbA4MKxtp/EdvFxsc4zI5vqfLxzOd0twIJ7I99zg==} + '@babel/plugin-transform-classes@7.25.9': + resolution: {integrity: sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1522,62 +1548,62 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-computed-properties@7.25.7': - resolution: {integrity: sha512-QIv+imtM+EtNxg/XBKL3hiWjgdLjMOmZ+XzQwSgmBfKbfxUjBzGgVPklUuE55eq5/uVoh8gg3dqlrwR/jw3ZeA==} + '@babel/plugin-transform-computed-properties@7.25.9': + resolution: {integrity: sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-destructuring@7.24.8': - resolution: {integrity: sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==} + '@babel/plugin-transform-destructuring@7.24.7': + resolution: {integrity: sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-destructuring@7.25.7': - resolution: {integrity: sha512-xKcfLTlJYUczdaM1+epcdh1UGewJqr9zATgrNHcLBcV2QmfvPPEixo/sK/syql9cEmbr7ulu5HMFG5vbbt/sEA==} + '@babel/plugin-transform-destructuring@7.25.9': + resolution: {integrity: sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-dotall-regex@7.25.7': - resolution: {integrity: sha512-kXzXMMRzAtJdDEgQBLF4oaiT6ZCU3oWHgpARnTKDAqPkDJ+bs3NrZb310YYevR5QlRo3Kn7dzzIdHbZm1VzJdQ==} + '@babel/plugin-transform-dotall-regex@7.25.9': + resolution: {integrity: sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-duplicate-keys@7.25.7': - resolution: {integrity: sha512-by+v2CjoL3aMnWDOyCIg+yxU9KXSRa9tN6MbqggH5xvymmr9p4AMjYkNlQy4brMceBnUyHZ9G8RnpvT8wP7Cfg==} + '@babel/plugin-transform-duplicate-keys@7.25.9': + resolution: {integrity: sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.7': - resolution: {integrity: sha512-HvS6JF66xSS5rNKXLqkk7L9c/jZ/cdIVIcoPVrnl8IsVpLggTjXs8OWekbLHs/VtYDDh5WXnQyeE3PPUGm22MA==} + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9': + resolution: {integrity: sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-dynamic-import@7.25.8': - resolution: {integrity: sha512-gznWY+mr4ZQL/EWPcbBQUP3BXS5FwZp8RUOw06BaRn8tQLzN4XLIxXejpHN9Qo8x8jjBmAAKp6FoS51AgkSA/A==} + '@babel/plugin-transform-dynamic-import@7.25.9': + resolution: {integrity: sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-exponentiation-operator@7.25.7': - resolution: {integrity: sha512-yjqtpstPfZ0h/y40fAXRv2snciYr0OAoMXY/0ClC7tm4C/nG5NJKmIItlaYlLbIVAWNfrYuy9dq1bE0SbX0PEg==} + '@babel/plugin-transform-exponentiation-operator@7.26.3': + resolution: {integrity: sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-export-namespace-from@7.25.8': - resolution: {integrity: sha512-sPtYrduWINTQTW7FtOy99VCTWp4H23UX7vYcut7S4CIMEXU+54zKX9uCoGkLsWXteyaMXzVHgzWbLfQ1w4GZgw==} + '@babel/plugin-transform-export-namespace-from@7.25.9': + resolution: {integrity: sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-flow-strip-types@7.25.2': - resolution: {integrity: sha512-InBZ0O8tew5V0K6cHcQ+wgxlrjOw1W4wDXLkOTjLRD8GYhTSkxTVBtdy3MMtvYBrbAWa1Qm3hNoTc1620Yj+Mg==} + '@babel/plugin-transform-flow-strip-types@7.24.7': + resolution: {integrity: sha512-cjRKJ7FobOH2eakx7Ja+KpJRj8+y+/SiB3ooYm/n2UJfxu0oEaOoxOinitkJcPqv9KxS0kxTGPUaR7L2XcXDXA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1588,44 +1614,44 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-for-of@7.25.7': - resolution: {integrity: sha512-n/TaiBGJxYFWvpJDfsxSj9lEEE44BFM1EPGz4KEiTipTgkoFVVcCmzAL3qA7fdQU96dpo4gGf5HBx/KnDvqiHw==} + '@babel/plugin-transform-for-of@7.25.9': + resolution: {integrity: sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-function-name@7.25.1': - resolution: {integrity: sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==} + '@babel/plugin-transform-function-name@7.24.7': + resolution: {integrity: sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-function-name@7.25.7': - resolution: {integrity: sha512-5MCTNcjCMxQ63Tdu9rxyN6cAWurqfrDZ76qvVPrGYdBxIj+EawuuxTu/+dgJlhK5eRz3v1gLwp6XwS8XaX2NiQ==} + '@babel/plugin-transform-function-name@7.25.9': + resolution: {integrity: sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-json-strings@7.25.8': - resolution: {integrity: sha512-4OMNv7eHTmJ2YXs3tvxAfa/I43di+VcF+M4Wt66c88EAED1RoGaf1D64cL5FkRpNL+Vx9Hds84lksWvd/wMIdA==} + '@babel/plugin-transform-json-strings@7.25.9': + resolution: {integrity: sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-literals@7.25.2': - resolution: {integrity: sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==} + '@babel/plugin-transform-literals@7.24.7': + resolution: {integrity: sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-literals@7.25.7': - resolution: {integrity: sha512-fwzkLrSu2fESR/cm4t6vqd7ebNIopz2QHGtjoU+dswQo/P6lwAG04Q98lliE3jkz/XqnbGFLnUcE0q0CVUf92w==} + '@babel/plugin-transform-literals@7.25.9': + resolution: {integrity: sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-logical-assignment-operators@7.25.8': - resolution: {integrity: sha512-f5W0AhSbbI+yY6VakT04jmxdxz+WsID0neG7+kQZbCOjuyJNdL5Nn4WIBm4hRpKnUcO9lP0eipUhFN12JpoH8g==} + '@babel/plugin-transform-logical-assignment-operators@7.25.9': + resolution: {integrity: sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1636,38 +1662,38 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-member-expression-literals@7.25.7': - resolution: {integrity: sha512-Std3kXwpXfRV0QtQy5JJcRpkqP8/wG4XL7hSKZmGlxPlDqmpXtEPRmhF7ztnlTCtUN3eXRUJp+sBEZjaIBVYaw==} + '@babel/plugin-transform-member-expression-literals@7.25.9': + resolution: {integrity: sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-amd@7.25.7': - resolution: {integrity: sha512-CgselSGCGzjQvKzghCvDTxKHP3iooenLpJDO842ehn5D2G5fJB222ptnDwQho0WjEvg7zyoxb9P+wiYxiJX5yA==} + '@babel/plugin-transform-modules-amd@7.25.9': + resolution: {integrity: sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.24.8': - resolution: {integrity: sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==} + '@babel/plugin-transform-modules-commonjs@7.24.7': + resolution: {integrity: sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.25.7': - resolution: {integrity: sha512-L9Gcahi0kKFYXvweO6n0wc3ZG1ChpSFdgG+eV1WYZ3/dGbJK7vvk91FgGgak8YwRgrCuihF8tE/Xg07EkL5COg==} + '@babel/plugin-transform-modules-commonjs@7.26.3': + resolution: {integrity: sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-systemjs@7.25.7': - resolution: {integrity: sha512-t9jZIvBmOXJsiuyOwhrIGs8dVcD6jDyg2icw1VL4A/g+FnWyJKwUfSSU2nwJuMV2Zqui856El9u+ElB+j9fV1g==} + '@babel/plugin-transform-modules-systemjs@7.25.9': + resolution: {integrity: sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-umd@7.25.7': - resolution: {integrity: sha512-p88Jg6QqsaPh+EB7I9GJrIqi1Zt4ZBHUQtjw3z1bzEXcLh6GfPqzZJ6G+G1HBGKUNukT58MnKG7EN7zXQBCODw==} + '@babel/plugin-transform-modules-umd@7.25.9': + resolution: {integrity: sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1678,32 +1704,32 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-named-capturing-groups-regex@7.25.7': - resolution: {integrity: sha512-BtAT9LzCISKG3Dsdw5uso4oV1+v2NlVXIIomKJgQybotJY3OwCwJmkongjHgwGKoZXd0qG5UZ12JUlDQ07W6Ow==} + '@babel/plugin-transform-named-capturing-groups-regex@7.25.9': + resolution: {integrity: sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-new-target@7.25.7': - resolution: {integrity: sha512-CfCS2jDsbcZaVYxRFo2qtavW8SpdzmBXC2LOI4oO0rP+JSRDxxF3inF4GcPsLgfb5FjkhXG5/yR/lxuRs2pySA==} + '@babel/plugin-transform-new-target@7.25.9': + resolution: {integrity: sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.8': - resolution: {integrity: sha512-Z7WJJWdQc8yCWgAmjI3hyC+5PXIubH9yRKzkl9ZEG647O9szl9zvmKLzpbItlijBnVhTUf1cpyWBsZ3+2wjWPQ==} + '@babel/plugin-transform-nullish-coalescing-operator@7.25.9': + resolution: {integrity: sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-numeric-separator@7.25.8': - resolution: {integrity: sha512-rm9a5iEFPS4iMIy+/A/PiS0QN0UyjPIeVvbU5EMZFKJZHt8vQnasbpo3T3EFcxzCeYO0BHfc4RqooCZc51J86Q==} + '@babel/plugin-transform-numeric-separator@7.25.9': + resolution: {integrity: sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-rest-spread@7.25.8': - resolution: {integrity: sha512-LkUu0O2hnUKHKE7/zYOIjByMa4VRaV2CD/cdGz0AxU9we+VA3kDDggKEzI0Oz1IroG+6gUP6UmWEHBMWZU316g==} + '@babel/plugin-transform-object-rest-spread@7.25.9': + resolution: {integrity: sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1714,20 +1740,20 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-super@7.25.7': - resolution: {integrity: sha512-pWT6UXCEW3u1t2tcAGtE15ornCBvopHj9Bps9D2DsH15APgNVOTwwczGckX+WkAvBmuoYKRCFa4DK+jM8vh5AA==} + '@babel/plugin-transform-object-super@7.25.9': + resolution: {integrity: sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-catch-binding@7.25.8': - resolution: {integrity: sha512-EbQYweoMAHOn7iJ9GgZo14ghhb9tTjgOc88xFgYngifx7Z9u580cENCV159M4xDh3q/irbhSjZVpuhpC2gKBbg==} + '@babel/plugin-transform-optional-catch-binding@7.25.9': + resolution: {integrity: sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.25.8': - resolution: {integrity: sha512-q05Bk7gXOxpTHoQ8RSzGSh/LHVB9JEIkKnk3myAWwZHnYiTGYtbdrYkIsS8Xyh4ltKf7GNUSgzs/6P2bJtBAQg==} + '@babel/plugin-transform-optional-chaining@7.25.9': + resolution: {integrity: sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1738,20 +1764,20 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-parameters@7.25.7': - resolution: {integrity: sha512-FYiTvku63me9+1Nz7TOx4YMtW3tWXzfANZtrzHhUZrz4d47EEtMQhzFoZWESfXuAMMT5mwzD4+y1N8ONAX6lMQ==} + '@babel/plugin-transform-parameters@7.25.9': + resolution: {integrity: sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.25.7': - resolution: {integrity: sha512-KY0hh2FluNxMLwOCHbxVOKfdB5sjWG4M183885FmaqWWiGMhRZq4DQRKH6mHdEucbJnyDyYiZNwNG424RymJjA==} + '@babel/plugin-transform-private-methods@7.25.9': + resolution: {integrity: sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-property-in-object@7.25.8': - resolution: {integrity: sha512-8Uh966svuB4V8RHHg0QJOB32QK287NBksJOByoKmHMp1TAobNniNalIkI2i5IPj5+S9NYCG4VIjbEuiSN8r+ow==} + '@babel/plugin-transform-private-property-in-object@7.25.9': + resolution: {integrity: sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1762,8 +1788,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-property-literals@7.25.7': - resolution: {integrity: sha512-lQEeetGKfFi0wHbt8ClQrUSUMfEeI3MMm74Z73T9/kuz990yYVtfofjf3NuA42Jy3auFOpbjDyCSiIkTs1VIYw==} + '@babel/plugin-transform-property-literals@7.25.9': + resolution: {integrity: sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1792,8 +1818,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx@7.25.2': - resolution: {integrity: sha512-KQsqEAVBpU82NM/B/N9j9WOdphom1SZH3R+2V7INrQUH+V9EBFwZsEJl8eBIVeQE62FxJCc70jzEZwqU7RcVqA==} + '@babel/plugin-transform-react-jsx@7.24.7': + resolution: {integrity: sha512-+Dj06GDZEFRYvclU6k4bme55GKBEWUmByM/eoKuqg4zTNQHiApWRhQph5fxQB2wAEFvRzL1tOEj1RJ19wJrhoA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1804,14 +1830,20 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-regenerator@7.25.7': - resolution: {integrity: sha512-mgDoQCRjrY3XK95UuV60tZlFCQGXEtMg8H+IsW72ldw1ih1jZhzYXbJvghmAEpg5UVhhnCeia1CkGttUvCkiMQ==} + '@babel/plugin-transform-regenerator@7.25.9': + resolution: {integrity: sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-reserved-words@7.25.7': - resolution: {integrity: sha512-3OfyfRRqiGeOvIWSagcwUTVk2hXBsr/ww7bLn6TRTuXnexA+Udov2icFOxFX9abaj4l96ooYkcNN1qi2Zvqwng==} + '@babel/plugin-transform-regexp-modifiers@7.26.0': + resolution: {integrity: sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-reserved-words@7.25.9': + resolution: {integrity: sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1828,8 +1860,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-shorthand-properties@7.25.7': - resolution: {integrity: sha512-uBbxNwimHi5Bv3hUccmOFlUy3ATO6WagTApenHz9KzoIdn0XeACdB12ZJ4cjhuB2WSi80Ez2FWzJnarccriJeA==} + '@babel/plugin-transform-shorthand-properties@7.25.9': + resolution: {integrity: sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1840,8 +1872,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-spread@7.25.7': - resolution: {integrity: sha512-Mm6aeymI0PBh44xNIv/qvo8nmbkpZze1KvR8MkEqbIREDxoiWTi18Zr2jryfRMwDfVZF9foKh060fWgni44luw==} + '@babel/plugin-transform-spread@7.25.9': + resolution: {integrity: sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1852,8 +1884,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-sticky-regex@7.25.7': - resolution: {integrity: sha512-ZFAeNkpGuLnAQ/NCsXJ6xik7Id+tHuS+NT+ue/2+rn/31zcdnupCdmunOizEaP0JsUmTFSTOPoQY7PkK2pttXw==} + '@babel/plugin-transform-sticky-regex@7.25.9': + resolution: {integrity: sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1864,32 +1896,32 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-template-literals@7.25.7': - resolution: {integrity: sha512-SI274k0nUsFFmyQupiO7+wKATAmMFf8iFgq2O+vVFXZ0SV9lNfT1NGzBEhjquFmD8I9sqHLguH+gZVN3vww2AA==} + '@babel/plugin-transform-template-literals@7.25.9': + resolution: {integrity: sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typeof-symbol@7.25.7': - resolution: {integrity: sha512-OmWmQtTHnO8RSUbL0NTdtpbZHeNTnm68Gj5pA4Y2blFNh+V4iZR68V1qL9cI37J21ZN7AaCnkfdHtLExQPf2uA==} + '@babel/plugin-transform-typeof-symbol@7.25.9': + resolution: {integrity: sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.25.2': - resolution: {integrity: sha512-lBwRvjSmqiMYe/pS0+1gggjJleUJi7NzjvQ1Fkqtt69hBa/0t1YuW/MLQMAPixfwaQOHUXsd6jeU3Z+vdGv3+A==} + '@babel/plugin-transform-typescript@7.24.7': + resolution: {integrity: sha512-iLD3UNkgx2n/HrjBesVbYX6j0yqn/sJktvbtKKgcaLIQ4bTTQ8obAypc1VpyHPD2y4Phh9zHOaAt8e/L14wCpw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-escapes@7.25.7': - resolution: {integrity: sha512-BN87D7KpbdiABA+t3HbVqHzKWUDN3dymLaTnPFAMyc8lV+KN3+YzNhVRNdinaCPA4AUqx7ubXbQ9shRjYBl3SQ==} + '@babel/plugin-transform-unicode-escapes@7.25.9': + resolution: {integrity: sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-property-regex@7.25.7': - resolution: {integrity: sha512-IWfR89zcEPQGB/iB408uGtSPlQd3Jpq11Im86vUgcmSTcoWAiQMCTOa2K2yNNqFJEBVICKhayctee65Ka8OB0w==} + '@babel/plugin-transform-unicode-property-regex@7.25.9': + resolution: {integrity: sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1900,20 +1932,20 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-regex@7.25.7': - resolution: {integrity: sha512-8JKfg/hiuA3qXnlLx8qtv5HWRbgyFx2hMMtpDDuU2rTckpKkGu4ycK5yYHwuEa16/quXfoxHBIApEsNyMWnt0g==} + '@babel/plugin-transform-unicode-regex@7.25.9': + resolution: {integrity: sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-sets-regex@7.25.7': - resolution: {integrity: sha512-YRW8o9vzImwmh4Q3Rffd09bH5/hvY0pxg+1H1i0f7APoUeg12G7+HhLj9ZFNIrYkgBXhIijPJ+IXypN0hLTIbw==} + '@babel/plugin-transform-unicode-sets-regex@7.25.9': + resolution: {integrity: sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/preset-env@7.25.8': - resolution: {integrity: sha512-58T2yulDHMN8YMUxiLq5YmWUnlDCyY1FsHM+v12VMx+1/FlrUj5tY50iDCpofFQEM8fMYOaY9YRvym2jcjn1Dg==} + '@babel/preset-env@7.26.0': + resolution: {integrity: sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1950,61 +1982,61 @@ packages: '@babel/regjsgen@0.8.0': resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} - '@babel/runtime@7.25.0': - resolution: {integrity: sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==} + '@babel/runtime@7.24.7': + resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.0': - resolution: {integrity: sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==} + '@babel/template@7.24.7': + resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.7': - resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} + '@babel/template@7.25.9': + resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.3': - resolution: {integrity: sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==} + '@babel/traverse@7.24.7': + resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.7': - resolution: {integrity: sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==} + '@babel/traverse@7.26.4': + resolution: {integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==} engines: {node: '>=6.9.0'} - '@babel/types@7.25.2': - resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} + '@babel/types@7.24.7': + resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} engines: {node: '>=6.9.0'} - '@babel/types@7.25.8': - resolution: {integrity: sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==} + '@babel/types@7.26.3': + resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@changesets/apply-release-plan@7.0.4': - resolution: {integrity: sha512-HLFwhKWayKinWAul0Vj+76jVx1Pc2v55MGPVjZ924Y/ROeSsBMFutv9heHmCUj48lJyRfOTJG5+ar+29FUky/A==} + '@changesets/apply-release-plan@7.0.3': + resolution: {integrity: sha512-klL6LCdmfbEe9oyfLxnidIf/stFXmrbFO/3gT5LU5pcyoZytzJe4gWpTBx3BPmyNPl16dZ1xrkcW7b98e3tYkA==} - '@changesets/assemble-release-plan@6.0.3': - resolution: {integrity: sha512-bLNh9/Lgl1VwkjWZTq8JmRqH+hj7/Yzfz0jsQ/zJJ+FTmVqmqPj3szeKOri8O/hEM8JmHW019vh2gTO9iq5Cuw==} + '@changesets/assemble-release-plan@6.0.2': + resolution: {integrity: sha512-n9/Tdq+ze+iUtjmq0mZO3pEhJTKkku9hUxtUadW30jlN7kONqJG3O6ALeXrmc6gsi/nvoCuKjqEJ68Hk8RbMTQ==} '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - '@changesets/cli@2.27.7': - resolution: {integrity: sha512-6lr8JltiiXPIjDeYg4iM2MeePP6VN/JkmqBsVA5XRiy01hGS3y629LtSDvKcycj/w/5Eur1rEwby/MjcYS+e2A==} + '@changesets/cli@2.27.5': + resolution: {integrity: sha512-UVppOvzCjjylBenFcwcZNG5IaZ8jsIaEVraV/pbXgukYNb0Oqa0d8UWb0LkYzA1Bf1HmUrOfccFcRLheRuA7pA==} hasBin: true - '@changesets/config@3.0.2': - resolution: {integrity: sha512-cdEhS4t8woKCX2M8AotcV2BOWnBp09sqICxKapgLHf9m5KdENpWjyrFNMjkLqGJtUys9U+w93OxWT0czorVDfw==} + '@changesets/config@3.0.1': + resolution: {integrity: sha512-nCr8pOemUjvGJ8aUu8TYVjqnUL+++bFOQHBVmtNbLvKzIDkN/uiP/Z4RKmr7NNaiujIURHySDEGFPftR4GbTUA==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@2.1.1': - resolution: {integrity: sha512-LRFjjvigBSzfnPU2n/AhFsuWR5DK++1x47aq6qZ8dzYsPtS/I5mNhIGAS68IAxh1xjO9BTtz55FwefhANZ+FCA==} + '@changesets/get-dependents-graph@2.1.0': + resolution: {integrity: sha512-QOt6pQq9RVXKGHPVvyKimJDYJumx7p4DO5MO9AhRJYgAPgv0emhNqAqqysSVKHBm4sxKlGN4S1zXOIb5yCFuhQ==} - '@changesets/get-release-plan@4.0.3': - resolution: {integrity: sha512-6PLgvOIwTSdJPTtpdcr3sLtGatT+Jr22+cQwEBJBy6wP0rjB4yJ9lv583J9fVpn1bfQlBkDa8JxbS2g/n9lIyA==} + '@changesets/get-release-plan@4.0.2': + resolution: {integrity: sha512-rOalz7nMuMV2vyeP7KBeAhqEB7FM2GFPO5RQSoOoUKKH9L6wW3QyPA2K+/rG9kBrWl2HckPVES73/AuwPvbH3w==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} @@ -2311,8 +2343,8 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.0': - resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + '@eslint-community/regexpp@4.10.1': + resolution: {integrity: sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/eslintrc@2.1.4': @@ -2362,28 +2394,28 @@ packages: '@ethersproject/transactions@5.7.0': resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} - '@expo/bunyan@4.0.1': - resolution: {integrity: sha512-+Lla7nYSiHZirgK+U/uYzsLv/X+HaJienbD5AKX1UQZHYfWaP+9uuQluRB4GrEVWF0GZ7vEVp/jzaOT9k/SQlg==} - engines: {node: '>=0.10.0'} + '@expo/bunyan@4.0.0': + resolution: {integrity: sha512-Ydf4LidRB/EBI+YrB+cVLqIseiRfjUI/AeHBgjGMtq3GroraDu81OV7zqophRgupngoL3iS3JUMDMnxO7g39qA==} + engines: {'0': node >=0.10.0} - '@expo/cli@0.18.29': - resolution: {integrity: sha512-X810C48Ss+67RdZU39YEO1khNYo1RmjouRV+vVe0QhMoTe8R6OA3t+XYEdwaNbJ5p/DJN7szfHfNmX2glpC7xg==} + '@expo/cli@0.18.19': + resolution: {integrity: sha512-8Rj18cTofpLl+7D++auMVS71KungldHbrArR44fpE8loMVAvYZA+U932lmd0K2lOYBASPhm7SVP9wzls//ESFQ==} hasBin: true '@expo/code-signing-certificates@0.0.5': resolution: {integrity: sha512-BNhXkY1bblxKZpltzAx98G2Egj9g1Q+JRcvR7E99DOj862FTCX+ZPsAUtPTr7aHxwtrL7+fL3r0JSmM9kBm+Bw==} - '@expo/config-plugins@8.0.8': - resolution: {integrity: sha512-Fvu6IO13EUw0R9WeqxUO37FkM62YJBNcZb9DyJAOgMz7Ez/vaKQGEjKt9cwT+Q6uirtCATMgaq6VWAW7YW8xXw==} + '@expo/config-plugins@8.0.5': + resolution: {integrity: sha512-VGseKX1dYvaf2qHUDGzIQwSOJrO5fomH0gE5cKSQyi6wn+Q6rcV2Dj2E5aga+9aKNPL6FxZ0dqRFC3t2sbhaSA==} - '@expo/config-types@51.0.2': - resolution: {integrity: sha512-IglkIoiDwJMY01lYkF/ZSBoe/5cR+O3+Gx6fpLFjLfgZGBTdyPkKa1g8NWoWQCk+D3cKL2MDbszT2DyRRB0YqQ==} + '@expo/config-types@51.0.1': + resolution: {integrity: sha512-5JuzUFobFImrUgnq93LeucP44ZMxq8WMXmCtIUf3ZC3mJSwjvvHJBMO2fS/sIlmgvvQk9eq4VnX06/7tgDFMSg==} - '@expo/config@9.0.3': - resolution: {integrity: sha512-eOTNM8eOC8gZNHgenySRlc/lwmYY1NOgvjwA8LHuvPT7/eUwD93zrxu3lPD1Cc/P6C/2BcVdfH4hf0tLmDxnsg==} + '@expo/config@9.0.1': + resolution: {integrity: sha512-0tjaXBstTbXmD4z+UMFBkh2SZFwilizSQhW6DlaTMnPG5ezuw93zSFEWAuEC3YzkpVtNQTmYzxAYjxwh6seOGg==} - '@expo/devcert@1.1.4': - resolution: {integrity: sha512-fqBODr8c72+gBSX5Ty3SIzaY4bXainlpab78+vEYEKL3fXmsOswMLf0+KE36mUEAa36BYabX7K3EiXOXX5OPMw==} + '@expo/devcert@1.1.2': + resolution: {integrity: sha512-FyWghLu7rUaZEZSTLt/XNRukm0c9GFfwP0iFaswoDWpV6alvVg+zRAfCLdIVQEz1SVcQ3zo1hMZFDrnKGvkCuQ==} '@expo/env@0.3.0': resolution: {integrity: sha512-OtB9XVHWaXidLbHvrVDeeXa09yvTl3+IQN884sO6PhIi2/StXfgSH/9zC7IvzrDB8kW3EBJ1PPLuCUJ2hxAT7Q==} @@ -2394,8 +2426,8 @@ packages: '@expo/json-file@8.3.3': resolution: {integrity: sha512-eZ5dld9AD0PrVRiIWpRkm5aIoWBw3kAyd8VkuWEy92sEthBKDDDHAnK2a0dw0Eil6j7rK7lS/Qaq/Zzngv2h5A==} - '@expo/metro-config@0.18.11': - resolution: {integrity: sha512-/uOq55VbSf9yMbUO1BudkUM2SsGW1c5hr9BnhIqYqcsFv0Jp5D3DtJ4rljDKaUeNLbwr6m7pqIrkSMq5NrYf4Q==} + '@expo/metro-config@0.18.7': + resolution: {integrity: sha512-MzAyFP0fvoyj9IUc6SPnpy6/HLT23j/p5J+yWjGug2ddOpSuKNDHOOqlwWZbJp5KfZCEIVWNHeUoE+TaC/yhaQ==} '@expo/osascript@2.1.3': resolution: {integrity: sha512-aOEkhPzDsaAfolSswObGiYW0Pf0ROfR9J2NBRLQACdQ6uJlyAMiPF45DVEVknAU9juKh0y8ZyvC9LXqLEJYohA==} @@ -2407,8 +2439,8 @@ packages: '@expo/plist@0.1.3': resolution: {integrity: sha512-GW/7hVlAylYg1tUrEASclw1MMk9FP4ZwyFAY/SUTJIhPDQHtfOlXREyWV3hhrHdX/K+pS73GNgdfT6E/e+kBbg==} - '@expo/prebuild-config@7.0.8': - resolution: {integrity: sha512-wH9NVg6HiwF5y9x0TxiMEeBF+ITPGDXy5/i6OUheSrKpPgb0lF1Mwzl/f2fLPXBEpl+ZXOQ8LlLW32b7K9lrNg==} + '@expo/prebuild-config@7.0.6': + resolution: {integrity: sha512-Hts+iGBaG6OQ+N8IEMMgwQElzJeSTb7iUJ26xADEHkaexsucAK+V52dM8M4ceicvbZR9q8M+ebJEGj0MCNA3dQ==} peerDependencies: expo-modules-autolinking: '>=0.8.1' @@ -2559,10 +2591,6 @@ packages: resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/types@24.9.0': - resolution: {integrity: sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==} - engines: {node: '>= 6'} - '@jest/types@26.6.2': resolution: {integrity: sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==} engines: {node: '>= 10.14.2'} @@ -2590,8 +2618,8 @@ packages: '@jridgewell/source-map@0.3.6': resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/sourcemap-codec@1.4.15': + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} @@ -2617,9 +2645,9 @@ packages: resolution: {integrity: sha512-x/iUDjcS90W69PryLDIMgFyV21YLTnG9zOpPXS7Bkt2b8AsY3zZsIpOLBkYr9fBcF3HbkKaER5hOBZLfpLgYNw==} engines: {node: '>= 14.0.0'} - '@koa/router@12.0.1': - resolution: {integrity: sha512-ribfPYfHb+Uw3b27Eiw6NPqjhIhTpVFzEWLwyc/1Xp+DCdwRRyIlAUODX+9bPARF6aQtUu1+/PHzdNvRzcs/+Q==} - engines: {node: '>= 12'} + '@koa/router@13.1.0': + resolution: {integrity: sha512-mNVu1nvkpSd8Q8gMebGbCkDWJ51ODetrFvLKYusej+V0ByD4btqHYnPIzTBLXnQMVUlm/oxVwqmWBY3zQfZilw==} + engines: {node: '>= 18'} '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -2631,12 +2659,16 @@ packages: resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true + '@mattrglobal/bbs-signatures@1.3.1': + resolution: {integrity: sha512-syZGkapPpktD2el4lPTCQRw/LSia6/NwBS83hzCKu4dTlaJRO636qo5NCiiQb+iBYWyZQQEzN0jdRik8N9EUGA==} + engines: {node: '>=14'} + '@mattrglobal/bbs-signatures@1.4.0': resolution: {integrity: sha512-uBK1IWw48fqloO9W/yoDncTs9rfwfbG/53cOrrCQL7XkyZe4DtB40HcLbi3i+yxTYs5wytf1Qr4Z5RpzpW10jw==} engines: {node: '>=16'} - '@mattrglobal/bls12381-key-pair@1.2.2': - resolution: {integrity: sha512-wbbj5sN+0OHChyXdPHY5v4VM54C3bAKzLY0EbQZphHwMOe5Vo/Kij8x+4Nu0Cvx7kAIVxDk418jUo8BwlaE0Tw==} + '@mattrglobal/bls12381-key-pair@1.2.1': + resolution: {integrity: sha512-Xh63NP1iSGBLW10N5uRpDyoPo2LtNHHh/TRGVJEHRgo+07yxgl8tS06Q2zO9gN9+b+GU5COKvR3lACwrvn+MYw==} engines: {node: '>=14.0.0'} '@mattrglobal/node-bbs-signatures@0.18.1': @@ -2656,16 +2688,20 @@ packages: '@noble/ciphers@0.5.3': resolution: {integrity: sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w==} - '@noble/curves@1.6.0': - resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} + '@noble/curves@1.7.0': + resolution: {integrity: sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==} engines: {node: ^14.21.3 || >=16} '@noble/hashes@1.4.0': resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} - '@noble/hashes@1.5.0': - resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} + '@noble/hashes@1.6.0': + resolution: {integrity: sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ==} + engines: {node: ^14.21.3 || >=16} + + '@noble/hashes@1.6.1': + resolution: {integrity: sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==} engines: {node: ^14.21.3 || >=16} '@nodelib/fs.scandir@2.1.5': @@ -2699,8 +2735,8 @@ packages: '@peculiar/asn1-csr@2.3.13': resolution: {integrity: sha512-+JtFsOUWCw4zDpxp1LbeTYBnZLlGVOWmHHEhoFdjM5yn4wCn+JiYQ8mghOi36M2f6TPQ17PmhNL6/JfNh7/jCA==} - '@peculiar/asn1-ecc@2.3.13': - resolution: {integrity: sha512-3dF2pQcrN/WJEMq+9qWLQ0gqtn1G81J4rYqFl6El6QV367b4IuhcRv+yMA84tNNyHOJn9anLXV5radnpPiG3iA==} + '@peculiar/asn1-ecc@2.3.14': + resolution: {integrity: sha512-zWPyI7QZto6rnLv6zPniTqbGaLh6zBpJyI46r1yS/bVHJXT2amdMHCRRnbV5yst2H8+ppXG6uXu/M6lKakiQ8w==} '@peculiar/asn1-pfx@2.3.13': resolution: {integrity: sha512-fypYxjn16BW+5XbFoY11Rm8LhZf6euqX/C7BTYpqVvLem1GvRl7A+Ro1bO/UPwJL0z+1mbvXEnkG0YOwbwz2LA==} @@ -2717,6 +2753,9 @@ packages: '@peculiar/asn1-schema@2.3.13': resolution: {integrity: sha512-3Xq3a01WkHRZL8X04Zsfg//mGaA21xlL4tlVn4v2xGT0JStiztATRkMwa5b+f/HXmY2smsiLXYK46Gwgzvfg3g==} + '@peculiar/asn1-schema@2.3.8': + resolution: {integrity: sha512-ULB1XqHKx1WBU/tTFIA+uARuRoBVZ4pNdOA878RDrRbBfBGcSzi5HBkdScC6ZbHn8z7L8gmKCgPC1LHRrP46tA==} + '@peculiar/asn1-x509-attr@2.3.13': resolution: {integrity: sha512-WpEos6CcnUzJ6o2Qb68Z7Dz5rSjRGv/DtXITCNBtjZIRWRV12yFVci76SVfOX8sisL61QWMhpLKQibrG8pi2Pw==} @@ -2731,8 +2770,8 @@ packages: resolution: {integrity: sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg==} engines: {node: '>=10.12.0'} - '@peculiar/x509@1.12.1': - resolution: {integrity: sha512-2T9t2viNP9m20mky50igPTpn2ByhHl5NlT6wW4Tp4BejQaQ5XDNZgfsabYwYysLXhChABlgtTCpp2gM3JBZRKA==} + '@peculiar/x509@1.12.3': + resolution: {integrity: sha512-+Mzq+W7cNEKfkNZzyLl6A6ffqc3r21HGZUezgfKxpZrkORfOqgRXnS80Zu0IV6a9Ue9QBJeKD7kN0iWfc3bhRQ==} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -2809,35 +2848,35 @@ packages: '@react-native/assets@1.0.0': resolution: {integrity: sha512-KrwSpS1tKI70wuKl68DwJZYEvXktDHdZMG0k2AXD/rJVSlB23/X2CB2cutVR0HwNMJIal9HOUOBB2rVfa6UGtQ==} - '@react-native/babel-plugin-codegen@0.74.87': - resolution: {integrity: sha512-+vJYpMnENFrwtgvDfUj+CtVJRJuUnzAUYT0/Pb68Sq9RfcZ5xdcCuUgyf7JO+akW2VTBoJY427wkcxU30qrWWw==} + '@react-native/babel-plugin-codegen@0.74.84': + resolution: {integrity: sha512-UR4uiii5szIJA84mSC6GJOfYKDq7/ThyetOQT62+BBcyGeHVtHlNLNRzgaMeLqIQaT8Fq4pccMI+7QqLOMXzdw==} engines: {node: '>=18'} - '@react-native/babel-preset@0.74.87': - resolution: {integrity: sha512-hyKpfqzN2nxZmYYJ0tQIHG99FQO0OWXp/gVggAfEUgiT+yNKas1C60LuofUsK7cd+2o9jrpqgqW4WzEDZoBlTg==} + '@react-native/babel-preset@0.74.84': + resolution: {integrity: sha512-WUfu6Y4aGuVdocQZvx33BJiQWFH6kRCHYbZfBn2psgFrSRLgQWEQrDCxqPFObNAVSayM0rNhp2FvI5K/Eyeqlg==} engines: {node: '>=18'} peerDependencies: '@babel/core': '*' - '@react-native/codegen@0.74.87': - resolution: {integrity: sha512-GMSYDiD+86zLKgMMgz9z0k6FxmRn+z6cimYZKkucW4soGbxWsbjUAZoZ56sJwt2FJ3XVRgXCrnOCgXoH/Bkhcg==} + '@react-native/codegen@0.74.84': + resolution: {integrity: sha512-0hXlnu9i0o8v+gXKQi+x6T471L85kCDwW4WrJiYAeOheWrQdNNW6rC3g8+LL7HXAf7QcHGU/8/d57iYfdVK2BQ==} engines: {node: '>=18'} peerDependencies: '@babel/preset-env': ^7.1.6 - '@react-native/debugger-frontend@0.74.85': - resolution: {integrity: sha512-gUIhhpsYLUTYWlWw4vGztyHaX/kNlgVspSvKe2XaPA7o3jYKUoNLc3Ov7u70u/MBWfKdcEffWq44eSe3j3s5JQ==} + '@react-native/debugger-frontend@0.74.84': + resolution: {integrity: sha512-YUEA03UNFbiYzHpYxlcS2D9+3eNT5YLGkl5yRg3nOSN6KbCc/OttGnNZme+tuSOJwjMN/vcvtDKYkTqjJw8U0A==} engines: {node: '>=18'} - '@react-native/dev-middleware@0.74.85': - resolution: {integrity: sha512-BRmgCK5vnMmHaKRO+h8PKJmHHH3E6JFuerrcfE3wG2eZ1bcSr+QTu8DAlpxsDWvJvHpCi8tRJGauxd+Ssj/c7w==} + '@react-native/dev-middleware@0.74.84': + resolution: {integrity: sha512-veYw/WmyrAOQHUiIeULzn2duJQnXDPiKq2jZ/lcmDo6jsLirpp+Q73lx09TYgy/oVoPRuV0nfmU3x9B6EV/7qQ==} engines: {node: '>=18'} '@react-native/normalize-color@2.1.0': resolution: {integrity: sha512-Z1jQI2NpdFJCVgpY+8Dq/Bt3d+YUi1928Q+/CZm/oh66fzM0RUl54vvuXlPJKybH4pdCZey1eDTPaLHkMPNgWA==} - '@react-native/normalize-colors@0.74.85': - resolution: {integrity: sha512-pcE4i0X7y3hsAE0SpIl7t6dUc0B0NZLd1yv7ssm4FrLhWG+CGyIq4eFDXpmPU1XHmL5PPySxTAjEMiwv6tAmOw==} + '@react-native/normalize-colors@0.74.84': + resolution: {integrity: sha512-Y5W6x8cC5RuakUcTVUFNAIhUZ/tYpuqHZlRBoAuakrTwVuoNHXfQki8lj1KsYU7rW6e3VWgdEx33AfOQpdNp6A==} '@react-native/polyfills@2.0.0': resolution: {integrity: sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==} @@ -2846,8 +2885,8 @@ packages: resolution: {integrity: sha512-lzD84av1ZQhYUS+jsGqJiCMaJO2dn9u+RTT9n9q6D3SaKVwWqv+7AoRKqBu19bkwyE+iFRl1ymr40QS90jVFYg==} engines: {node: '>=14.15'} - '@scure/base@1.1.8': - resolution: {integrity: sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg==} + '@scure/base@1.2.1': + resolution: {integrity: sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==} '@sd-jwt/core@0.7.2': resolution: {integrity: sha512-vix1GplUFc1A9H42r/yXkg7cKYthggyqZEwlFdsBbn4xdZNE+AHVF4N7kPa1pPxipwN3UIHd4XnQ5MJV15mhsQ==} @@ -2937,8 +2976,8 @@ packages: resolution: {integrity: sha512-+AAUvEEFs0vzz1mrgjSgvDkcBtr18d2XEVgJex7QlAqxCKVGfjzZlqL2Q2vOLKYVaXsazhD5LnYiY6B5WMTC3Q==} engines: {node: '>=18'} - '@sphereon/pex-models@2.3.1': - resolution: {integrity: sha512-SByU4cJ0XYA6VZQ/L6lsSiRcFtBPHbFioCeQ4GP7/W/jQ+PSBD7uK2oTnKQ9/0iEiMK/6JYqhKgLs4a9UX3UTQ==} + '@sphereon/pex-models@2.3.2': + resolution: {integrity: sha512-foFxfLkRwcn/MOp/eht46Q7wsvpQGlO7aowowIIb5Tz9u97kYZ2kz6K2h2ODxWuv5CRA7Q0MY8XUBGE2lfOhOQ==} '@sphereon/pex@5.0.0-unstable.24': resolution: {integrity: sha512-CZc+kr8cJqPsFSpg4kHyamr5oB5xLVP2E5eJ0pbetOfOE2uSxqk0/A8zGazcPhU1zZILrO51hD4vW/hJRgtKJQ==} @@ -3098,8 +3137,8 @@ packages: '@types/cors@2.8.17': resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} - '@types/eslint@8.56.11': - resolution: {integrity: sha512-sVBpJMf7UPo/wGecYOpk2aQya2VUGeHhe38WG7/mN5FufNSubf5VT9Uh9Uyp8/eLJpu1/tuhJ/qTo4mhSB4V4Q==} + '@types/eslint@8.56.10': + resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -3107,8 +3146,8 @@ packages: '@types/events@3.0.3': resolution: {integrity: sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==} - '@types/express-serve-static-core@4.19.5': - resolution: {integrity: sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==} + '@types/express-serve-static-core@4.19.3': + resolution: {integrity: sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==} '@types/express@4.17.21': resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} @@ -3119,8 +3158,8 @@ packages: '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} - '@types/http-assert@1.5.5': - resolution: {integrity: sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==} + '@types/http-assert@1.5.6': + resolution: {integrity: sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==} '@types/http-cache-semantics@4.0.4': resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} @@ -3137,9 +3176,6 @@ packages: '@types/istanbul-lib-report@3.0.3': resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} - '@types/istanbul-reports@1.1.2': - resolution: {integrity: sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==} - '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} @@ -3173,6 +3209,9 @@ packages: '@types/mime@1.3.5': resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} + '@types/minimist@1.2.5': + resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} + '@types/multer@1.4.11': resolution: {integrity: sha512-svK240gr6LVWvv3YGyhLlA+6LRRWA4mnGIU7RcNmgjBYFl6665wcXrRfxGp5tEPVHUNm5FMcmq7too9bxCwX/w==} @@ -3182,6 +3221,9 @@ packages: '@types/node@18.18.8': resolution: {integrity: sha512-OLGBaaK5V3VRBS1bAkMVP2/W9B+H8meUfl866OrMNQqt7wDgdpWPp5o6gmIc9pB+lIQHSq4ZL8ypeH1vPxcPaQ==} + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + '@types/object-inspect@1.13.0': resolution: {integrity: sha512-lwGTVESDDV+XsQ1pH4UifpJ1f7OtXzQ6QBOX2Afq2bM/T3oOt8hF6exJMjjIjtEWeAN2YAo25J7HxWh97CCz9w==} @@ -3236,23 +3278,20 @@ packages: '@types/varint@6.0.3': resolution: {integrity: sha512-DHukoGWdJ2aYkveZJTB2rN2lp6m7APzVsoJQ7j/qy1fQxyamJTPD5xQzCMoJ2Qtgn0mE3wWeNOpbTyBFvF+dyA==} - '@types/ws@8.5.12': - resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} + '@types/ws@8.5.10': + resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} - '@types/yargs@13.0.12': - resolution: {integrity: sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==} - '@types/yargs@15.0.19': resolution: {integrity: sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==} '@types/yargs@16.0.9': resolution: {integrity: sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==} - '@types/yargs@17.0.33': - resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + '@types/yargs@17.0.32': + resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} '@typescript-eslint/eslint-plugin@7.18.0': resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} @@ -3377,8 +3416,8 @@ packages: resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} engines: {node: '>=0.4.0'} - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.12.0: + resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} engines: {node: '>=0.4.0'} hasBin: true @@ -3401,8 +3440,8 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.16.0: + resolution: {integrity: sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==} anser@1.4.10: resolution: {integrity: sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==} @@ -3528,6 +3567,10 @@ packages: resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} engines: {node: '>= 0.4'} + arrify@1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} @@ -3558,8 +3601,8 @@ packages: async-mutex@0.4.1: resolution: {integrity: sha512-WfoBo4E/TbCX1G95XTjbWTE3X2XLG0m1Xbv2cwOtuPdyH9CZvnaA5nCt1ucjaKEgW2A5IF71hxrRhr83Je5xjA==} - async@3.2.6: - resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + async@3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -3605,6 +3648,11 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs3@0.10.4: + resolution: {integrity: sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs3@0.10.6: resolution: {integrity: sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==} peerDependencies: @@ -3615,9 +3663,6 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - babel-plugin-react-compiler@0.0.0-experimental-7d62301-20240819: - resolution: {integrity: sha512-MtERcQLDo4ZlkDmZXfdPJoW8s8P7mGvQH6vwFLHdllOrezDow8Njg+jJqU4G9awKAKd5hv8znxfb2rsvJf78GA==} - babel-plugin-react-native-web@0.19.12: resolution: {integrity: sha512-eYZ4+P6jNcB37lObWIg0pUbi7+3PKoU1Oie2j0C8UF3cXyXoR74tO2NBjI/FORb2LJyItJZEAmjU5pSaJYEL1w==} @@ -3627,13 +3672,13 @@ packages: babel-plugin-transform-flow-enums@0.0.2: resolution: {integrity: sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==} - babel-preset-current-node-syntax@1.1.0: - resolution: {integrity: sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==} + babel-preset-current-node-syntax@1.0.1: + resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 - babel-preset-expo@11.0.14: - resolution: {integrity: sha512-4BVYR0Sc2sSNxYTiE/OLSnPiOp+weFNy8eV+hX3aD6YAIbBnw+VubKRWqJV/sOJauzOLz0SgYAYyFciYMqizRA==} + babel-preset-expo@11.0.10: + resolution: {integrity: sha512-YBg40Om31gw9IPlRw5v8elzgtPUtNEh4GSibBi5MsmmYddGg4VPjWtCZIFJChN543qRmbGb/fa/kejvLX567hQ==} babel-preset-fbjs@3.4.0: resolution: {integrity: sha512-9ywCsCvo1ojrw0b+XYk7aFvTH6D9064t0RIL1rtMf3nsa02Xw41MS7sZw216Im35xj/UY0PDBQsa1brUDDF1Ow==} @@ -3652,8 +3697,8 @@ packages: base-64@0.1.0: resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==} - base-x@3.0.10: - resolution: {integrity: sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==} + base-x@3.0.9: + resolution: {integrity: sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==} base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -3736,16 +3781,19 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + breakword@1.0.6: + resolution: {integrity: sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==} + brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - browserslist@4.23.3: - resolution: {integrity: sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==} + browserslist@4.23.1: + resolution: {integrity: sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true - browserslist@4.24.0: - resolution: {integrity: sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==} + browserslist@4.24.2: + resolution: {integrity: sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -3796,8 +3844,8 @@ packages: resolution: {integrity: sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==} engines: {node: '>=6.0.0'} - cacache@18.0.4: - resolution: {integrity: sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ==} + cacache@18.0.3: + resolution: {integrity: sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg==} engines: {node: ^16.14.0 || >=18.0.0} cache-content-type@1.0.1: @@ -3832,6 +3880,10 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase-keys@6.2.2: + resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} + engines: {node: '>=8'} + camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -3840,11 +3892,11 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001651: - resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==} + caniuse-lite@1.0.30001636: + resolution: {integrity: sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==} - caniuse-lite@1.0.30001668: - resolution: {integrity: sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==} + caniuse-lite@1.0.30001687: + resolution: {integrity: sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==} canonicalize@1.0.8: resolution: {integrity: sha512-0CNTVCLZggSh7bc5VkX5WWPWO+cyZbNd07IHIsSXLia/eAq+r836hgk+8BKoEh7949Mda87VUOitx5OddVj64A==} @@ -4075,8 +4127,11 @@ packages: resolution: {integrity: sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==} engines: {node: '>= 0.8'} - core-js-compat@3.38.1: - resolution: {integrity: sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==} + core-js-compat@3.37.1: + resolution: {integrity: sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==} + + core-js-compat@3.39.0: + resolution: {integrity: sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw==} core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -4138,6 +4193,19 @@ packages: resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} engines: {node: '>=8'} + csv-generate@3.4.3: + resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} + + csv-parse@4.16.3: + resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + + csv-stringify@5.6.5: + resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + + csv@5.5.3: + resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} + engines: {node: '>= 0.1.90'} + d@1.0.2: resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} engines: {node: '>=0.12'} @@ -4165,8 +4233,8 @@ packages: resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} engines: {node: '>= 0.4'} - dayjs@1.11.13: - resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==} + dayjs@1.11.11: + resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==} debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} @@ -4184,8 +4252,17 @@ packages: supports-color: optional: true - debug@4.3.6: - resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + debug@4.3.5: + resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -4193,6 +4270,10 @@ packages: supports-color: optional: true + decamelize-keys@1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} @@ -4362,22 +4443,20 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - ejs@3.1.10: - resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} - engines: {node: '>=0.10.0'} - hasBin: true - - electron-to-chromium@1.5.13: - resolution: {integrity: sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==} + electron-to-chromium@1.4.806: + resolution: {integrity: sha512-nkoEX2QIB8kwCOtvtgwhXWy2IHVcOLQZu9Qo36uaGB835mdX/h8uLRlosL6QIhLVUnAiicXRW00PwaPZC74Nrg==} - electron-to-chromium@1.5.38: - resolution: {integrity: sha512-VbeVexmZ1IFh+5EfrYz1I0HTzHVIlJa112UEWhciPyeOcKJGeTv6N8WnG4wsQB81DGCaVEGhpSb6o6a8WYFXXg==} + electron-to-chromium@1.5.71: + resolution: {integrity: sha512-dB68l59BI75W1BUGVTAEJy45CEVuEGy9qPVVQ8pnHyHMn36PLPPoE1mjLH+lo9rKulO3HC2OhbACI/8tCqJBcA==} elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} - elliptic@6.5.7: - resolution: {integrity: sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==} + elliptic@6.5.5: + resolution: {integrity: sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==} + + elliptic@6.6.1: + resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -4396,8 +4475,8 @@ packages: end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} - enhanced-resolve@5.17.1: - resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} + enhanced-resolve@5.17.0: + resolution: {integrity: sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==} engines: {node: '>=10.13.0'} enquirer@2.4.1: @@ -4473,6 +4552,10 @@ packages: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -4580,8 +4663,8 @@ packages: engines: {node: '>=4'} hasBin: true - esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} esrecurse@4.3.0: @@ -4638,8 +4721,8 @@ packages: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - expo-asset@10.0.10: - resolution: {integrity: sha512-0qoTIihB79k+wGus9wy0JMKq7DdenziVx3iUkGvMAy2azscSgWH6bd2gJ9CGnhC6JRd3qTMFBL0ou/fx7WZl7A==} + expo-asset@10.0.9: + resolution: {integrity: sha512-KX7LPtVf9eeMidUvYZafXZldrVdzfjZNKKFAjFvDy2twg7sTa2R0L4VdCXp32eGLWZyk+i/rpOUSbyD1YFyJnA==} peerDependencies: expo: '*' @@ -4653,8 +4736,8 @@ packages: peerDependencies: expo: '*' - expo-font@12.0.9: - resolution: {integrity: sha512-seTCyf0tbgkAnp3ZI9ZfK9QVtURQUgFnuj+GuJ5TSnN0XsOtVe1s2RxTvmMgkfuvfkzcjJ69gyRpsZS1cC8hjw==} + expo-font@12.0.7: + resolution: {integrity: sha512-rbSdpjtT/A3M+u9xchR9tdD+5VGSxptUis7ngX5zfAVp3O5atOcPNSA82Jeo15HkrQE+w/upfFBOvi56lsGdsQ==} peerDependencies: expo: '*' @@ -4667,12 +4750,12 @@ packages: resolution: {integrity: sha512-azkCRYj/DxbK4udDuDxA9beYzQTwpJ5a9QA0bBgha2jHtWdFGF4ZZWSY+zNA5mtU3KqzYt8jWHfoqgSvKyu1Aw==} hasBin: true - expo-modules-autolinking@1.11.2: - resolution: {integrity: sha512-fdcaNO8ucHA3yLNY52ZUENBcAG7KEx8QyMmnVNavO1JVBGRMZG8JyVcbrhYQDtVtpxkbai5YzwvLutINvbDZDQ==} + expo-modules-autolinking@1.11.1: + resolution: {integrity: sha512-2dy3lTz76adOl7QUvbreMCrXyzUiF8lygI7iFJLjgIQIVH+43KnFWE5zBumpPbkiaq0f0uaFpN9U0RGQbnKiMw==} hasBin: true - expo-modules-core@1.12.21: - resolution: {integrity: sha512-UQxRljqPcowS1+bECW9tnuVGfvWL18GAKPiKMnu9sZwJssAN9FU/JhED50DJzdzICLR0hL17FZAgV4rbMG3IWQ==} + expo-modules-core@1.12.15: + resolution: {integrity: sha512-VjDPIgUyhCZzf692NF4p2iFTsKAQMcU3jc0pg33eNvN/kdrJqkeucqCDuuwoNxg0vIBKtoqAJDuPnWiemldsTg==} expo-random@14.0.1: resolution: {integrity: sha512-gX2mtR9o+WelX21YizXUCD/y+a4ZL+RDthDmFkHxaYbdzjSYTn8u/igoje/l3WEO+/RYspmqUFa8w/ckNbt6Vg==} @@ -4680,8 +4763,8 @@ packages: peerDependencies: expo: '*' - expo@51.0.29: - resolution: {integrity: sha512-bW8JR3RAw5hQhEGbwDqO3UxtjEq8noCYfqQ9v3aUfdtCoWtAp4jwB+xtwfDZPvRh1b8ebSJ/WI2jK/RljZw3mA==} + expo@51.0.14: + resolution: {integrity: sha512-99BAMSYBH1aq1TIEJqM03kRpsZjN8OqZXDqYHRq9/PXT67axRUOvRjwMMLprnCmqkAVM7m7FpiECNWN4U0gvLQ==} hasBin: true express@4.19.2: @@ -4723,11 +4806,8 @@ packages: fast-text-encoding@1.0.6: resolution: {integrity: sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==} - fast-uri@3.0.1: - resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} - - fast-xml-parser@4.4.1: - resolution: {integrity: sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==} + fast-xml-parser@4.4.0: + resolution: {integrity: sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg==} hasBin: true fastq@1.17.1: @@ -4778,9 +4858,6 @@ packages: resolution: {integrity: sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==} engines: {node: '>=10'} - filelist@1.0.4: - resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -4855,8 +4932,8 @@ packages: for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - foreground-child@3.3.0: - resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} + foreground-child@3.2.1: + resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} engines: {node: '>=14'} form-data-encoder@2.1.4: @@ -4975,8 +5052,8 @@ packages: get-symbol-from-current-process-h@1.0.2: resolution: {integrity: sha512-syloC6fsCt62ELLrr1VKBM1ggOpMdetX9hTrdW77UQdcApPHLmf7CI7OKcN1c9kYuNxKcDe4iJ4FY9sX3aw2xw==} - get-tsconfig@4.7.6: - resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==} + get-tsconfig@4.7.5: + resolution: {integrity: sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==} get-uv-event-loop-napi-h@1.0.6: resolution: {integrity: sha512-t5c9VNR84nRoF+eLiz6wFrEp1SE2Acg0wS+Ysa2zF0eROes+LzOfuTaVHxGy8AbS8rq7FHEJzjnCZo1BupwdJg==} @@ -4996,10 +5073,15 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.4.5: - resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + glob@10.4.2: + resolution: {integrity: sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==} + engines: {node: '>=16 || 14 >=14.18'} hasBin: true + glob@6.0.4: + resolution: {integrity: sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==} + deprecated: Glob versions prior to v9 are no longer supported + glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} deprecated: Glob versions prior to v9 are no longer supported @@ -5038,6 +5120,9 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} @@ -5056,6 +5141,10 @@ packages: engines: {node: '>=0.4.7'} hasBin: true + hard-rejection@2.1.0: + resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} + engines: {node: '>=6'} + has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} @@ -5118,6 +5207,9 @@ packages: hmac-drbg@1.0.1: resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + hosted-git-info@3.0.8: resolution: {integrity: sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==} engines: {node: '>=10'} @@ -5159,11 +5251,15 @@ packages: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + ignore@5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} image-size@0.6.3: @@ -5184,8 +5280,8 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} - import-local@3.2.0: - resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + import-local@3.1.0: + resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} engines: {node: '>=8'} hasBin: true @@ -5270,9 +5366,8 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.15.0: - resolution: {integrity: sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==} - engines: {node: '>= 0.4'} + is-core-module@2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} is-data-view@1.0.1: resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} @@ -5354,6 +5449,10 @@ packages: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} + is-plain-obj@1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} @@ -5446,8 +5545,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} - istanbul-lib-instrument@6.0.3: - resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} + istanbul-lib-instrument@6.0.2: + resolution: {integrity: sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==} engines: {node: '>=10'} istanbul-lib-report@3.0.1: @@ -5462,13 +5561,9 @@ packages: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} - jackspeak@3.4.3: - resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - - jake@10.9.2: - resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} - engines: {node: '>=10'} - hasBin: true + jackspeak@3.4.0: + resolution: {integrity: sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==} + engines: {node: '>=14'} jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} @@ -5626,14 +5721,14 @@ packages: jimp-compact@0.16.1: resolution: {integrity: sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==} - joi@17.13.3: - resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + joi@17.13.1: + resolution: {integrity: sha512-vaBlIKCyo4FCUtCm7Eu4QZd/q02bWcxfUO6YSXAZOWF6gzcLBeba8kwotUdYJjDLW8Cz8RywsSOqiNJZW0mNvg==} join-component@1.1.0: resolution: {integrity: sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ==} - jose@5.8.0: - resolution: {integrity: sha512-E7CqYpL/t7MMnfGnK/eg416OsFCVUrU/Y3Vwe7QjKhu/BkS1Ms455+2xsqZQVN57/U2MHMBvEb5SrmAZWAIntA==} + jose@5.9.6: + resolution: {integrity: sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==} js-base64@3.7.7: resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} @@ -5755,9 +5850,9 @@ packages: jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - jsonld-signatures@11.3.0: - resolution: {integrity: sha512-+KaA2uWhnQ6eYDYqFoopYS8PcmbAdMuM0RFuycZw5Vh0gZiuMHt5/nCLh/p2x5blPGREntTHCQtI/1TtZ1+CUg==} - engines: {node: '>=18'} + jsonld-signatures@11.2.1: + resolution: {integrity: sha512-RNaHTEeRrX0jWeidPCwxMq/E/Ze94zFyEZz/v267ObbCHQlXhPO7GtkY6N5PSHQfQhZPXa8NlMBg5LiDF4dNbA==} + engines: {node: '>=14'} jsonld@8.3.2: resolution: {integrity: sha512-MwBbq95szLwt8eVQ1Bcfwmgju/Y5P2GdtlHE2ncyfuYjIdEhluUVyj1eudacf1mOkWIoS9GpDBTECqhmq7EOaA==} @@ -5789,6 +5884,10 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + koa-compose@4.1.0: resolution: {integrity: sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==} @@ -5847,14 +5946,14 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - libphonenumber-js@1.11.7: - resolution: {integrity: sha512-x2xON4/Qg2bRIS11KIN9yCNYUjhtiEjNyptjX0mX+pyKHecxuJVLIpfX1lq9ZD6CrC/rB+y4GBi18c6CEcUR+A==} + libphonenumber-js@1.11.3: + resolution: {integrity: sha512-RU0CTsLCu2v6VEzdP+W6UU2n5+jEpMDRkGxUeBgsAJgre3vKgm17eApISH9OQY4G0jZYJVIc8qXmz6CJFueAFg==} - libsodium-wrappers@0.7.15: - resolution: {integrity: sha512-E4anqJQwcfiC6+Yrl01C1m8p99wEhLmJSs0VQqST66SbQXXBoaJY0pF4BNjRYa/sOQAxx6lXAaAFIlx+15tXJQ==} + libsodium-wrappers@0.7.13: + resolution: {integrity: sha512-kasvDsEi/r1fMzKouIDv7B8I6vNmknXwGiYodErGuESoFTohGSKZplFtVxZqHaoQ217AynyIFgnOVRitpHs0Qw==} - libsodium@0.7.15: - resolution: {integrity: sha512-sZwRknt/tUpE2AwzHq3jEyUU5uvIZHtSssktXq7owd++3CSgn8RGrv6UZJJBpP7+iBghBqe7Z06/2M31rI2NKw==} + libsodium@0.7.13: + resolution: {integrity: sha512-mK8ju0fnrKXXfleL53vtp9xiPq5hKM0zbDQtcxQIsSmxNgSxqCj6R7Hl9PkrNe2j29T4yoDaF7DJLK9/i5iWUw==} lighthouse-logger@1.4.2: resolution: {integrity: sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==} @@ -5989,8 +6088,9 @@ packages: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - lru-cache@10.4.3: - resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@10.2.2: + resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} + engines: {node: 14 || >=16.14} lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -6030,6 +6130,14 @@ packages: makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + map-obj@1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + + map-obj@4.3.0: + resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} + engines: {node: '>=8'} + marky@1.2.5: resolution: {integrity: sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q==} @@ -6057,6 +6165,10 @@ packages: memory-cache@0.2.0: resolution: {integrity: sha512-OcjA+jzjOYzKmKS6IQVALHLVz+rNTMPoJvCztFaZxwG14wtAW7VRZjwTQu06vKCYOxh4jVnik7ya0SXTB0W+xA==} + meow@6.1.1: + resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} + engines: {node: '>=8'} + merge-descriptors@1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} @@ -6140,18 +6252,10 @@ packages: resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} engines: {node: '>=8.6'} - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} - mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} - mime-db@1.53.0: - resolution: {integrity: sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==} - engines: {node: '>= 0.6'} - mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} @@ -6182,6 +6286,10 @@ packages: resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} @@ -6191,18 +6299,18 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minimatch@5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} - engines: {node: '>=10'} - minimatch@8.0.4: resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==} engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + minimatch@9.0.4: + resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} engines: {node: '>=16 || 14 >=14.17'} + minimist-options@4.1.0: + resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} + engines: {node: '>= 6'} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -6238,6 +6346,10 @@ packages: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} + mixme@0.5.10: + resolution: {integrity: sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==} + engines: {node: '>= 8.0.0'} + mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -6252,10 +6364,6 @@ packages: engines: {node: '>=10'} hasBin: true - mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} - ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -6290,6 +6398,10 @@ packages: mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + mv@2.1.1: + resolution: {integrity: sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==} + engines: {node: '>=0.8.0'} + mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -6298,14 +6410,18 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - nanoid@5.0.7: - resolution: {integrity: sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ==} + nanoid@5.0.9: + resolution: {integrity: sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==} engines: {node: ^18 || >=20} hasBin: true natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + ncp@2.0.0: + resolution: {integrity: sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==} + hasBin: true + negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} @@ -6377,6 +6493,9 @@ packages: node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + node-releases@2.0.14: + resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} + node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} @@ -6389,6 +6508,9 @@ packages: engines: {node: '>=6'} hasBin: true + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -6426,9 +6548,8 @@ packages: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} - object-inspect@1.13.2: - resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} - engines: {node: '>= 0.4'} + object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} @@ -6450,8 +6571,8 @@ packages: resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} engines: {node: '>= 0.4'} - oidc-provider@8.5.1: - resolution: {integrity: sha512-Bm3EyxN68/KS76IlciJ3+4pnVtfdRWL+NghWpIF0XQbiRT1gzc6Qf/cyFmpL9yieko/jXYZ/uLHUv77jD00qww==} + oidc-provider@8.6.0: + resolution: {integrity: sha512-LTzQza+KA72fFWe/70ttjTpCPvwZRoaydPFY2izNfQjo6u33lFOzJeqA9Q0TblTShkaH56ChoE2KdMYIQlNHdw==} oidc-token-hash@5.0.3: resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} @@ -6641,8 +6762,8 @@ packages: path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} - path-to-regexp@6.2.2: - resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} + path-to-regexp@6.3.0: + resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==} path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -6655,6 +6776,9 @@ packages: picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -6695,12 +6819,12 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} - postcss@8.4.41: - resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} + postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} - preferred-pm@3.1.4: - resolution: {integrity: sha512-lEHd+yEm22jXdCphDrkvIJQU66EuLojPPtvZkpKIkiD+l0DMThF/niqZKJSoU8Vl7iuvtmzyMhir9LdVy5WMnA==} + preferred-pm@3.1.3: + resolution: {integrity: sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==} engines: {node: '>=10'} prelude-ls@1.1.2: @@ -6724,10 +6848,6 @@ packages: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} engines: {node: '>=6'} - pretty-format@24.9.0: - resolution: {integrity: sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==} - engines: {node: '>= 6'} - pretty-format@26.6.2: resolution: {integrity: sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==} engines: {node: '>= 10'} @@ -6800,8 +6920,8 @@ packages: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} engines: {node: '>=0.6'} - qs@6.13.0: - resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} + qs@6.12.1: + resolution: {integrity: sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==} engines: {node: '>=0.6'} query-string@7.1.3: @@ -6814,6 +6934,10 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + quick-lru@4.0.1: + resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} + engines: {node: '>=8'} + quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -6830,6 +6954,10 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} + raw-body@3.0.0: + resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==} + engines: {node: '>= 0.8'} + rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -6838,10 +6966,6 @@ packages: resolution: {integrity: sha512-fUeWjrkOO0t1rg7B2fdyDTvngj+9RlUyL92vOdiB7c0FPguWVsniIMjEtHH+meLBO9rzkUlUzBVXgWrjI8P9LA==} engines: {node: '>=12'} - rdf-canonize@4.0.1: - resolution: {integrity: sha512-B5ynHt4sasbUafzrvYI2GFARgeFcD8Sx9yXPbg7gEyT2EH76rlCv84kyO6tnxzVbxUN/uJDbK1S/MXh+DsnuTA==} - engines: {node: '>=18'} - react-devtools-core@4.28.5: resolution: {integrity: sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==} @@ -6903,6 +7027,14 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} + read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + + read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} @@ -6928,6 +7060,10 @@ packages: resolution: {integrity: sha512-hjMmLaUXAm1hIuTqOdeYObMslq/q+Xff6QE3Y2P+uoHAg2nmVlLBps2hzh1UJDdMtDTMXOFewK6ky51JQIeECg==} engines: {node: '>= 4'} + redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + reduce-flatten@2.0.0: resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} engines: {node: '>=6'} @@ -6972,15 +7108,15 @@ packages: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} - regexpu-core@6.1.1: - resolution: {integrity: sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw==} + regexpu-core@6.2.0: + resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} engines: {node: '>=4'} regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} - regjsparser@0.11.1: - resolution: {integrity: sha512-1DHODs4B8p/mQHU9kr+jv8+wIC9mtG4eBHxWxIq5mhjE3D5oORhCc6deRKzTjs9DcfRFmj9BHSDguZklqCGFWQ==} + regjsparser@0.12.0: + resolution: {integrity: sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==} hasBin: true regjsparser@0.9.1: @@ -7065,11 +7201,21 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true + rimraf@2.4.5: + resolution: {integrity: sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true + rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} deprecated: Rimraf versions prior to v4 are no longer supported @@ -7104,6 +7250,9 @@ packages: safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + safe-json-stringify@1.2.0: + resolution: {integrity: sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==} + safe-regex-test@1.0.3: resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} engines: {node: '>= 0.4'} @@ -7117,9 +7266,9 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - secp256k1@5.0.0: - resolution: {integrity: sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==} - engines: {node: '>=14.0.0'} + secp256k1@5.0.1: + resolution: {integrity: sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA==} + engines: {node: '>=18.0.0'} selfsigned@2.4.1: resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==} @@ -7133,8 +7282,8 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.3: - resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} hasBin: true @@ -7230,6 +7379,11 @@ packages: resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==} engines: {node: '>=8.0.0'} + smartwrap@2.0.2: + resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} + engines: {node: '>=6'} + hasBin: true + source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -7264,8 +7418,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.20: - resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} + spdx-license-ids@3.0.18: + resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} split-on-first@1.1.0: resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} @@ -7310,6 +7464,9 @@ packages: resolution: {integrity: sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==} engines: {node: '>= 0.10.0'} + stream-transform@2.1.3: + resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} + streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -7378,6 +7535,10 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -7488,8 +7649,8 @@ packages: resolution: {integrity: sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==} engines: {node: '>=8'} - terser@5.31.6: - resolution: {integrity: sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==} + terser@5.31.1: + resolution: {integrity: sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==} engines: {node: '>=10'} hasBin: true @@ -7549,12 +7710,12 @@ packages: resolution: {integrity: sha512-7bBrcF+/LQzSgFmT0X5YclVqQxtv7TDJ1f8Wj7ibBu/U6BMLeOpUxuZjV7rMc44UtKxlnMFigdhFAIszSX1DMg==} engines: {node: '>= 0.4'} - trim-right@1.0.1: - resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==} - engines: {node: '>=0.10.0'} + trim-newlines@3.0.1: + resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} + engines: {node: '>=8'} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + ts-api-utils@1.4.3: + resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' @@ -7562,8 +7723,8 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-jest@29.2.4: - resolution: {integrity: sha512-3d6tgDyhCI29HlpwIq87sNuI+3Q6GLTTCeYRHCs7vDz+/3GCMwEtV9jezLyl4ZtnBgx00I7hm8PCP8cTksMGrw==} + ts-jest@29.1.5: + resolution: {integrity: sha512-UuClSYxM7byvvYfyWdFI+/2UxMmwNyJb0NPkZPQE2hew3RurV7l7zURgOHAd/1I1ZdPpe3GUsXNXAcN8TFKSIg==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -7612,6 +7773,9 @@ packages: tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tslog@4.9.3: resolution: {integrity: sha512-oDWuGVONxhVEBtschLf2cs/Jy8i7h1T+CpdkTNWQgdAF7DhRo2G8vMCgILKe7ojdEkLhICWgI1LYSSKaJsRgcw==} engines: {node: '>=16'} @@ -7620,8 +7784,8 @@ packages: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} - tsx@4.19.0: - resolution: {integrity: sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==} + tsx@4.19.2: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} engines: {node: '>=18.0.0'} hasBin: true @@ -7629,6 +7793,11 @@ packages: resolution: {integrity: sha512-YB1FG+axdxADa3ncEtRnQCFq/M0lALGLxSZeVNbTU8NqhOVc51nnv2CISTcvc1kyv6EGPtXVr0v6lWeDxiijOA==} engines: {node: '>= 6.0.0'} + tty-table@4.2.3: + resolution: {integrity: sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==} + engines: {node: '>=8.0.0'} + hasBin: true + type-check@0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} engines: {node: '>= 0.8.0'} @@ -7641,6 +7810,10 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + type-fest@0.13.1: + resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} + engines: {node: '>=10'} + type-fest@0.16.0: resolution: {integrity: sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==} engines: {node: '>=10'} @@ -7657,10 +7830,18 @@ packages: resolution: {integrity: sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==} engines: {node: '>=6'} + type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + type-fest@0.7.1: resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} engines: {node: '>=8'} + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + type-fest@3.13.1: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} @@ -7775,8 +7956,8 @@ packages: deprecated: support for ECMAScript is superseded by `uglify-js` as of v3.13.0 hasBin: true - uglify-js@3.19.2: - resolution: {integrity: sha512-S8KA6DDI47nQXJSi2ctQ629YzwOVs+bQML6DAtvy0wgNdpi+0ySpQK0g2pxBq2xfF2z3YCscu7NNA8nXT9PlIQ==} + uglify-js@3.18.0: + resolution: {integrity: sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==} engines: {node: '>=0.8.0'} hasBin: true @@ -7789,8 +7970,8 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - undici@6.20.1: - resolution: {integrity: sha512-AjQF1QsmqfJys+LXfGTNum+qw4S88CojRInG/6t31W/1fk6G59s92bnAvGz5Cmur+kQv2SURXEvvudLmbrE8QA==} + undici@6.21.0: + resolution: {integrity: sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==} engines: {node: '>=18.17'} unicode-canonical-property-names-ecmascript@2.0.0: @@ -7841,8 +8022,14 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - update-browserslist-db@1.1.0: - resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} + update-browserslist-db@1.0.16: + resolution: {integrity: sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + update-browserslist-db@1.1.1: + resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -7893,8 +8080,8 @@ packages: v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - v8-to-istanbul@9.3.0: - resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + v8-to-istanbul@9.2.0: + resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} valibot@0.42.1: @@ -7973,8 +8160,8 @@ packages: which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - which-pm@2.2.0: - resolution: {integrity: sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==} + which-pm@2.0.0: + resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} engines: {node: '>=8.15'} which-typed-array@1.1.15: @@ -8052,8 +8239,8 @@ packages: utf-8-validate: optional: true - ws@8.18.0: - resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -8107,8 +8294,8 @@ packages: yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yaml@2.5.0: - resolution: {integrity: sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==} + yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} engines: {node: '>= 14'} hasBin: true @@ -8153,12 +8340,6 @@ packages: engines: {node: '>=8.0.0'} hasBin: true - zod-validation-error@2.1.0: - resolution: {integrity: sha512-VJh93e2wb4c3tWtGgTa0OF/dTt/zoPCPzXq4V11ZjxmEAFaPi/Zss1xIZdEB5RD8GD00U0/iVXgqkF77RV7pdQ==} - engines: {node: '>=18.0.0'} - peerDependencies: - zod: ^3.18.0 - zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} @@ -8167,7 +8348,7 @@ snapshots: '@2060.io/ffi-napi@4.0.9': dependencies: '@2060.io/ref-napi': 3.0.6 - debug: 4.3.6 + debug: 4.3.5 get-uv-event-loop-napi-h: 1.0.6 node-addon-api: 3.2.1 node-gyp-build: 4.8.1 @@ -8177,7 +8358,7 @@ snapshots: '@2060.io/ref-napi@3.0.6': dependencies: - debug: 4.3.6 + debug: 4.3.5 get-symbol-from-current-process-h: 1.0.2 node-addon-api: 3.2.1 node-gyp-build: 4.8.1 @@ -8189,14 +8370,14 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@animo-id/expo-secure-environment@0.1.0-alpha.11(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)))(react-native@0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1))(react@18.3.1)': + '@animo-id/expo-secure-environment@0.1.0-alpha.12(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(react@18.3.1)': dependencies: - '@peculiar/asn1-ecc': 2.3.13 - '@peculiar/asn1-schema': 2.3.13 + '@peculiar/asn1-ecc': 2.3.14 + '@peculiar/asn1-schema': 2.3.8 '@peculiar/asn1-x509': 2.3.13 - expo: 51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) react: 18.3.1 - react-native: 0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1) + react-native: 0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1) '@animo-id/mdoc@0.2.39': dependencies: @@ -8230,20 +8411,20 @@ snapshots: '@sd-jwt/decode': 0.7.2 '@sd-jwt/present': 0.7.2 '@sd-jwt/types': 0.7.2 - '@sphereon/pex-models': 2.3.1 + '@sphereon/pex-models': 2.3.2 '@sphereon/ssi-types': 0.30.2-next.135 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) + ajv: 8.16.0 + ajv-formats: 2.1.1(ajv@8.16.0) jwt-decode: 3.1.2 nanoid: 3.3.7 uint8arrays: 3.1.1 transitivePeerDependencies: - supports-color - '@animo-id/react-native-bbs-signatures@0.1.0(react-native@0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1))(react@18.3.1)': + '@animo-id/react-native-bbs-signatures@0.1.0(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(react@18.3.1)': dependencies: react: 18.3.1 - react-native: 0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1) + react-native: 0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1) '@astronautlabs/jsonpath@1.1.2': dependencies: @@ -8253,438 +8434,302 @@ snapshots: '@babel/code-frame@7.10.4': dependencies: - '@babel/highlight': 7.25.7 + '@babel/highlight': 7.24.7 '@babel/code-frame@7.24.7': dependencies: '@babel/highlight': 7.24.7 picocolors: 1.0.1 - '@babel/code-frame@7.25.7': + '@babel/code-frame@7.26.2': dependencies: - '@babel/highlight': 7.25.7 + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 picocolors: 1.0.1 - '@babel/compat-data@7.25.2': {} - - '@babel/compat-data@7.25.8': {} + '@babel/compat-data@7.24.7': {} - '@babel/core@7.25.2': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.0 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.2) - '@babel/helpers': 7.25.0 - '@babel/parser': 7.25.3 - '@babel/template': 7.25.0 - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 - convert-source-map: 2.0.0 - debug: 4.3.6 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + '@babel/compat-data@7.26.3': {} - '@babel/core@7.25.8': + '@babel/core@7.26.0': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) - '@babel/helpers': 7.25.7 - '@babel/parser': 7.25.8 - '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helpers': 7.26.0 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 convert-source-map: 2.0.0 - debug: 4.3.6 + debug: 4.3.5 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.2.0': - dependencies: - '@babel/types': 7.25.8 - jsesc: 2.5.2 - lodash: 4.17.21 - source-map: 0.5.7 - trim-right: 1.0.1 - - '@babel/generator@7.25.0': + '@babel/generator@7.24.7': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.24.7 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 - '@babel/generator@7.25.7': + '@babel/generator@7.26.3': dependencies: - '@babel/types': 7.25.8 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.0.2 '@babel/helper-annotate-as-pure@7.24.7': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.24.7 - '@babel/helper-annotate-as-pure@7.25.7': + '@babel/helper-annotate-as-pure@7.25.9': dependencies: - '@babel/types': 7.25.8 - - '@babel/helper-builder-binary-assignment-operator-visitor@7.25.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.26.3 - '@babel/helper-compilation-targets@7.25.2': + '@babel/helper-compilation-targets@7.24.7': dependencies: - '@babel/compat-data': 7.25.2 - '@babel/helper-validator-option': 7.24.8 - browserslist: 4.23.3 + '@babel/compat-data': 7.24.7 + '@babel/helper-validator-option': 7.24.7 + browserslist: 4.23.1 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-compilation-targets@7.25.7': + '@babel/helper-compilation-targets@7.25.9': dependencies: - '@babel/compat-data': 7.25.8 - '@babel/helper-validator-option': 7.25.7 - browserslist: 4.24.0 + '@babel/compat-data': 7.26.3 + '@babel/helper-validator-option': 7.25.9 + browserslist: 4.24.2 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.25.0(@babel/core@7.25.2)': + '@babel/helper-create-class-features-plugin@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 + '@babel/core': 7.26.0 '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-member-expression-to-functions': 7.24.8 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.2) - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/traverse': 7.25.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/helper-create-class-features-plugin@7.25.0(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-member-expression-to-functions': 7.24.8 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-member-expression-to-functions': 7.24.7 '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.8) + '@babel/helper-replace-supers': 7.24.7(@babel/core@7.26.0) '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/traverse': 7.25.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/helper-split-export-declaration': 7.24.7 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.8)': + '@babel/helper-create-class-features-plugin@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.8) - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/traverse': 7.26.4 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-regexp-features-plugin@7.25.2(@babel/core@7.25.2)': + '@babel/helper-create-regexp-features-plugin@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 + '@babel/core': 7.26.0 '@babel/helper-annotate-as-pure': 7.24.7 regexpu-core: 5.3.2 semver: 6.3.1 - '@babel/helper-create-regexp-features-plugin@7.25.2(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.24.7 - regexpu-core: 5.3.2 - semver: 6.3.1 - - '@babel/helper-create-regexp-features-plugin@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.25.7 - regexpu-core: 6.1.1 - semver: 6.3.1 - - '@babel/helper-create-regexp-features-plugin@7.25.7(@babel/core@7.25.8)': + '@babel/helper-create-regexp-features-plugin@7.26.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.25.7 - regexpu-core: 6.1.1 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + regexpu-core: 6.2.0 semver: 6.3.1 - '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.25.2)': + '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - debug: 4.3.6 + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + debug: 4.3.5 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: - supports-color - '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.25.8)': + '@babel/helper-environment-visitor@7.24.7': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - debug: 4.3.6 - lodash.debounce: 4.0.8 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.7 - '@babel/helper-environment-visitor@7.24.7': + '@babel/helper-function-name@7.24.7': dependencies: - '@babel/types': 7.25.2 + '@babel/template': 7.24.7 + '@babel/types': 7.24.7 - '@babel/helper-member-expression-to-functions@7.24.8': + '@babel/helper-hoist-variables@7.24.7': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.7 - '@babel/helper-member-expression-to-functions@7.25.7': + '@babel/helper-member-expression-to-functions@7.24.7': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.24.7': + '@babel/helper-member-expression-to-functions@7.25.9': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.25.7': + '@babel/helper-module-imports@7.24.7': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.2(@babel/core@7.25.2)': + '@babel/helper-module-imports@7.25.9': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.3 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.2(@babel/core@7.25.8)': + '@babel/helper-module-transforms@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 + '@babel/helper-environment-visitor': 7.24.7 '@babel/helper-module-imports': 7.24.7 '@babel/helper-simple-access': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.8)': + '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color '@babel/helper-optimise-call-expression@7.24.7': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.24.7 - '@babel/helper-optimise-call-expression@7.25.7': + '@babel/helper-optimise-call-expression@7.25.9': dependencies: - '@babel/types': 7.25.8 - - '@babel/helper-plugin-utils@7.24.8': {} + '@babel/types': 7.26.3 - '@babel/helper-plugin-utils@7.25.7': {} + '@babel/helper-plugin-utils@7.24.7': {} - '@babel/helper-remap-async-to-generator@7.25.0(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-wrap-function': 7.25.0 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color + '@babel/helper-plugin-utils@7.25.9': {} - '@babel/helper-remap-async-to-generator@7.25.0(@babel/core@7.25.8)': + '@babel/helper-remap-async-to-generator@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-wrap-function': 7.25.0 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - - '@babel/helper-remap-async-to-generator@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-wrap-function': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-remap-async-to-generator@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-wrap-function': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-wrap-function': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.25.0(@babel/core@7.25.2)': + '@babel/helper-remap-async-to-generator@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-member-expression-to-functions': 7.24.8 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/traverse': 7.25.3 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-wrap-function': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.25.0(@babel/core@7.25.8)': + '@babel/helper-replace-supers@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-member-expression-to-functions': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-member-expression-to-functions': 7.24.7 '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - - '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.8)': + '@babel/helper-replace-supers@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-member-expression-to-functions': 7.25.7 - '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color '@babel/helper-simple-access@7.24.7': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/helper-simple-access@7.25.7': + '@babel/helper-skip-transparent-expression-wrappers@7.24.7': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.24.7': + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.25.7': + '@babel/helper-split-export-declaration@7.24.7': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.7 - '@babel/helper-string-parser@7.24.8': {} + '@babel/helper-string-parser@7.24.7': {} - '@babel/helper-string-parser@7.25.7': {} + '@babel/helper-string-parser@7.25.9': {} '@babel/helper-validator-identifier@7.24.7': {} - '@babel/helper-validator-identifier@7.25.7': {} + '@babel/helper-validator-identifier@7.25.9': {} - '@babel/helper-validator-option@7.24.8': {} + '@babel/helper-validator-option@7.24.7': {} - '@babel/helper-validator-option@7.25.7': {} + '@babel/helper-validator-option@7.25.9': {} - '@babel/helper-wrap-function@7.25.0': + '@babel/helper-wrap-function@7.24.7': dependencies: - '@babel/template': 7.25.0 - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/helper-function-name': 7.24.7 + '@babel/template': 7.24.7 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/helper-wrap-function@7.25.7': + '@babel/helper-wrap-function@7.25.9': dependencies: - '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.8 + '@babel/template': 7.25.9 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color - '@babel/helpers@7.25.0': + '@babel/helpers@7.26.0': dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.2 - - '@babel/helpers@7.25.7': - dependencies: - '@babel/template': 7.25.7 - '@babel/types': 7.25.8 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 '@babel/highlight@7.24.7': dependencies: @@ -8693,1736 +8738,882 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.0.1 - '@babel/highlight@7.25.7': - dependencies: - '@babel/helper-validator-identifier': 7.25.7 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.0.1 - - '@babel/parser@7.25.3': - dependencies: - '@babel/types': 7.25.2 - - '@babel/parser@7.25.8': - dependencies: - '@babel/types': 7.25.8 - - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.7(@babel/core@7.25.2)': + '@babel/parser@7.24.7': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/types': 7.24.7 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.7(@babel/core@7.25.8)': + '@babel/parser@7.26.3': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/types': 7.26.3 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/plugin-transform-optional-chaining': 7.25.8(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/plugin-transform-optional-chaining': 7.25.8(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.25.2)': + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-remap-async-to-generator': 7.25.0(@babel/core@7.25.2) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.25.8)': + '@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-remap-async-to-generator': 7.25.0(@babel/core@7.25.8) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-remap-async-to-generator': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-decorators@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-decorators': 7.24.7(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.24.7 transitivePeerDependencies: - supports-color - optional: true - '@babel/plugin-proposal-decorators@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-proposal-decorators@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-decorators': 7.24.7(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-decorators': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-export-default-from@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-proposal-export-default-from@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.26.0) - '@babel/plugin-proposal-export-default-from@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-proposal-export-namespace-from@7.18.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.26.0) - '@babel/plugin-proposal-export-namespace-from@7.18.9(@babel/core@7.25.2)': + '@babel/plugin-proposal-logical-assignment-operators@7.20.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.26.0) - '@babel/plugin-proposal-logical-assignment-operators@7.20.7(@babel/core@7.25.2)': + '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.25.2) - optional: true + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.26.0) - '@babel/plugin-proposal-logical-assignment-operators@7.20.7(@babel/core@7.25.8)': + '@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.26.0) - '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.25.2)': + '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.2) + '@babel/compat-data': 7.24.7 + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.26.0) - '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.25.8)': + '@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.26.0) - '@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.25.2)': + '@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.25.2) - optional: true - - '@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.25.8) - - '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.25.2)': - dependencies: - '@babel/compat-data': 7.25.2 - '@babel/core': 7.25.2 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.25.2) - - '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.25.8)': - dependencies: - '@babel/compat-data': 7.25.2 - '@babel/core': 7.25.8 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.25.8) - - '@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.2) - - '@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.8) - - '@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.2) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-decorators@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - optional: true - - '@babel/plugin-syntax-decorators@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-export-default-from@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-export-default-from@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-import-assertions@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-import-assertions@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-import-attributes@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-import-attributes@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-import-attributes@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - optional: true - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - optional: true - - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-arrow-functions@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-arrow-functions@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-arrow-functions@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-arrow-functions@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-async-generator-functions@7.25.8(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.2) - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-async-generator-functions@7.25.8(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.8) - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-async-to-generator@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-remap-async-to-generator': 7.25.0(@babel/core@7.25.2) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-async-to-generator@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-remap-async-to-generator': 7.25.0(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-async-to-generator@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.2) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-async-to-generator@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-block-scoped-functions@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-block-scoped-functions@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-block-scoped-functions@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-block-scoped-functions@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-block-scoping@7.25.0(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-block-scoping@7.25.0(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-block-scoping@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-block-scoping@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-class-properties@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-class-properties@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-class-static-block@7.25.8(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-class-static-block@7.25.8(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-classes@7.25.0(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.2) - '@babel/traverse': 7.25.3 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-classes@7.25.0(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.8) - '@babel/traverse': 7.25.3 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-classes@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) - '@babel/traverse': 7.25.7 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-classes@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.8) - '@babel/traverse': 7.25.7 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-computed-properties@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/template': 7.25.0 - - '@babel/plugin-transform-computed-properties@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/template': 7.25.0 - - '@babel/plugin-transform-computed-properties@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/template': 7.25.7 - - '@babel/plugin-transform-computed-properties@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/template': 7.25.7 - - '@babel/plugin-transform-destructuring@7.24.8(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-destructuring@7.24.8(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-destructuring@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-destructuring@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-dotall-regex@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-dotall-regex@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-duplicate-keys@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-duplicate-keys@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-dynamic-import@7.25.8(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-dynamic-import@7.25.8(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-exponentiation-operator@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-exponentiation-operator@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 - '@babel/plugin-transform-export-namespace-from@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-export-namespace-from@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-flow-strip-types@7.25.2(@babel/core@7.25.2)': + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-flow-strip-types@7.25.2(@babel/core@7.25.8)': + '@babel/plugin-syntax-decorators@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-for-of@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-for-of@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/plugin-syntax-export-default-from@7.24.7(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-for-of@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-for-of@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-function-name@7.25.1(@babel/core@7.25.2)': + '@babel/plugin-syntax-import-assertions@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-function-name@7.25.1(@babel/core@7.25.8)': + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-function-name@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-function-name@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-json-strings@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-json-strings@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-literals@7.25.2(@babel/core@7.25.2)': + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-literals@7.25.2(@babel/core@7.25.8)': + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-literals@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-literals@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-logical-assignment-operators@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-logical-assignment-operators@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-member-expression-literals@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-member-expression-literals@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-member-expression-literals@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-arrow-functions@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-member-expression-literals@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-arrow-functions@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-modules-amd@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-async-generator-functions@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-remap-async-to-generator': 7.25.9(@babel/core@7.26.0) + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-amd@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-async-to-generator@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-remap-async-to-generator': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.24.8(@babel/core@7.25.2)': + '@babel/plugin-transform-async-to-generator@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-simple-access': 7.24.7 + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-remap-async-to-generator': 7.25.9(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.24.8(@babel/core@7.25.8)': + '@babel/plugin-transform-block-scoped-functions@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-simple-access': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-modules-commonjs@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-block-scoped-functions@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-modules-commonjs@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-block-scoping@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-modules-systemjs@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-block-scoping@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-modules-systemjs@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-class-properties@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-umd@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-class-static-block@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-umd@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-classes@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.24.7 + '@babel/helper-compilation-targets': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-replace-supers': 7.24.7(@babel/core@7.26.0) + '@babel/helper-split-export-declaration': 7.24.7 + globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-named-capturing-groups-regex@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-classes@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) + '@babel/traverse': 7.26.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-named-capturing-groups-regex@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-computed-properties@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/template': 7.24.7 - '@babel/plugin-transform-named-capturing-groups-regex@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-computed-properties@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/template': 7.25.9 - '@babel/plugin-transform-named-capturing-groups-regex@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-destructuring@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-new-target@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-destructuring@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-new-target@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-dotall-regex@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-transform-duplicate-keys@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-nullish-coalescing-operator@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-numeric-separator@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-transform-dynamic-import@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-numeric-separator@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-transform-exponentiation-operator@7.26.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-object-rest-spread@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-transform-export-namespace-from@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-object-rest-spread@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-transform-flow-strip-types@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.26.0) - '@babel/plugin-transform-object-super@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-for-of@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-object-super@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-for-of@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-object-super@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-function-name@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-object-super@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-function-name@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-optional-catch-binding@7.25.8(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-optional-catch-binding@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-transform-json-strings@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-optional-chaining@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-transform-literals@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-optional-chaining@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-transform-literals@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-parameters@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-logical-assignment-operators@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-parameters@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-member-expression-literals@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-parameters@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-member-expression-literals@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-parameters@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-modules-amd@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-private-methods@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-modules-commonjs@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.24.7(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-simple-access': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-private-methods@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-modules-commonjs@7.26.3(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-private-property-in-object@7.25.8(@babel/core@7.25.2)': + '@babel/plugin-transform-modules-systemjs@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.26.4 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-private-property-in-object@7.25.8(@babel/core@7.25.8)': + '@babel/plugin-transform-modules-umd@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-property-literals@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-named-capturing-groups-regex@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-property-literals@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-named-capturing-groups-regex@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-property-literals@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-new-target@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-property-literals@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-nullish-coalescing-operator@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-react-display-name@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-numeric-separator@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-react-display-name@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-object-rest-spread@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.0) - '@babel/plugin-transform-react-jsx-development@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-object-super@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-replace-supers': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - optional: true - '@babel/plugin-transform-react-jsx-development@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-object-super@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-replace-supers': 7.25.9(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-optional-catch-binding@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-optional-chaining@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-parameters@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-parameters@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-react-jsx@7.25.2(@babel/core@7.25.2)': + '@babel/plugin-transform-private-methods@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.2) - '@babel/types': 7.25.2 + '@babel/core': 7.26.0 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-react-jsx@7.25.2(@babel/core@7.25.8)': + '@babel/plugin-transform-private-property-in-object@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.8) - '@babel/types': 7.25.2 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-create-class-features-plugin': 7.25.9(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-react-pure-annotations@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - optional: true - - '@babel/plugin-transform-react-pure-annotations@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-property-literals@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-regenerator@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-property-literals@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - regenerator-transform: 0.15.2 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-regenerator@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-react-display-name@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - regenerator-transform: 0.15.2 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-reserved-words@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-react-jsx-development@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.26.0) + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-reserved-words@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-react-jsx-self@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-runtime@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-react-jsx-source@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.2) - babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.2) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.25.2) - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-runtime@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.24.7 '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.8) - babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.8) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.25.8) - semver: 6.3.1 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/types': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-shorthand-properties@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-react-pure-annotations@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-shorthand-properties@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-regenerator@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + regenerator-transform: 0.15.2 - '@babel/plugin-transform-shorthand-properties@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-regexp-modifiers@7.26.0(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-shorthand-properties@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-reserved-words@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-spread@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-runtime@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 + '@babel/core': 7.26.0 + '@babel/helper-module-imports': 7.24.7 + '@babel/helper-plugin-utils': 7.24.7 + babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.26.0) + babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.26.0) + babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.26.0) + semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-spread@7.24.7(@babel/core@7.25.8)': + '@babel/plugin-transform-shorthand-properties@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-spread@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-shorthand-properties@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-spread@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-spread@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-sticky-regex@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-sticky-regex@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-sticky-regex@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-sticky-regex@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-template-literals@7.24.7(@babel/core@7.25.2)': + '@babel/plugin-transform-spread@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-template-literals@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-template-literals@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-sticky-regex@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-template-literals@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-sticky-regex@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-typeof-symbol@7.25.7(@babel/core@7.25.2)': + '@babel/plugin-transform-template-literals@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-transform-typeof-symbol@7.25.7(@babel/core@7.25.8)': + '@babel/plugin-transform-template-literals@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-typescript@7.25.2(@babel/core@7.25.2)': + '@babel/plugin-transform-typeof-symbol@7.25.9(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.25.2) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 - '@babel/plugin-transform-typescript@7.25.2(@babel/core@7.25.8)': + '@babel/plugin-transform-typescript@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-unicode-escapes@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-escapes@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-property-regex@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-property-regex@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-regex@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-unicode-regex@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.24.8 - - '@babel/plugin-transform-unicode-regex@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-regex@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-sets-regex@7.25.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-unicode-sets-regex@7.25.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/preset-env@7.25.8(@babel/core@7.25.2)': - dependencies: - '@babel/compat-data': 7.25.8 - '@babel/core': 7.25.2 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.25.2) - '@babel/plugin-syntax-import-assertions': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-syntax-import-attributes': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-transform-arrow-functions': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-async-generator-functions': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-async-to-generator': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-block-scoped-functions': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-block-scoping': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-class-properties': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-class-static-block': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-classes': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-computed-properties': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-destructuring': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-dotall-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-duplicate-keys': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-dynamic-import': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-exponentiation-operator': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-export-namespace-from': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-for-of': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-function-name': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-json-strings': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-literals': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-logical-assignment-operators': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-member-expression-literals': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-amd': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-systemjs': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-umd': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-new-target': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-nullish-coalescing-operator': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-numeric-separator': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-object-rest-spread': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-object-super': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-optional-catch-binding': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-optional-chaining': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-private-property-in-object': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-property-literals': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-regenerator': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-reserved-words': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-shorthand-properties': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-spread': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-sticky-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-template-literals': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-typeof-symbol': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-unicode-escapes': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-unicode-property-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-unicode-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-unicode-sets-regex': 7.25.7(@babel/core@7.25.2) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.25.2) - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.2) - babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.2) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.25.2) - core-js-compat: 3.38.1 - semver: 6.3.1 + '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.24.7 + '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/preset-env@7.25.8(@babel/core@7.25.8)': - dependencies: - '@babel/compat-data': 7.25.8 - '@babel/core': 7.25.8 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.25.8) - '@babel/plugin-syntax-import-assertions': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-syntax-import-attributes': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-transform-arrow-functions': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-async-generator-functions': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-async-to-generator': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-block-scoped-functions': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-block-scoping': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-class-properties': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-class-static-block': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-classes': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-computed-properties': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-destructuring': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-dotall-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-duplicate-keys': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-dynamic-import': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-exponentiation-operator': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-export-namespace-from': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-for-of': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-function-name': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-json-strings': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-literals': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-logical-assignment-operators': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-member-expression-literals': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-amd': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-systemjs': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-umd': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-new-target': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-nullish-coalescing-operator': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-numeric-separator': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-object-rest-spread': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-object-super': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-optional-catch-binding': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-optional-chaining': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-private-property-in-object': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-property-literals': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-regenerator': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-reserved-words': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-shorthand-properties': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-spread': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-sticky-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-template-literals': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-typeof-symbol': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-unicode-escapes': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-unicode-property-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-unicode-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-unicode-sets-regex': 7.25.7(@babel/core@7.25.8) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.25.8) - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.8) - babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.8) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.25.8) - core-js-compat: 3.38.1 + '@babel/plugin-transform-unicode-escapes@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-property-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-regex@7.24.7(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.24.7 + + '@babel/plugin-transform-unicode-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/plugin-transform-unicode-sets-regex@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.0) + '@babel/helper-plugin-utils': 7.25.9 + + '@babel/preset-env@7.26.0(@babel/core@7.26.0)': + dependencies: + '@babel/compat-data': 7.26.3 + '@babel/core': 7.26.0 + '@babel/helper-compilation-targets': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-validator-option': 7.25.9 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.26.0) + '@babel/plugin-syntax-import-assertions': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-transform-arrow-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-async-generator-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-async-to-generator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoped-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoping': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-class-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-class-static-block': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-transform-classes': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-computed-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-destructuring': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-dotall-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-duplicate-keys': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-dynamic-import': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-exponentiation-operator': 7.26.3(@babel/core@7.26.0) + '@babel/plugin-transform-export-namespace-from': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-for-of': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-function-name': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-json-strings': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-logical-assignment-operators': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-member-expression-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-amd': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.26.3(@babel/core@7.26.0) + '@babel/plugin-transform-modules-systemjs': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-umd': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-new-target': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-nullish-coalescing-operator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-numeric-separator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-object-rest-spread': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-object-super': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-optional-catch-binding': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-methods': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-property-in-object': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-property-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-regenerator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-regexp-modifiers': 7.26.0(@babel/core@7.26.0) + '@babel/plugin-transform-reserved-words': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-shorthand-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-spread': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-sticky-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-template-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-typeof-symbol': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-escapes': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-property-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-sets-regex': 7.25.9(@babel/core@7.26.0) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.26.0) + babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.26.0) + babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.26.0) + babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.26.0) + core-js-compat: 3.39.0 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/preset-flow@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-validator-option': 7.24.8 - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.2) - - '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.25.2)': + '@babel/preset-flow@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/types': 7.25.2 - esutils: 2.0.3 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-validator-option': 7.24.7 + '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.26.0) - '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.25.8)': + '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/types': 7.25.2 + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/types': 7.24.7 esutils: 2.0.3 - '@babel/preset-react@7.24.7(@babel/core@7.25.2)': + '@babel/preset-react@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx-development': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-pure-annotations': 7.24.7(@babel/core@7.25.2) - transitivePeerDependencies: - - supports-color - optional: true - - '@babel/preset-react@7.24.7(@babel/core@7.25.8)': - dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx-development': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-pure-annotations': 7.24.7(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color - - '@babel/preset-typescript@7.24.7(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-validator-option': 7.24.8 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) - '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/helper-validator-option': 7.25.9 + '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx-development': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-pure-annotations': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/preset-typescript@7.24.7(@babel/core@7.25.8)': + '@babel/preset-typescript@7.24.7(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-validator-option': 7.24.8 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.8) - '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-validator-option': 7.24.7 + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-typescript': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - '@babel/register@7.24.6(@babel/core@7.25.2)': + '@babel/register@7.24.6(@babel/core@7.26.0)': dependencies: - '@babel/core': 7.25.2 + '@babel/core': 7.26.0 clone-deep: 4.0.1 find-cache-dir: 2.1.0 make-dir: 2.1.0 @@ -10431,64 +9622,66 @@ snapshots: '@babel/regjsgen@0.8.0': {} - '@babel/runtime@7.25.0': + '@babel/runtime@7.24.7': dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.25.0': + '@babel/template@7.24.7': dependencies: '@babel/code-frame': 7.24.7 - '@babel/parser': 7.25.3 - '@babel/types': 7.25.2 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 - '@babel/template@7.25.7': + '@babel/template@7.25.9': dependencies: - '@babel/code-frame': 7.25.7 - '@babel/parser': 7.25.8 - '@babel/types': 7.25.8 + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 - '@babel/traverse@7.25.3': + '@babel/traverse@7.24.7': dependencies: '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.0 - '@babel/parser': 7.25.3 - '@babel/template': 7.25.0 - '@babel/types': 7.25.2 - debug: 4.3.6 + '@babel/generator': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-hoist-variables': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/traverse@7.25.7': + '@babel/traverse@7.26.4': dependencies: - '@babel/code-frame': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/parser': 7.25.8 - '@babel/template': 7.25.7 - '@babel/types': 7.25.8 - debug: 4.3.6 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.25.2': + '@babel/types@7.24.7': dependencies: - '@babel/helper-string-parser': 7.24.8 + '@babel/helper-string-parser': 7.24.7 '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 - '@babel/types@7.25.8': + '@babel/types@7.26.3': dependencies: - '@babel/helper-string-parser': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - to-fast-properties: 2.0.0 + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 '@bcoe/v8-coverage@0.2.3': {} - '@changesets/apply-release-plan@7.0.4': + '@changesets/apply-release-plan@7.0.3': dependencies: - '@babel/runtime': 7.25.0 - '@changesets/config': 3.0.2 + '@babel/runtime': 7.24.7 + '@changesets/config': 3.0.1 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.0 '@changesets/should-skip-package': 0.1.0 @@ -10500,32 +9693,32 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.6.2 - '@changesets/assemble-release-plan@6.0.3': + '@changesets/assemble-release-plan@6.0.2': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.1 + '@changesets/get-dependents-graph': 2.1.0 '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 - semver: 7.6.3 + semver: 7.6.2 '@changesets/changelog-git@0.2.0': dependencies: '@changesets/types': 6.0.0 - '@changesets/cli@2.27.7': + '@changesets/cli@2.27.5': dependencies: - '@babel/runtime': 7.25.0 - '@changesets/apply-release-plan': 7.0.4 - '@changesets/assemble-release-plan': 6.0.3 + '@babel/runtime': 7.24.7 + '@changesets/apply-release-plan': 7.0.3 + '@changesets/assemble-release-plan': 6.0.2 '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.2 + '@changesets/config': 3.0.1 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.1 - '@changesets/get-release-plan': 4.0.3 + '@changesets/get-dependents-graph': 2.1.0 + '@changesets/get-release-plan': 4.0.2 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/pre': 2.0.0 @@ -10542,19 +9735,20 @@ snapshots: external-editor: 3.1.0 fs-extra: 7.0.1 human-id: 1.0.2 - mri: 1.2.0 + meow: 6.1.1 outdent: 0.5.0 p-limit: 2.3.0 - preferred-pm: 3.1.4 + preferred-pm: 3.1.3 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.6.2 spawndamnit: 2.0.0 term-size: 2.2.1 + tty-table: 4.2.3 - '@changesets/config@3.0.2': + '@changesets/config@3.0.1': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.1 + '@changesets/get-dependents-graph': 2.1.0 '@changesets/logger': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10565,19 +9759,19 @@ snapshots: dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@2.1.1': + '@changesets/get-dependents-graph@2.1.0': dependencies: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.6.3 + semver: 7.6.2 - '@changesets/get-release-plan@4.0.3': + '@changesets/get-release-plan@4.0.2': dependencies: - '@babel/runtime': 7.25.0 - '@changesets/assemble-release-plan': 6.0.3 - '@changesets/config': 3.0.2 + '@babel/runtime': 7.24.7 + '@changesets/assemble-release-plan': 6.0.2 + '@changesets/config': 3.0.1 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 '@changesets/types': 6.0.0 @@ -10587,7 +9781,7 @@ snapshots: '@changesets/git@3.0.0': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10606,7 +9800,7 @@ snapshots: '@changesets/pre@2.0.0': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10614,7 +9808,7 @@ snapshots: '@changesets/read@0.6.0': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/parse': 0.4.0 @@ -10625,7 +9819,7 @@ snapshots: '@changesets/should-skip-package@0.1.0': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10635,7 +9829,7 @@ snapshots: '@changesets/write@0.3.1': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 @@ -10660,7 +9854,7 @@ snapshots: file-type: 16.5.4 long: 4.0.0 multiformats: 9.9.0 - secp256k1: 5.0.0 + secp256k1: 5.0.1 uuid: 10.0.0 transitivePeerDependencies: - bufferutil @@ -10674,7 +9868,7 @@ snapshots: '@confio/ics23@0.6.8': dependencies: - '@noble/hashes': 1.5.0 + '@noble/hashes': 1.6.1 protobufjs: 6.11.4 '@cosmjs/amino@0.30.1': @@ -10691,8 +9885,8 @@ snapshots: '@cosmjs/utils': 0.30.1 '@noble/hashes': 1.4.0 bn.js: 5.2.1 - elliptic: 6.5.7 - libsodium-wrappers: 0.7.15 + elliptic: 6.5.5 + libsodium-wrappers: 0.7.13 '@cosmjs/encoding@0.30.1': dependencies: @@ -10784,7 +9978,7 @@ snapshots: dependencies: ky: 0.33.3 ky-universal: 0.11.0(ky@0.33.3)(web-streams-polyfill@3.3.3) - undici: 6.20.1 + undici: 6.21.0 transitivePeerDependencies: - web-streams-polyfill @@ -10805,7 +9999,7 @@ snapshots: dependencies: credentials-context: 2.0.0 jsonld: 8.3.2(web-streams-polyfill@3.3.3) - jsonld-signatures: 11.3.0(web-streams-polyfill@3.3.3) + jsonld-signatures: 11.2.1(web-streams-polyfill@3.3.3) transitivePeerDependencies: - web-streams-polyfill @@ -10820,11 +10014,11 @@ snapshots: '@digitalcredentials/base64url-universal': 2.0.6 pako: 2.1.0 - '@digitalcredentials/ed25519-signature-2020@3.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/ed25519-signature-2020@3.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: '@digitalcredentials/base58-universal': 1.0.1 '@digitalcredentials/ed25519-verification-key-2020': 3.2.2 - '@digitalcredentials/jsonld-signatures': 9.4.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/jsonld-signatures': 9.4.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) ed25519-signature-2018-context: 1.1.0 ed25519-signature-2020-context: 1.1.0 transitivePeerDependencies: @@ -10848,12 +10042,12 @@ snapshots: - domexception - web-streams-polyfill - '@digitalcredentials/jsonld-signatures@9.4.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/jsonld-signatures@9.4.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: '@digitalbazaar/security-context': 1.0.1 - '@digitalcredentials/jsonld': 6.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/jsonld': 6.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) fast-text-encoding: 1.0.6 - isomorphic-webcrypto: 2.3.8(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + isomorphic-webcrypto: 2.3.8(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) serialize-error: 8.1.0 transitivePeerDependencies: - domexception @@ -10861,10 +10055,10 @@ snapshots: - react-native - web-streams-polyfill - '@digitalcredentials/jsonld@5.2.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/jsonld@5.2.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: '@digitalcredentials/http-client': 1.2.2(web-streams-polyfill@3.3.3) - '@digitalcredentials/rdf-canonize': 1.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + '@digitalcredentials/rdf-canonize': 1.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) canonicalize: 1.0.8 lru-cache: 6.0.0 transitivePeerDependencies: @@ -10873,10 +10067,10 @@ snapshots: - react-native - web-streams-polyfill - '@digitalcredentials/jsonld@6.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/jsonld@6.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: '@digitalcredentials/http-client': 1.2.2(web-streams-polyfill@3.3.3) - '@digitalcredentials/rdf-canonize': 1.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + '@digitalcredentials/rdf-canonize': 1.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) canonicalize: 1.0.8 lru-cache: 6.0.0 transitivePeerDependencies: @@ -10887,19 +10081,19 @@ snapshots: '@digitalcredentials/open-badges-context@2.1.0': {} - '@digitalcredentials/rdf-canonize@1.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))': + '@digitalcredentials/rdf-canonize@1.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))': dependencies: fast-text-encoding: 1.0.6 - isomorphic-webcrypto: 2.3.8(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + isomorphic-webcrypto: 2.3.8(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) transitivePeerDependencies: - expo - react-native - '@digitalcredentials/vc-status-list@5.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/vc-status-list@5.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: '@digitalbazaar/vc-status-list-context': 3.1.1 '@digitalcredentials/bitstring': 2.0.1 - '@digitalcredentials/vc': 4.2.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/vc': 4.2.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) credentials-context: 2.0.0 transitivePeerDependencies: - domexception @@ -10907,10 +10101,10 @@ snapshots: - react-native - web-streams-polyfill - '@digitalcredentials/vc@4.2.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/vc@4.2.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: - '@digitalcredentials/jsonld': 5.2.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) - '@digitalcredentials/jsonld-signatures': 9.4.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/jsonld': 5.2.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/jsonld-signatures': 9.4.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) credentials-context: 2.0.0 transitivePeerDependencies: - domexception @@ -10918,14 +10112,14 @@ snapshots: - react-native - web-streams-polyfill - '@digitalcredentials/vc@6.0.1(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3)': + '@digitalcredentials/vc@6.0.1(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3)': dependencies: '@digitalbazaar/vc-status-list': 7.1.0(web-streams-polyfill@3.3.3) - '@digitalcredentials/ed25519-signature-2020': 3.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) - '@digitalcredentials/jsonld': 6.0.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) - '@digitalcredentials/jsonld-signatures': 9.4.0(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/ed25519-signature-2020': 3.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/jsonld': 6.0.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/jsonld-signatures': 9.4.0(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) '@digitalcredentials/open-badges-context': 2.1.0 - '@digitalcredentials/vc-status-list': 5.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1))(web-streams-polyfill@3.3.3) + '@digitalcredentials/vc-status-list': 5.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1))(web-streams-polyfill@3.3.3) credentials-context: 2.0.0 fix-esm: 1.0.1 transitivePeerDependencies: @@ -11012,15 +10206,15 @@ snapshots: eslint: 8.57.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.0': {} + '@eslint-community/regexpp@4.10.1': {} '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.6 + debug: 4.3.5 espree: 9.6.1 globals: 13.24.0 - ignore: 5.3.2 + ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -11104,29 +10298,32 @@ snapshots: '@ethersproject/rlp': 5.7.0 '@ethersproject/signing-key': 5.7.0 - '@expo/bunyan@4.0.1': + '@expo/bunyan@4.0.0': dependencies: uuid: 8.3.2 + optionalDependencies: + mv: 2.1.1 + safe-json-stringify: 1.2.0 - '@expo/cli@0.18.29(expo-modules-autolinking@1.11.2)': + '@expo/cli@0.18.19(expo-modules-autolinking@1.11.1)': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@expo/code-signing-certificates': 0.0.5 - '@expo/config': 9.0.3 - '@expo/config-plugins': 8.0.8 - '@expo/devcert': 1.1.4 + '@expo/config': 9.0.1 + '@expo/config-plugins': 8.0.5 + '@expo/devcert': 1.1.2 '@expo/env': 0.3.0 '@expo/image-utils': 0.5.1 '@expo/json-file': 8.3.3 - '@expo/metro-config': 0.18.11 + '@expo/metro-config': 0.18.7 '@expo/osascript': 2.1.3 '@expo/package-manager': 1.5.2 '@expo/plist': 0.1.3 - '@expo/prebuild-config': 7.0.8(expo-modules-autolinking@1.11.2) + '@expo/prebuild-config': 7.0.6(expo-modules-autolinking@1.11.1) '@expo/rudder-sdk-node': 1.1.1 '@expo/spawn-async': 1.7.2 '@expo/xcpretty': 4.3.1 - '@react-native/dev-middleware': 0.74.85 + '@react-native/dev-middleware': 0.74.84 '@urql/core': 2.3.6(graphql@15.8.0) '@urql/exchange-retry': 0.3.0(graphql@15.8.0) accepts: 1.3.8 @@ -11134,11 +10331,11 @@ snapshots: better-opn: 3.0.2 bplist-creator: 0.0.7 bplist-parser: 0.3.2 - cacache: 18.0.4 + cacache: 18.0.3 chalk: 4.1.2 ci-info: 3.9.0 connect: 3.7.0 - debug: 4.3.6 + debug: 4.4.0 env-editor: 0.4.2 fast-glob: 3.3.2 find-yarn-workspace-root: 2.0.0 @@ -11173,7 +10370,7 @@ snapshots: resolve: 1.22.8 resolve-from: 5.0.0 resolve.exports: 2.0.2 - semver: 7.6.3 + semver: 7.6.2 send: 0.18.0 slugify: 1.6.6 source-map-support: 0.5.21 @@ -11186,7 +10383,7 @@ snapshots: text-table: 0.2.0 url-join: 4.0.0 wrap-ansi: 7.0.0 - ws: 8.18.0 + ws: 8.17.1 transitivePeerDependencies: - bufferutil - encoding @@ -11199,19 +10396,19 @@ snapshots: node-forge: 1.3.1 nullthrows: 1.1.1 - '@expo/config-plugins@8.0.8': + '@expo/config-plugins@8.0.5': dependencies: - '@expo/config-types': 51.0.2 + '@expo/config-types': 51.0.1 '@expo/json-file': 8.3.3 '@expo/plist': 0.1.3 '@expo/sdk-runtime-versions': 1.0.0 chalk: 4.1.2 - debug: 4.3.6 + debug: 4.4.0 find-up: 5.0.0 getenv: 1.0.0 glob: 7.1.6 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.6.2 slash: 3.0.0 slugify: 1.6.6 xcode: 3.0.1 @@ -11219,45 +10416,46 @@ snapshots: transitivePeerDependencies: - supports-color - '@expo/config-types@51.0.2': {} + '@expo/config-types@51.0.1': {} - '@expo/config@9.0.3': + '@expo/config@9.0.1': dependencies: '@babel/code-frame': 7.10.4 - '@expo/config-plugins': 8.0.8 - '@expo/config-types': 51.0.2 + '@expo/config-plugins': 8.0.5 + '@expo/config-types': 51.0.1 '@expo/json-file': 8.3.3 getenv: 1.0.0 glob: 7.1.6 require-from-string: 2.0.2 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.6.2 slugify: 1.6.6 sucrase: 3.34.0 transitivePeerDependencies: - supports-color - '@expo/devcert@1.1.4': + '@expo/devcert@1.1.2': dependencies: application-config-path: 0.1.1 command-exists: 1.2.9 debug: 3.2.7 eol: 0.9.1 get-port: 3.2.0 - glob: 10.4.5 + glob: 7.2.3 lodash: 4.17.21 mkdirp: 0.5.6 password-prompt: 1.1.3 + rimraf: 2.7.1 sudo-prompt: 8.2.5 tmp: 0.0.33 - tslib: 2.6.3 + tslib: 2.8.1 transitivePeerDependencies: - supports-color '@expo/env@0.3.0': dependencies: chalk: 4.1.2 - debug: 4.3.6 + debug: 4.4.0 dotenv: 16.4.5 dotenv-expand: 11.0.6 getenv: 1.0.0 @@ -11274,7 +10472,7 @@ snapshots: node-fetch: 2.7.0 parse-png: 2.1.0 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.6.2 tempy: 0.3.0 transitivePeerDependencies: - encoding @@ -11285,25 +10483,25 @@ snapshots: json5: 2.2.3 write-file-atomic: 2.4.3 - '@expo/metro-config@0.18.11': + '@expo/metro-config@0.18.7': dependencies: - '@babel/core': 7.25.8 - '@babel/generator': 7.25.7 - '@babel/parser': 7.25.8 - '@babel/types': 7.25.8 - '@expo/config': 9.0.3 + '@babel/core': 7.26.0 + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@expo/config': 9.0.1 '@expo/env': 0.3.0 '@expo/json-file': 8.3.3 '@expo/spawn-async': 1.7.2 chalk: 4.1.2 - debug: 4.3.6 + debug: 4.4.0 find-yarn-workspace-root: 2.0.0 fs-extra: 9.1.0 getenv: 1.0.0 glob: 7.2.3 jsc-safe-url: 0.2.4 lightningcss: 1.19.0 - postcss: 8.4.41 + postcss: 8.4.38 resolve-from: 5.0.0 transitivePeerDependencies: - supports-color @@ -11322,7 +10520,7 @@ snapshots: find-up: 5.0.0 find-yarn-workspace-root: 2.0.0 js-yaml: 3.14.1 - micromatch: 4.0.8 + micromatch: 4.0.7 npm-package-arg: 7.0.0 ora: 3.4.0 split: 1.0.1 @@ -11334,19 +10532,19 @@ snapshots: base64-js: 1.5.1 xmlbuilder: 14.0.0 - '@expo/prebuild-config@7.0.8(expo-modules-autolinking@1.11.2)': + '@expo/prebuild-config@7.0.6(expo-modules-autolinking@1.11.1)': dependencies: - '@expo/config': 9.0.3 - '@expo/config-plugins': 8.0.8 - '@expo/config-types': 51.0.2 + '@expo/config': 9.0.1 + '@expo/config-plugins': 8.0.5 + '@expo/config-types': 51.0.1 '@expo/image-utils': 0.5.1 '@expo/json-file': 8.3.3 - '@react-native/normalize-colors': 0.74.85 - debug: 4.3.6 - expo-modules-autolinking: 1.11.2 + '@react-native/normalize-colors': 0.74.84 + debug: 4.4.0 + expo-modules-autolinking: 1.11.1 fs-extra: 9.1.0 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.6.2 xml2js: 0.6.0 transitivePeerDependencies: - encoding @@ -11354,7 +10552,7 @@ snapshots: '@expo/rudder-sdk-node@1.1.1': dependencies: - '@expo/bunyan': 4.0.1 + '@expo/bunyan': 4.0.0 '@segment/loosely-validate-event': 2.0.0 fetch-retry: 4.1.1 md5: 2.3.0 @@ -11396,7 +10594,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.6 + debug: 4.3.5 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -11569,7 +10767,7 @@ snapshots: glob: 7.2.3 graceful-fs: 4.2.11 istanbul-lib-coverage: 3.2.2 - istanbul-lib-instrument: 6.0.3 + istanbul-lib-instrument: 6.0.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.7 @@ -11579,7 +10777,7 @@ snapshots: slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 - v8-to-istanbul: 9.3.0 + v8-to-istanbul: 9.2.0 transitivePeerDependencies: - supports-color @@ -11609,7 +10807,7 @@ snapshots: '@jest/transform@29.7.0': dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 @@ -11627,12 +10825,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@jest/types@24.9.0': - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 1.1.2 - '@types/yargs': 13.0.12 - '@jest/types@26.6.2': dependencies: '@types/istanbul-lib-coverage': 2.0.6 @@ -11655,13 +10847,13 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 '@types/node': 18.18.8 - '@types/yargs': 17.0.33 + '@types/yargs': 17.0.32 chalk: 4.1.2 '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/trace-mapping': 0.3.25 '@jridgewell/resolve-uri@3.1.2': {} @@ -11673,17 +10865,17 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/sourcemap-codec@1.4.15': {} '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.4.15 '@js-joda/core@5.6.3': {} @@ -11702,26 +10894,22 @@ snapshots: dependencies: vary: 1.1.2 - '@koa/router@12.0.1': + '@koa/router@13.1.0': dependencies: - debug: 4.3.6 http-errors: 2.0.0 koa-compose: 4.1.0 - methods: 1.1.2 - path-to-regexp: 6.2.2 - transitivePeerDependencies: - - supports-color + path-to-regexp: 6.3.0 '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@types/node': 18.18.8 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -11737,12 +10925,21 @@ snapshots: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.6.3 + semver: 7.6.2 tar: 6.2.1 transitivePeerDependencies: - encoding - supports-color + '@mattrglobal/bbs-signatures@1.3.1': + dependencies: + '@stablelib/random': 1.0.0 + optionalDependencies: + '@mattrglobal/node-bbs-signatures': 0.18.1 + transitivePeerDependencies: + - encoding + - supports-color + '@mattrglobal/bbs-signatures@1.4.0': dependencies: '@stablelib/random': 1.0.0 @@ -11752,9 +10949,9 @@ snapshots: - encoding - supports-color - '@mattrglobal/bls12381-key-pair@1.2.2': + '@mattrglobal/bls12381-key-pair@1.2.1': dependencies: - '@mattrglobal/bbs-signatures': 1.4.0 + '@mattrglobal/bbs-signatures': 1.3.1 bs58: 4.0.1 rfc4648: 1.5.2 transitivePeerDependencies: @@ -11785,13 +10982,15 @@ snapshots: '@noble/ciphers@0.5.3': {} - '@noble/curves@1.6.0': + '@noble/curves@1.7.0': dependencies: - '@noble/hashes': 1.5.0 + '@noble/hashes': 1.6.0 '@noble/hashes@1.4.0': {} - '@noble/hashes@1.5.0': {} + '@noble/hashes@1.6.0': {} + + '@noble/hashes@1.6.1': {} '@nodelib/fs.scandir@2.1.5': dependencies: @@ -11807,7 +11006,7 @@ snapshots: '@npmcli/fs@3.1.1': dependencies: - semver: 7.6.3 + semver: 7.6.2 '@open-draft/deferred-promise@2.2.0': {} @@ -11824,21 +11023,21 @@ snapshots: '@peculiar/asn1-x509': 2.3.13 '@peculiar/asn1-x509-attr': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-csr@2.3.13': dependencies: '@peculiar/asn1-schema': 2.3.13 '@peculiar/asn1-x509': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 - '@peculiar/asn1-ecc@2.3.13': + '@peculiar/asn1-ecc@2.3.14': dependencies: '@peculiar/asn1-schema': 2.3.13 '@peculiar/asn1-x509': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-pfx@2.3.13': dependencies: @@ -11847,14 +11046,14 @@ snapshots: '@peculiar/asn1-rsa': 2.3.13 '@peculiar/asn1-schema': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-pkcs8@2.3.13': dependencies: '@peculiar/asn1-schema': 2.3.13 '@peculiar/asn1-x509': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-pkcs9@2.3.13': dependencies: @@ -11865,16 +11064,22 @@ snapshots: '@peculiar/asn1-x509': 2.3.13 '@peculiar/asn1-x509-attr': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-rsa@2.3.13': dependencies: '@peculiar/asn1-schema': 2.3.13 '@peculiar/asn1-x509': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-schema@2.3.13': + dependencies: + asn1js: 3.0.5 + pvtsutils: 1.3.5 + tslib: 2.8.1 + + '@peculiar/asn1-schema@2.3.8': dependencies: asn1js: 3.0.5 pvtsutils: 1.3.5 @@ -11885,7 +11090,7 @@ snapshots: '@peculiar/asn1-schema': 2.3.13 '@peculiar/asn1-x509': 2.3.13 asn1js: 3.0.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/asn1-x509@2.3.13': dependencies: @@ -11893,7 +11098,7 @@ snapshots: asn1js: 3.0.5 ipaddr.js: 2.2.0 pvtsutils: 1.3.5 - tslib: 2.6.3 + tslib: 2.8.1 '@peculiar/json-schema@1.1.12': dependencies: @@ -11904,21 +11109,21 @@ snapshots: '@peculiar/asn1-schema': 2.3.13 '@peculiar/json-schema': 1.1.12 pvtsutils: 1.3.5 - tslib: 2.6.3 + tslib: 2.8.1 webcrypto-core: 1.8.0 - '@peculiar/x509@1.12.1': + '@peculiar/x509@1.12.3': dependencies: '@peculiar/asn1-cms': 2.3.13 '@peculiar/asn1-csr': 2.3.13 - '@peculiar/asn1-ecc': 2.3.13 + '@peculiar/asn1-ecc': 2.3.14 '@peculiar/asn1-pkcs9': 2.3.13 '@peculiar/asn1-rsa': 2.3.13 '@peculiar/asn1-schema': 2.3.13 '@peculiar/asn1-x509': 2.3.13 pvtsutils: 1.3.5 reflect-metadata: 0.2.2 - tslib: 2.6.3 + tslib: 2.8.1 tsyringe: 4.8.0 '@pkgjs/parseargs@0.11.0': @@ -11963,7 +11168,7 @@ snapshots: cosmiconfig: 5.2.1 deepmerge: 3.3.0 glob: 7.2.3 - joi: 17.13.3 + joi: 17.13.1 transitivePeerDependencies: - encoding @@ -12017,33 +11222,13 @@ snapshots: '@react-native-community/cli-tools': 10.1.1 chalk: 4.1.2 execa: 1.0.0 - fast-xml-parser: 4.4.1 + fast-xml-parser: 4.4.0 glob: 7.2.3 ora: 5.4.1 transitivePeerDependencies: - encoding - '@react-native-community/cli-plugin-metro@10.2.3(@babel/core@7.25.2)': - dependencies: - '@react-native-community/cli-server-api': 10.1.1 - '@react-native-community/cli-tools': 10.1.1 - chalk: 4.1.2 - execa: 1.0.0 - metro: 0.73.10 - metro-config: 0.73.10 - metro-core: 0.73.10 - metro-react-native-babel-transformer: 0.73.10(@babel/core@7.25.2) - metro-resolver: 0.73.10 - metro-runtime: 0.73.10 - readline: 1.3.0 - transitivePeerDependencies: - - '@babel/core' - - bufferutil - - encoding - - supports-color - - utf-8-validate - - '@react-native-community/cli-plugin-metro@10.2.3(@babel/core@7.25.8)': + '@react-native-community/cli-plugin-metro@10.2.3(@babel/core@7.26.0)': dependencies: '@react-native-community/cli-server-api': 10.1.1 '@react-native-community/cli-tools': 10.1.1 @@ -12052,7 +11237,7 @@ snapshots: metro: 0.73.10 metro-config: 0.73.10 metro-core: 0.73.10 - metro-react-native-babel-transformer: 0.73.10(@babel/core@7.25.8) + metro-react-native-babel-transformer: 0.73.10(@babel/core@7.26.0) metro-resolver: 0.73.10 metro-runtime: 0.73.10 readline: 1.3.0 @@ -12096,42 +11281,16 @@ snapshots: '@react-native-community/cli-types@10.0.0': dependencies: - joi: 17.13.3 - - '@react-native-community/cli@10.2.7(@babel/core@7.25.2)': - dependencies: - '@react-native-community/cli-clean': 10.1.1 - '@react-native-community/cli-config': 10.1.1 - '@react-native-community/cli-debugger-ui': 10.0.0 - '@react-native-community/cli-doctor': 10.2.7 - '@react-native-community/cli-hermes': 10.2.7 - '@react-native-community/cli-plugin-metro': 10.2.3(@babel/core@7.25.2) - '@react-native-community/cli-server-api': 10.1.1 - '@react-native-community/cli-tools': 10.1.1 - '@react-native-community/cli-types': 10.0.0 - chalk: 4.1.2 - commander: 9.5.0 - execa: 1.0.0 - find-up: 4.1.0 - fs-extra: 8.1.0 - graceful-fs: 4.2.11 - prompts: 2.4.2 - semver: 6.3.1 - transitivePeerDependencies: - - '@babel/core' - - bufferutil - - encoding - - supports-color - - utf-8-validate + joi: 17.13.1 - '@react-native-community/cli@10.2.7(@babel/core@7.25.8)': + '@react-native-community/cli@10.2.7(@babel/core@7.26.0)': dependencies: '@react-native-community/cli-clean': 10.1.1 '@react-native-community/cli-config': 10.1.1 '@react-native-community/cli-debugger-ui': 10.0.0 '@react-native-community/cli-doctor': 10.2.7 '@react-native-community/cli-hermes': 10.2.7 - '@react-native-community/cli-plugin-metro': 10.2.3(@babel/core@7.25.8) + '@react-native-community/cli-plugin-metro': 10.2.3(@babel/core@7.26.0) '@react-native-community/cli-server-api': 10.1.1 '@react-native-community/cli-tools': 10.1.1 '@react-native-community/cli-types': 10.0.0 @@ -12152,153 +11311,81 @@ snapshots: '@react-native/assets@1.0.0': {} - '@react-native/babel-plugin-codegen@0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.2))': - dependencies: - '@react-native/codegen': 0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - transitivePeerDependencies: - - '@babel/preset-env' - - supports-color - optional: true - - '@react-native/babel-plugin-codegen@0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.8))': + '@react-native/babel-plugin-codegen@0.74.84(@babel/preset-env@7.26.0(@babel/core@7.26.0))': dependencies: - '@react-native/codegen': 0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - transitivePeerDependencies: - - '@babel/preset-env' - - supports-color - - '@react-native/babel-preset@0.74.87(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))': - dependencies: - '@babel/core': 7.25.2 - '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.25.2) - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-export-default-from': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-proposal-logical-assignment-operators': 7.20.7(@babel/core@7.25.2) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.25.2) - '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.25.2) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-transform-arrow-functions': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-async-to-generator': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-block-scoping': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-classes': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-computed-properties': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-destructuring': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-function-name': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-literals': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-private-property-in-object': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-shorthand-properties': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-spread': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-sticky-regex': 7.25.7(@babel/core@7.25.2) - '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-unicode-regex': 7.25.7(@babel/core@7.25.2) - '@babel/template': 7.25.7 - '@react-native/babel-plugin-codegen': 0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.25.2) - react-refresh: 0.14.2 + '@react-native/codegen': 0.74.84(@babel/preset-env@7.26.0(@babel/core@7.26.0)) transitivePeerDependencies: - '@babel/preset-env' - supports-color - optional: true - '@react-native/babel-preset@0.74.87(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))': - dependencies: - '@babel/core': 7.25.8 - '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.25.8) - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-export-default-from': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-proposal-logical-assignment-operators': 7.20.7(@babel/core@7.25.8) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.25.8) - '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.25.8) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-transform-arrow-functions': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-async-to-generator': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-block-scoping': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-classes': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-computed-properties': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-destructuring': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-function-name': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-literals': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-private-property-in-object': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-shorthand-properties': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-spread': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-sticky-regex': 7.25.7(@babel/core@7.25.8) - '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-unicode-regex': 7.25.7(@babel/core@7.25.8) - '@babel/template': 7.25.7 - '@react-native/babel-plugin-codegen': 0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.25.8) + '@react-native/babel-preset@0.74.84(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))': + dependencies: + '@babel/core': 7.26.0 + '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.26.0) + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-export-default-from': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-proposal-logical-assignment-operators': 7.20.7(@babel/core@7.26.0) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.26.0) + '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.26.0) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-transform-arrow-functions': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-async-to-generator': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoping': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-classes': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-computed-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-destructuring': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-function-name': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-literals': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.26.3(@babel/core@7.26.0) + '@babel/plugin-transform-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-methods': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-private-property-in-object': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-shorthand-properties': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-spread': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-sticky-regex': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-typescript': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-regex': 7.25.9(@babel/core@7.26.0) + '@babel/template': 7.25.9 + '@react-native/babel-plugin-codegen': 0.74.84(@babel/preset-env@7.26.0(@babel/core@7.26.0)) + babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.26.0) react-refresh: 0.14.2 transitivePeerDependencies: - '@babel/preset-env' - supports-color - '@react-native/codegen@0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.2))': - dependencies: - '@babel/parser': 7.25.8 - '@babel/preset-env': 7.25.8(@babel/core@7.25.2) - glob: 7.2.3 - hermes-parser: 0.19.1 - invariant: 2.2.4 - jscodeshift: 0.14.0(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - mkdirp: 0.5.6 - nullthrows: 1.1.1 - transitivePeerDependencies: - - supports-color - optional: true - - '@react-native/codegen@0.74.87(@babel/preset-env@7.25.8(@babel/core@7.25.8))': + '@react-native/codegen@0.74.84(@babel/preset-env@7.26.0(@babel/core@7.26.0))': dependencies: - '@babel/parser': 7.25.8 - '@babel/preset-env': 7.25.8(@babel/core@7.25.8) + '@babel/parser': 7.26.3 + '@babel/preset-env': 7.26.0(@babel/core@7.26.0) glob: 7.2.3 hermes-parser: 0.19.1 invariant: 2.2.4 - jscodeshift: 0.14.0(@babel/preset-env@7.25.8(@babel/core@7.25.8)) + jscodeshift: 0.14.0(@babel/preset-env@7.26.0(@babel/core@7.26.0)) mkdirp: 0.5.6 nullthrows: 1.1.1 transitivePeerDependencies: - supports-color - '@react-native/debugger-frontend@0.74.85': {} + '@react-native/debugger-frontend@0.74.84': {} - '@react-native/dev-middleware@0.74.85': + '@react-native/dev-middleware@0.74.84': dependencies: '@isaacs/ttlcache': 1.4.1 - '@react-native/debugger-frontend': 0.74.85 + '@react-native/debugger-frontend': 0.74.84 '@rnx-kit/chromium-edge-launcher': 1.0.0 chrome-launcher: 0.15.2 connect: 3.7.0 @@ -12318,7 +11405,7 @@ snapshots: '@react-native/normalize-color@2.1.0': {} - '@react-native/normalize-colors@0.74.85': {} + '@react-native/normalize-colors@0.74.84': {} '@react-native/polyfills@2.0.0': {} @@ -12333,7 +11420,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@scure/base@1.1.8': {} + '@scure/base@1.2.1': {} '@sd-jwt/core@0.7.2': dependencies: @@ -12417,15 +11504,15 @@ snapshots: '@sphereon/jarm': 0.16.1-fix.173(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4))(typescript@5.5.4) '@sphereon/oid4vc-common': 0.16.1-fix.173(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) '@sphereon/pex': 5.0.0-unstable.24 - '@sphereon/pex-models': 2.3.1 + '@sphereon/pex-models': 2.3.2 '@sphereon/ssi-types': 0.30.2-next.129 cross-fetch: 4.0.0 - debug: 4.3.6 + debug: 4.3.5 events: 3.3.0 jwt-decode: 4.0.0 language-tags: 1.0.9 multiformats: 12.1.3 - qs: 6.13.0 + qs: 6.12.1 uint8arrays: 3.1.1 transitivePeerDependencies: - '@google-cloud/spanner' @@ -12516,7 +11603,7 @@ snapshots: - ts-node - typeorm-aurora-data-api-driver - '@sphereon/pex-models@2.3.1': {} + '@sphereon/pex-models@2.3.2': {} '@sphereon/pex@5.0.0-unstable.24': dependencies: @@ -12524,10 +11611,10 @@ snapshots: '@sd-jwt/decode': 0.7.2 '@sd-jwt/present': 0.7.2 '@sd-jwt/types': 0.7.2 - '@sphereon/pex-models': 2.3.1 + '@sphereon/pex-models': 2.3.2 '@sphereon/ssi-types': 0.30.2-next.129 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) + ajv: 8.16.0 + ajv-formats: 2.1.1(ajv@8.16.0) jwt-decode: 3.1.2 nanoid: 3.3.7 uint8arrays: 3.1.1 @@ -12549,7 +11636,7 @@ snapshots: '@veramo/utils': 4.2.0 did-jwt: 6.11.6 did-resolver: 4.1.0 - elliptic: 6.5.7 + elliptic: 6.5.5 uint8arrays: 3.1.1 transitivePeerDependencies: - '@google-cloud/spanner' @@ -12581,7 +11668,7 @@ snapshots: '@sphereon/ssi-types': 0.29.1-unstable.161 '@veramo/core': 4.2.0 '@veramo/utils': 4.2.0 - debug: 4.3.6 + debug: 4.3.5 pkijs: 3.2.4 uint8arrays: 3.1.1 transitivePeerDependencies: @@ -12616,7 +11703,7 @@ snapshots: '@sphereon/ssi-types': 0.29.1-unstable.161 '@veramo/core': 4.2.0 '@veramo/utils': 4.2.0 - debug: 4.3.6 + debug: 4.3.5 jwt-decode: 4.0.0 uint8arrays: 3.1.1 transitivePeerDependencies: @@ -12659,9 +11746,9 @@ snapshots: '@trust/keyto': 1.0.1 '@veramo/core': 4.2.0 base64url: 3.0.1 - debug: 4.3.6 + debug: 4.3.5 did-resolver: 4.1.0 - elliptic: 6.5.7 + elliptic: 6.5.5 lodash.isplainobject: 4.0.6 multiformats: 9.9.0 uint8arrays: 3.1.1 @@ -12673,7 +11760,7 @@ snapshots: '@sphereon/ssi-sdk-ext.x509-utils@0.24.1-unstable.130': dependencies: '@trust/keyto': 1.0.1 - debug: 4.3.6 + debug: 4.3.5 js-x509-utils: 1.0.7 pkijs: 3.2.4 uint8arrays: 3.1.1 @@ -12683,11 +11770,11 @@ snapshots: '@sphereon/ssi-sdk.agent-config@0.29.1-unstable.161(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4))': dependencies: '@veramo/core': 4.2.0 - debug: 4.3.6 + debug: 4.3.5 jsonpointer: 5.0.1 typeorm: 0.3.20(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) url-parse: 1.5.10 - yaml: 2.5.0 + yaml: 2.4.5 transitivePeerDependencies: - '@google-cloud/spanner' - '@sap/hana-client' @@ -12713,7 +11800,7 @@ snapshots: '@sphereon/ssi-types': 0.29.1-unstable.161 '@veramo/core': 4.2.0 cross-fetch: 3.1.8 - debug: 4.3.6 + debug: 4.3.5 image-size: 2.0.0-beta.2 uint8arrays: 3.1.1 transitivePeerDependencies: @@ -12723,7 +11810,7 @@ snapshots: '@sphereon/ssi-types@0.29.1-unstable.161': dependencies: '@sd-jwt/decode': 0.6.1 - debug: 4.3.6 + debug: 4.3.5 events: 3.3.0 jwt-decode: 3.1.2 transitivePeerDependencies: @@ -12734,7 +11821,7 @@ snapshots: '@sd-jwt/decode': 0.7.2 '@sphereon/kmp-mdl-mdoc': 0.2.0-SNAPSHOT.22 '@sphereon/ssi-sdk-ext.jwt-service': 0.24.1-unstable.130(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) - debug: 4.3.6 + debug: 4.3.5 events: 3.3.0 jwt-decode: 3.1.2 transitivePeerDependencies: @@ -12762,7 +11849,7 @@ snapshots: dependencies: '@sd-jwt/decode': 0.7.2 '@sphereon/kmp-mdl-mdoc': 0.2.0-SNAPSHOT.22 - debug: 4.3.6 + debug: 4.3.5 events: 3.3.0 jwt-decode: 3.1.2 transitivePeerDependencies: @@ -12772,7 +11859,7 @@ snapshots: dependencies: '@sd-jwt/decode': 0.7.2 '@sphereon/kmp-mdl-mdoc': 0.2.0-SNAPSHOT.22 - debug: 4.3.6 + debug: 4.3.5 events: 3.3.0 jwt-decode: 3.1.2 transitivePeerDependencies: @@ -12877,7 +11964,7 @@ snapshots: dependencies: asn1.js: 5.4.1 base64url: 3.0.1 - elliptic: 6.5.7 + elliptic: 6.5.5 '@tsconfig/node10@1.0.11': {} @@ -12893,24 +11980,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.25.3 - '@babel/types': 7.25.2 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.24.7 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.25.3 - '@babel/types': 7.25.2 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 '@types/babel__traverse@7.20.6': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.24.7 '@types/bn.js@5.1.5': dependencies: @@ -12940,7 +12027,7 @@ snapshots: dependencies: '@types/node': 18.18.8 - '@types/eslint@8.56.11': + '@types/eslint@8.56.10': dependencies: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 @@ -12949,7 +12036,7 @@ snapshots: '@types/events@3.0.3': {} - '@types/express-serve-static-core@4.19.5': + '@types/express-serve-static-core@4.19.3': dependencies: '@types/node': 18.18.8 '@types/qs': 6.9.15 @@ -12959,7 +12046,7 @@ snapshots: '@types/express@4.17.21': dependencies: '@types/body-parser': 1.19.5 - '@types/express-serve-static-core': 4.19.5 + '@types/express-serve-static-core': 4.19.3 '@types/qs': 6.9.15 '@types/serve-static': 1.15.7 @@ -12969,7 +12056,7 @@ snapshots: dependencies: '@types/node': 18.18.8 - '@types/http-assert@1.5.5': {} + '@types/http-assert@1.5.6': {} '@types/http-cache-semantics@4.0.4': {} @@ -12986,11 +12073,6 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports@1.1.2': - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-lib-report': 3.0.3 - '@types/istanbul-reports@3.0.4': dependencies: '@types/istanbul-lib-report': 3.0.3 @@ -13015,7 +12097,7 @@ snapshots: '@types/accepts': 1.3.7 '@types/content-disposition': 0.5.8 '@types/cookies': 0.9.0 - '@types/http-assert': 1.5.5 + '@types/http-assert': 1.5.6 '@types/http-errors': 2.0.4 '@types/keygrip': 1.0.6 '@types/koa-compose': 3.2.8 @@ -13029,6 +12111,8 @@ snapshots: '@types/mime@1.3.5': {} + '@types/minimist@1.2.5': {} + '@types/multer@1.4.11': dependencies: '@types/express': 4.17.21 @@ -13041,6 +12125,8 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/normalize-package-data@2.4.4': {} + '@types/object-inspect@1.13.0': {} '@types/oidc-provider@8.5.2': @@ -13107,16 +12193,12 @@ snapshots: dependencies: '@types/node': 18.18.8 - '@types/ws@8.5.12': + '@types/ws@8.5.10': dependencies: '@types/node': 18.18.8 '@types/yargs-parser@21.0.3': {} - '@types/yargs@13.0.12': - dependencies: - '@types/yargs-parser': 21.0.3 - '@types/yargs@15.0.19': dependencies: '@types/yargs-parser': 21.0.3 @@ -13125,13 +12207,13 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@types/yargs@17.0.33': + '@types/yargs@17.0.32': dependencies: '@types/yargs-parser': 21.0.3 '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@eslint-community/regexpp': 4.11.0 + '@eslint-community/regexpp': 4.10.1 '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/scope-manager': 7.18.0 '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) @@ -13139,9 +12221,9 @@ snapshots: '@typescript-eslint/visitor-keys': 7.18.0 eslint: 8.57.0 graphemer: 1.4.0 - ignore: 5.3.2 + ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.5.4) + ts-api-utils: 1.4.3(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -13153,7 +12235,7 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + debug: 4.3.5 eslint: 8.57.0 optionalDependencies: typescript: 5.5.4 @@ -13169,9 +12251,9 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) - debug: 4.3.6 + debug: 4.3.5 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.5.4) + ts-api-utils: 1.4.3(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -13183,12 +12265,12 @@ snapshots: dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.5.4) + minimatch: 9.0.4 + semver: 7.6.2 + ts-api-utils: 1.4.3(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -13238,7 +12320,7 @@ snapshots: '@veramo/core@4.2.0': dependencies: credential-status: 2.0.6 - debug: 4.3.6 + debug: 4.3.5 did-jwt-vc: 3.2.15 did-resolver: 4.1.0 events: 3.3.0 @@ -13266,11 +12348,11 @@ snapshots: '@veramo/core': 4.2.0 blakejs: 1.2.1 cross-fetch: 3.1.8 - debug: 4.3.6 + debug: 4.3.5 did-jwt: 6.11.6 did-jwt-vc: 3.2.15 did-resolver: 4.1.0 - elliptic: 6.5.7 + elliptic: 6.5.5 multiformats: 9.7.1 uint8arrays: 3.1.1 transitivePeerDependencies: @@ -13297,19 +12379,19 @@ snapshots: mime-types: 2.1.35 negotiator: 0.6.3 - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.12.0): dependencies: - acorn: 8.12.1 + acorn: 8.12.0 acorn-walk@8.3.3: dependencies: - acorn: 8.12.1 + acorn: 8.12.0 - acorn@8.12.1: {} + acorn@8.12.0: {} agent-base@6.0.2: dependencies: - debug: 4.3.6 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -13318,9 +12400,9 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 - ajv-formats@2.1.1(ajv@8.17.1): + ajv-formats@2.1.1(ajv@8.16.0): optionalDependencies: - ajv: 8.17.1 + ajv: 8.16.0 ajv@6.12.6: dependencies: @@ -13329,12 +12411,12 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ajv@8.17.1: + ajv@8.16.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.0.1 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 + uri-js: 4.4.1 anser@1.4.10: {} @@ -13465,6 +12547,8 @@ snapshots: is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 + arrify@1.0.1: {} + asap@2.0.6: {} asmcrypto.js@0.22.0: {} @@ -13488,7 +12572,7 @@ snapshots: ast-types@0.15.2: dependencies: - tslib: 2.6.3 + tslib: 2.8.1 astral-regex@1.0.0: {} @@ -13498,7 +12582,7 @@ snapshots: dependencies: tslib: 2.6.3 - async@3.2.6: {} + async@3.2.5: {} asynckit@0.4.0: {} @@ -13522,17 +12606,17 @@ snapshots: dependencies: b64-lite: 1.4.0 - babel-core@7.0.0-bridge.0(@babel/core@7.25.2): + babel-core@7.0.0-bridge.0(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.2 + '@babel/core': 7.26.0 - babel-jest@29.7.0(@babel/core@7.25.8): + babel-jest@29.7.0(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.25.8) + babel-preset-jest: 29.6.3(@babel/core@7.26.0) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -13541,7 +12625,7 @@ snapshots: babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-plugin-utils': 7.24.7 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -13551,133 +12635,78 @@ snapshots: babel-plugin-jest-hoist@29.6.3: dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.2 + '@babel/template': 7.24.7 + '@babel/types': 7.24.7 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.6 - babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.25.2): - dependencies: - '@babel/compat-data': 7.25.2 - '@babel/core': 7.25.2 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.2) - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.25.8): + babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.26.0): dependencies: - '@babel/compat-data': 7.25.2 - '@babel/core': 7.25.8 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.8) + '@babel/compat-data': 7.26.3 + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.26.0) semver: 6.3.1 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-corejs3@0.10.6(@babel/core@7.25.2): - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.2) - core-js-compat: 3.38.1 - transitivePeerDependencies: - - supports-color - - babel-plugin-polyfill-corejs3@0.10.6(@babel/core@7.25.8): + babel-plugin-polyfill-corejs3@0.10.4(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.8 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.8) - core-js-compat: 3.38.1 + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.26.0) + core-js-compat: 3.37.1 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.25.2): + babel-plugin-polyfill-corejs3@0.10.6(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.2 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.26.0) + core-js-compat: 3.39.0 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.25.8): + babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.8 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.25.8) + '@babel/core': 7.26.0 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.26.0) transitivePeerDependencies: - supports-color - babel-plugin-react-compiler@0.0.0-experimental-7d62301-20240819: - dependencies: - '@babel/generator': 7.2.0 - '@babel/types': 7.25.8 - chalk: 4.1.2 - invariant: 2.2.4 - pretty-format: 24.9.0 - zod: 3.23.8 - zod-validation-error: 2.1.0(zod@3.23.8) - babel-plugin-react-native-web@0.19.12: {} babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: {} - babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.25.2): - dependencies: - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.2) - transitivePeerDependencies: - - '@babel/core' - optional: true - - babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.25.8): + babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.26.0): dependencies: - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.8) - transitivePeerDependencies: - - '@babel/core' - - babel-preset-current-node-syntax@1.1.0(@babel/core@7.25.8): - dependencies: - '@babel/core': 7.25.8 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.8) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.8) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.25.8) - '@babel/plugin-syntax-import-attributes': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.25.8) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.25.8) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.25.8) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.25.8) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.25.8) - - babel-preset-expo@11.0.14(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)): - dependencies: - '@babel/plugin-proposal-decorators': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-export-namespace-from': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-object-rest-spread': 7.25.8(@babel/core@7.25.2) - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.2) - '@babel/preset-react': 7.24.7(@babel/core@7.25.2) - '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) - '@react-native/babel-preset': 0.74.87(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - babel-plugin-react-compiler: 0.0.0-experimental-7d62301-20240819 - babel-plugin-react-native-web: 0.19.12 - react-refresh: 0.14.2 + '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - '@babel/core' - - '@babel/preset-env' - - supports-color - optional: true - babel-preset-expo@11.0.14(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)): - dependencies: - '@babel/plugin-proposal-decorators': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-export-namespace-from': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-object-rest-spread': 7.25.8(@babel/core@7.25.8) - '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.8) - '@babel/preset-react': 7.24.7(@babel/core@7.25.8) - '@babel/preset-typescript': 7.24.7(@babel/core@7.25.8) - '@react-native/babel-preset': 0.74.87(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - babel-plugin-react-compiler: 0.0.0-experimental-7d62301-20240819 + babel-preset-current-node-syntax@1.0.1(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.26.0) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.26.0) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.0) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.26.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.26.0) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.26.0) + + babel-preset-expo@11.0.10(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)): + dependencies: + '@babel/plugin-proposal-decorators': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-export-namespace-from': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-object-rest-spread': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.0) + '@babel/preset-react': 7.24.7(@babel/core@7.26.0) + '@babel/preset-typescript': 7.24.7(@babel/core@7.26.0) + '@react-native/babel-preset': 0.74.84(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) babel-plugin-react-native-web: 0.19.12 react-refresh: 0.14.2 transitivePeerDependencies: @@ -13685,83 +12714,50 @@ snapshots: - '@babel/preset-env' - supports-color - babel-preset-fbjs@3.4.0(@babel/core@7.25.2): - dependencies: - '@babel/core': 7.25.2 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.25.2) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.2) - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.25.2) - '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.25.2) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.25.2) - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.25.2) - '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) - '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.25.2) - babel-plugin-syntax-trailing-function-commas: 7.0.0-beta.0 - transitivePeerDependencies: - - supports-color - - babel-preset-fbjs@3.4.0(@babel/core@7.25.8): - dependencies: - '@babel/core': 7.25.8 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.25.8) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.8) - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.25.8) - '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.25.8) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.25.8) - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.25.8) - '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.8) - '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.25.8) + babel-preset-fbjs@3.4.0(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.26.0) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.26.0) + '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoping': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-classes': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-destructuring': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-function-name': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-literals': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.26.0) babel-plugin-syntax-trailing-function-commas: 7.0.0-beta.0 transitivePeerDependencies: - supports-color - babel-preset-jest@29.6.3(@babel/core@7.25.8): + babel-preset-jest@29.6.3(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.1.0(@babel/core@7.25.8) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.26.0) balanced-match@1.0.2: {} base-64@0.1.0: {} - base-x@3.0.10: + base-x@3.0.9: dependencies: safe-buffer: 5.2.1 @@ -13861,21 +12857,25 @@ snapshots: dependencies: fill-range: 7.1.1 + breakword@1.0.6: + dependencies: + wcwidth: 1.0.1 + brorand@1.1.0: {} - browserslist@4.23.3: + browserslist@4.23.1: dependencies: - caniuse-lite: 1.0.30001651 - electron-to-chromium: 1.5.13 - node-releases: 2.0.18 - update-browserslist-db: 1.1.0(browserslist@4.23.3) + caniuse-lite: 1.0.30001636 + electron-to-chromium: 1.4.806 + node-releases: 2.0.14 + update-browserslist-db: 1.0.16(browserslist@4.23.1) - browserslist@4.24.0: + browserslist@4.24.2: dependencies: - caniuse-lite: 1.0.30001668 - electron-to-chromium: 1.5.38 + caniuse-lite: 1.0.30001687 + electron-to-chromium: 1.5.71 node-releases: 2.0.18 - update-browserslist-db: 1.1.0(browserslist@4.24.0) + update-browserslist-db: 1.1.1(browserslist@4.24.2) bs-logger@0.2.6: dependencies: @@ -13883,7 +12883,7 @@ snapshots: bs58@4.0.1: dependencies: - base-x: 3.0.10 + base-x: 3.0.9 bser@2.1.1: dependencies: @@ -13922,12 +12922,12 @@ snapshots: bytestreamjs@2.0.1: {} - cacache@18.0.4: + cacache@18.0.3: dependencies: '@npmcli/fs': 3.1.1 fs-minipass: 3.0.3 - glob: 10.4.5 - lru-cache: 10.4.3 + glob: 10.4.2 + lru-cache: 10.2.2 minipass: 7.1.2 minipass-collect: 2.0.1 minipass-flush: 1.0.5 @@ -13974,13 +12974,19 @@ snapshots: callsites@3.1.0: {} + camelcase-keys@6.2.2: + dependencies: + camelcase: 5.3.1 + map-obj: 4.3.0 + quick-lru: 4.0.1 + camelcase@5.3.1: {} camelcase@6.3.0: {} - caniuse-lite@1.0.30001651: {} + caniuse-lite@1.0.30001636: {} - caniuse-lite@1.0.30001668: {} + caniuse-lite@1.0.30001687: {} canonicalize@1.0.8: {} @@ -14025,7 +13031,7 @@ snapshots: class-validator@0.14.1: dependencies: '@types/validator': 13.12.0 - libphonenumber-js: 1.11.7 + libphonenumber-js: 1.11.3 validator: 13.12.0 clean-stack@2.2.0: {} @@ -14085,7 +13091,7 @@ snapshots: dependencies: '@hapi/bourne': 3.0.0 inflation: 2.1.0 - qs: 6.13.0 + qs: 6.12.1 raw-body: 2.5.2 type-is: 1.6.18 @@ -14159,7 +13165,7 @@ snapshots: compressible@2.0.18: dependencies: - mime-db: 1.53.0 + mime-db: 1.52.0 compression@1.7.4: dependencies: @@ -14212,9 +13218,13 @@ snapshots: depd: 2.0.0 keygrip: 1.1.0 - core-js-compat@3.38.1: + core-js-compat@3.37.1: dependencies: - browserslist: 4.23.3 + browserslist: 4.23.1 + + core-js-compat@3.39.0: + dependencies: + browserslist: 4.24.2 core-util-is@1.0.3: {} @@ -14299,6 +13309,19 @@ snapshots: crypto-random-string@2.0.0: {} + csv-generate@3.4.3: {} + + csv-parse@4.16.3: {} + + csv-stringify@5.6.5: {} + + csv@5.5.3: + dependencies: + csv-generate: 3.4.3 + csv-parse: 4.16.3 + csv-stringify: 5.6.5 + stream-transform: 2.1.3 + d@1.0.2: dependencies: es5-ext: 0.10.64 @@ -14328,7 +13351,7 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.1 - dayjs@1.11.13: {} + dayjs@1.11.11: {} debug@2.6.9: dependencies: @@ -14338,10 +13361,19 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.6: + debug@4.3.5: dependencies: ms: 2.1.2 + debug@4.4.0: + dependencies: + ms: 2.1.3 + + decamelize-keys@1.1.1: + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + decamelize@1.2.0: {} decode-uri-component@0.2.2: {} @@ -14449,7 +13481,7 @@ snapshots: bech32: 2.0.0 canonicalize: 2.0.0 did-resolver: 4.1.0 - elliptic: 6.5.7 + elliptic: 6.5.5 js-sha3: 0.8.0 multiformats: 9.9.0 uint8arrays: 3.1.1 @@ -14457,9 +13489,9 @@ snapshots: did-jwt@7.4.7: dependencies: '@noble/ciphers': 0.4.1 - '@noble/curves': 1.6.0 - '@noble/hashes': 1.5.0 - '@scure/base': 1.1.8 + '@noble/curves': 1.7.0 + '@noble/hashes': 1.6.1 + '@scure/base': 1.2.1 canonicalize: 2.0.0 did-resolver: 4.1.0 multibase: 4.0.6 @@ -14469,9 +13501,9 @@ snapshots: did-jwt@8.0.4: dependencies: '@noble/ciphers': 0.5.3 - '@noble/curves': 1.6.0 - '@noble/hashes': 1.5.0 - '@scure/base': 1.1.8 + '@noble/curves': 1.7.0 + '@noble/hashes': 1.6.1 + '@scure/base': 1.2.1 canonicalize: 2.0.0 did-resolver: 4.1.0 multibase: 4.0.6 @@ -14510,13 +13542,9 @@ snapshots: ee-first@1.1.1: {} - ejs@3.1.10: - dependencies: - jake: 10.9.2 - - electron-to-chromium@1.5.13: {} + electron-to-chromium@1.4.806: {} - electron-to-chromium@1.5.38: {} + electron-to-chromium@1.5.71: {} elliptic@6.5.4: dependencies: @@ -14528,7 +13556,17 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - elliptic@6.5.7: + elliptic@6.5.5: + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + + elliptic@6.6.1: dependencies: bn.js: 4.12.0 brorand: 1.1.0 @@ -14550,7 +13588,7 @@ snapshots: dependencies: once: 1.4.0 - enhanced-resolve@5.17.1: + enhanced-resolve@5.17.0: dependencies: graceful-fs: 4.2.11 tapable: 2.2.1 @@ -14612,7 +13650,7 @@ snapshots: is-string: 1.0.7 is-typed-array: 1.1.13 is-weakref: 1.0.2 - object-inspect: 1.13.2 + object-inspect: 1.13.1 object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.2 @@ -14701,6 +13739,8 @@ snapshots: escalade@3.1.2: {} + escalade@3.2.0: {} + escape-html@1.0.3: {} escape-string-regexp@1.0.5: {} @@ -14725,21 +13765,21 @@ snapshots: eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 - is-core-module: 2.15.0 + is-core-module: 2.13.1 resolve: 1.22.8 transitivePeerDependencies: - supports-color eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0): dependencies: - debug: 4.3.6 - enhanced-resolve: 5.17.1 + debug: 4.3.5 + enhanced-resolve: 5.17.0 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 - get-tsconfig: 4.7.6 - is-core-module: 2.15.0 + get-tsconfig: 4.7.5 + is-core-module: 2.13.1 is-glob: 4.0.3 transitivePeerDependencies: - '@typescript-eslint/parser' @@ -14747,7 +13787,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -14768,9 +13808,9 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 - is-core-module: 2.15.0 + is-core-module: 2.13.1 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 @@ -14807,7 +13847,7 @@ snapshots: eslint@8.57.0: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.11.0 + '@eslint-community/regexpp': 4.10.1 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.57.0 '@humanwhocodes/config-array': 0.11.14 @@ -14817,13 +13857,13 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.6 + debug: 4.3.5 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 - esquery: 1.6.0 + esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 @@ -14831,7 +13871,7 @@ snapshots: glob-parent: 6.0.2 globals: 13.24.0 graphemer: 1.4.0 - ignore: 5.3.2 + ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -14856,13 +13896,13 @@ snapshots: espree@9.6.1: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) + acorn: 8.12.0 + acorn-jsx: 5.3.2(acorn@8.12.0) eslint-visitor-keys: 3.4.3 esprima@4.0.1: {} - esquery@1.6.0: + esquery@1.5.0: dependencies: estraverse: 5.3.0 @@ -14923,70 +13963,35 @@ snapshots: jest-message-util: 29.7.0 jest-util: 29.7.0 - expo-asset@10.0.10(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))): - dependencies: - expo: 51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - expo-constants: 16.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))) - invariant: 2.2.4 - md5-file: 3.2.3 - transitivePeerDependencies: - - supports-color - optional: true - - expo-asset@10.0.10(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))): + expo-asset@10.0.9(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))): dependencies: - expo: 51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - expo-constants: 16.0.2(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))) + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) + expo-constants: 16.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))) invariant: 2.2.4 md5-file: 3.2.3 transitivePeerDependencies: - supports-color - expo-constants@16.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))): + expo-constants@16.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))): dependencies: - '@expo/config': 9.0.3 + '@expo/config': 9.0.1 '@expo/env': 0.3.0 - expo: 51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) transitivePeerDependencies: - supports-color - optional: true - - expo-constants@16.0.2(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))): - dependencies: - '@expo/config': 9.0.3 - '@expo/env': 0.3.0 - expo: 51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - transitivePeerDependencies: - - supports-color - - expo-file-system@17.0.1(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))): - dependencies: - expo: 51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - optional: true - - expo-file-system@17.0.1(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))): - dependencies: - expo: 51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - expo-font@12.0.9(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))): + expo-file-system@17.0.1(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))): dependencies: - expo: 51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - fontfaceobserver: 2.3.0 - optional: true + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) - expo-font@12.0.9(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))): + expo-font@12.0.7(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))): dependencies: - expo: 51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) fontfaceobserver: 2.3.0 - expo-keep-awake@13.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))): - dependencies: - expo: 51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - optional: true - - expo-keep-awake@13.0.2(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))): + expo-keep-awake@13.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))): dependencies: - expo: 51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) expo-modules-autolinking@0.0.3: dependencies: @@ -14997,67 +14002,39 @@ snapshots: fs-extra: 9.1.0 optional: true - expo-modules-autolinking@1.11.2: + expo-modules-autolinking@1.11.1: dependencies: chalk: 4.1.2 commander: 7.2.0 fast-glob: 3.3.2 find-up: 5.0.0 fs-extra: 9.1.0 - require-from-string: 2.0.2 - resolve-from: 5.0.0 - expo-modules-core@1.12.21: + expo-modules-core@1.12.15: dependencies: invariant: 2.2.4 - expo-random@14.0.1(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))): + expo-random@14.0.1(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))): dependencies: base64-js: 1.5.1 - expo: 51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - optional: true - - expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)): - dependencies: - '@babel/runtime': 7.25.0 - '@expo/cli': 0.18.29(expo-modules-autolinking@1.11.2) - '@expo/config': 9.0.3 - '@expo/config-plugins': 8.0.8 - '@expo/metro-config': 0.18.11 - '@expo/vector-icons': 14.0.2 - babel-preset-expo: 11.0.14(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - expo-asset: 10.0.10(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))) - expo-file-system: 17.0.1(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))) - expo-font: 12.0.9(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))) - expo-keep-awake: 13.0.2(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))) - expo-modules-autolinking: 1.11.2 - expo-modules-core: 1.12.21 - fbemitter: 3.0.0 - whatwg-url-without-unicode: 8.0.0-3 - transitivePeerDependencies: - - '@babel/core' - - '@babel/preset-env' - - bufferutil - - encoding - - supports-color - - utf-8-validate + expo: 51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) optional: true - expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)): + expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)): dependencies: - '@babel/runtime': 7.25.0 - '@expo/cli': 0.18.29(expo-modules-autolinking@1.11.2) - '@expo/config': 9.0.3 - '@expo/config-plugins': 8.0.8 - '@expo/metro-config': 0.18.11 + '@babel/runtime': 7.24.7 + '@expo/cli': 0.18.19(expo-modules-autolinking@1.11.1) + '@expo/config': 9.0.1 + '@expo/config-plugins': 8.0.5 + '@expo/metro-config': 0.18.7 '@expo/vector-icons': 14.0.2 - babel-preset-expo: 11.0.14(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8)) - expo-asset: 10.0.10(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))) - expo-file-system: 17.0.1(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))) - expo-font: 12.0.9(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))) - expo-keep-awake: 13.0.2(expo@51.0.29(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))) - expo-modules-autolinking: 1.11.2 - expo-modules-core: 1.12.21 + babel-preset-expo: 11.0.10(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)) + expo-asset: 10.0.9(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))) + expo-file-system: 17.0.1(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))) + expo-font: 12.0.7(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))) + expo-keep-awake: 13.0.2(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))) + expo-modules-autolinking: 1.11.1 + expo-modules-core: 1.12.15 fbemitter: 3.0.0 whatwg-url-without-unicode: 8.0.0-3 transitivePeerDependencies: @@ -15138,9 +14115,7 @@ snapshots: fast-text-encoding@1.0.6: {} - fast-uri@3.0.1: {} - - fast-xml-parser@4.4.1: + fast-xml-parser@4.4.0: dependencies: strnum: 1.0.5 @@ -15197,10 +14172,6 @@ snapshots: strtok3: 6.3.0 token-types: 4.2.1 - filelist@1.0.4: - dependencies: - minimatch: 5.1.6 - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -15260,7 +14231,7 @@ snapshots: dependencies: fast-glob: 3.3.2 type-fest: 3.13.1 - yaml: 2.5.0 + yaml: 2.4.5 find-yarn-workspace-root2@1.2.16: dependencies: @@ -15269,13 +14240,13 @@ snapshots: find-yarn-workspace-root@2.0.0: dependencies: - micromatch: 4.0.8 + micromatch: 4.0.7 fix-esm@1.0.1: dependencies: - '@babel/core': 7.25.2 - '@babel/plugin-proposal-export-namespace-from': 7.18.9(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/plugin-proposal-export-namespace-from': 7.18.9(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.26.0) transitivePeerDependencies: - supports-color @@ -15297,7 +14268,7 @@ snapshots: dependencies: is-callable: 1.2.7 - foreground-child@3.3.0: + foreground-child@3.2.1: dependencies: cross-spawn: 7.0.3 signal-exit: 4.1.0 @@ -15426,7 +14397,7 @@ snapshots: get-symbol-from-current-process-h@1.0.2: {} - get-tsconfig@4.7.6: + get-tsconfig@4.7.5: dependencies: resolve-pkg-maps: 1.0.0 @@ -15449,15 +14420,24 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.4.5: + glob@10.4.2: dependencies: - foreground-child: 3.3.0 - jackspeak: 3.4.3 - minimatch: 9.0.5 + foreground-child: 3.2.1 + jackspeak: 3.4.0 + minimatch: 9.0.4 minipass: 7.1.2 package-json-from-dist: 1.0.0 path-scurry: 1.11.1 + glob@6.0.4: + dependencies: + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + optional: true + glob@7.1.6: dependencies: fs.realpath: 1.0.0 @@ -15499,7 +14479,7 @@ snapshots: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.3.2 - ignore: 5.3.2 + ignore: 5.3.1 merge2: 1.4.1 slash: 3.0.0 @@ -15523,12 +14503,14 @@ snapshots: graceful-fs@4.2.11: {} + grapheme-splitter@1.0.4: {} + graphemer@1.4.0: {} graphql-tag@2.12.6(graphql@15.8.0): dependencies: graphql: 15.8.0 - tslib: 2.6.3 + tslib: 2.8.1 graphql@15.8.0: {} @@ -15539,9 +14521,11 @@ snapshots: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.19.2 + uglify-js: 3.18.0 optional: true + hard-rejection@2.1.0: {} + has-bigints@1.0.2: {} has-flag@3.0.0: {} @@ -15597,6 +14581,8 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 + hosted-git-info@2.8.9: {} + hosted-git-info@3.0.8: dependencies: lru-cache: 6.0.0 @@ -15634,7 +14620,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.6 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -15646,9 +14632,13 @@ snapshots: dependencies: safer-buffer: 2.1.2 + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + ieee754@1.2.1: {} - ignore@5.3.2: {} + ignore@5.3.1: {} image-size@0.6.3: {} @@ -15664,7 +14654,7 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - import-local@3.2.0: + import-local@3.1.0: dependencies: pkg-dir: 4.2.0 resolve-cwd: 3.0.0 @@ -15768,7 +14758,7 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.15.0: + is-core-module@2.13.1: dependencies: hasown: 2.0.2 @@ -15826,6 +14816,8 @@ snapshots: is-path-inside@3.0.3: {} + is-plain-obj@1.1.0: {} + is-plain-object@2.0.4: dependencies: isobject: 3.0.1 @@ -15887,7 +14879,7 @@ snapshots: isobject@3.0.1: {} - isomorphic-webcrypto@2.3.8(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2)))(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)): + isomorphic-webcrypto@2.3.8(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0)))(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)): dependencies: '@peculiar/webcrypto': 1.5.0 asmcrypto.js: 0.22.0 @@ -15899,8 +14891,8 @@ snapshots: optionalDependencies: '@unimodules/core': 7.1.2 '@unimodules/react-native-adapter': 6.3.9 - expo-random: 14.0.1(expo@51.0.29(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))) - react-native-securerandom: 0.1.1(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)) + expo-random: 14.0.1(expo@51.0.14(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))) + react-native-securerandom: 0.1.1(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)) transitivePeerDependencies: - expo - react-native @@ -15913,21 +14905,21 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.25.8 - '@babel/parser': 7.25.3 + '@babel/core': 7.26.0 + '@babel/parser': 7.24.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 transitivePeerDependencies: - supports-color - istanbul-lib-instrument@6.0.3: + istanbul-lib-instrument@6.0.2: dependencies: - '@babel/core': 7.25.8 - '@babel/parser': 7.25.3 + '@babel/core': 7.26.0 + '@babel/parser': 7.24.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.6.3 + semver: 7.6.2 transitivePeerDependencies: - supports-color @@ -15939,7 +14931,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.6 + debug: 4.3.5 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -15950,19 +14942,12 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - jackspeak@3.4.3: + jackspeak@3.4.0: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jake@10.9.2: - dependencies: - async: 3.2.6 - chalk: 4.1.2 - filelist: 1.0.4 - minimatch: 3.1.2 - jest-changed-files@29.7.0: dependencies: execa: 5.1.1 @@ -16003,7 +14988,7 @@ snapshots: chalk: 4.1.2 create-jest: 29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) exit: 0.1.2 - import-local: 3.2.0 + import-local: 3.1.0 jest-config: 29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) jest-util: 29.7.0 jest-validate: 29.7.0 @@ -16016,10 +15001,10 @@ snapshots: jest-config@29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)): dependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.25.8) + babel-jest: 29.7.0(@babel/core@7.26.0) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -16210,15 +15195,15 @@ snapshots: jest-snapshot@29.7.0: dependencies: - '@babel/core': 7.25.8 - '@babel/generator': 7.25.0 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.25.8) - '@babel/types': 7.25.2 + '@babel/core': 7.26.0 + '@babel/generator': 7.24.7 + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.26.0) + '@babel/types': 7.24.7 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.1.0(@babel/core@7.25.8) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.26.0) chalk: 4.1.2 expect: 29.7.0 graceful-fs: 4.2.11 @@ -16229,7 +15214,7 @@ snapshots: jest-util: 29.7.0 natural-compare: 1.4.0 pretty-format: 29.7.0 - semver: 7.6.3 + semver: 7.6.2 transitivePeerDependencies: - supports-color @@ -16297,7 +15282,7 @@ snapshots: dependencies: '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) '@jest/types': 29.6.3 - import-local: 3.2.0 + import-local: 3.1.0 jest-cli: 29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) transitivePeerDependencies: - '@types/node' @@ -16307,7 +15292,7 @@ snapshots: jimp-compact@0.16.1: {} - joi@17.13.3: + joi@17.13.1: dependencies: '@hapi/hoek': 9.3.0 '@hapi/topo': 5.1.0 @@ -16317,7 +15302,7 @@ snapshots: join-component@1.1.0: {} - jose@5.8.0: {} + jose@5.9.6: {} js-base64@3.7.7: {} @@ -16329,7 +15314,7 @@ snapshots: dependencies: asn1.js: 5.4.1 buffer: 6.0.3 - elliptic: 6.5.7 + elliptic: 6.5.5 js-crypto-env: 1.0.5 js-crypto-hash: 1.0.7 js-crypto-key-utils: 1.0.7 @@ -16356,7 +15341,7 @@ snapshots: asn1.js: 5.4.1 buffer: 6.0.3 des.js: 1.1.0 - elliptic: 6.5.7 + elliptic: 6.5.5 js-crypto-aes: 1.0.6 js-crypto-hash: 1.0.7 js-crypto-pbkdf: 1.0.7 @@ -16415,44 +15400,19 @@ snapshots: jsc-safe-url@0.2.4: {} - jscodeshift@0.14.0(@babel/preset-env@7.25.8(@babel/core@7.25.2)): - dependencies: - '@babel/core': 7.25.2 - '@babel/parser': 7.25.3 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) - '@babel/preset-env': 7.25.8(@babel/core@7.25.2) - '@babel/preset-flow': 7.24.7(@babel/core@7.25.2) - '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) - '@babel/register': 7.24.6(@babel/core@7.25.2) - babel-core: 7.0.0-bridge.0(@babel/core@7.25.2) - chalk: 4.1.2 - flow-parser: 0.185.2 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - neo-async: 2.6.2 - node-dir: 0.1.17 - recast: 0.21.5 - temp: 0.8.4 - write-file-atomic: 2.4.3 - transitivePeerDependencies: - - supports-color - - jscodeshift@0.14.0(@babel/preset-env@7.25.8(@babel/core@7.25.8)): - dependencies: - '@babel/core': 7.25.2 - '@babel/parser': 7.25.3 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) - '@babel/preset-env': 7.25.8(@babel/core@7.25.8) - '@babel/preset-flow': 7.24.7(@babel/core@7.25.2) - '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) - '@babel/register': 7.24.6(@babel/core@7.25.2) - babel-core: 7.0.0-bridge.0(@babel/core@7.25.2) + jscodeshift@0.14.0(@babel/preset-env@7.26.0(@babel/core@7.26.0)): + dependencies: + '@babel/core': 7.26.0 + '@babel/parser': 7.24.7 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.26.0) + '@babel/preset-env': 7.26.0(@babel/core@7.26.0) + '@babel/preset-flow': 7.24.7(@babel/core@7.26.0) + '@babel/preset-typescript': 7.24.7(@babel/core@7.26.0) + '@babel/register': 7.24.6(@babel/core@7.26.0) + babel-core: 7.0.0-bridge.0(@babel/core@7.26.0) chalk: 4.1.2 flow-parser: 0.185.2 graceful-fs: 4.2.11 @@ -16516,11 +15476,10 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 - jsonld-signatures@11.3.0(web-streams-polyfill@3.3.3): + jsonld-signatures@11.2.1(web-streams-polyfill@3.3.3): dependencies: '@digitalbazaar/security-context': 1.0.1 jsonld: 8.3.2(web-streams-polyfill@3.3.3) - rdf-canonize: 4.0.1 serialize-error: 8.1.0 transitivePeerDependencies: - web-streams-polyfill @@ -16552,6 +15511,8 @@ snapshots: kleur@3.0.3: {} + kleur@4.1.5: {} + koa-compose@4.1.0: {} koa-convert@2.0.0: @@ -16566,7 +15527,7 @@ snapshots: content-disposition: 0.5.4 content-type: 1.0.5 cookies: 0.9.1 - debug: 4.3.6 + debug: 4.4.0 delegates: 1.0.0 depd: 2.0.0 destroy: 1.2.0 @@ -16627,13 +15588,13 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - libphonenumber-js@1.11.7: {} + libphonenumber-js@1.11.3: {} - libsodium-wrappers@0.7.15: + libsodium-wrappers@0.7.13: dependencies: - libsodium: 0.7.15 + libsodium: 0.7.13 - libsodium@0.7.15: {} + libsodium@0.7.13: {} lighthouse-logger@1.4.2: dependencies: @@ -16736,7 +15697,7 @@ snapshots: logkitty@0.7.1: dependencies: ansi-fragments: 0.2.1 - dayjs: 1.11.13 + dayjs: 1.11.11 yargs: 15.4.1 long@4.0.0: {} @@ -16749,7 +15710,7 @@ snapshots: lowercase-keys@3.0.0: {} - lru-cache@10.4.3: {} + lru-cache@10.2.2: {} lru-cache@4.1.5: dependencies: @@ -16779,7 +15740,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.6.3 + semver: 7.6.2 make-error@1.3.6: {} @@ -16790,6 +15751,10 @@ snapshots: dependencies: tmpl: 1.0.5 + map-obj@1.0.1: {} + + map-obj@4.3.0: {} + marky@1.2.5: {} md5-file@3.2.3: @@ -16816,6 +15781,20 @@ snapshots: memory-cache@0.2.0: {} + meow@6.1.1: + dependencies: + '@types/minimist': 1.2.5 + camelcase-keys: 6.2.2 + decamelize-keys: 1.1.1 + hard-rejection: 2.1.0 + minimist-options: 4.1.0 + normalize-package-data: 2.5.0 + read-pkg-up: 7.0.1 + redent: 3.0.0 + trim-newlines: 3.0.1 + type-fest: 0.13.1 + yargs-parser: 18.1.3 + merge-descriptors@1.0.1: {} merge-stream@2.0.0: {} @@ -16826,7 +15805,7 @@ snapshots: metro-babel-transformer@0.73.10: dependencies: - '@babel/core': 7.25.2 + '@babel/core': 7.26.0 hermes-parser: 0.8.0 metro-source-map: 0.73.10 nullthrows: 1.1.1 @@ -16894,117 +15873,62 @@ snapshots: metro-minify-terser@0.73.10: dependencies: - terser: 5.31.6 + terser: 5.31.1 metro-minify-uglify@0.73.10: dependencies: uglify-es: 3.3.9 - metro-react-native-babel-preset@0.73.10(@babel/core@7.25.2): - dependencies: - '@babel/core': 7.25.2 - '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.25.2) - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-export-default-from': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.25.2) - '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.25.2) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.25.2) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.2) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-async-to-generator': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.25.2) - '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.25.2) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.25.2) - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.25.2) - '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.2) - '@babel/plugin-transform-named-capturing-groups-regex': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-sticky-regex': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.25.2) - '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.2) - '@babel/plugin-transform-unicode-regex': 7.24.7(@babel/core@7.25.2) - '@babel/template': 7.25.0 + metro-react-native-babel-preset@0.73.10(@babel/core@7.26.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.26.0) + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-export-default-from': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.26.0) + '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.26.0) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.26.0) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.26.0) + '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-async-to-generator': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-block-scoping': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-classes': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-destructuring': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-function-name': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-literals': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-named-capturing-groups-regex': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-sticky-regex': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-typescript': 7.24.7(@babel/core@7.26.0) + '@babel/plugin-transform-unicode-regex': 7.24.7(@babel/core@7.26.0) + '@babel/template': 7.24.7 react-refresh: 0.4.3 transitivePeerDependencies: - supports-color - metro-react-native-babel-preset@0.73.10(@babel/core@7.25.8): - dependencies: - '@babel/core': 7.25.8 - '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.25.8) - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-export-default-from': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.25.8) - '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.25.8) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.25.8) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-export-default-from': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.8) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-async-to-generator': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.25.8) - '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.25.8) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.25.8) - '@babel/plugin-transform-flow-strip-types': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.25.8) - '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.25.8) - '@babel/plugin-transform-named-capturing-groups-regex': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-sticky-regex': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.25.8) - '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.8) - '@babel/plugin-transform-unicode-regex': 7.24.7(@babel/core@7.25.8) - '@babel/template': 7.25.0 - react-refresh: 0.4.3 - transitivePeerDependencies: - - supports-color - - metro-react-native-babel-transformer@0.73.10(@babel/core@7.25.2): - dependencies: - '@babel/core': 7.25.2 - babel-preset-fbjs: 3.4.0(@babel/core@7.25.2) - hermes-parser: 0.8.0 - metro-babel-transformer: 0.73.10 - metro-react-native-babel-preset: 0.73.10(@babel/core@7.25.2) - metro-source-map: 0.73.10 - nullthrows: 1.1.1 - transitivePeerDependencies: - - supports-color - - metro-react-native-babel-transformer@0.73.10(@babel/core@7.25.8): + metro-react-native-babel-transformer@0.73.10(@babel/core@7.26.0): dependencies: - '@babel/core': 7.25.8 - babel-preset-fbjs: 3.4.0(@babel/core@7.25.8) + '@babel/core': 7.26.0 + babel-preset-fbjs: 3.4.0(@babel/core@7.26.0) hermes-parser: 0.8.0 metro-babel-transformer: 0.73.10 - metro-react-native-babel-preset: 0.73.10(@babel/core@7.25.8) + metro-react-native-babel-preset: 0.73.10(@babel/core@7.26.0) metro-source-map: 0.73.10 nullthrows: 1.1.1 transitivePeerDependencies: @@ -17016,13 +15940,13 @@ snapshots: metro-runtime@0.73.10: dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 react-refresh: 0.4.3 metro-source-map@0.73.10: dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 invariant: 2.2.4 metro-symbolicate: 0.73.10 nullthrows: 1.1.1 @@ -17045,21 +15969,21 @@ snapshots: metro-transform-plugins@0.73.10: dependencies: - '@babel/core': 7.25.2 - '@babel/generator': 7.25.0 - '@babel/template': 7.25.0 - '@babel/traverse': 7.25.3 + '@babel/core': 7.26.0 + '@babel/generator': 7.24.7 + '@babel/template': 7.24.7 + '@babel/traverse': 7.24.7 nullthrows: 1.1.1 transitivePeerDependencies: - supports-color metro-transform-worker@0.73.10: dependencies: - '@babel/core': 7.25.2 - '@babel/generator': 7.25.0 - '@babel/parser': 7.25.3 - '@babel/types': 7.25.2 - babel-preset-fbjs: 3.4.0(@babel/core@7.25.2) + '@babel/core': 7.26.0 + '@babel/generator': 7.24.7 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 + babel-preset-fbjs: 3.4.0(@babel/core@7.26.0) metro: 0.73.10 metro-babel-transformer: 0.73.10 metro-cache: 0.73.10 @@ -17077,15 +16001,15 @@ snapshots: metro@0.73.10: dependencies: '@babel/code-frame': 7.24.7 - '@babel/core': 7.25.2 - '@babel/generator': 7.25.0 - '@babel/parser': 7.25.3 - '@babel/template': 7.25.0 - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/core': 7.26.0 + '@babel/generator': 7.24.7 + '@babel/parser': 7.24.7 + '@babel/template': 7.24.7 + '@babel/traverse': 7.24.7 + '@babel/types': 7.24.7 absolute-path: 0.0.0 accepts: 1.3.8 - async: 3.2.6 + async: 3.2.5 chalk: 4.1.2 ci-info: 2.0.0 connect: 3.7.0 @@ -17109,7 +16033,7 @@ snapshots: metro-inspector-proxy: 0.73.10 metro-minify-terser: 0.73.10 metro-minify-uglify: 0.73.10 - metro-react-native-babel-preset: 0.73.10(@babel/core@7.25.2) + metro-react-native-babel-preset: 0.73.10(@babel/core@7.26.0) metro-resolver: 0.73.10 metro-runtime: 0.73.10 metro-source-map: 0.73.10 @@ -17138,15 +16062,8 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 - micromatch@4.0.8: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - mime-db@1.52.0: {} - mime-db@1.53.0: {} - mime-types@2.1.35: dependencies: mime-db: 1.52.0 @@ -17163,6 +16080,8 @@ snapshots: mimic-response@4.0.0: {} + min-indent@1.0.1: {} + minimalistic-assert@1.0.1: {} minimalistic-crypto-utils@1.0.1: {} @@ -17171,17 +16090,19 @@ snapshots: dependencies: brace-expansion: 1.1.11 - minimatch@5.1.6: + minimatch@8.0.4: dependencies: brace-expansion: 2.0.1 - minimatch@8.0.4: + minimatch@9.0.4: dependencies: brace-expansion: 2.0.1 - minimatch@9.0.5: + minimist-options@4.1.0: dependencies: - brace-expansion: 2.0.1 + arrify: 1.0.1 + is-plain-obj: 1.1.0 + kind-of: 6.0.3 minimist@1.2.8: {} @@ -17212,6 +16133,8 @@ snapshots: minipass: 3.3.6 yallist: 4.0.0 + mixme@0.5.10: {} + mkdirp@0.5.6: dependencies: minimist: 1.2.8 @@ -17220,8 +16143,6 @@ snapshots: mkdirp@2.1.6: {} - mri@1.2.0: {} - ms@2.0.0: {} ms@2.1.2: {} @@ -17252,6 +16173,13 @@ snapshots: mute-stream@0.0.8: {} + mv@2.1.1: + dependencies: + mkdirp: 0.5.6 + ncp: 2.0.0 + rimraf: 2.4.5 + optional: true + mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -17260,10 +16188,13 @@ snapshots: nanoid@3.3.7: {} - nanoid@5.0.7: {} + nanoid@5.0.9: {} natural-compare@1.4.0: {} + ncp@2.0.0: + optional: true + negotiator@0.6.3: {} neo-async@2.6.2: {} @@ -17279,7 +16210,7 @@ snapshots: inquirer: 7.3.3 make-promises-safe: 5.1.0 rimraf: 3.0.2 - semver: 7.6.3 + semver: 7.6.2 toml: 3.0.0 ts-typed-json: 0.3.2 validate-npm-package-license: 3.0.4 @@ -17333,6 +16264,8 @@ snapshots: node-int64@0.4.0: {} + node-releases@2.0.14: {} + node-releases@2.0.18: {} node-stream-zip@1.15.0: {} @@ -17341,6 +16274,13 @@ snapshots: dependencies: abbrev: 1.1.1 + normalize-package-data@2.5.0: + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.8 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + normalize-path@3.0.0: {} normalize-url@8.0.1: {} @@ -17375,7 +16315,7 @@ snapshots: object-hash@3.0.0: {} - object-inspect@1.13.2: {} + object-inspect@1.13.1: {} object-keys@1.1.1: {} @@ -17405,21 +16345,21 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.0.0 - oidc-provider@8.5.1: + oidc-provider@8.6.0: dependencies: '@koa/cors': 5.0.0 - '@koa/router': 12.0.1 - debug: 4.3.6 + '@koa/router': 13.1.0 + debug: 4.4.0 eta: 3.5.0 got: 13.0.0 - jose: 5.8.0 + jose: 5.9.6 jsesc: 3.0.2 koa: 2.15.3 - nanoid: 5.0.7 + nanoid: 5.0.9 object-hash: 3.0.0 oidc-token-hash: 5.0.3 quick-lru: 7.0.0 - raw-body: 2.5.2 + raw-body: 3.0.0 transitivePeerDependencies: - supports-color @@ -17605,12 +16545,12 @@ snapshots: path-scurry@1.11.1: dependencies: - lru-cache: 10.4.3 + lru-cache: 10.2.2 minipass: 7.1.2 path-to-regexp@0.1.7: {} - path-to-regexp@6.2.2: {} + path-to-regexp@6.3.0: {} path-type@4.0.0: {} @@ -17618,6 +16558,8 @@ snapshots: picocolors@1.0.1: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} picomatch@3.0.1: {} @@ -17636,12 +16578,12 @@ snapshots: pkijs@3.2.4: dependencies: - '@noble/hashes': 1.5.0 + '@noble/hashes': 1.6.1 asn1js: 3.0.5 bytestreamjs: 2.0.1 pvtsutils: 1.3.5 pvutils: 1.1.3 - tslib: 2.6.3 + tslib: 2.8.1 plist@3.1.0: dependencies: @@ -17653,18 +16595,18 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss@8.4.41: + postcss@8.4.38: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 + picocolors: 1.1.1 source-map-js: 1.2.0 - preferred-pm@3.1.4: + preferred-pm@3.1.3: dependencies: find-up: 5.0.0 find-yarn-workspace-root2: 1.2.16 path-exists: 4.0.0 - which-pm: 2.2.0 + which-pm: 2.0.0 prelude-ls@1.1.2: {} @@ -17678,13 +16620,6 @@ snapshots: pretty-bytes@5.6.0: {} - pretty-format@24.9.0: - dependencies: - '@jest/types': 24.9.0 - ansi-regex: 4.1.1 - ansi-styles: 3.2.1 - react-is: 16.13.1 - pretty-format@26.6.2: dependencies: '@jest/types': 26.6.2 @@ -17782,7 +16717,7 @@ snapshots: dependencies: side-channel: 1.0.6 - qs@6.13.0: + qs@6.12.1: dependencies: side-channel: 1.0.6 @@ -17797,6 +16732,8 @@ snapshots: queue-microtask@1.2.3: {} + quick-lru@4.0.1: {} + quick-lru@5.1.1: {} quick-lru@7.0.0: {} @@ -17810,6 +16747,13 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 + raw-body@3.0.0: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.6.3 + unpipe: 1.0.0 + rc@1.2.8: dependencies: deep-extend: 0.6.0 @@ -17821,10 +16765,6 @@ snapshots: dependencies: setimmediate: 1.0.5 - rdf-canonize@4.0.1: - dependencies: - setimmediate: 1.0.5 - react-devtools-core@4.28.5: dependencies: shell-quote: 1.8.1 @@ -17839,95 +16779,39 @@ snapshots: react-is@18.3.1: {} - react-native-codegen@0.71.6(@babel/preset-env@7.25.8(@babel/core@7.25.2)): - dependencies: - '@babel/parser': 7.25.3 - flow-parser: 0.185.2 - jscodeshift: 0.14.0(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - nullthrows: 1.1.1 - transitivePeerDependencies: - - '@babel/preset-env' - - supports-color - - react-native-codegen@0.71.6(@babel/preset-env@7.25.8(@babel/core@7.25.8)): + react-native-codegen@0.71.6(@babel/preset-env@7.26.0(@babel/core@7.26.0)): dependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.24.7 flow-parser: 0.185.2 - jscodeshift: 0.14.0(@babel/preset-env@7.25.8(@babel/core@7.25.8)) + jscodeshift: 0.14.0(@babel/preset-env@7.26.0(@babel/core@7.26.0)) nullthrows: 1.1.1 transitivePeerDependencies: - '@babel/preset-env' - supports-color - react-native-fs@2.20.0(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)): + react-native-fs@2.20.0(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)): dependencies: base-64: 0.1.0 - react-native: 0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1) + react-native: 0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1) utf8: 3.0.0 - react-native-get-random-values@1.11.0(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)): + react-native-get-random-values@1.11.0(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)): dependencies: fast-base64-decode: 1.0.0 - react-native: 0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1) + react-native: 0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1) react-native-gradle-plugin@0.71.19: {} - react-native-securerandom@0.1.1(react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1)): + react-native-securerandom@0.1.1(react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1)): dependencies: base64-js: 1.5.1 - react-native: 0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1) + react-native: 0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1) optional: true - react-native@0.71.19(@babel/core@7.25.2)(@babel/preset-env@7.25.8(@babel/core@7.25.2))(react@18.3.1): - dependencies: - '@jest/create-cache-key-function': 29.7.0 - '@react-native-community/cli': 10.2.7(@babel/core@7.25.2) - '@react-native-community/cli-platform-android': 10.2.0 - '@react-native-community/cli-platform-ios': 10.2.5 - '@react-native/assets': 1.0.0 - '@react-native/normalize-color': 2.1.0 - '@react-native/polyfills': 2.0.0 - abort-controller: 3.0.0 - anser: 1.4.10 - ansi-regex: 5.0.1 - base64-js: 1.5.1 - deprecated-react-native-prop-types: 3.0.2 - event-target-shim: 5.0.1 - invariant: 2.2.4 - jest-environment-node: 29.7.0 - jsc-android: 250231.0.0 - memoize-one: 5.2.1 - metro-react-native-babel-transformer: 0.73.10(@babel/core@7.25.2) - metro-runtime: 0.73.10 - metro-source-map: 0.73.10 - mkdirp: 0.5.6 - nullthrows: 1.1.1 - pretty-format: 26.6.2 - promise: 8.3.0 - react: 18.3.1 - react-devtools-core: 4.28.5 - react-native-codegen: 0.71.6(@babel/preset-env@7.25.8(@babel/core@7.25.2)) - react-native-gradle-plugin: 0.71.19 - react-refresh: 0.4.3 - react-shallow-renderer: 16.15.0(react@18.3.1) - regenerator-runtime: 0.13.11 - scheduler: 0.23.2 - stacktrace-parser: 0.1.10 - use-sync-external-store: 1.2.2(react@18.3.1) - whatwg-fetch: 3.6.20 - ws: 6.2.3 - transitivePeerDependencies: - - '@babel/core' - - '@babel/preset-env' - - bufferutil - - encoding - - supports-color - - utf-8-validate - - react-native@0.71.19(@babel/core@7.25.8)(@babel/preset-env@7.25.8(@babel/core@7.25.8))(react@18.3.1): + react-native@0.71.19(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@18.3.1): dependencies: '@jest/create-cache-key-function': 29.7.0 - '@react-native-community/cli': 10.2.7(@babel/core@7.25.8) + '@react-native-community/cli': 10.2.7(@babel/core@7.26.0) '@react-native-community/cli-platform-android': 10.2.0 '@react-native-community/cli-platform-ios': 10.2.5 '@react-native/assets': 1.0.0 @@ -17943,7 +16827,7 @@ snapshots: jest-environment-node: 29.7.0 jsc-android: 250231.0.0 memoize-one: 5.2.1 - metro-react-native-babel-transformer: 0.73.10(@babel/core@7.25.8) + metro-react-native-babel-transformer: 0.73.10(@babel/core@7.26.0) metro-runtime: 0.73.10 metro-source-map: 0.73.10 mkdirp: 0.5.6 @@ -17952,7 +16836,7 @@ snapshots: promise: 8.3.0 react: 18.3.1 react-devtools-core: 4.28.5 - react-native-codegen: 0.71.6(@babel/preset-env@7.25.8(@babel/core@7.25.8)) + react-native-codegen: 0.71.6(@babel/preset-env@7.26.0(@babel/core@7.26.0)) react-native-gradle-plugin: 0.71.19 react-refresh: 0.4.3 react-shallow-renderer: 16.15.0(react@18.3.1) @@ -17984,6 +16868,19 @@ snapshots: dependencies: loose-envify: 1.4.0 + read-pkg-up@7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + + read-pkg@5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + read-yaml-file@1.1.0: dependencies: graceful-fs: 4.2.11 @@ -18020,7 +16917,12 @@ snapshots: ast-types: 0.15.2 esprima: 4.0.1 source-map: 0.6.1 - tslib: 2.6.3 + tslib: 2.8.1 + + redent@3.0.0: + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 reduce-flatten@2.0.0: optional: true @@ -18058,7 +16960,7 @@ snapshots: regenerator-transform@0.15.2: dependencies: - '@babel/runtime': 7.25.0 + '@babel/runtime': 7.24.7 regexp.prototype.flags@1.5.2: dependencies: @@ -18076,18 +16978,18 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.1.0 - regexpu-core@6.1.1: + regexpu-core@6.2.0: dependencies: regenerate: 1.4.2 regenerate-unicode-properties: 10.2.0 regjsgen: 0.8.0 - regjsparser: 0.11.1 + regjsparser: 0.12.0 unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.1.0 regjsgen@0.8.0: {} - regjsparser@0.11.1: + regjsparser@0.12.0: dependencies: jsesc: 3.0.2 @@ -18129,7 +17031,7 @@ snapshots: resolve@1.22.8: dependencies: - is-core-module: 2.15.0 + is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -18157,10 +17059,19 @@ snapshots: rimraf@2.2.8: {} + rimraf@2.4.5: + dependencies: + glob: 6.0.4 + optional: true + rimraf@2.6.3: dependencies: glob: 7.2.3 + rimraf@2.7.1: + dependencies: + glob: 7.2.3 + rimraf@3.0.2: dependencies: glob: 7.2.3 @@ -18195,6 +17106,9 @@ snapshots: safe-buffer@5.2.1: {} + safe-json-stringify@1.2.0: + optional: true + safe-regex-test@1.0.3: dependencies: call-bind: 1.0.7 @@ -18209,9 +17123,9 @@ snapshots: dependencies: loose-envify: 1.4.0 - secp256k1@5.0.0: + secp256k1@5.0.1: dependencies: - elliptic: 6.5.7 + elliptic: 6.6.1 node-addon-api: 5.1.0 node-gyp-build: 4.8.1 @@ -18224,7 +17138,7 @@ snapshots: semver@6.3.1: {} - semver@7.6.3: {} + semver@7.6.2: {} send@0.18.0: dependencies: @@ -18313,7 +17227,7 @@ snapshots: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 - object-inspect: 1.13.2 + object-inspect: 1.13.1 signal-exit@3.0.7: {} @@ -18337,6 +17251,15 @@ snapshots: slugify@1.6.6: {} + smartwrap@2.0.2: + dependencies: + array.prototype.flat: 1.3.2 + breakword: 1.0.6 + grapheme-splitter: 1.0.4 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 15.4.1 + source-map-js@1.2.0: {} source-map-support@0.5.13: @@ -18363,20 +17286,16 @@ snapshots: spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.20 - optional: true + spdx-license-ids: 3.0.18 - spdx-exceptions@2.5.0: - optional: true + spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.20 - optional: true + spdx-license-ids: 3.0.18 - spdx-license-ids@3.0.20: - optional: true + spdx-license-ids@3.0.18: {} split-on-first@1.1.0: {} @@ -18412,6 +17331,10 @@ snapshots: stream-buffers@2.2.0: {} + stream-transform@2.1.3: + dependencies: + mixme: 0.5.10 + streamsearch@1.1.0: {} strict-event-emitter@0.5.1: {} @@ -18482,6 +17405,10 @@ snapshots: strip-final-newline@2.0.0: {} + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + strip-json-comments@2.0.1: {} strip-json-comments@3.1.1: {} @@ -18515,13 +17442,13 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.3.6 + debug: 4.3.5 fast-safe-stringify: 2.1.1 form-data: 4.0.0 formidable: 3.5.2 methods: 1.1.2 mime: 2.6.0 - qs: 6.13.0 + qs: 6.12.1 transitivePeerDependencies: - supports-color @@ -18606,10 +17533,10 @@ snapshots: ansi-escapes: 4.3.2 supports-hyperlinks: 2.3.0 - terser@5.31.6: + terser@5.31.1: dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.12.1 + acorn: 8.12.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -18668,32 +17595,31 @@ snapshots: typedarray.prototype.slice: 1.0.3 which-typed-array: 1.1.15 - trim-right@1.0.1: {} + trim-newlines@3.0.1: {} - ts-api-utils@1.3.0(typescript@5.5.4): + ts-api-utils@1.4.3(typescript@5.5.4): dependencies: typescript: 5.5.4 ts-interface-checker@0.1.13: {} - ts-jest@29.2.4(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)))(typescript@5.5.4): + ts-jest@29.1.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)))(typescript@5.5.4): dependencies: bs-logger: 0.2.6 - ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 - semver: 7.6.3 + semver: 7.6.2 typescript: 5.5.4 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.25.8 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.25.8) + babel-jest: 29.7.0(@babel/core@7.26.0) ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4): dependencies: @@ -18703,7 +17629,7 @@ snapshots: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 '@types/node': 18.18.8 - acorn: 8.12.1 + acorn: 8.12.0 acorn-walk: 8.3.3 arg: 4.1.3 create-require: 1.1.1 @@ -18727,14 +17653,16 @@ snapshots: tslib@2.6.3: {} + tslib@2.8.1: {} + tslog@4.9.3: {} tsscmp@1.0.6: {} - tsx@4.19.0: + tsx@4.19.2: dependencies: esbuild: 0.23.1 - get-tsconfig: 4.7.6 + get-tsconfig: 4.7.5 optionalDependencies: fsevents: 2.3.3 @@ -18742,6 +17670,16 @@ snapshots: dependencies: tslib: 1.14.1 + tty-table@4.2.3: + dependencies: + chalk: 4.1.2 + csv: 5.5.3 + kleur: 4.1.5 + smartwrap: 2.0.2 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 17.7.2 + type-check@0.3.2: dependencies: prelude-ls: 1.1.2 @@ -18752,6 +17690,8 @@ snapshots: type-detect@4.0.8: {} + type-fest@0.13.1: {} + type-fest@0.16.0: {} type-fest@0.20.2: {} @@ -18760,8 +17700,12 @@ snapshots: type-fest@0.3.1: {} + type-fest@0.6.0: {} + type-fest@0.7.1: {} + type-fest@0.8.1: {} + type-fest@3.13.1: {} type-is@1.6.18: @@ -18821,14 +17765,14 @@ snapshots: buffer: 6.0.3 chalk: 4.1.2 cli-highlight: 2.1.11 - dayjs: 1.11.13 - debug: 4.3.6 + dayjs: 1.11.11 + debug: 4.3.5 dotenv: 16.4.5 - glob: 10.4.5 + glob: 10.4.2 mkdirp: 2.1.6 reflect-metadata: 0.2.2 sha.js: 2.4.11 - tslib: 2.6.3 + tslib: 2.8.1 uuid: 9.0.1 yargs: 17.7.2 optionalDependencies: @@ -18851,7 +17795,7 @@ snapshots: commander: 2.13.0 source-map: 0.6.1 - uglify-js@3.19.2: + uglify-js@3.18.0: optional: true uint8arrays@3.1.1: @@ -18867,7 +17811,7 @@ snapshots: undici-types@5.26.5: {} - undici@6.20.1: {} + undici@6.21.0: {} unicode-canonical-property-names-ecmascript@2.0.0: {} @@ -18904,17 +17848,17 @@ snapshots: unpipe@1.0.0: {} - update-browserslist-db@1.1.0(browserslist@4.23.3): + update-browserslist-db@1.0.16(browserslist@4.23.1): dependencies: - browserslist: 4.23.3 + browserslist: 4.23.1 escalade: 3.1.2 picocolors: 1.0.1 - update-browserslist-db@1.1.0(browserslist@4.24.0): + update-browserslist-db@1.1.1(browserslist@4.24.2): dependencies: - browserslist: 4.24.0 - escalade: 3.1.2 - picocolors: 1.0.1 + browserslist: 4.24.2 + escalade: 3.2.0 + picocolors: 1.1.1 uri-js@4.4.1: dependencies: @@ -18955,7 +17899,7 @@ snapshots: v8-compile-cache-lib@3.0.1: {} - v8-to-istanbul@9.3.0: + v8-to-istanbul@9.2.0: dependencies: '@jridgewell/trace-mapping': 0.3.25 '@types/istanbul-lib-coverage': 2.0.6 @@ -18971,7 +17915,6 @@ snapshots: dependencies: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - optional: true validate-npm-package-name@3.0.0: dependencies: @@ -19045,7 +17988,7 @@ snapshots: which-module@2.0.1: {} - which-pm@2.2.0: + which-pm@2.0.0: dependencies: load-yaml-file: 0.2.0 path-exists: 4.0.0 @@ -19120,7 +18063,7 @@ snapshots: ws@7.5.10: {} - ws@8.18.0: {} + ws@8.17.1: {} xcode@3.0.1: dependencies: @@ -19155,7 +18098,7 @@ snapshots: yallist@4.0.0: {} - yaml@2.5.0: {} + yaml@2.4.5: {} yargs-parser@18.1.3: dependencies: @@ -19214,8 +18157,4 @@ snapshots: optionalDependencies: commander: 9.5.0 - zod-validation-error@2.1.0(zod@3.23.8): - dependencies: - zod: 3.23.8 - zod@3.23.8: {} diff --git a/samples/extension-module/dummy/DummyApi.ts b/samples/extension-module/dummy/DummyApi.ts index 5083a5b66e..de0aff77ea 100644 --- a/samples/extension-module/dummy/DummyApi.ts +++ b/samples/extension-module/dummy/DummyApi.ts @@ -1,9 +1,9 @@ import type { DummyRecord } from './repository/DummyRecord' import type { Query, QueryOptions } from '@credo-ts/core' -import { getOutboundMessageContext, AgentContext, ConnectionService, injectable, MessageSender } from '@credo-ts/core' +import { AgentContext, injectable } from '@credo-ts/core' +import { getOutboundMessageContext, ConnectionService, MessageSender } from '@credo-ts/didcomm' -import { DummyRequestHandler, DummyResponseHandler } from './handlers' import { DummyState } from './repository' import { DummyService } from './services' @@ -24,11 +24,6 @@ export class DummyApi { this.dummyService = dummyService this.connectionService = connectionService this.agentContext = agentContext - - this.agentContext.dependencyManager.registerMessageHandlers([ - new DummyRequestHandler(this.dummyService), - new DummyResponseHandler(this.dummyService), - ]) } /** diff --git a/samples/extension-module/dummy/DummyModule.ts b/samples/extension-module/dummy/DummyModule.ts index f7669486c9..c48d0d80fc 100644 --- a/samples/extension-module/dummy/DummyModule.ts +++ b/samples/extension-module/dummy/DummyModule.ts @@ -1,10 +1,11 @@ import type { DummyModuleConfigOptions } from './DummyModuleConfig' -import type { DependencyManager, FeatureRegistry, Module } from '@credo-ts/core' +import type { AgentContext, DependencyManager, Module } from '@credo-ts/core' -import { Protocol } from '@credo-ts/core' +import { FeatureRegistry, MessageHandlerRegistry, Protocol } from '@credo-ts/didcomm' import { DummyApi } from './DummyApi' import { DummyModuleConfig } from './DummyModuleConfig' +import { DummyRequestHandler, DummyResponseHandler } from './handlers' import { DummyRepository } from './repository' import { DummyService } from './services' @@ -17,14 +18,27 @@ export class DummyModule implements Module { this.config = new DummyModuleConfig(config) } - public register(dependencyManager: DependencyManager, featureRegistry: FeatureRegistry) { + public register(dependencyManager: DependencyManager) { // Config dependencyManager.registerInstance(DummyModuleConfig, this.config) + // Repository dependencyManager.registerSingleton(DummyRepository) + + // Service dependencyManager.registerSingleton(DummyService) + } + + public async initialize(agentContext: AgentContext): Promise { + const messageHandlerRegistry = agentContext.dependencyManager.resolve(MessageHandlerRegistry) + const featureRegistry = agentContext.dependencyManager.resolve(FeatureRegistry) + const dummyService = agentContext.dependencyManager.resolve(DummyService) + + messageHandlerRegistry.registerMessageHandlers([ + new DummyRequestHandler(dummyService), + new DummyResponseHandler(dummyService), + ]) - // Features featureRegistry.register( new Protocol({ id: 'https://didcomm.org/dummy/1.0', diff --git a/samples/extension-module/dummy/handlers/DummyRequestHandler.ts b/samples/extension-module/dummy/handlers/DummyRequestHandler.ts index 928c070af0..e9a69f970b 100644 --- a/samples/extension-module/dummy/handlers/DummyRequestHandler.ts +++ b/samples/extension-module/dummy/handlers/DummyRequestHandler.ts @@ -1,7 +1,7 @@ import type { DummyService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' -import { getOutboundMessageContext } from '@credo-ts/core' +import { getOutboundMessageContext } from '@credo-ts/didcomm' import { DummyRequestMessage } from '../messages' diff --git a/samples/extension-module/dummy/handlers/DummyResponseHandler.ts b/samples/extension-module/dummy/handlers/DummyResponseHandler.ts index 194a57f639..8b01e193f3 100644 --- a/samples/extension-module/dummy/handlers/DummyResponseHandler.ts +++ b/samples/extension-module/dummy/handlers/DummyResponseHandler.ts @@ -1,5 +1,5 @@ import type { DummyService } from '../services' -import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core' +import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/didcomm' import { DummyResponseMessage } from '../messages' diff --git a/samples/extension-module/dummy/messages/DummyRequestMessage.ts b/samples/extension-module/dummy/messages/DummyRequestMessage.ts index 871c8de61d..5a710cc503 100644 --- a/samples/extension-module/dummy/messages/DummyRequestMessage.ts +++ b/samples/extension-module/dummy/messages/DummyRequestMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType, ReturnRouteTypes } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType, ReturnRouteTypes } from '@credo-ts/didcomm' export interface DummyRequestMessageOptions { id?: string diff --git a/samples/extension-module/dummy/messages/DummyResponseMessage.ts b/samples/extension-module/dummy/messages/DummyResponseMessage.ts index ce4e32ebbe..1a8b7f3b6f 100644 --- a/samples/extension-module/dummy/messages/DummyResponseMessage.ts +++ b/samples/extension-module/dummy/messages/DummyResponseMessage.ts @@ -1,4 +1,4 @@ -import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core' +import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm' export interface DummyResponseMessageOptions { id?: string diff --git a/samples/extension-module/dummy/services/DummyService.ts b/samples/extension-module/dummy/services/DummyService.ts index 98e05502c2..62b50d4664 100644 --- a/samples/extension-module/dummy/services/DummyService.ts +++ b/samples/extension-module/dummy/services/DummyService.ts @@ -1,5 +1,6 @@ import type { DummyStateChangedEvent } from './DummyEvents' -import type { Query, QueryOptions, AgentContext, ConnectionRecord, InboundMessageContext } from '@credo-ts/core' +import type { Query, QueryOptions, AgentContext } from '@credo-ts/core' +import type { ConnectionRecord, InboundMessageContext } from '@credo-ts/didcomm' import { injectable, EventEmitter } from '@credo-ts/core' diff --git a/samples/extension-module/package.json b/samples/extension-module/package.json index 7edfc4069e..670f00f7a2 100644 --- a/samples/extension-module/package.json +++ b/samples/extension-module/package.json @@ -20,6 +20,7 @@ }, "dependencies": { "@credo-ts/core": "workspace:*", + "@credo-ts/didcomm": "workspace:*", "@credo-ts/node": "workspace:*", "@credo-ts/askar": "workspace:*", "class-validator": "0.14.1", diff --git a/samples/extension-module/requester.ts b/samples/extension-module/requester.ts index a2e4d29b9f..7b5502b6c9 100644 --- a/samples/extension-module/requester.ts +++ b/samples/extension-module/requester.ts @@ -1,15 +1,17 @@ import type { DummyRecord, DummyStateChangedEvent } from './dummy' +import { AskarModule } from '@credo-ts/askar' +import { Agent, CredoError, ConsoleLogger, LogLevel } from '@credo-ts/core' import { HttpOutboundTransport, - Agent, - CredoError, - ConsoleLogger, - LogLevel, WsOutboundTransport, ConnectionsModule, -} from '@credo-ts/core' + DidCommModule, + OutOfBandModule, + MessagePickupModule, +} from '@credo-ts/didcomm' import { agentDependencies } from '@credo-ts/node' +import { ariesAskar } from '@hyperledger/aries-askar-nodejs' import { filter, first, firstValueFrom, map, ReplaySubject, timeout } from 'rxjs' import { DummyEventTypes, DummyState, DummyModule } from './dummy' @@ -31,6 +33,10 @@ const run = async () => { logger: new ConsoleLogger(LogLevel.info), }, modules: { + askar: new AskarModule({ ariesAskar }), + didcomm: new DidCommModule(), + oob: new OutOfBandModule(), + messagePickup: new MessagePickupModule(), dummy: new DummyModule(), connections: new ConnectionsModule({ autoAcceptConnections: true, @@ -40,8 +46,8 @@ const run = async () => { }) // Register transports - agent.registerOutboundTransport(wsOutboundTransport) - agent.registerOutboundTransport(httpOutboundTransport) + agent.modules.didcomm.registerOutboundTransport(wsOutboundTransport) + agent.modules.didcomm.registerOutboundTransport(httpOutboundTransport) // Now agent will handle messages and events from Dummy protocol @@ -50,11 +56,11 @@ const run = async () => { // Connect to responder using its invitation endpoint const invitationUrl = await (await agentDependencies.fetch(`http://localhost:${port}/invitation`)).text() - const { connectionRecord } = await agent.oob.receiveInvitationFromUrl(invitationUrl) + const { connectionRecord } = await agent.modules.oob.receiveInvitationFromUrl(invitationUrl) if (!connectionRecord) { throw new CredoError('Connection record for out-of-band invitation was not created.') } - await agent.connections.returnWhenIsConnected(connectionRecord.id) + await agent.modules.connections.returnWhenIsConnected(connectionRecord.id) // Create observable for Response Received event const observable = agent.events.observable(DummyEventTypes.StateChanged) diff --git a/samples/extension-module/responder.ts b/samples/extension-module/responder.ts index f1b3e655d5..67934d7f15 100644 --- a/samples/extension-module/responder.ts +++ b/samples/extension-module/responder.ts @@ -1,8 +1,11 @@ import type { DummyStateChangedEvent } from './dummy' import type { Socket } from 'net' -import { Agent, ConnectionsModule, ConsoleLogger, LogLevel } from '@credo-ts/core' +import { AskarModule } from '@credo-ts/askar' +import { Agent, ConsoleLogger, LogLevel } from '@credo-ts/core' +import { ConnectionsModule, DidCommModule, MessagePickupModule, OutOfBandModule } from '@credo-ts/didcomm' import { agentDependencies, HttpInboundTransport, WsInboundTransport } from '@credo-ts/node' +import { ariesAskar } from '@hyperledger/aries-askar-nodejs' import express from 'express' import { Server } from 'ws' @@ -22,7 +25,6 @@ const run = async () => { const agent = new Agent({ config: { label: 'Dummy-powered agent - responder', - endpoints: [`http://localhost:${port}`], walletConfig: { id: 'responder', key: 'responder', @@ -30,6 +32,10 @@ const run = async () => { logger: new ConsoleLogger(LogLevel.debug), }, modules: { + askar: new AskarModule({ ariesAskar }), + didcomm: new DidCommModule({ endpoints: [`http://localhost:${port}`] }), + oob: new OutOfBandModule(), + messagePickup: new MessagePickupModule(), dummy: new DummyModule({ autoAcceptRequests }), connections: new ConnectionsModule({ autoAcceptConnections: true, @@ -39,12 +45,12 @@ const run = async () => { }) // Register transports - agent.registerInboundTransport(httpInboundTransport) - agent.registerInboundTransport(wsInboundTransport) + agent.modules.didcomm.registerInboundTransport(httpInboundTransport) + agent.modules.didcomm.registerInboundTransport(wsInboundTransport) // Allow to create invitation, no other way to ask for invitation yet app.get('/invitation', async (req, res) => { - const { outOfBandInvitation } = await agent.oob.createInvitation() + const { outOfBandInvitation } = await agent.modules.oob.createInvitation() res.send(outOfBandInvitation.toUrl({ domain: `http://localhost:${port}/invitation` })) }) diff --git a/samples/extension-module/tests/dummy.test.ts b/samples/extension-module/tests/dummy.test.ts index 50458e9044..e3834617c1 100644 --- a/samples/extension-module/tests/dummy.test.ts +++ b/samples/extension-module/tests/dummy.test.ts @@ -1,5 +1,5 @@ import type { SubjectMessage } from '../../../tests/transport/SubjectInboundTransport' -import type { ConnectionRecord } from '@credo-ts/core' +import type { ConnectionRecord } from '@credo-ts/didcomm' import { AskarModule } from '@credo-ts/askar' import { Agent } from '@credo-ts/core' @@ -27,6 +27,7 @@ const bobAgentOptions = getAgentOptions( { endpoints: ['rxjs:bob'], }, + {}, modules ) @@ -35,12 +36,13 @@ const aliceAgentOptions = getAgentOptions( { endpoints: ['rxjs:alice'], }, + {}, modules ) describe('Dummy extension module test', () => { - let bobAgent: Agent - let aliceAgent: Agent + let bobAgent: Agent + let aliceAgent: Agent let aliceConnection: ConnectionRecord beforeEach(async () => { @@ -52,14 +54,14 @@ describe('Dummy extension module test', () => { } bobAgent = new Agent(bobAgentOptions) - bobAgent.registerInboundTransport(new SubjectInboundTransport(bobMessages)) - bobAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + bobAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(bobMessages)) + bobAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await bobAgent.initialize() aliceAgent = new Agent(aliceAgentOptions) - aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) - aliceAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + aliceAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(aliceMessages)) + aliceAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await aliceAgent.initialize() ;[aliceConnection] = await makeConnection(aliceAgent, bobAgent) }) diff --git a/samples/mediator.ts b/samples/mediator.ts index 9e5c967099..f92d42ce9a 100644 --- a/samples/mediator.ts +++ b/samples/mediator.ts @@ -22,15 +22,17 @@ import { Server } from 'ws' import { TestLogger } from '../packages/core/tests/logger' import { AskarModule } from '@credo-ts/askar' +import { Agent, LogLevel } from '@credo-ts/core' import { ConnectionsModule, MediatorModule, HttpOutboundTransport, - Agent, ConnectionInvitationMessage, - LogLevel, WsOutboundTransport, -} from '@credo-ts/core' + DidCommModule, + MessagePickupModule, + OutOfBandModule, +} from '@credo-ts/didcomm' import { HttpInboundTransport, agentDependencies, WsInboundTransport } from '@credo-ts/node' const port = process.env.AGENT_PORT ? Number(process.env.AGENT_PORT) : 3001 @@ -45,13 +47,11 @@ const endpoints = process.env.AGENT_ENDPOINTS?.split(',') ?? [`http://localhost: const logger = new TestLogger(LogLevel.info) const agentConfig: InitConfig = { - endpoints, label: process.env.AGENT_LABEL || 'Credo Mediator', walletConfig: { id: process.env.WALLET_NAME || 'Credo', key: process.env.WALLET_KEY || 'Credo', }, - logger, } @@ -61,6 +61,9 @@ const agent = new Agent({ dependencies: agentDependencies, modules: { askar: new AskarModule({ ariesAskar }), + didcomm: new DidCommModule({ endpoints }), + oob: new OutOfBandModule(), + messagePickup: new MessagePickupModule(), mediator: new MediatorModule({ autoAcceptMediationRequests: true, }), @@ -69,7 +72,6 @@ const agent = new Agent({ }), }, }) -const config = agent.config // Create all transports const httpInboundTransport = new HttpInboundTransport({ app, port }) @@ -78,10 +80,10 @@ const wsInboundTransport = new WsInboundTransport({ server: socketServer }) const wsOutboundTransport = new WsOutboundTransport() // Register all Transports -agent.registerInboundTransport(httpInboundTransport) -agent.registerOutboundTransport(httpOutboundTransport) -agent.registerInboundTransport(wsInboundTransport) -agent.registerOutboundTransport(wsOutboundTransport) +agent.modules.didcomm.registerInboundTransport(httpInboundTransport) +agent.modules.didcomm.registerOutboundTransport(httpOutboundTransport) +agent.modules.didcomm.registerInboundTransport(wsInboundTransport) +agent.modules.didcomm.registerOutboundTransport(wsOutboundTransport) // Allow to create invitation, no other way to ask for invitation yet httpInboundTransport.app.get('/invitation', async (req, res) => { @@ -89,8 +91,8 @@ httpInboundTransport.app.get('/invitation', async (req, res) => { const invitation = ConnectionInvitationMessage.fromUrl(req.url) res.send(invitation.toJSON()) } else { - const { outOfBandInvitation } = await agent.oob.createInvitation() - const httpEndpoint = config.endpoints.find((e) => e.startsWith('http')) + const { outOfBandInvitation } = await agent.modules.oob.createInvitation() + const httpEndpoint = endpoints.find((e) => e.startsWith('http')) res.send(outOfBandInvitation.toUrl({ domain: httpEndpoint + '/invitation' })) } }) diff --git a/tests/e2e-askar-indy-vdr-anoncreds-rs.e2e.test.ts b/tests/e2e-askar-indy-vdr-anoncreds-rs.e2e.test.ts index 7ea2f8aa5c..7daf440498 100644 --- a/tests/e2e-askar-indy-vdr-anoncreds-rs.e2e.test.ts +++ b/tests/e2e-askar-indy-vdr-anoncreds-rs.e2e.test.ts @@ -11,17 +11,18 @@ import { e2eTest } from './e2e-test' import { SubjectInboundTransport } from './transport/SubjectInboundTransport' import { SubjectOutboundTransport } from './transport/SubjectOutboundTransport' +import { Agent } from '@credo-ts/core' import { - Agent, AutoAcceptCredential, MediatorModule, MediatorPickupStrategy, MediationRecipientModule, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' const recipientAgentOptions = getAgentOptions( 'E2E Askar Subject Recipient', {}, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -37,6 +38,7 @@ const mediatorAgentOptions = getAgentOptions( { endpoints: ['rxjs:mediator'], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -50,6 +52,7 @@ const senderAgentOptions = getAgentOptions( { endpoints: ['rxjs:sender'], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -92,17 +95,17 @@ describe('E2E Askar-AnonCredsRS-IndyVDR Subject tests', () => { } // Recipient Setup - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await recipientAgent.initialize() // Mediator Setup - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Sender Setup - senderAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - senderAgent.registerInboundTransport(new SubjectInboundTransport(senderMessages)) + senderAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + senderAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(senderMessages)) await senderAgent.initialize() await e2eTest({ diff --git a/tests/e2e-http.e2e.test.ts b/tests/e2e-http.e2e.test.ts index 8ce820697b..63ccb69b2c 100644 --- a/tests/e2e-http.e2e.test.ts +++ b/tests/e2e-http.e2e.test.ts @@ -5,19 +5,20 @@ import { getInMemoryAgentOptions } from '../packages/core/tests/helpers' import { e2eTest } from './e2e-test' +import { Agent } from '@credo-ts/core' import { HttpOutboundTransport, - Agent, AutoAcceptCredential, MediatorPickupStrategy, MediationRecipientModule, MediatorModule, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { HttpInboundTransport } from '@credo-ts/node' const recipientAgentOptions = getInMemoryAgentOptions( 'E2E HTTP Recipient', {}, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -35,6 +36,7 @@ const mediatorAgentOptions = getInMemoryAgentOptions( { endpoints: [`http://localhost:${mediatorPort}`], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -51,6 +53,7 @@ const senderAgentOptions = getInMemoryAgentOptions( { endpoints: [`http://localhost:${senderPort}`], }, + {}, getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, }) @@ -78,17 +81,17 @@ describe('E2E HTTP tests', () => { test('Full HTTP flow (connect, request mediation, issue, verify)', async () => { // Recipient Setup - recipientAgent.registerOutboundTransport(new HttpOutboundTransport()) + recipientAgent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) await recipientAgent.initialize() // Mediator Setup - mediatorAgent.registerInboundTransport(new HttpInboundTransport({ port: mediatorPort })) - mediatorAgent.registerOutboundTransport(new HttpOutboundTransport()) + mediatorAgent.modules.didcomm.registerInboundTransport(new HttpInboundTransport({ port: mediatorPort })) + mediatorAgent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) await mediatorAgent.initialize() // Sender Setup - senderAgent.registerInboundTransport(new HttpInboundTransport({ port: senderPort })) - senderAgent.registerOutboundTransport(new HttpOutboundTransport()) + senderAgent.modules.didcomm.registerInboundTransport(new HttpInboundTransport({ port: senderPort })) + senderAgent.modules.didcomm.registerOutboundTransport(new HttpOutboundTransport()) await senderAgent.initialize() await e2eTest({ diff --git a/tests/e2e-subject.e2e.test.ts b/tests/e2e-subject.e2e.test.ts index fe04fbe9ff..c04f179938 100644 --- a/tests/e2e-subject.e2e.test.ts +++ b/tests/e2e-subject.e2e.test.ts @@ -10,17 +10,18 @@ import { e2eTest } from './e2e-test' import { SubjectInboundTransport } from './transport/SubjectInboundTransport' import { SubjectOutboundTransport } from './transport/SubjectOutboundTransport' +import { Agent } from '@credo-ts/core' import { - Agent, AutoAcceptCredential, MediatorModule, MediatorPickupStrategy, MediationRecipientModule, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' const recipientAgentOptions = getInMemoryAgentOptions( 'E2E Subject Recipient', {}, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -35,6 +36,7 @@ const mediatorAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:mediator'], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -47,6 +49,7 @@ const senderAgentOptions = getInMemoryAgentOptions( { endpoints: ['rxjs:sender'], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -88,17 +91,17 @@ describe('E2E Subject tests', () => { } // Recipient Setup - recipientAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + recipientAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) await recipientAgent.initialize() // Mediator Setup - mediatorAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - mediatorAgent.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) + mediatorAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + mediatorAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(mediatorMessages)) await mediatorAgent.initialize() // Sender Setup - senderAgent.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) - senderAgent.registerInboundTransport(new SubjectInboundTransport(senderMessages)) + senderAgent.modules.didcomm.registerOutboundTransport(new SubjectOutboundTransport(subjectMap)) + senderAgent.modules.didcomm.registerInboundTransport(new SubjectInboundTransport(senderMessages)) await senderAgent.initialize() await e2eTest({ diff --git a/tests/e2e-test.ts b/tests/e2e-test.ts index d65b681a88..a29d0f09e8 100644 --- a/tests/e2e-test.ts +++ b/tests/e2e-test.ts @@ -1,5 +1,5 @@ import type { AnonCredsTestsAgent } from '../packages/anoncreds/tests/anoncredsSetup' -import type { AgentMessageProcessedEvent, AgentMessageSentEvent } from '@credo-ts/core' +import type { AgentMessageProcessedEvent, AgentMessageSentEvent } from '@credo-ts/didcomm' import { filter, firstValueFrom, map } from 'rxjs' @@ -23,7 +23,7 @@ import { CredentialEventTypes, ProofEventTypes, AgentEventTypes, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' export async function e2eTest({ mediatorAgent, @@ -49,13 +49,15 @@ export async function e2eTest({ expect(recipientMediatorConnection).toBeConnectedWith(mediatorRecipientConnection) // Request mediation from mediator - const mediationRecord = await recipientAgent.mediationRecipient.requestAndAwaitGrant(recipientMediatorConnection) + const mediationRecord = await recipientAgent.modules.mediationRecipient.requestAndAwaitGrant( + recipientMediatorConnection + ) expect(mediationRecord.state).toBe(MediationState.Granted) // Set mediator as default for recipient, start picking up messages - await recipientAgent.mediationRecipient.setDefaultMediator(mediationRecord) - await recipientAgent.mediationRecipient.initiateMessagePickup(mediationRecord) - const defaultMediator = await recipientAgent.mediationRecipient.findDefaultMediator() + await recipientAgent.modules.mediationRecipient.setDefaultMediator(mediationRecord) + await recipientAgent.modules.mediationRecipient.initiateMessagePickup(mediationRecord) + const defaultMediator = await recipientAgent.modules.mediationRecipient.findDefaultMediator() expect(defaultMediator?.id).toBe(mediationRecord.id) // Make connection between sender and recipient @@ -128,7 +130,7 @@ export async function e2eTest({ expect(verifierProofExchangeRecord.state).toBe(ProofState.Done) // We want to stop the mediator polling before the agent is shutdown. - await recipientAgent.mediationRecipient.stopMessagePickup() + await recipientAgent.modules.mediationRecipient.stopMessagePickup() const pickupRequestMessages = [V2DeliveryRequestMessage.type.messageTypeUri, V1BatchPickupMessage.type.messageTypeUri] const deliveryMessages = [V2MessageDeliveryMessage.type.messageTypeUri, V1BatchMessage.type.messageTypeUri] diff --git a/tests/e2e-ws-pickup-v2.e2e.test.ts b/tests/e2e-ws-pickup-v2.e2e.test.ts index 833486bb57..a8257f4c8f 100644 --- a/tests/e2e-ws-pickup-v2.e2e.test.ts +++ b/tests/e2e-ws-pickup-v2.e2e.test.ts @@ -2,19 +2,19 @@ import type { AnonCredsTestsAgent } from '../packages/anoncreds/tests/anoncredsS import { getAnonCredsModules } from '../packages/anoncreds/tests/anoncredsSetup' import { askarModule } from '../packages/askar/tests/helpers' -import { MessageForwardingStrategy } from '../packages/core/src/modules/routing/MessageForwardingStrategy' import { getAgentOptions } from '../packages/core/tests/helpers' - -import { e2eTest } from './e2e-test' - import { - Agent, + MessageForwardingStrategy, WsOutboundTransport, AutoAcceptCredential, MediatorPickupStrategy, MediationRecipientModule, MediatorModule, -} from '@credo-ts/core' +} from '../packages/didcomm/src' + +import { e2eTest } from './e2e-test' + +import { Agent } from '@credo-ts/core' import { WsInboundTransport } from '@credo-ts/node' // FIXME: somehow if we use the in memory wallet and storage service in the WS test it will fail, @@ -27,6 +27,7 @@ const mediatorOptions = getAgentOptions( { endpoints: [`ws://localhost:${mediatorPort}`], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -45,6 +46,7 @@ const senderOptions = getAgentOptions( { endpoints: [`ws://localhost:${senderPort}`], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -78,6 +80,7 @@ describe('E2E WS Pickup V2 tests', () => { const recipientOptions = getAgentOptions( 'E2E WS Pickup V2 Recipient polling mode', {}, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -93,17 +96,17 @@ describe('E2E WS Pickup V2 tests', () => { recipientAgent = new Agent(recipientOptions) as unknown as AnonCredsTestsAgent // Recipient Setup - recipientAgent.registerOutboundTransport(new WsOutboundTransport()) + recipientAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await recipientAgent.initialize() // Mediator Setup - mediatorAgent.registerInboundTransport(new WsInboundTransport({ port: mediatorPort })) - mediatorAgent.registerOutboundTransport(new WsOutboundTransport()) + mediatorAgent.modules.didcomm.registerInboundTransport(new WsInboundTransport({ port: mediatorPort })) + mediatorAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await mediatorAgent.initialize() // Sender Setup - senderAgent.registerInboundTransport(new WsInboundTransport({ port: senderPort })) - senderAgent.registerOutboundTransport(new WsOutboundTransport()) + senderAgent.modules.didcomm.registerInboundTransport(new WsInboundTransport({ port: senderPort })) + senderAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await senderAgent.initialize() await e2eTest({ @@ -117,6 +120,7 @@ describe('E2E WS Pickup V2 tests', () => { const recipientOptions = getAgentOptions( 'E2E WS Pickup V2 Recipient live mode', {}, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -131,17 +135,17 @@ describe('E2E WS Pickup V2 tests', () => { recipientAgent = new Agent(recipientOptions) as unknown as AnonCredsTestsAgent // Recipient Setup - recipientAgent.registerOutboundTransport(new WsOutboundTransport()) + recipientAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await recipientAgent.initialize() // Mediator Setup - mediatorAgent.registerInboundTransport(new WsInboundTransport({ port: mediatorPort })) - mediatorAgent.registerOutboundTransport(new WsOutboundTransport()) + mediatorAgent.modules.didcomm.registerInboundTransport(new WsInboundTransport({ port: mediatorPort })) + mediatorAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await mediatorAgent.initialize() // Sender Setup - senderAgent.registerInboundTransport(new WsInboundTransport({ port: senderPort })) - senderAgent.registerOutboundTransport(new WsOutboundTransport()) + senderAgent.modules.didcomm.registerInboundTransport(new WsInboundTransport({ port: senderPort })) + senderAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await senderAgent.initialize() await e2eTest({ diff --git a/tests/e2e-ws.e2e.test.ts b/tests/e2e-ws.e2e.test.ts index 0da198e86b..c5ed9f73a5 100644 --- a/tests/e2e-ws.e2e.test.ts +++ b/tests/e2e-ws.e2e.test.ts @@ -6,14 +6,14 @@ import { getAgentOptions } from '../packages/core/tests/helpers' import { e2eTest } from './e2e-test' +import { Agent } from '@credo-ts/core' import { - Agent, WsOutboundTransport, AutoAcceptCredential, MediatorPickupStrategy, MediationRecipientModule, MediatorModule, -} from '@credo-ts/core' +} from '@credo-ts/didcomm' import { WsInboundTransport } from '@credo-ts/node' // FIXME: somehow if we use the in memory wallet and storage service in the WS test it will fail, @@ -21,6 +21,7 @@ import { WsInboundTransport } from '@credo-ts/node' const recipientAgentOptions = getAgentOptions( 'E2E WS Recipient ', {}, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -38,6 +39,7 @@ const mediatorAgentOptions = getAgentOptions( { endpoints: [`ws://localhost:${mediatorPort}`], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -53,6 +55,7 @@ const senderAgentOptions = getAgentOptions( { endpoints: [`ws://localhost:${senderPort}`], }, + {}, { ...getAnonCredsModules({ autoAcceptCredentials: AutoAcceptCredential.ContentApproved, @@ -87,17 +90,17 @@ describe('E2E WS tests', () => { test('Full WS flow (connect, request mediation, issue, verify)', async () => { // Recipient Setup - recipientAgent.registerOutboundTransport(new WsOutboundTransport()) + recipientAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await recipientAgent.initialize() // Mediator Setup - mediatorAgent.registerInboundTransport(new WsInboundTransport({ port: mediatorPort })) - mediatorAgent.registerOutboundTransport(new WsOutboundTransport()) + mediatorAgent.modules.didcomm.registerInboundTransport(new WsInboundTransport({ port: mediatorPort })) + mediatorAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await mediatorAgent.initialize() // Sender Setup - senderAgent.registerInboundTransport(new WsInboundTransport({ port: senderPort })) - senderAgent.registerOutboundTransport(new WsOutboundTransport()) + senderAgent.modules.didcomm.registerInboundTransport(new WsInboundTransport({ port: senderPort })) + senderAgent.modules.didcomm.registerOutboundTransport(new WsOutboundTransport()) await senderAgent.initialize() await e2eTest({ diff --git a/tests/transport/SubjectInboundTransport.ts b/tests/transport/SubjectInboundTransport.ts index 7cf6932dec..7e46d0591f 100644 --- a/tests/transport/SubjectInboundTransport.ts +++ b/tests/transport/SubjectInboundTransport.ts @@ -1,13 +1,12 @@ -import type { InboundTransport, Agent, AgentContext } from '../../packages/core/src' -import type { TransportSession } from '../../packages/core/src/agent/TransportService' -import type { EncryptedMessage } from '../../packages/core/src/types' +import type { AgentContext } from '../../packages/core/src' +import type { InboundTransport, EncryptedMessage, TransportSession } from '../../packages/didcomm/src' import type { Subscription } from 'rxjs' import { Subject } from 'rxjs' -import { MessageReceiver } from '../../packages/core/src' -import { TransportService } from '../../packages/core/src/agent/TransportService' +import { EventEmitter } from '../../packages/core/src' import { uuid } from '../../packages/core/src/utils/uuid' +import { MessageReceiver, TransportService } from '../../packages/didcomm/src' export type SubjectMessage = { message: EncryptedMessage; replySubject?: Subject } @@ -19,7 +18,7 @@ export class SubjectInboundTransport implements InboundTransport { this.ourSubject = ourSubject } - public async start(agent: Agent) { + public async start(agent: AgentContext) { this.subscribe(agent) } @@ -27,10 +26,11 @@ export class SubjectInboundTransport implements InboundTransport { this.subscription?.unsubscribe() } - private subscribe(agent: Agent) { - const logger = agent.config.logger - const transportService = agent.dependencyManager.resolve(TransportService) - const messageReceiver = agent.dependencyManager.resolve(MessageReceiver) + private subscribe(agentContext: AgentContext) { + const logger = agentContext.config.logger + const transportService = agentContext.dependencyManager.resolve(TransportService) + const messageReceiver = agentContext.dependencyManager.resolve(MessageReceiver) + const eventEmitter = agentContext.dependencyManager.resolve(EventEmitter) this.subscription = this.ourSubject.subscribe({ next: async ({ message, replySubject }: SubjectMessage) => { @@ -53,7 +53,7 @@ export class SubjectInboundTransport implements InboundTransport { try { await messageReceiver.receiveMessage(message, { session }) } catch (error) { - agent.events.emit(agent.context, { + eventEmitter.emit(agentContext, { type: 'AgentReceiveMessageError', payload: error, }) diff --git a/tests/transport/SubjectOutboundTransport.ts b/tests/transport/SubjectOutboundTransport.ts index 0291f84948..643c743d13 100644 --- a/tests/transport/SubjectOutboundTransport.ts +++ b/tests/transport/SubjectOutboundTransport.ts @@ -1,14 +1,16 @@ import type { SubjectMessage } from './SubjectInboundTransport' -import type { OutboundPackage, OutboundTransport, Agent, Logger } from '@credo-ts/core' +import type { Logger, AgentContext } from '@credo-ts/core' +import type { OutboundPackage, OutboundTransport } from '@credo-ts/didcomm' import { takeUntil, Subject, take } from 'rxjs' -import { MessageReceiver, InjectionSymbols, CredoError } from '@credo-ts/core' +import { InjectionSymbols, CredoError } from '@credo-ts/core' +import { MessageReceiver } from '@credo-ts/didcomm' export class SubjectOutboundTransport implements OutboundTransport { private logger!: Logger private subjectMap: { [key: string]: Subject | undefined } - private agent!: Agent + private agentContext!: AgentContext private stop$!: Subject public supportedSchemes = ['rxjs', 'wss'] @@ -17,11 +19,11 @@ export class SubjectOutboundTransport implements OutboundTransport { this.subjectMap = subjectMap } - public async start(agent: Agent): Promise { - this.agent = agent + public async start(agentContext: AgentContext): Promise { + this.agentContext = agentContext - this.logger = agent.dependencyManager.resolve(InjectionSymbols.Logger) - this.stop$ = agent.dependencyManager.resolve(InjectionSymbols.Stop$) + this.logger = agentContext.dependencyManager.resolve(InjectionSymbols.Logger) + this.stop$ = agentContext.dependencyManager.resolve(InjectionSymbols.Stop$) } public async stop(): Promise { @@ -29,7 +31,7 @@ export class SubjectOutboundTransport implements OutboundTransport { } public async sendMessage(outboundPackage: OutboundPackage) { - const messageReceiver = this.agent.dependencyManager.resolve(MessageReceiver) + const messageReceiver = this.agentContext.dependencyManager.resolve(MessageReceiver) this.logger.debug(`Sending outbound message to endpoint ${outboundPackage.endpoint}`, { endpoint: outboundPackage.endpoint, })