Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,16 @@
},
"dependencies": {
"@ayanworks/credo-polygon-w3c-module": "1.0.1-alpha.1",
"@credo-ts/anoncreds": "0.6.0-alpha-20250325224513",
"@credo-ts/askar": "0.6.0-alpha-20250325224513",
"@credo-ts/core": "0.6.0-alpha-20250325224513",
"@credo-ts/indy-vdr": "0.6.0-alpha-20250325224513",
"@credo-ts/node": "^0.6.0-alpha-20250325224513",
"@credo-ts/openid4vc": "0.6.0-alpha-20250325224513",
"@credo-ts/anoncreds": "0.6.1",
"@credo-ts/askar": "0.6.1",
"@credo-ts/core": "0.6.1",
"@credo-ts/indy-vdr": "0.6.1",
"@credo-ts/node": "0.6.1",
"@credo-ts/openid4vc": "0.6.1",
"@credo-ts/push-notifications": "^0.7.1",
"@credo-ts/question-answer": "0.6.0-alpha-20250325224513",
"@credo-ts/tenants": "0.6.0-alpha-20250325224513",
"@credo-ts/question-answer": "0.6.1",
"@credo-ts/tenants": "0.6.1",
"@hyperledger/anoncreds-nodejs": "0.3.1",
"@openwallet-foundation/askar-nodejs": "^0.3.2",
"@hyperledger/indy-vdr-nodejs": "0.2.2",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/exporter-logs-otlp-http": "^0.202.0",
Expand All @@ -62,6 +61,7 @@
"@opentelemetry/sdk-logs": "^0.202.0",
"@opentelemetry/sdk-node": "^0.202.0",
"@opentelemetry/semantic-conventions": "^1.34.0",
"@openwallet-foundation/askar-nodejs": "^0.3.2",
"@tsoa/runtime": "^6.6.0",
"@types/node-fetch": "^2.6.4",
"@types/ref-struct-di": "^1.1.12",
Expand All @@ -82,6 +82,7 @@
"tslog": "^3.3.3",
"tsoa": "^6.0.1",
"tsyringe": "^4.8.0",
"uuid": "^13.0.0",
"ws": "^8.18.2",
"yargs": "^17.7.2"
},
Expand Down Expand Up @@ -116,7 +117,7 @@
"typescript": "^5.8.3"
},
"resolutions": {
"@credo-ts/core": "0.6.0-alpha-20250325224513",
"@credo-ts/askar": "0.6.0-alpha-20250325224513"
"@credo-ts/core": "0.6.1",
"@credo-ts/askar": "0.6.1"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/node_modules/@credo-ts/core/build/utils/version.d.mts b/node_modules/@credo-ts/core/build/utils/version.d.mts
index a71659d..8ed88e2 100644
--- a/node_modules/@credo-ts/core/build/utils/version.d.mts
+++ b/node_modules/@credo-ts/core/build/utils/version.d.mts
@@ -1,5 +1,5 @@
//#region src/utils/version.d.ts
-type VersionString = `${number}.${number}` | `${number}.${number}.${number}`;
+type VersionString = string;
//#endregion
export { VersionString };
//# sourceMappingURL=version.d.mts.map
\ No newline at end of file
diff --git a/node_modules/@credo-ts/core/build/utils/version.mjs.map b/node_modules/@credo-ts/core/build/utils/version.mjs.map
index 19457ed..5fb595f 100644
--- a/node_modules/@credo-ts/core/build/utils/version.mjs.map
+++ b/node_modules/@credo-ts/core/build/utils/version.mjs.map
@@ -1 +1 @@
-{"version":3,"file":"version.mjs","names":[],"sources":["../../src/utils/version.ts"],"sourcesContent":["export function parseVersionString(version: VersionString): Version {\n const [major, minor, patch] = version.split('.')\n\n return [Number(major), Number(minor), Number(patch ?? '0')]\n}\n\nexport function isFirstVersionHigherThanSecond(first: Version, second: Version) {\n return (\n first[0] > second[0] ||\n (first[0] === second[0] && first[1] > second[1]) ||\n (first[0] === second[0] && first[1] === second[1] && first[2] > second[2])\n )\n}\n\nexport function isFirstVersionEqualToSecond(first: Version, second: Version) {\n return first[0] === second[0] && first[1] === second[1] && first[2] === second[2]\n}\n\nexport type VersionString = `${number}.${number}` | `${number}.${number}.${number}`\nexport type MajorVersion = number\nexport type MinorVersion = number\nexport type PatchVersion = number\nexport type Version = [MajorVersion, MinorVersion, PatchVersion]\n"],"mappings":";;;AAAA,SAAgB,mBAAmB,SAAiC;CAClE,MAAM,CAAC,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI;AAEhD,QAAO;EAAC,OAAO,MAAM;EAAE,OAAO,MAAM;EAAE,OAAO,SAAS,IAAI;EAAC;;AAG7D,SAAgB,+BAA+B,OAAgB,QAAiB;AAC9E,QACE,MAAM,KAAK,OAAO,MACjB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO,MAC5C,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO;;AAI3E,SAAgB,4BAA4B,OAAgB,QAAiB;AAC3E,QAAO,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO"}
\ No newline at end of file
+{"version":3,"file":"version.mjs","names":[],"sources":["../../src/utils/version.ts"],"sourcesContent":["export function parseVersionString(version: VersionString): Version {\n const [major, minor, patch] = version.split('.')\n\n return [Number(major), Number(minor), Number(patch ?? '0')]\n}\n\nexport function isFirstVersionHigherThanSecond(first: Version, second: Version) {\n return (\n first[0] > second[0] ||\n (first[0] === second[0] && first[1] > second[1]) ||\n (first[0] === second[0] && first[1] === second[1] && first[2] > second[2])\n )\n}\n\nexport function isFirstVersionEqualToSecond(first: Version, second: Version) {\n return first[0] === second[0] && first[1] === second[1] && first[2] === second[2]\n}\n\nexport type VersionString = string\nexport type MajorVersion = number\nexport type MinorVersion = number\nexport type PatchVersion = number\nexport type Version = [MajorVersion, MinorVersion, PatchVersion]\n"],"mappings":";;;AAAA,SAAgB,mBAAmB,SAAiC;CAClE,MAAM,CAAC,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI;AAEhD,QAAO;EAAC,OAAO,MAAM;EAAE,OAAO,MAAM;EAAE,OAAO,SAAS,IAAI;EAAC;;AAG7D,SAAgB,+BAA+B,OAAgB,QAAiB;AAC9E,QACE,MAAM,KAAK,OAAO,MACjB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO,MAC5C,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK,OAAO;;AAI3E,SAAgB,4BAA4B,OAAgB,QAAiB;AAC3E,QAAO,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO,OAAO"}
\ No newline at end of file

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { RestAgentModules, RestMultiTenantAgentModules } from './cliAgent'
import type { TenantAgent } from '@credo-ts/tenants/build/TenantAgent'
import type { Request } from 'express'

import { Agent, LogLevel } from '@credo-ts/core'
import { uuid } from '@credo-ts/core/build/utils/uuid'
import jwt, { decode } from 'jsonwebtoken'
import { container } from 'tsyringe'

import { AgentRole, ErrorMessages, SCOPES } from './enums'
import { StatusException } from './errors'
import { TsLogger } from './utils/logger'
import { TenantAgent } from '@credo-ts/tenants'
import { randomUUID as uuid } from 'node:crypto'

// export type AgentType = Agent<RestAgentModules> | Agent<RestMultiTenantAgentModules> | TenantAgent<RestAgentModules>

Expand Down
26 changes: 13 additions & 13 deletions src/controllers/didcomm/connections/ConnectionController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConnectionRecordProps } from '@credo-ts/didcomm'
import type { DidCommConnectionRecordProps } from '@credo-ts/didcomm'

