Skip to content

Commit

Permalink
feat: Implement contact exchange library with OOB invitation process…
Browse files Browse the repository at this point in the history
…ing and wallet management
  • Loading branch information
Ogenbertrand committed Oct 11, 2024
1 parent 354e337 commit 4653ce9
Show file tree
Hide file tree
Showing 22 changed files with 743 additions and 23 deletions.
41 changes: 18 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions packages/contact-exchange/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
52 changes: 52 additions & 0 deletions packages/contact-exchange/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contact Exchange Library

This library was generated with [Nx](https://nx.dev).

# Building the Library

- Before builld, please move to the root directory of the library folder, that is **contact-exchange** and installl dependencies with :

```bash
npm i
``

## Building

Run `npm run build ` to build the library.

## Running unit tests

Run `nx run test ` to execute the unit tests via [Jest](https://jestjs.io).

## Basic overview of the library

```

+---------------+
| Wallet |
+---------------+
|
| DIDComm Messaging
|
v
+---------------+
| Contact Storage|
+---------------+
|
| (Accessible by all identities)
|
v
+---------------+
| Identities |
+---------------+
|
| DIDComm Messaging
|
v
+---------------+
| Wallet |
+---------------+

```
```
14 changes: 14 additions & 0 deletions packages/contact-exchange/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
testMatch: ['**/tests/**/*.test.ts', '**/src/**/*.test.ts'],
};
21 changes: 21 additions & 0 deletions packages/contact-exchange/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@datev/contact-exchange",
"version": "0.0.1",
"dependencies": {
"jest-worker": "^29.7.0",
"tslib": "^2.3.0"
},
"type": "commonjs",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"devDependencies": {
"@types/jest": "^29.5.13",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.0.0"
},
"scripts": {
"build": "tsc",
"test": "jest"
}
}
30 changes: 30 additions & 0 deletions packages/contact-exchange/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "contact-exchange",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/contact-exchange/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/contact-exchange",
"main": "libs/contact-exchange/src/index.ts",
"tsConfig": "libs/contact-exchange/tsconfig.lib.json",
"assets": ["libs/contact-exchange/*.md"]
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/contact-exchange/jest.config.ts"
}
}
},
"tags": []
}
1 change: 1 addition & 0 deletions packages/contact-exchange/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/contact-exchange';
7 changes: 7 additions & 0 deletions packages/contact-exchange/src/lib/contact-exchange.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { contactExchange } from './contact-exchange';

describe('contactExchange', () => {
it('should work', () => {
expect(contactExchange()).toEqual('contact-exchange');
});
});
3 changes: 3 additions & 0 deletions packages/contact-exchange/src/lib/contact-exchange.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function contactExchange(): string {
return 'contact-exchange';
}
Loading

0 comments on commit 4653ce9

Please sign in to comment.