Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: update to credo 0.5 #239

Merged
merged 5 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Setup Libindy
uses: ./.github/actions/setup-libindy

- name: Setup node v16
- name: Setup node v18
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org/'
cache: yarn

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
- name: Setup Libindy
uses: ./.github/actions/setup-libindy

- name: Setup node v16
- name: Setup node v18
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org/'
cache: yarn

Expand All @@ -78,7 +78,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x]

steps:
- name: Checkout credo-ts-ext
Expand Down Expand Up @@ -131,10 +131,10 @@ jobs:
- name: Setup Libindy
uses: ./.github/actions/setup-libindy

- name: Setup node v16
- name: Setup node v18
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org/'
cache: yarn

Expand Down Expand Up @@ -175,10 +175,10 @@ jobs:
uses: ./.github/actions/setup-libindy
if: ${{ steps.release-please.outputs.release_created }}

- name: Setup node v16
- name: Setup node v18
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org/'
cache: yarn
if: ${{ steps.release-please.outputs.release_created }}
Expand Down
41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"**/@credo-ts/*",
"**/@credo-ts/*/**",
"@credo-ts/*/**",
"@aries-framework/*",
"**/@aries-framework/*",
"**/@aries-framework/*/**",
"@aries-framework/*/**",
"@hyperledger/*",
"**/@hyperledger/*",
"**/@hyperledger/*/**",
Expand Down Expand Up @@ -46,38 +50,39 @@
"check-types": "yarn check-types:build && yarn check-types:tests",
"check-types:tests": "tsc -p tsconfig.test.json --noEmit",
"check-types:build": "yarn workspaces run tsc --noEmit -p tsconfig.build.json",
"prettier": "prettier '**/*.+(js|json|ts|md|yml|yaml)'",
"prettier": "prettier '**/*.+(js|json|ts|tsx|md|yml|yaml)'",
"format": "yarn prettier --write",
"check-format": "yarn prettier --list-different",
"test": "jest",
"lint": "eslint --ignore-path .gitignore .",
"validate": "yarn lint && yarn check-types && yarn check-format"
},
"devDependencies": {
"@types/eslint": "^8.40.2",
"@types/eslint": "^8.56.2",
"@types/jest": "^29.5.2",
"@types/node": "^16.7.10",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"conventional-changelog-conventionalcommits": "^6.1.0",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"conventional-changelog-conventionalcommits": "^7.0.2",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.5.0",
"prettier": "^2.8.8",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "~4.4.0",
"rimraf": "^5.0.1"
"typescript": "~5.3.3",
"rimraf": "^5.0.5"
},
"engines": {
"node": ">= 12"
"node": ">= 16"
},
"resolutions": {
"@types/indy-sdk": "1.16.9",
"@jest/types": "^29.5.0"
"@jest/types": "^29.5.0",
"@types/node": "^18.0.0"
}
}
14 changes: 6 additions & 8 deletions packages/push-notifications/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@
"test": "jest"
},
"devDependencies": {
"@aries-framework/core": "^0.4.0",
"@aries-framework/indy-sdk": "^0.4.0",
"@aries-framework/node": "^0.4.0",
"@types/node-fetch": "^2.6.3",
"indy-sdk": "^1.16.0-dev-1655",
"@hyperledger/aries-askar-nodejs": "^0.2.0",
"@credo-ts/askar": "^0.5.0-alpha.127",
"@credo-ts/core": "^0.5.0-alpha.127",
"@credo-ts/node": "^0.5.0-alpha.127",
"ts-node-dev": "^1.1.8"
},
"peerDependencies": {
"@aries-framework/core": "^0.4.0"
"@credo-ts/core": "^0.5.0-alpha.127"
},
"dependencies": {
"class-transformer": "0.5.1",
"class-validator": "0.14.0",
"reflect-metadata": "^0.1.13",
"class-validator": "0.14.1",
"tsyringe": "^4.6.0"
}
}
10 changes: 2 additions & 8 deletions packages/push-notifications/src/apns/PushNotificationsApnsApi.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import type { ApnsDeviceInfo } from './models'

