Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertoledo committed Sep 23, 2023
1 parent a4ff1af commit 75bc40d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/framework-core/src/booster-command-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CommandHandlerGlobalError,
TraceActionTypes,
CommandInput,
CommandInterface,
} from '@boostercloud/framework-types'
import { RegisterHandler } from './booster-register-handler'
import { createInstance, getLogger } from '@boostercloud/framework-common-helpers'
Expand Down Expand Up @@ -38,7 +39,7 @@ export class BoosterCommandDispatcher {

await commandMetadata.authorizer(commandEnvelope.currentUser, commandEnvelope)

const commandClass = commandMetadata.class
const commandClass = commandMetadata.class as CommandInterface<any, any>
logger.debug('Found the following command:', commandClass.name)

const migratedCommandEnvelope = await new SchemaMigrator(this.config).migrate<CommandEnvelope>(commandEnvelope)
Expand Down
3 changes: 2 additions & 1 deletion packages/framework-core/src/booster-query-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
QueryHandlerGlobalError,
QueryInfo,
QueryInput,
QueryInterface,
} from '@boostercloud/framework-types'
import { createInstance, getLogger } from '@boostercloud/framework-common-helpers'
import { BoosterGlobalErrorDispatcher } from './booster-global-error-dispatcher'
Expand Down Expand Up @@ -33,7 +34,7 @@ export class BoosterQueryDispatcher {

await queryMetadata.authorizer(queryEnvelope.currentUser, queryEnvelope)

const queryClass = queryMetadata.class
const queryClass = queryMetadata.class as QueryInterface<any, any>
logger.debug('Found the following query:', queryClass.name)

let result: unknown
Expand Down
2 changes: 1 addition & 1 deletion packages/framework-core/src/decorators/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const Notification =
*/
export function partitionKey(
notificationClass: Class<NotificationInterface>,
_functionName: string,
_functionName: string | undefined, // Constructors don't have a name
parameterIndex: number
): void {
const args = getFunctionArguments(notificationClass)
Expand Down
6 changes: 5 additions & 1 deletion packages/metadata-booster/src/metadata-extractors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ function getTypeInfo(tp: Type, nd?: Node): TypeInfo {
// This happens for literal objects like `{ a: string, b: { c: string } }`
typeInfo.typeName = 'Object'
}
if (typeInfo.name === 'unknown') {
typeInfo.typeName = 'Object'
}
break
case 'Interface':
case 'Type':
Expand All @@ -152,7 +155,8 @@ function getTypeInfo(tp: Type, nd?: Node): TypeInfo {
break
}

if (typeInfo.typeName === '') throw new Error(`Could not extract typeName for type ${JSON.stringify(typeInfo)}`)
if (typeInfo.typeName === '')
throw new Error(`Could not extract typeName for type ${JSON.stringify(typeInfo)}`)

return typeInfo
}
Expand Down

0 comments on commit 75bc40d

Please sign in to comment.