import { DidExchangeState } from '@credo-ts/didcomm'
import { DidCommDidExchangeState } from '@credo-ts/didcomm'
import { Request as Req } from 'express'
import { Controller, Delete, Example, Get, Path, Post, Query, Route, Tags, Security, Request } from 'tsoa'
import { injectable } from 'tsyringe'
Expand All @@ -23,20 +23,20 @@ export class ConnectionController extends Controller {
* @param theirLabel Their label
* @returns ConnectionRecord[]
*/
@Example<ConnectionRecordProps[]>([ConnectionRecordExample])
@Example<DidCommConnectionRecordProps[]>([ConnectionRecordExample])
@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT])
@Get('/didcomm/connections')
public async getAllConnections(
@Request() request: Req,
@Query('outOfBandId') outOfBandId?: string,
@Query('alias') alias?: string,
@Query('state') state?: DidExchangeState,
@Query('state') state?: DidCommDidExchangeState,
@Query('myDid') myDid?: string,
@Query('theirDid') theirDid?: string,
@Query('theirLabel') theirLabel?: string,
) {
try {
const connections = await request.agent.modules.connections.findAllByQuery({
const connections = await request.agent.modules.didcomm.connections.findAllByQuery({
outOfBandId,
alias,
myDid,
Expand All @@ -56,12 +56,12 @@ export class ConnectionController extends Controller {
* @param connectionId Connection identifier
* @returns ConnectionRecord
*/
@Example<ConnectionRecordProps>(ConnectionRecordExample)
@Example<DidCommConnectionRecordProps>(ConnectionRecordExample)
@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT])
@Get('/didcomm/connections/:connectionId')
public async getConnectionById(@Request() request: Req, @Path('connectionId') connectionId: RecordId) {
try {
const connection = await request.agent.modules.connections.findById(connectionId)
const connection = await request.agent.modules.didcomm.connections.findById(connectionId)

if (!connection) throw new NotFoundError(`Connection with connection id "${connectionId}" not found.`)

Expand All @@ -81,7 +81,7 @@ export class ConnectionController extends Controller {
public async deleteConnection(@Request() request: Req, @Path('connectionId') connectionId: RecordId) {
try {
this.setStatus(204)
await request.agent.modules.connections.deleteById(connectionId)
await request.agent.modules.didcomm.connections.deleteById(connectionId)
} catch (error) {
throw ErrorHandlingService.handle(error)
}
Expand All @@ -96,12 +96,12 @@ export class ConnectionController extends Controller {
* @param connectionId Connection identifier
* @returns ConnectionRecord
*/
@Example<ConnectionRecordProps>(ConnectionRecordExample)
@Example<DidCommConnectionRecordProps>(ConnectionRecordExample)
@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT])
@Post('/didcomm/connections/:connectionId/accept-request')
public async acceptRequest(@Request() request: Req, @Path('connectionId') connectionId: RecordId) {
try {
const connection = await request.agent.modules.connections.acceptRequest(connectionId)
const connection = await request.agent.modules.didcomm.connections.acceptRequest(connectionId)
return connection.toJSON()
} catch (error) {
throw ErrorHandlingService.handle(error)
Expand All @@ -117,12 +117,12 @@ export class ConnectionController extends Controller {
* @param connectionId Connection identifier
* @returns ConnectionRecord
*/
@Example<ConnectionRecordProps>(ConnectionRecordExample)
@Example<DidCommConnectionRecordProps>(ConnectionRecordExample)
@Security('jwt', [SCOPES.TENANT_AGENT, SCOPES.DEDICATED_AGENT])
@Post('/didcomm/connections/:connectionId/accept-response')
public async acceptResponse(@Request() request: Req, @Path('connectionId') connectionId: RecordId) {
try {
const connection = await request.agent.modules.connections.acceptResponse(connectionId)
const connection = await request.agent.modules.didcomm.connections.acceptResponse(connectionId)
return connection.toJSON()
} catch (error) {
throw ErrorHandlingService.handle(error)
Expand All @@ -132,7 +132,7 @@ export class ConnectionController extends Controller {
@Get('/didcomm/url/:invitationId')
public async getInvitation(@Request() request: Req, @Path('invitationId') invitationId: string) {
try {
const outOfBandRecord = await request.agent.modules.connections.findByInvitationDid(invitationId)
const outOfBandRecord = await request.agent.modules.didcomm.connections.findByInvitationDid(invitationId)

if (!outOfBandRecord)
throw new NotFoundError(`connection with invitationId "${invitationId}" not found.`)
Expand Down
Loading