Skip to content

Commit

Permalink
Export the Booster object without proxying it in the core index
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertoledo committed Nov 2, 2023
1 parent b37b85c commit f2572cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions packages/framework-core/src/booster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class Booster {
*
* @deprecated [EOL v3] Please use the static `boosterEventDispatcher` function exported by `@boostercloud/framework-core` instead.
*/
public static dispatchEvent(rawEvents: unknown): Promise<unknown> {
static dispatchEvent(rawEvents: unknown): Promise<unknown> {
return boosterEventDispatcher(rawEvents)
}

Expand All @@ -180,7 +180,7 @@ export class Booster {
*
* @deprecated [EOL v3] Please use the static `boosterServeGraphQL` function exported by `@boostercloud/framework-core` instead.
*/
public static serveGraphQL(request: unknown): Promise<unknown> {
static serveGraphQL(request: unknown): Promise<unknown> {
return boosterServeGraphQL(request)
}

Expand All @@ -189,7 +189,7 @@ export class Booster {
*
* @deprecated [EOL v3] Please use the static `boosterTriggerScheduledCommands` function exported by `@boostercloud/framework-core` instead.
*/
public static triggerScheduledCommand(request: unknown): Promise<unknown> {
static triggerScheduledCommand(request: unknown): Promise<unknown> {
return boosterTriggerScheduledCommands(request)
}

Expand All @@ -198,7 +198,7 @@ export class Booster {
*
* @deprecated [EOL v3] Please use the static `boosterNotifySubscribers` function exported by `@boostercloud/framework-core` instead.
*/
public static notifySubscribers(request: unknown): Promise<unknown> {
static notifySubscribers(request: unknown): Promise<unknown> {
return boosterNotifySubscribers(request)
}

Expand All @@ -207,7 +207,7 @@ export class Booster {
*
* @deprecated [EOL v3] Please use the static `boosterRocketDispatcher` function exported by `@boostercloud/framework-core` instead.
*/
public static dispatchRocket(request: unknown): Promise<unknown> {
static dispatchRocket(request: unknown): Promise<unknown> {
return boosterRocketDispatcher(request)
}

Expand Down
16 changes: 7 additions & 9 deletions packages/framework-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as boosterModule from './booster'
import { BoosterApp } from '@boostercloud/framework-types'
import { Booster } from './booster'
import { BoosterEventDispatcher } from './booster-event-dispatcher'
import { BoosterGraphQLDispatcher } from './booster-graphql-dispatcher'
import { BoosterScheduledCommandDispatcher } from './booster-scheduled-command-dispatcher'
import { BoosterSubscribersNotifier } from './booster-subscribers-notifier'
import { BoosterRocketDispatcher } from './booster-rocket-dispatcher'

export { Booster } from './booster'
export { RegisterHandler } from './booster-register-handler'
export * from './decorators'
export { BoosterDataMigrations } from './booster-data-migrations'
Expand All @@ -22,7 +22,7 @@ export * from './instrumentation/index'
* @returns A promise that resolves when the events are processed
*/
export async function boosterEventDispatcher(rawEvents: unknown): Promise<void> {
return BoosterEventDispatcher.dispatch(rawEvents, boosterModule.Booster.config)
return BoosterEventDispatcher.dispatch(rawEvents, Booster.config)
}

/**
Expand All @@ -32,7 +32,7 @@ export async function boosterEventDispatcher(rawEvents: unknown): Promise<void>
* @returns A promise that resolves to the GraphQL response.
*/
export async function boosterServeGraphQL(rawRequest: unknown): Promise<unknown> {
return new BoosterGraphQLDispatcher(boosterModule.Booster.config).dispatch(rawRequest)
return new BoosterGraphQLDispatcher(Booster.config).dispatch(rawRequest)
}

/**
Expand All @@ -42,7 +42,7 @@ export async function boosterServeGraphQL(rawRequest: unknown): Promise<unknown>
* @returns A promise that resolves when the scheduled commands are triggered
*/
export async function boosterTriggerScheduledCommands(rawRequest: unknown): Promise<void> {
return new BoosterScheduledCommandDispatcher(boosterModule.Booster.config).dispatch(rawRequest)
return new BoosterScheduledCommandDispatcher(Booster.config).dispatch(rawRequest)
}

/**
Expand All @@ -57,7 +57,7 @@ export const boosterTriggerScheduledCommand = boosterTriggerScheduledCommands
* @returns A promise that resolves when the subscribers are notified
*/
export async function boosterNotifySubscribers(rawRequest: unknown): Promise<void> {
return new BoosterSubscribersNotifier(boosterModule.Booster.config).dispatch(rawRequest)
return new BoosterSubscribersNotifier(Booster.config).dispatch(rawRequest)
}

/**
Expand All @@ -67,7 +67,5 @@ export async function boosterNotifySubscribers(rawRequest: unknown): Promise<voi
* @returns A promise that resolves when the request is processed
*/
export async function boosterRocketDispatcher(rawRequest: unknown): Promise<unknown> {
return new BoosterRocketDispatcher(boosterModule.Booster.config).dispatch(rawRequest)
return new BoosterRocketDispatcher(Booster.config).dispatch(rawRequest)
}

export const Booster: BoosterApp = boosterModule.Booster

0 comments on commit f2572cf

Please sign in to comment.