-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add queryInfo and hooks to Query decorator (#1418)
* Add queryInfo and hooks to Query decorator * Add rush change
- Loading branch information
1 parent
2fa6f1c
commit e2335b1
Showing
15 changed files
with
175 additions
and
45 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...changes/@boostercloud/framework-core/query_add_query_info_and_hooks_2023-06-22-14-25.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@boostercloud/framework-core", | ||
"comment": "Add queryInfo and hooks to query decorator", | ||
"type": "minor" | ||
} | ||
], | ||
"packageName": "@boostercloud/framework-core" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
import { Class } from '../typelevel' | ||
import { PropertyMetadata } from '@boostercloud/metadata-booster' | ||
import { QueryAuthorizer } from './.' | ||
import { QueryAuthorizer, QueryFilterHooks, UUID } from './.' | ||
import { ContextEnvelope, UserEnvelope } from '../envelope' | ||
|
||
export type QueryInput = Record<string, any> | ||
|
||
export interface QueryInterface<TQuery = unknown, THandleResult = unknown> extends Class<TQuery> { | ||
handle(query: TQuery): Promise<THandleResult> | ||
handle(query: TQuery, queryInfo?: QueryInfo): Promise<THandleResult> | ||
} | ||
|
||
export interface QueryMetadata<TCommand = unknown> { | ||
readonly class: QueryInterface<TCommand> | ||
readonly properties: Array<PropertyMetadata> | ||
readonly methods: Array<PropertyMetadata> | ||
readonly authorizer: QueryAuthorizer | ||
readonly before: NonNullable<QueryFilterHooks['before']> | ||
} | ||
|
||
export interface QueryInfo { | ||
requestID: UUID | ||
responseHeaders: Record<string, string> | ||
currentUser?: UserEnvelope | ||
context?: ContextEnvelope | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.