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

fix: fix typing issues with typescript 4.9 #1214

Merged
merged 2 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"test": "jest",
"lint": "eslint --ignore-path .gitignore .",
"validate": "yarn lint && yarn check-types && yarn check-format",
"prepare": "husky install",
"run-mediator": "ts-node ./samples/mediator.ts",
"next-version-bump": "ts-node ./scripts/get-next-bump.ts"
},
Expand All @@ -31,12 +32,12 @@
"@types/eslint": "^7.2.13",
"@types/express": "^4.17.13",
"@types/jest": "^26.0.23",
"@types/node": "^15.14.4",
"@types/node": "^16.11.7",
"@types/uuid": "^8.3.1",
"@types/varint": "^6.0.0",
"@types/ws": "^7.4.6",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"conventional-changelog-conventionalcommits": "^5.0.0",
"conventional-recommended-bump": "^6.1.0",
"cors": "^2.8.5",
Expand All @@ -47,20 +48,21 @@
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"express": "^4.17.1",
"husky": "^7.0.1",
"indy-sdk": "^1.16.0-dev-1636",
"jest": "^27.0.4",
"lerna": "^4.0.0",
"prettier": "^2.3.1",
"rxjs": "^7.2.0",
"ts-jest": "^27.0.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.9.0",
"tsconfig-paths": "^4.1.2",
"tsyringe": "^4.7.0",
"typescript": "~4.3.0",
"typescript": "~4.9.4",
"ws": "^7.4.6"
},
"resolutions": {
"@types/node": "^15.14.4"
"@types/node": "^16.11.7"
},
"engines": {
"node": ">= 14"
Expand Down
6 changes: 3 additions & 3 deletions packages/action-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./build",
"clean": "rimraf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build",
"test": "jest"
Expand All @@ -31,7 +31,7 @@
},
"devDependencies": {
"reflect-metadata": "^0.1.13",
"rimraf": "~3.0.2",
"typescript": "~4.3.0"
"rimraf": "^4.0.7",
"typescript": "~4.9.4"
}
}
4 changes: 2 additions & 2 deletions packages/action-menu/src/services/ActionMenuService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { ActionMenuStateChangedEvent } from '../ActionMenuEvents'
import type { ActionMenuProblemReportMessage } from '../messages'
import type {
ClearMenuOptions,
CreateMenuOptions,
CreatePerformOptions,
CreateRequestOptions,
FindMenuOptions,
} from './ActionMenuServiceOptions'
import type { ActionMenuStateChangedEvent } from '../ActionMenuEvents'
import type { ActionMenuProblemReportMessage } from '../messages'
import type { AgentContext, InboundMessageContext, Logger, Query } from '@aries-framework/core'

import { AgentConfig, EventEmitter, AriesFrameworkError, injectable, JsonTransformer } from '@aries-framework/core'
Expand Down
4 changes: 2 additions & 2 deletions packages/action-menu/tests/action-menu.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { SubjectOutboundTransport } from '../../../tests/transport/SubjectOutbou
import { getAgentOptions, makeConnection } from '../../core/tests/helpers'
import testLogger from '../../core/tests/logger'

import { waitForActionMenuRecord } from './helpers'

