Skip to content

Commit

Permalink
chore!: update to credo 0.5 (#239)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
  • Loading branch information
TimoGlastra authored Feb 14, 2024
1 parent 3d90812 commit 16e44ec
Show file tree
Hide file tree
Showing 81 changed files with 2,931 additions and 1,740 deletions.
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
42 changes: 16 additions & 26 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,18 @@ jobs:
if: needs.ci-trigger.outputs.triggered == 'true'
steps:
- name: Checkout credo-ts-ext
uses: actions/checkout@v2

# setup dependencies
- name: Setup Libindy
uses: ./.github/actions/setup-libindy
uses: actions/checkout@v4

- 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

# Ignore scripts so we don't need libindy setup
- name: Install dependencies
run: yarn install
run: yarn install --ignore-scripts

- name: Linting
run: yarn lint
Expand All @@ -78,11 +75,11 @@ jobs:

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

steps:
- name: Checkout credo-ts-ext
uses: actions/checkout@v2
uses: actions/checkout@v4

# setup dependencies
- name: Setup Libindy
Expand Down Expand Up @@ -125,21 +122,18 @@ jobs:
packages: ${{ steps.get-packages.outputs.packages }}
steps:
- name: Checkout credo-ts-ext
uses: actions/checkout@v2

# Some packages need indy-sdk for node as part of yarn install
- name: Setup Libindy
uses: ./.github/actions/setup-libindy
uses: actions/checkout@v4

- 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

# Ignore scripts so we don't need libindy setup
- name: Install dependencies
run: yarn install
run: yarn install --ignore-scripts

- id: get-packages
name: Get all NPM packages
Expand Down Expand Up @@ -170,21 +164,17 @@ jobs:
uses: actions/checkout@v4
if: ${{ steps.release-please.outputs.release_created }}

# Some packages need indy-sdk for node as part of yarn install
- name: Setup Libindy
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 }}

# Ignore scripts so we don't need libindy setup
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-scripts
if: ${{ steps.release-please.outputs.release_created }}

- name: Release to NPM
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
Loading

0 comments on commit 16e44ec

Please sign in to comment.