Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

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 5c5b2c8 commit 7c7cd36
Show file tree
Hide file tree
Showing 22 changed files with 1,191 additions and 195 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:
# Ideally we only add this to the 'release' job so it doesn't limit PR runs, but github can't guarantee the job order in that case:
# "When concurrency is specified at the job level, order is not guaranteed for jobs or runs that queue within 5 minutes of each other."
concurrency:
group: aries-javascript-user-profile${{ github.ref }}-${{ github.repository }}-{{ github.event_name }}
group: credo-ts-user-profile${{ github.ref }}-${{ github.repository }}-{{ github.event_name }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
name: Validate
steps:
- name: Checkout aries-javascript-user-profile
- name: Checkout credo-ts-user-profile
uses: actions/checkout@v3

- name: Get yarn cache directory path
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
name: Release
needs: [validate]
steps:
- name: Checkout aries-javascript-user-profile
- name: Checkout credo-ts-user-profile
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ on:
# Ideally we only add this to the 'release' job so it doesn't limit PR runs, but github can't guarantee the job order in that case:
# "When concurrency is specified at the job level, order is not guaranteed for jobs or runs that queue within 5 minutes of each other."
concurrency:
group: aries-javascript-user-profile${{ github.ref }}-${{ github.repository }}-{{ github.event_name }}
group: credo-ts-user-profile${{ github.ref }}-${{ github.repository }}-{{ github.event_name }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
name: Validate
steps:
- name: Checkout aries-javascript-user-profile
- name: Checkout credo-ts-user-profile
uses: actions/checkout@v3

- name: Get yarn cache directory path
Expand Down Expand Up @@ -56,9 +56,9 @@ jobs:
name: Release
needs: [validate]
# Only run on workflow dispatch to main branch
if: github.ref == 'refs/heads/main' && github.repository == '2060-io/aries-javascript-user-profile' && github.event_name == 'workflow_dispatch'
if: github.ref == 'refs/heads/main' && github.repository == '2060-io/credo-ts-user-profile' && github.event_name == 'workflow_dispatch'
steps:
- name: Checkout aries-javascript-user-profile
- name: Checkout credo-ts-user-profile
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This module is used to provide an Aries Agent built with Aries Framework JavaScr
It's conceived as an extension module for Aries Framework JavaScript which can be injected to an existing agent instance:

```ts
import { UserProfileModule } from 'aries-javascript-user-profile'
import { UserProfileModule } from 'credo-ts-user-profile'

const agent = new Agent({
config: {
Expand Down
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "aries-framework-user-profile",
"name": "credo-ts-user-profile",
"version": "0.0.0",
"description": "User Profile protocol implementation for aries-framework-javascript",
"description": "User Profile protocol implementation for credo-ts-javascript",
"author": "2060.io",
"homepage": "https://github.com/2060-io/aries-javascript-receipts",
"homepage": "https://github.com/2060-io/credo-ts-receipts",
"license": "ISC",
"main": "build/index.js",
"types": "build/index.js",
Expand All @@ -23,22 +23,21 @@
},
"repository": {
"type": "git",
"url": "https://github.com/2060-io/aries-javascript-user-profile"
"url": "https://github.com/2060-io/credo-ts-user-profile"
},
"bugs": {
"url": "https://github.com/2060-io/aries-javascript-user-profile/issues"
"url": "https://github.com/2060-io/credo-ts-user-profile/issues"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@aries-framework/askar": "^0.4.0",
"@aries-framework/node": "^0.4.0",
"@hyperledger/aries-askar-nodejs": "^0.1.0",
"@credo-ts/askar": "^0.5.0-alpha.116",
"@credo-ts/node": "^0.5.0-alpha.116",
"@hyperledger/aries-askar-nodejs": "^0.2.0-dev.6",
"@types/jest": "^26.0.23",
"@types/node": "^16.11.7",
"@types/node-fetch": "^2.6.4",
"@types/node": "^20.11.16",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
Expand All @@ -51,17 +50,14 @@
"typescript": "~4.9.4"
},
"dependencies": {
"@aries-framework/core": "^0.4.0",
"@credo-ts/core": "^0.5.0-alpha.116",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"tsyringe": "^4.7.0",
"tsyringe": "^4.8.0",
"uuid": "^9.0.0"
},
"resolutions": {
"ref-napi": "npm:@2060.io/ref-napi"
},
"release-it": {
"github": {
"release": true
Expand Down
2 changes: 1 addition & 1 deletion src/UserProfileApi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { injectable, MessageSender, AgentContext, OutboundMessageContext, ConnectionsApi } from '@aries-framework/core'
import { injectable, MessageSender, AgentContext, OutboundMessageContext, ConnectionsApi } from '@credo-ts/core'
import { ProfileHandler, RequestProfileHandler } from './handlers'
import { UserProfileService } from './services'
import { UserProfileData } from './model'
Expand Down
4 changes: 2 additions & 2 deletions src/UserProfileModule.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DependencyManager, FeatureRegistry, Module } from '@aries-framework/core'
import type { DependencyManager, FeatureRegistry, Module } from '@credo-ts/core'

import { Protocol } from '@aries-framework/core'
import { Protocol } from '@credo-ts/core'

import { UserProfileApi } from './UserProfileApi'
import { UserProfileService } from './services'
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/ProfileHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageHandler, MessageHandlerInboundMessage, OutboundMessageContext } from '@aries-framework/core'
import { MessageHandler, MessageHandlerInboundMessage, OutboundMessageContext } from '@credo-ts/core'
import { ProfileMessage } from '../messages'
import { UserProfileService } from '../services'

Expand Down
2 changes: 1 addition & 1 deletion src/handlers/RequestProfileHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageHandler, MessageHandlerInboundMessage, OutboundMessageContext } from '@aries-framework/core'
import { MessageHandler, MessageHandlerInboundMessage, OutboundMessageContext } from '@credo-ts/core'
import { RequestProfileMessage } from '../messages'
import { UserProfileService } from '../services'

Expand Down
2 changes: 1 addition & 1 deletion src/messages/ProfileMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AgentMessage, Attachment, IsValidMessageType, parseMessageType } from '@aries-framework/core'
import { AgentMessage, Attachment, IsValidMessageType, parseMessageType } from '@credo-ts/core'
import { Expose } from 'class-transformer'
import { IsBoolean, IsOptional } from 'class-validator'
import { UserProfile, UserProfileData } from '../model'
Expand Down
2 changes: 1 addition & 1 deletion src/messages/RequestProfileMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AgentMessage, IsValidMessageType, parseMessageType } from '@aries-framework/core'
import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core'
import { Expose } from 'class-transformer'
import { UserProfile } from '../model'

Expand Down
2 changes: 1 addition & 1 deletion src/model/ConnectionMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConnectionRecord } from '@aries-framework/core'
import { ConnectionRecord } from '@credo-ts/core'
import { UserProfileData } from '../model'

export const getConnectionProfile = (record: ConnectionRecord) =>
Expand Down
2 changes: 1 addition & 1 deletion src/repository/UserProfileRecord.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseRecord } from '@aries-framework/core'
import { BaseRecord } from '@credo-ts/core'
import { UserProfileData, PictureData } from '../model'
import { v4 as uuid } from 'uuid'

Expand Down
4 changes: 2 additions & 2 deletions src/repository/UserProfileRepository.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter, InjectionSymbols } from '@aries-framework/core'
import { Repository, StorageService } from '@aries-framework/core'
import { EventEmitter, InjectionSymbols } from '@credo-ts/core'
import { Repository, StorageService } from '@credo-ts/core'
import { inject, scoped, Lifecycle } from 'tsyringe'
import { UserProfileRecord } from './UserProfileRecord'

Expand Down
2 changes: 1 addition & 1 deletion src/services/UserProfileEvents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseEvent, ConnectionRecord } from '@aries-framework/core'
import { BaseEvent, ConnectionRecord } from '@credo-ts/core'
import { ConnectionProfileKey } from '../messages'
import { UserProfileData } from '../model'
import { UserProfileRecord } from '../repository'
Expand Down
8 changes: 1 addition & 7 deletions src/services/UserProfileService.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { Lifecycle, scoped } from 'tsyringe'
import {
AgentContext,
ConnectionRecord,
ConnectionService,
EventEmitter,
InboundMessageContext,
} from '@aries-framework/core'
import { AgentContext, ConnectionRecord, ConnectionService, EventEmitter, InboundMessageContext } from '@credo-ts/core'
import { UserProfileRepository, UserProfileRecord } from '../repository'
import { UserProfileData } from '../model'
import {
Expand Down
13 changes: 3 additions & 10 deletions test/profile.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { agentDependencies } from '@aries-framework/node'
import { AskarModule } from '@aries-framework/askar'
import { agentDependencies } from '@credo-ts/node'
import { AskarModule } from '@credo-ts/askar'
import { ariesAskar } from '@hyperledger/aries-askar-nodejs'

import {
Agent,
ConnectionRecord,
ConsoleLogger,
DidExchangeState,
EncryptedMessage,
LogLevel,
} from '@aries-framework/core'
import { Agent, ConnectionRecord, ConsoleLogger, DidExchangeState, EncryptedMessage, LogLevel } from '@credo-ts/core'
import { v4 as uuid } from 'uuid'
import { filter, firstValueFrom, map, Subject, timeout } from 'rxjs'
import { UserProfileModule } from '../src/UserProfileModule'
Expand Down
6 changes: 3 additions & 3 deletions test/recordUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import type {
RecordUpdatedEvent,
Agent,
BaseEvent,
} from '@aries-framework/core'
import type { Constructor } from '@aries-framework/core/build/utils/mixins'
} from '@credo-ts/core'
import type { Constructor } from '@credo-ts/core/build/utils/mixins'

import { RepositoryEventTypes } from '@aries-framework/core'
import { RepositoryEventTypes } from '@credo-ts/core'
import { map, filter, pipe } from 'rxjs'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion test/transport/SubjectInboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TransportService,
TransportSession,
utils,
} from '@aries-framework/core'
} from '@credo-ts/core'
import type { Subscription } from 'rxjs'

import { Subject } from 'rxjs'
Expand Down
8 changes: 4 additions & 4 deletions test/transport/SubjectOutboundTransport.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { SubjectMessage } from './SubjectInboundTransport'
import type { OutboundPackage, OutboundTransport, Agent, Logger } from '@aries-framework/core'
import type { OutboundPackage, OutboundTransport, Agent, Logger } from '@credo-ts/core'

import { takeUntil, Subject, take } from 'rxjs'

import { MessageReceiver, InjectionSymbols, AriesFrameworkError } from '@aries-framework/core'
import { MessageReceiver, InjectionSymbols, CredoError } from '@credo-ts/core'

export class SubjectOutboundTransport implements OutboundTransport {
private logger!: Logger
Expand Down Expand Up @@ -36,13 +36,13 @@ export class SubjectOutboundTransport implements OutboundTransport {
const { payload, endpoint } = outboundPackage

if (!endpoint) {
throw new AriesFrameworkError('Cannot send message to subject without endpoint')
throw new CredoError('Cannot send message to subject without endpoint')
}

const subject = this.subjectMap[endpoint]

if (!subject) {
throw new AriesFrameworkError(`No subject found for endpoint ${endpoint}`)
throw new CredoError(`No subject found for endpoint ${endpoint}`)
}

// Create a replySubject just for this session. Both ends will be able to close it,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"aries-javascript-media-sharing/*": ["src"]
"credo-ts-media-sharing/*": ["src"]
}
},
"include": ["packages", "./.eslintrc.js", "./jest.config.ts", "./jest.config.base.ts", "types", "test", "samples"],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"aries-javascript-user-profile/*": ["src"]
"credo-ts-user-profile/*": ["src"]
},
"types": ["jest", "node"],
"watch": true
Expand Down
Loading

0 comments on commit 7c7cd36

Please sign in to comment.