import {
ActionMenu,
ActionMenuModule,
Expand All @@ -19,6 +17,8 @@ import {
ActionMenuState,
} from '@aries-framework/action-menu'

import { waitForActionMenuRecord } from './helpers'

const faberAgentOptions = getAgentOptions(
'Faber Action Menu',
{
Expand Down
6 changes: 3 additions & 3 deletions packages/anoncreds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./build",
"clean": "rimraf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build",
"test": "jest"
Expand All @@ -28,7 +28,7 @@
"@aries-framework/core": "0.3.2"
},
"devDependencies": {
"rimraf": "~3.0.2",
"typescript": "~4.3.0"
"rimraf": "^4.0.7",
"typescript": "~4.9.4"
}
}
4 changes: 2 additions & 2 deletions packages/anoncreds/src/services/AnonCredsHolderService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { CredentialInfo } from '../models'
import type { AnonCredsProof } from '../models/exchange'
import type {
CreateCredentialRequestOptions,
CreateCredentialRequestReturn,
Expand All @@ -9,6 +7,8 @@ import type {
GetCredentialsForProofRequestOptions,
GetCredentialsForProofRequestReturn,
} from './AnonCredsHolderServiceOptions'
import type { CredentialInfo } from '../models'
import type { AnonCredsProof } from '../models/exchange'
import type { AgentContext } from '@aries-framework/core'

export interface AnonCredsHolderService {
Expand Down
4 changes: 2 additions & 2 deletions packages/anoncreds/src/services/AnonCredsIssuerService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { AnonCredsCredentialOffer } from '../models/exchange'
import type { AnonCredsCredentialDefinition, AnonCredsSchema } from '../models/registry'
import type {
CreateSchemaOptions,
CreateCredentialDefinitionOptions,
CreateCredentialOfferOptions,
CreateCredentialReturn,
CreateCredentialOptions,
} from './AnonCredsIssuerServiceOptions'
import type { AnonCredsCredentialOffer } from '../models/exchange'
import type { AnonCredsCredentialDefinition, AnonCredsSchema } from '../models/registry'
import type { AgentContext } from '@aries-framework/core'

export interface AnonCredsIssuerService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { AnonCredsCredentialDefinition } from '../../models/registry'
import type {
AnonCredsResolutionMetadata,
Extensible,
AnonCredsOperationStateFailed,
AnonCredsOperationStateFinished,
AnonCredsOperationState,
} from './base'
import type { AnonCredsCredentialDefinition } from '../../models/registry'

export interface GetCredentialDefinitionReturn {
credentialDefinition: AnonCredsCredentialDefinition | null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AnonCredsRevocationList } from '../../models/registry'
import type { AnonCredsResolutionMetadata, Extensible } from './base'
import type { AnonCredsRevocationList } from '../../models/registry'

export interface GetRevocationListReturn {
revocationList: AnonCredsRevocationList | null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AnonCredsRevocationRegistryDefinition } from '../../models/registry'
import type { AnonCredsResolutionMetadata, Extensible } from './base'
import type { AnonCredsRevocationRegistryDefinition } from '../../models/registry'

export interface GetRevocationRegistryDefinitionReturn {
revocationRegistryDefinition: AnonCredsRevocationRegistryDefinition | null
Expand Down
2 changes: 1 addition & 1 deletion packages/anoncreds/src/services/registry/SchemaOptions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { AnonCredsSchema } from '../../models/registry'
import type {
AnonCredsResolutionMetadata,
Extensible,
AnonCredsOperationStateFailed,
AnonCredsOperationStateFinished,
AnonCredsOperationState,
} from './base'
import type { AnonCredsSchema } from '../../models/registry'

// Get Schema
export interface GetSchemaReturn {
Expand Down
6 changes: 3 additions & 3 deletions packages/bbs-signatures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./build",
"clean": "rimraf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build",
"test": "jest"
Expand All @@ -36,8 +36,8 @@
"devDependencies": {
"@aries-framework/node": "*",
"reflect-metadata": "^0.1.13",
"rimraf": "~3.0.2",
"typescript": "~4.3.0"
"rimraf": "^4.0.7",
"typescript": "~4.9.4"
},
"peerDependenciesMeta": {
"@animo-id/react-native-bbs-signatures": {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./build",
"clean": "rimraf ./build",
"compile": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn run build"
},
Expand Down Expand Up @@ -60,8 +60,8 @@
"@types/uuid": "^8.3.0",
"@types/varint": "^6.0.0",
"node-fetch": "^2.0",
"rimraf": "~3.0.2",
"rimraf": "^4.0.7",
"tslog": "^3.2.0",
"typescript": "~4.3.0"
"typescript": "~4.9.4"
}
}
6 changes: 3 additions & 3 deletions packages/core/src/agent/Agent.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { InboundTransport } from '../transport/InboundTransport'
import type { OutboundTransport } from '../transport/OutboundTransport'
import type { InitConfig } from '../types'
import type { AgentDependencies } from './AgentDependencies'
import type { AgentModulesInput } from './AgentModules'
import type { AgentMessageReceivedEvent } from './Events'
import type { InboundTransport } from '../transport/InboundTransport'
import type { OutboundTransport } from '../transport/OutboundTransport'
import type { InitConfig } from '../types'
import type { Subscription } from 'rxjs'

import { Subject } from 'rxjs'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent/AgentConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AgentDependencies } from './AgentDependencies'
import type { Logger } from '../logger'
import type { InitConfig } from '../types'
import type { AgentDependencies } from './AgentDependencies'

import { DID_COMM_TRANSPORT_QUEUE } from '../constants'
import { AriesFrameworkError } from '../error'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent/AgentModules.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AgentConfig } from './AgentConfig'
import type { Module, DependencyManager, ApiModule } from '../plugins'
import type { IsAny } from '../types'
import type { Constructor } from '../utils/mixins'
import type { AgentConfig } from './AgentConfig'

import { BasicMessagesModule } from '../modules/basic-messages'
import { ConnectionsModule } from '../modules/connections'
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/agent/BaseAgent.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Logger } from '../logger'
import type { CredentialsModule } from '../modules/credentials'
import type { DependencyManager } from '../plugins'
import type { AgentConfig } from './AgentConfig'
import type { AgentApi, EmptyModuleMap, ModulesMap, WithoutDefaultModules, CustomOrDefaultApi } from './AgentModules'
import type { TransportSession } from './TransportService'
import type { Logger } from '../logger'
import type { CredentialsModule } from '../modules/credentials'
import type { DependencyManager } from '../plugins'

import { AriesFrameworkError } from '../error'
import { BasicMessagesApi } from '../modules/basic-messages'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent/EnvelopeService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { EncryptedMessage, PlaintextMessage } from '../types'
import type { AgentMessage } from './AgentMessage'
import type { AgentContext } from './context'
import type { EncryptedMessage, PlaintextMessage } from '../types'

import { InjectionSymbols } from '../constants'
import { Key, KeyType } from '../crypto'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent/Events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConnectionRecord } from '../modules/connections'
import type { AgentMessage } from './AgentMessage'
import type { OutboundMessageContext, OutboundMessageSendStatus } from './models'
import type { ConnectionRecord } from '../modules/connections'
import type { Observable } from 'rxjs'

