Skip to content

Commit

Permalink
fix: DataStoreORM interface
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat authored and mirceanis committed Sep 7, 2020
1 parent 0ab68fd commit 719959a
Show file tree
Hide file tree
Showing 6 changed files with 591 additions and 39 deletions.
47 changes: 22 additions & 25 deletions packages/daf-typeorm/src/data-store-orm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,32 @@ interface IContext {
authenticatedDid?: string
}

export type FindIdentitiesArgs = FindArgs<TIdentitiesColumns>
export type FindMessagesArgs = FindArgs<TMessageColumns>
export type FindClaimsArgs = FindArgs<TClaimsColumns>
export type FindCredentialsArgs = FindArgs<TCredentialColumns>
export type FindPresentationsArgs = FindArgs<TPresentationColumns>

export interface IDataStoreORM extends IPluginMethodMap {
dataStoreORMGetIdentities: (args: FindArgs<TIdentitiesColumns>, context: IContext) => Promise<IIdentity[]>
dataStoreORMGetIdentitiesCount: (args: FindArgs<TIdentitiesColumns>, context: IContext) => Promise<number>
dataStoreORMGetMessages: (args: FindArgs<TMessageColumns>, context: IContext) => Promise<IMessage[]>
dataStoreORMGetMessagesCount: (args: FindArgs<TMessageColumns>, context: IContext) => Promise<number>
dataStoreORMGetVerifiableCredentialsByClaims: (
args: FindArgs<TClaimsColumns>,
context: IContext,
) => Promise<VerifiableCredential[]>
dataStoreORMGetVerifiableCredentialsByClaimsCount: (
args: FindArgs<TClaimsColumns>,
context: IContext,
) => Promise<number>
dataStoreORMGetVerifiableCredentials: (
args: FindArgs<TCredentialColumns>,
dataStoreORMGetIdentities(args: FindIdentitiesArgs, context: IContext): Promise<Array<IIdentity>>
dataStoreORMGetIdentitiesCount(args: FindIdentitiesArgs, context: IContext): Promise<number>
dataStoreORMGetMessages(args: FindMessagesArgs, context: IContext): Promise<Array<IMessage>>
dataStoreORMGetMessagesCount(args: FindMessagesArgs, context: IContext): Promise<number>
dataStoreORMGetVerifiableCredentialsByClaims(
args: FindClaimsArgs,
context: IContext,
) => Promise<VerifiableCredential[]>
dataStoreORMGetVerifiableCredentialsCount: (
args: FindArgs<TCredentialColumns>,
): Promise<Array<VerifiableCredential>>
dataStoreORMGetVerifiableCredentialsByClaimsCount(args: FindClaimsArgs, context: IContext): Promise<number>
dataStoreORMGetVerifiableCredentials(
args: FindCredentialsArgs,
context: IContext,
) => Promise<number>
dataStoreORMGetVerifiablePresentations: (
args: FindArgs<TPresentationColumns>,
context: IContext,
) => Promise<VerifiablePresentation[]>
dataStoreORMGetVerifiablePresentationsCount: (
args: FindArgs<TPresentationColumns>,
): Promise<Array<VerifiableCredential>>
dataStoreORMGetVerifiableCredentialsCount(args: FindCredentialsArgs, context: IContext): Promise<number>
dataStoreORMGetVerifiablePresentations(
args: FindPresentationsArgs,
context: IContext,
) => Promise<number>
): Promise<Array<VerifiablePresentation>>
dataStoreORMGetVerifiablePresentationsCount(args: FindPresentationsArgs, context: IContext): Promise<number>
}

export class DataStoreORM implements IAgentPlugin {
Expand Down
10 changes: 9 additions & 1 deletion packages/daf-typeorm/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
export { IdentityStore } from './identity/identity-store'
export { KeyStore } from './identity/key-store'
export { DataStore } from './data-store'
export { DataStoreORM, IDataStoreORM } from './data-store-orm'
export {
DataStoreORM,
IDataStoreORM,
FindClaimsArgs,
FindCredentialsArgs,
FindIdentitiesArgs,
FindMessagesArgs,
FindPresentationsArgs,
} from './data-store-orm'
export * from './types'
import { Key, KeyType } from './entities/key'
import { Identity } from './entities/identity'
Expand Down
83 changes: 83 additions & 0 deletions report/daf-selective-disclosure.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
## API Report File for "daf-selective-disclosure"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { AbstractMessageHandler } from 'daf-core'
import { IAgentContext } from 'daf-core'
import { IAgentPlugin } from 'daf-core'
import { IDataStoreORM } from 'daf-typeorm'
import { IHandleMessage } from 'daf-core'
import { IIdentityManager } from 'daf-core'
import { IKeyManager } from 'daf-core'
import { IPluginMethodMap } from 'daf-core'
import { Message } from 'daf-core'
import { VerifiableCredential } from 'daf-core'
import { VerifiablePresentation } from 'daf-core'

// Warning: (ae-forgotten-export) The symbol "TCreateSelectiveDisclosureRequest" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const createSelectiveDisclosureRequest: TCreateSelectiveDisclosureRequest

// Warning: (ae-forgotten-export) The symbol "TGetVerifiableCredentialsForSdr" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const getVerifiableCredentialsForSdr: TGetVerifiableCredentialsForSdr

// @public (undocumented)
export interface ICreateSelectiveDisclosureRequest extends IPluginMethodMap {
// Warning: (ae-forgotten-export) The symbol "ICreateSelectiveDisclosureRequestArgs" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "IContext" needs to be exported by the entry point index.d.ts
//
// (undocumented)
createSelectiveDisclosureRequest(
args: ICreateSelectiveDisclosureRequestArgs,
context: IContext_2,
): Promise<string>
}

// @public (undocumented)
export interface IGetVerifiableCredentialsForSdr extends IPluginMethodMap {
// (undocumented)
getVerifiableCredentialsForSdr: TGetVerifiableCredentialsForSdr
}

// @public (undocumented)
export interface ISdr
extends ICreateSelectiveDisclosureRequest,
IGetVerifiableCredentialsForSdr,
IValidatePresentationAgainstSdr {}

// @public (undocumented)
export interface IValidatePresentationAgainstSdr extends IPluginMethodMap {
// Warning: (ae-forgotten-export) The symbol "TValidatePresentationAgainstSdr" needs to be exported by the entry point index.d.ts
//
// (undocumented)
validatePresentationAgainstSdr: TValidatePresentationAgainstSdr
}

// @public (undocumented)
export const MessageTypes: {
sdr: string
}

// @public (undocumented)
export class Sdr implements IAgentPlugin {
// (undocumented)
readonly methods: ISdr
}

// @public (undocumented)
export class SdrMessageHandler extends AbstractMessageHandler {
// Warning: (ae-forgotten-export) The symbol "IContext" needs to be exported by the entry point index.d.ts
//
// (undocumented)
handle(message: Message, context: IContext): Promise<Message>
}

// @public (undocumented)
export const validatePresentationAgainstSdr: TValidatePresentationAgainstSdr

// (No @packageDocumentation comment for this package)
```
Loading

0 comments on commit 719959a

Please sign in to comment.