Skip to content

Commit

Permalink
support for env.HOLDER_TYPE + normalizing logging
Browse files Browse the repository at this point in the history
Signed-off-by: Clécio Varjão <[email protected]>
  • Loading branch information
cvarjao committed Jul 18, 2024
1 parent 66344ea commit 46880df
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 137 deletions.
3 changes: 2 additions & 1 deletion src/Agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConnectionRecord, OutOfBandRecord } from "@credo-ts/core";
import { Logger, OutOfBandRecord } from "@credo-ts/core";
import { CredentialDefinitionBuilder, ProofRequestBuilder, SchemaBuilder } from "./lib";

export type ConnectionRef = {connection_id: string}
Expand All @@ -8,6 +8,7 @@ export type CredentialOfferRef = {id: string} & ConnectionRef
export type AcceptProofArgs = {id: string}
export type ReceiveInvitationResponse = { outOfBandRecord?: OutOfBandRecord; connectionRecord?: ConnectionRef, invitationRequestsThreadIds?: string[] }
export interface AriesAgent {
readonly logger: Logger
createInvitationToConnect(): Promise<Invitation>
receiveInvitation(invitation: Invitation): Promise<ReceiveInvitationResponse>;
startup(): Promise<void>;
Expand Down
10 changes: 2 additions & 8 deletions src/AgentCredo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import axios from "axios";
import {
AcceptProofArgs,
AriesAgent,
ConnectionRef,
CredentialOfferRef,
Invitation,
ReceiveInvitationResponse,
Expand All @@ -17,16 +15,12 @@ import {
CredentialsModule,
HttpOutboundTransport,
InitConfig,
InjectionSymbols,
LogLevel,
Logger,
MediationRecipientModule,
MediatorPickupStrategy,
OutOfBandState,
ProofsModule,
V2CredentialProtocol,
V2ProofProtocol,
WalletConfig,
WsOutboundTransport,
} from "@credo-ts/core";
import {
Expand All @@ -38,7 +32,7 @@ import {
V1CredentialProtocol,
V1ProofProtocol,
} from "@credo-ts/anoncreds";
import { AskarModule, AskarWallet } from "@credo-ts/askar";
import { AskarModule } from "@credo-ts/askar";
import {
IndyVdrAnonCredsRegistry,
IndyVdrModule,
Expand Down Expand Up @@ -191,7 +185,7 @@ function delay(ms: number) {
export class AgentCredo implements AriesAgent {
config: any;
ledgers: any[];
logger: Logger;
public readonly logger: Logger;
agent!: Agent<{
// Register the Askar module on the agent
// We do this to have access to a wallet
Expand Down
10 changes: 3 additions & 7 deletions src/AgentManual.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { AcceptProofArgs, AriesAgent, ConnectionRef, CredentialOfferRef, Invitation, ReceiveInvitationResponse } from "./Agent";
import { Agent, ConnectionRecord, ConnectionsModule, CredentialExchangeRecord, CredentialsModule, Logger, MediationRecipientModule, ProofsModule, V2CredentialProtocol, V2ProofProtocol } from "@credo-ts/core";
import { AnonCredsCredentialFormatService, AnonCredsModule, AnonCredsProofFormatService, LegacyIndyCredentialFormatService, LegacyIndyProofFormatService, V1CredentialProtocol, V1ProofProtocol } from "@credo-ts/anoncreds";
import { AskarModule } from "@credo-ts/askar";
import { IndyVdrModule } from "@credo-ts/indy-vdr";
import { AcceptProofArgs, AriesAgent, CredentialOfferRef, Invitation, ReceiveInvitationResponse } from "./Agent";
import { Logger } from "@credo-ts/core";
import { CredentialDefinitionBuilder, ProofRequestBuilder, SchemaBuilder } from "./lib";
import QRCode from 'qrcode'
import readline from 'readline';
import fs from 'node:fs';
import path from 'node:path';

export class AgentManual implements AriesAgent {
config: any;
logger: Logger;
public readonly logger: Logger;
public constructor(config:any,logger: Logger){
this.config = config
this.logger = logger
Expand Down
Loading

0 comments on commit 46880df

Please sign in to comment.