import { filter } from 'rxjs'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent/MessageHandlerRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class MessageHandlerRegistry {
*/
public get supportedMessageTypes() {
return this.messageHandlers
.reduce<typeof AgentMessage[]>((all, cur) => [...all, ...cur.supportedMessages], [])
.reduce<(typeof AgentMessage)[]>((all, cur) => [...all, ...cur.supportedMessages], [])
.map((m) => m.type)
}

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/agent/MessageReceiver.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ConnectionRecord } from '../modules/connections'
import type { InboundTransport } from '../transport'
import type { EncryptedMessage, PlaintextMessage } from '../types'
import type { AgentMessage } from './AgentMessage'
import type { DecryptedMessageContext } from './EnvelopeService'
import type { TransportSession } from './TransportService'
import type { AgentContext } from './context'
import type { ConnectionRecord } from '../modules/connections'
import type { InboundTransport } from '../transport'
import type { EncryptedMessage, PlaintextMessage } from '../types'

import { InjectionSymbols } from '../constants'
import { AriesFrameworkError } from '../error'
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/agent/MessageSender.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { AgentMessage } from './AgentMessage'
import type { EnvelopeKeys } from './EnvelopeService'
import type { AgentMessageSentEvent } from './Events'
import type { TransportSession } from './TransportService'
import type { AgentContext } from './context'
import type { ConnectionRecord } from '../modules/connections'
import type { ResolvedDidCommService } from '../modules/didcomm'
import type { DidDocument } from '../modules/dids'
import type { OutOfBandRecord } from '../modules/oob/repository'
import type { OutboundTransport } from '../transport/OutboundTransport'
import type { OutboundPackage, EncryptedMessage } from '../types'
import type { AgentMessage } from './AgentMessage'
import type { EnvelopeKeys } from './EnvelopeService'
import type { AgentMessageSentEvent } from './Events'
import type { TransportSession } from './TransportService'
import type { AgentContext } from './context'

import { DID_COMM_TRANSPORT_QUEUE, InjectionSymbols } from '../constants'
import { ReturnRouteTypes } from '../decorators/transport/TransportDecorator'
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/agent/TransportService.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AgentMessage } from './AgentMessage'
import type { EnvelopeKeys } from './EnvelopeService'
import type { ConnectionRecord } from '../modules/connections/repository'
import type { DidDocument } from '../modules/dids'
import type { EncryptedMessage } from '../types'
import type { AgentMessage } from './AgentMessage'
import type { EnvelopeKeys } from './EnvelopeService'

import { DID_COMM_TRANSPORT_QUEUE } from '../constants'
import { injectable } from '../plugins'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent/context/AgentContext.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AgentContextProvider } from './AgentContextProvider'
import type { DependencyManager } from '../../plugins'
import type { Wallet } from '../../wallet'
import type { AgentContextProvider } from './AgentContextProvider'

import { InjectionSymbols } from '../../constants'
import { AgentConfig } from '../AgentConfig'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/cache/PersistedLruCache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AgentContext } from '../agent'
import type { CacheRepository } from './CacheRepository'
import type { AgentContext } from '../agent'

import { LRUMap } from 'lru_map'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/crypto/JwsService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Jws, JwsGeneralFormat } from './JwsTypes'
import type { AgentContext } from '../agent'
import type { Buffer } from '../utils'
import type { Jws, JwsGeneralFormat } from './JwsTypes'

import { AriesFrameworkError } from '../error'
import { injectable } from '../plugins'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/crypto/WalletKeyPair.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Key } from './Key'
import type { LdKeyPairOptions } from '../modules/vc/models/LdKeyPair'
import type { Wallet } from '../wallet'
import type { Key } from './Key'

import { VerificationMethod } from '../modules/dids'
import { getKeyDidMappingByVerificationMethod } from '../modules/dids/domain/key-type/keyDidMapping'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { KeyType } from '..'
import type { SigningProvider } from './SigningProvider'
import type { KeyType } from '../KeyType'

import { AriesFrameworkError } from '../../error'
import { injectable, injectAll } from '../../plugins'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BaseMessageConstructor } from '../../agent/BaseMessage'
import type { ServiceDecoratorOptions } from './ServiceDecorator'
import type { BaseMessageConstructor } from '../../agent/BaseMessage'

import { Expose, Type } from 'class-transformer'
import { IsOptional, ValidateNested } from 'class-validator'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BaseEvent } from '../../agent/Events'
import type { BasicMessage } from './messages'
import type { BasicMessageRecord } from './repository'
import type { BaseEvent } from '../../agent/Events'

export enum BasicMessageEventTypes {
BasicMessageStateChanged = 'BasicMessageStateChanged',
Expand Down
Loading