Skip to content

Commit

Permalink
Merge pull request #71 from Indicio-tech/fix/service-parsing
Browse files Browse the repository at this point in the history
fix: service parsing
  • Loading branch information
dbluhm authored Jan 19, 2024
2 parents e867a5f + 4f3b9f0 commit b48f367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/lib/didcomm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
PackEncryptedMetadata,
MessagingServiceMetadata,
IMessage,
Service,
} from "didcomm"
import DIDPeer from "./peer2"
import { v4 as uuidv4 } from "uuid"
Expand Down Expand Up @@ -234,7 +235,7 @@ export class DIDComm {
return await this.resolver.resolve(did)
}

async resolveDIDCommServices(did: DID): Promise<any> {
async resolveDIDCommServices(did: DID): Promise<Service[]> {
const doc = await this.resolve(did)
if (!doc) {
throw new Error("Unable to resolve DID")
Expand Down Expand Up @@ -273,7 +274,7 @@ export class DIDComm {
*/
async httpEndpoint(did: DID): Promise<MessagingServiceMetadata> {
const services = await this.resolveDIDCommServices(did)
const service = services.filter((s: any) =>
const service = services.filter((s: Service) =>
s.serviceEndpoint.uri.startsWith("http")
)[0]
return {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/peer2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export default class DIDPeer {
if (!Array.isArray(doc.service)) {
doc.service = [];
}
doc.service.concat(services)
doc.service = doc.service.concat(services)
break
}

Expand Down

0 comments on commit b48f367

Please sign in to comment.