@busy-hour/blaze
Advanced tools
Comparing version 3.0.0-0 to 3.0.0-1
@@ -5,2 +5,9 @@ # Changelog | ||
## [3.0.0-1](https://github.com/Busy-Hour-Studio/blaze/compare/v3.0.0-0...v3.0.0-1) (2024-04-21) | ||
### Bug Fixes | ||
* v3 event extractor types ([1065587](https://github.com/Busy-Hour-Studio/blaze/commit/1065587a0f480a2bf5fe74176e60511d0741721e)) | ||
## [3.0.0-0](https://github.com/Busy-Hour-Studio/blaze/compare/v2.0.3...v3.0.0-0) (2024-04-21) | ||
@@ -7,0 +14,0 @@ |
@@ -14,4 +14,2 @@ import type { ActionCallResult as Result } from '../types/action'; | ||
event<T extends keyof EventCallRecord | (string & NonNullable<unknown>), U extends ActionEventCallRequest = EventCallRecord[T]>(eventName: T, body: U['body']): boolean; | ||
event<T extends keyof EventCallRecord | (string & NonNullable<unknown>), U extends ActionEventCallRequest = EventCallRecord[T]>(eventName: T, body: U['body'], params: U['params']): boolean; | ||
event<T extends keyof EventCallRecord | (string & NonNullable<unknown>), U extends ActionEventCallRequest = EventCallRecord[T]>(eventName: T, body: U['body'], params: U['params'], headers: U['headers']): boolean; | ||
} |
@@ -18,8 +18,8 @@ import { z } from 'zod'; | ||
export type ServiceNameExtractor<T extends Service> = NonNullable<T['version']> extends number ? NonNullable<T['name']> extends string ? `v${T['version']}.${T['name']}` : `v${T['version']}` : NonNullable<T['name']> extends string ? `${T['name']}` : never; | ||
export type ActionsExtractor<T extends Service> = NonNullable<T['actions']> extends Actions ? { | ||
export type ActionsExtractor<T extends Service> = { | ||
[A in keyof T['actions'] as `${ServiceNameExtractor<T>}.${A extends string ? A : never}`]: ActionEventCallRequest<ExtractActionValidator<T, A, 'header'>, ExtractActionValidator<T, A, 'params'>, ExtractActionValidator<T, A, 'body'>, ExtractActionHandler<T, A>>; | ||
} : never; | ||
export type EventsExtractor<T extends Service, U extends NonNullable<T['events']> extends Events ? T['events'] : never = T['events']> = { | ||
[E in keyof U as `${ServiceNameExtractor<T>}.${E extends string ? E : never}`]: ActionEventCallRequest<Record<string, unknown>, Record<string, unknown>, ExtractEventValidator<U, E>, unknown>; | ||
}; | ||
export type EventsExtractor<T extends Service> = { | ||
[E in keyof T['events'] as `${ServiceNameExtractor<T>}.${E extends string ? E : never}`]: ActionEventCallRequest<Record<string, unknown>, Record<string, unknown>, ExtractEventValidator<T, E>, unknown>; | ||
}; | ||
export interface ActionCallRecord { | ||
@@ -26,0 +26,0 @@ } |
@@ -7,3 +7,3 @@ { | ||
"type": "module", | ||
"version": "3.0.0-0", | ||
"version": "3.0.0-1", | ||
"license": "MIT", | ||
@@ -10,0 +10,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
176444
4604