Skip to content

Commit

Permalink
feat(proofs): added PresentationExchangeModule
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Dec 14, 2023
1 parent 97d617d commit 2d6e518
Show file tree
Hide file tree
Showing 18 changed files with 1,486 additions and 7 deletions.
5 changes: 5 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"@stablelib/ed25519": "^1.0.2",
"@stablelib/random": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@sphereon/pex": "^2.2.2",
"@sphereon/pex-models": "^2.1.2",
"@sphereon/ssi-types": "^0.17.5",
"@types/ws": "^8.5.4",
"abort-controller": "^3.0.0",
"big-integer": "^1.6.51",
Expand All @@ -38,6 +41,7 @@
"class-transformer": "0.5.1",
"class-validator": "0.14.0",
"did-resolver": "^4.1.0",
"jsonpath": "^1.1.1",
"lru_map": "^0.4.1",
"luxon": "^3.3.0",
"make-error": "^1.3.6",
Expand All @@ -52,6 +56,7 @@
},
"devDependencies": {
"@types/events": "^3.0.0",
"@types/jsonpath": "^0.2.4",
"@types/luxon": "^3.2.0",
"@types/object-inspect": "^1.8.0",
"@types/uuid": "^9.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { ProofsModuleConfig } from '../../ProofsModuleConfig'
import { PresentationProblemReportReason } from '../../errors/PresentationProblemReportReason'
import { AutoAcceptProof, ProofState } from '../../models'
import { ProofExchangeRecord, ProofRepository } from '../../repository'
import { composeAutoAccept } from '../../utils/composeAutoAccept'
import { composeAutoAccept } from '../../utils'
import { BaseProofProtocol } from '../BaseProofProtocol'

import { ProofFormatCoordinator } from './ProofFormatCoordinator'
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/modules/proofs/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './composeAutoAccept'
2 changes: 1 addition & 1 deletion packages/core/src/modules/vc/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './W3cCredentialService'
export * from './W3cCredentialServiceOptions'
export * from './repository/W3cCredentialRecord'
export * from './repository'
export * from './W3cCredentialsModule'
export * from './W3cCredentialsApi'
export * from './models'
Expand Down
15 changes: 15 additions & 0 deletions packages/presentation-exchange/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Config } from '@jest/types'

import base from '../../jest.config.base'

import packageJson from './package.json'

process.env.TZ = 'GMT'

const config: Config.InitialOptions = {
...base,
displayName: packageJson.name,
setupFilesAfterEnv: ['./tests/setup.ts'],
}

export default config
37 changes: 37 additions & 0 deletions packages/presentation-exchange/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@aries-framework/presentation-exchange",
"main": "build/index",
"types": "build/index",
"version": "0.4.2",
"files": [
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/agent-framework-javascript/tree/main/packages/presentation-exchange",
"repository": {
"type": "git",
"url": "https://github.com/openwallet-foundation/agent-framework-javascript",
"directory": "packages/presentation-exchange"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build"
},
"dependencies": {
"@aries-framework/core": "^0.4.2",
"@sphereon/pex": "^2.2.2",
"@sphereon/pex-models": "^2.1.2",
"@sphereon/ssi-types": "^0.17.5",
"jsonpath": "^1.1.1",
"tsyringe": "^4.8.0"
},
"devDependencies": {
"@types/jsonpath": "^0.2.4",
"typescript": "~4.9.5"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AriesFrameworkError } from '@aries-framework/core'

export class PresentationExchangeError extends AriesFrameworkError {}
25 changes: 25 additions & 0 deletions packages/presentation-exchange/src/PresentationExchangeModule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { DependencyManager, Module } from '@aries-framework/core'

import { AgentConfig } from '@aries-framework/core'

import { PresentationExchangeService } from './PresentationExchangeService'

/**
* @public
*/
export class PresentationExchangeModule implements Module {
/**
* Registers the dependencies of the presentation-exchange module on the dependency manager.
*/
public register(dependencyManager: DependencyManager) {
// Warn about experimental module
dependencyManager
.resolve(AgentConfig)
.logger.warn(
"The '@aries-framework/presentation-exchange' module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @aries-framework packages."
)

// Services
dependencyManager.registerSingleton(PresentationExchangeService)
}
}
Loading

0 comments on commit 2d6e518

Please sign in to comment.