Skip to content

Commit

Permalink
feat: update to credo-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
genaris committed Feb 3, 2024
1 parent 7c273d2 commit f849a5c
Show file tree
Hide file tree
Showing 5 changed files with 708 additions and 164 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "aries-framework-didweb-anoncreds",
"name": "credo-ts-didweb-anoncreds",
"version": "0.0.0.alpha-0",
"description": "did:web AnonCreds registry for aries-framework-javascript",
"description": "did:web AnonCreds registry for Credo",
"author": "2060.io",
"homepage": "https://github.com/2060-io/aries-javascript-didweb-anoncreds",
"homepage": "https://github.com/2060-io/credo-ts-didweb-anoncreds",
"license": "ISC",
"main": "build/index.js",
"types": "build/index.js",
Expand All @@ -23,17 +23,17 @@
},
"repository": {
"type": "git",
"url": "https://github.com/2060-io/aries-javascript-didweb-anoncreds"
"url": "https://github.com/2060-io/credo-ts-didweb-anoncreds"
},
"bugs": {
"url": "https://github.com/2060-io/aries-javascript-didweb-anoncreds/issues"
"url": "https://github.com/2060-io/credo-ts-didweb-anoncreds/issues"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@aries-framework/node": "0.5.0-alpha.71",
"@credo-ts/node": "0.5.0-alpha.116",
"@types/jest": "^26.0.23",
"@types/node-fetch": "^2.6.10",
"@types/uuid": "^9.0.0",
Expand All @@ -49,8 +49,9 @@
"typescript": "~4.9.5"
},
"dependencies": {
"@aries-framework/anoncreds": "^0.5.0-alpha.71",
"@aries-framework/core": "^0.5.0-alpha.71",
"@credo-ts/anoncreds": "^0.5.0-alpha.116",
"@credo-ts/core": "^0.5.0-alpha.116",
"@hyperledger/anoncreds-shared": "^0.2.0-dev.9",
"canonicalize": "^1.0.8",
"class-transformer": "0.5.1",
"class-validator": "0.13.1",
Expand All @@ -59,7 +60,7 @@
"query-string": "7.1.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"tsyringe": "^4.6.0",
"tsyringe": "^4.8.0",
"uuid": "^9.0.0"
},
"release-it": {
Expand Down
5 changes: 2 additions & 3 deletions src/anoncreds/DidWebAnonCredsRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
RegisterRevocationStatusListReturn,
RegisterSchemaOptions,
RegisterSchemaReturn,
} from '@aries-framework/anoncreds'
import { AgentContext, DidsApi } from '@aries-framework/core'
} from '@credo-ts/anoncreds'
import { AgentContext, DidsApi } from '@credo-ts/core'
import { parse } from 'did-resolver'
import { parseUrl } from 'query-string'
import { AnonCredsResourceResolutionResult } from './AnonCredsResourceResolutionResult'
Expand Down Expand Up @@ -255,7 +255,6 @@ export class DidWebAnonCredsRegistry implements AnonCredsRegistry {
revocationStatusListState: {
state: 'finished',
revocationStatusList: { ...options.revocationStatusList, timestamp },
timestamp: timestamp.toString(),
},
registrationMetadata: {},
revocationStatusListMetadata: {
Expand Down
2 changes: 1 addition & 1 deletion src/anoncreds/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TypedArrayEncoder, Hasher } from '@aries-framework/core'
import { TypedArrayEncoder, Hasher } from '@credo-ts/core'
import canonicalize from 'canonicalize'

export function calculateResourceId(resourceObjectValue: unknown) {
Expand Down
8 changes: 4 additions & 4 deletions test/schema.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { AgentConfig, AgentContext, DependencyManager, DidDocument, JsonTransformer } from '@aries-framework/core'
import { agentDependencies } from '@aries-framework/node'
import { AgentConfig, AgentContext, DependencyManager, DidDocument, JsonTransformer } from '@credo-ts/core'
import { agentDependencies } from '@credo-ts/node'
import { DidWebAnonCredsRegistry } from '../src/anoncreds'
import didDocument1 from './__fixtures__/did1.json'

import { DidsApi } from '@aries-framework/core/build/modules/dids/DidsApi'
import { DidsApi } from '@credo-ts/core/build/modules/dids/DidsApi'

jest.mock('node-fetch')
import fetch, { Response } from 'node-fetch'

jest.mock('@aries-framework/core/build/modules/dids/DidsApi')
jest.mock('@credo-ts/core/build/modules/dids/DidsApi')
const DidsApiMock = DidsApi as jest.Mock<DidsApi>
const didsApiMock = new DidsApiMock()

Expand Down
Loading

0 comments on commit f849a5c

Please sign in to comment.