Skip to content

Commit

Permalink
feat: Exporting findCredentialsForSdr
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Apr 1, 2020
1 parent be23418 commit ef1c973
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/daf-selective-disclosure/src/helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Agent, Message, Claim } from 'daf-core'
import { Claim } from 'daf-core'
import { SelectiveDisclosureRequest } from './action-handler'
import { In, Like } from 'typeorm'

Expand Down Expand Up @@ -30,10 +30,10 @@ export const findCredentialsForSdr = async (sdr: SelectiveDisclosureRequest, did
where['subject'] = did || sdr.subject
}

const claims = await Claim.find({ where, relations: ['credential']})
const claims = await Claim.find({ where, relations: ['credential'] })
result.push({
...credentialRequest,
credentials: claims.map(c => c.credential)
credentials: claims.map(c => c.credential),
})
}
return result
Expand Down
9 changes: 8 additions & 1 deletion packages/daf-selective-disclosure/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
export { SdrMessageHandler, MessageTypes } from './message-handler'
export { SdrActionHandler, ActionTypes, ActionSignSdr, SelectiveDisclosureRequest, CredentialRequestInput } from './action-handler'
export {
SdrActionHandler,
ActionTypes,
ActionSignSdr,
SelectiveDisclosureRequest,
CredentialRequestInput,
} from './action-handler'
export { findCredentialsForSdr } from './helper'
import SdrGql from './graphql'
export { SdrGql }

0 comments on commit ef1c973

Please sign in to comment.