import {
OutboundMessageContext,
AgentContext,
ConnectionService,
injectable,
MessageSender,
} from '@aries-framework/core'
import { OutboundMessageContext, AgentContext, ConnectionService, injectable, MessageSender } from '@credo-ts/core'

import { PushNotificationsApnsService } from './PushNotificationsApnsService'

Expand All @@ -21,7 +15,7 @@ export class PushNotificationsApnsApi {
messageSender: MessageSender,
pushNotificationsService: PushNotificationsApnsService,
connectionService: ConnectionService,
agentContext: AgentContext
agentContext: AgentContext,
) {
this.messageSender = messageSender
this.pushNotificationsService = pushNotificationsService
Expand Down
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 { PushNotificationsApnsApi } from './PushNotificationsApnsApi'
import { PushNotificationsApnsService } from './PushNotificationsApnsService'
Expand All @@ -25,7 +25,7 @@ export class PushNotificationsApnsModule implements Module {
new Protocol({
id: 'https://didcomm.org/push-notifications-apns/1.0',
roles: [PushNotificationsApnsRole.Sender, PushNotificationsApnsRole.Receiver],
})
}),
)

dependencyManager.registerMessageHandlers([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PushNotificationsApnsProblemReportReason } from './PushNotificationsApnsProblemReportReason'
import type { ProblemReportErrorOptions } from '@aries-framework/core'
import type { ProblemReportErrorOptions } from '@credo-ts/core'

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

import { PushNotificationsApnsProblemReportMessage } from '../messages'

Expand All @@ -18,7 +18,10 @@ interface PushNotificationsApnsProblemReportErrorOptions extends ProblemReportEr
export class PushNotificationsApnsProblemReportError extends ProblemReportError {
public problemReport: PushNotificationsApnsProblemReportMessage

public constructor(public message: string, { problemCode }: PushNotificationsApnsProblemReportErrorOptions) {
public constructor(
public message: string,
{ problemCode }: PushNotificationsApnsProblemReportErrorOptions,
) {
super(message, { problemCode })
this.problemReport = new PushNotificationsApnsProblemReportMessage({
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsApnsDeviceInfoMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsApnsGetDeviceInfoMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsApnsProblemReportMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsApnsSetDeviceInfoMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ApnsDeviceInfo } from '../models'

import { AgentMessage, IsValidMessageType, parseMessageType } from '@aries-framework/core'
import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core'
import { Expose } from 'class-transformer'
import { IsString, ValidateIf } from 'class-validator'

Expand Down
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'

interface PushNotificationsApnsGetDeviceInfoOptions {
id?: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ProblemReportMessageOptions } from '@aries-framework/core'
import type { ProblemReportMessageOptions } from '@credo-ts/core'

import { IsValidMessageType, parseMessageType, ProblemReportMessage } from '@aries-framework/core'
import { IsValidMessageType, parseMessageType, ProblemReportMessage } from '@credo-ts/core'

export type PushNotificationsApnsProblemReportMessageOptions = ProblemReportMessageOptions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ApnsDeviceInfo } from '../models'

import { AgentMessage, IsValidMessageType, parseMessageType } from '@aries-framework/core'
import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core'
import { Expose } from 'class-transformer'
import { IsString, ValidateIf } from 'class-validator'

Expand Down
10 changes: 2 additions & 8 deletions packages/push-notifications/src/fcm/PushNotificationsFcmApi.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import type { FcmDeviceInfo } from './models'

import {
OutboundMessageContext,
AgentContext,
ConnectionService,
injectable,
MessageSender,
} from '@aries-framework/core'
import { OutboundMessageContext, AgentContext, ConnectionService, injectable, MessageSender } from '@credo-ts/core'

import { PushNotificationsFcmService } from './PushNotificationsFcmService'

Expand All @@ -21,7 +15,7 @@ export class PushNotificationsFcmApi {
messageSender: MessageSender,
pushNotificationsService: PushNotificationsFcmService,
connectionService: ConnectionService,
agentContext: AgentContext
agentContext: AgentContext,
) {
this.messageSender = messageSender
this.pushNotificationsService = pushNotificationsService
Expand Down
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 { PushNotificationsFcmApi } from './PushNotificationsFcmApi'
import { PushNotificationsFcmService } from './PushNotificationsFcmService'
Expand All @@ -27,7 +27,7 @@ export class PushNotificationsFcmModule implements Module {
new Protocol({
id: 'https://didcomm.org/push-notifications-fcm/1.0',
roles: [PushNotificationsFcmRole.Sender, PushNotificationsFcmRole.Receiver],
})
}),
)

dependencyManager.registerMessageHandlers([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FcmDeviceInfo } from './models/FcmDeviceInfo'
import type { InboundMessageContext } from '@aries-framework/core'
import type { InboundMessageContext } from '@credo-ts/core'

import { AriesFrameworkError } from '@aries-framework/core'
import { CredoError } from '@credo-ts/core'
import { Lifecycle, scoped } from 'tsyringe'

import { PushNotificationsFcmProblemReportError, PushNotificationsFcmProblemReportReason } from './errors'
Expand All @@ -18,7 +18,7 @@ export class PushNotificationsFcmService {
(deviceInfo.deviceToken === null && deviceInfo.devicePlatform !== null) ||
(deviceInfo.deviceToken !== null && deviceInfo.devicePlatform === null)
)
throw new AriesFrameworkError('Both or none of deviceToken and devicePlatform must be null')
throw new CredoError('Both or none of deviceToken and devicePlatform must be null')

return new PushNotificationsFcmSetDeviceInfoMessage(deviceInfo)
}
Expand All @@ -33,7 +33,7 @@ export class PushNotificationsFcmService {
(deviceInfo.deviceToken === null && deviceInfo.devicePlatform !== null) ||
(deviceInfo.deviceToken !== null && deviceInfo.devicePlatform === null)
)
throw new AriesFrameworkError('Both or none of deviceToken and devicePlatform must be null')
throw new CredoError('Both or none of deviceToken and devicePlatform must be null')

return new PushNotificationsFcmDeviceInfoMessage({
threadId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PushNotificationsFcmProblemReportReason } from './PushNotificationsFcmProblemReportReason'
import type { ProblemReportErrorOptions } from '@aries-framework/core'
import type { ProblemReportErrorOptions } from '@credo-ts/core'

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

import { PushNotificationsFcmProblemReportMessage } from '../messages'

Expand All @@ -18,7 +18,10 @@ interface PushNotificationsFcmProblemReportErrorOptions extends ProblemReportErr
export class PushNotificationsFcmProblemReportError extends ProblemReportError {
public problemReport: PushNotificationsFcmProblemReportMessage

public constructor(public message: string, { problemCode }: PushNotificationsFcmProblemReportErrorOptions) {
public constructor(
public message: string,
{ problemCode }: PushNotificationsFcmProblemReportErrorOptions,
) {
super(message, { problemCode })
this.problemReport = new PushNotificationsFcmProblemReportMessage({
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsFcmDeviceInfoMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsFcmGetDeviceInfoMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsFcmProblemReportMessage } from '../messages'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageHandler, MessageHandlerInboundMessage } from '@aries-framework/core'
import type { MessageHandler, MessageHandlerInboundMessage } from '@credo-ts/core'

import { PushNotificationsFcmService } from '../PushNotificationsFcmService'
import { PushNotificationsFcmSetDeviceInfoMessage } from '../messages'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FcmDeviceInfo } from '../models'

import { AgentMessage, IsValidMessageType, parseMessageType } from '@aries-framework/core'
import { AgentMessage, IsValidMessageType, parseMessageType } from '@credo-ts/core'
import { Expose } from 'class-transformer'
import { IsString, ValidateIf } from 'class-validator'

Expand Down
Loading
Loading