@busy-hour/blaze
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.1.1](https://github.com/Busy-Hour-Studio/blaze/compare/v1.1.0...v1.1.1) (2024-02-23) | ||
### Bug Fixes | ||
* service/action/hooks type error ([2f87656](https://github.com/Busy-Hour-Studio/blaze/commit/2f87656772d6f79b956c24b2d6c6d61d8ba9156d)) | ||
## [1.1.0](https://github.com/Busy-Hour-Studio/blaze/compare/v1.0.0...v1.1.0) (2024-02-22) | ||
@@ -7,0 +14,0 @@ |
import type { RecordString, RecordUnknown } from '../types/helper'; | ||
import type { AfterHookHandler, BeforeHookHandler } from '../types/hooks'; | ||
export declare function createAfterHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = unknown>(hook: AfterHookHandler<Meta, Body, Params, Header, Result>): AfterHookHandler<Meta, Body, Params, Header, Result>; | ||
export declare function createAfterHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = never>(hook: AfterHookHandler<Meta, Body, Params, Header, Result>): AfterHookHandler<Meta, Body, Params, Header, Result>; | ||
export declare function createBeforeHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString>(hook: BeforeHookHandler<Meta, Body, Params, Header>): BeforeHookHandler<Meta, Body, Params, Header>; |
@@ -6,4 +6,5 @@ export type { Action, ActionHandler, ActionOpenAPI, ActionValidator, Actions, OpenAPIBody, } from './types/action'; | ||
export type { Service } from './types/service'; | ||
export * from './creator'; | ||
export { BlazeCreator } from './creator'; | ||
export { BlazeError } from './errors/BlazeError'; | ||
export * from './router'; | ||
export { initializeServices } from './utils/setup'; |
@@ -17,6 +17,9 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.initializeServices = void 0; | ||
__exportStar(require("./creator"), exports); | ||
exports.initializeServices = exports.BlazeError = exports.BlazeCreator = void 0; | ||
var creator_1 = require("./creator"); | ||
Object.defineProperty(exports, "BlazeCreator", { enumerable: true, get: function () { return creator_1.BlazeCreator; } }); | ||
var BlazeError_1 = require("./errors/BlazeError"); | ||
Object.defineProperty(exports, "BlazeError", { enumerable: true, get: function () { return BlazeError_1.BlazeError; } }); | ||
__exportStar(require("./router"), exports); | ||
var setup_1 = require("./utils/setup"); | ||
Object.defineProperty(exports, "initializeServices", { enumerable: true, get: function () { return setup_1.initializeServices; } }); |
@@ -29,3 +29,3 @@ import type { BlazeContext } from '../event/BlazeContext'; | ||
rest?: RestParam | null; | ||
hooks?: ActionHook<Meta, FinalBody, FinalParams, FinalHeader> | null; | ||
hooks?: ActionHook<Meta, FinalBody, FinalParams, FinalHeader, never> | null; | ||
throwOnValidationError?: boolean | null; | ||
@@ -32,0 +32,0 @@ } |
@@ -12,3 +12,3 @@ import type { Action, ActionOpenAPI, ActionValidator } from './action'; | ||
hook: { | ||
after<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = unknown>(hook: AfterHookHandler<Meta, Body, Params, Header, Result>): AfterHookHandler<Meta, Body, Params, Header, Result>; | ||
after<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = never>(hook: AfterHookHandler<Meta, Body, Params, Header, Result>): AfterHookHandler<Meta, Body, Params, Header, never>; | ||
before<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString>(hook: BeforeHookHandler<Meta, Body, Params, Header>): BeforeHookHandler<Meta, Body, Params, Header>; | ||
@@ -15,0 +15,0 @@ }; |
@@ -6,14 +6,14 @@ import type { BlazeContext } from '../event/BlazeContext'; | ||
} | ||
export interface AfterHookHandler<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = unknown> { | ||
export interface AfterHookHandler<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = never> { | ||
(ctx: BlazeContext<Meta, Body, Params, Header>, res: Result): Promise<unknown | void> | unknown | void; | ||
} | ||
export type AcceptedBeforeHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString> = BeforeHookHandler<Meta, Body, Params, Header> | BeforeHookHandler<Meta, Body, Params, Header>[]; | ||
export type AcceptedAfterHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString> = AfterHookHandler<Meta, Body, Params, Header> | AfterHookHandler<Meta, Body, Params, Header>[]; | ||
export interface ActionHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString> { | ||
export type AcceptedAfterHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = never> = AfterHookHandler<Meta, Body, Params, Header, Result> | AfterHookHandler<Meta, Body, Params, Header, Result>[]; | ||
export interface ActionHook<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = never> { | ||
before?: AcceptedBeforeHook<Meta, Body, Params, Header> | null; | ||
after?: AcceptedAfterHook<Meta, Body, Params, Header> | null; | ||
after?: AcceptedAfterHook<Meta, Body, Params, Header, Result> | null; | ||
} | ||
export interface AfterHookHandlerOption<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString> { | ||
export interface AfterHookHandlerOption<Meta extends RecordUnknown = RecordUnknown, Body extends RecordUnknown = RecordUnknown, Params extends RecordUnknown = RecordUnknown, Header extends RecordString = RecordString, Result = never> { | ||
result: unknown; | ||
hooks: AcceptedAfterHook<Meta, Body, Params, Header>; | ||
hooks: AcceptedAfterHook<Meta, Body, Params, Header, Result>; | ||
blazeCtx: BlazeContext<Meta, Body, Params, Header>; | ||
@@ -20,0 +20,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"types": "dist/index.d.ts", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
79282
1690
0