Skip to content

Commit

Permalink
chore!: update to credo 0.5
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Feb 13, 2024
1 parent 3d90812 commit 19ab152
Show file tree
Hide file tree
Showing 79 changed files with 2,915 additions and 1,714 deletions.
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
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 PushNotificationsFcmGetDeviceInfoOptions {
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 PushNotificationsFcmProblemReportMessageOptions = ProblemReportMessageOptions

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Agent } from '@aries-framework/core'
import type { Agent } from '@credo-ts/core'

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

import { PushNotificationsApnsService } from '../src/apns/PushNotificationsApnsService'

Expand Down Expand Up @@ -39,7 +39,7 @@ describe('Push Notifications apns', () => {
'@type': 'https://didcomm.org/push-notifications-apns/1.0/device-info',
device_token: '1234-1234-1234-1234',
'~thread': expect.objectContaining({ thid: '5678-5678-5678-5678' }),
})
}),
)
})
})
Expand Down
Loading

0 comments on commit 19ab152

Please sign in to comment.