Skip to content

Commit 81c6239

Browse files
committed
add allowing both synchronous and asynchronous handlers
improve redirect for blogs
1 parent a67e51f commit 81c6239

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

npm/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/// <reference path="types/globals.d.ts" />
1+
/// <reference path="types/global.d.ts" />
22
/// <reference path="types/faker.d.ts" />
33
/// <reference path="types/http.d.ts" />
44
/// <reference path="types/kafka.d.ts" />
5-
/// <reference path="types/mokapi.d.ts" />
5+
/// <reference path="types/index.d.ts" />
66
/// <reference path="types/mustache.d.ts" />
77
/// <reference path="types/yaml.d.ts" />

npm/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface EventHandler {
122122
* })
123123
* }
124124
*/
125-
export type HttpEventHandler = (request: HttpRequest, response: HttpResponse) => boolean;
125+
export type HttpEventHandler = (request: HttpRequest, response: HttpResponse) => boolean | Promise<boolean>;
126126

127127
/**
128128
* HttpRequest is an object used by HttpEventHandler that contains request-specific
@@ -204,7 +204,7 @@ export interface Url {
204204
* })
205205
* }
206206
*/
207-
export type KafkaEventHandler = (message: KafkaEventMessage) => boolean;
207+
export type KafkaEventHandler = (message: KafkaEventMessage) => boolean | Promise<boolean>;
208208

209209
/**
210210
* KafkaEventMessage is an object used by KafkaEventHandler that contains Kafka-specific message data.
@@ -243,7 +243,7 @@ export interface KafkaEventMessage {
243243
* })
244244
* }
245245
*/
246-
export type LdapEventHandler = (request: LdapSearchRequest, response: LdapSearchResponse) => boolean;
246+
export type LdapEventHandler = (request: LdapSearchRequest, response: LdapSearchResponse) => boolean | Promise<boolean>;
247247

248248
/**
249249
* LdapSearchRequest is an object used by LdapEventHandler that contains request-specific data.
@@ -343,7 +343,7 @@ export enum LdapResultStatus {
343343
SizeLimitExceeded = 4,
344344
}
345345

346-
export type SmtpEventHandler = (record: SmtpEventMessage) => boolean;
346+
export type SmtpEventHandler = (record: SmtpEventMessage) => boolean | Promise<boolean>;
347347

348348
export interface SmtpEventMessage {
349349
server: string;

webui/public/.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
RewriteRule ^docs/examples/(.*)$ /docs/resources/$1 [R=301,L]
2222

2323
# Redirect exactly /docs/blogs to /docs/resources
24-
RewriteRule ^docs/blogs/?$ /docs/resources [R=301,L]
24+
RewriteRule ^docs/blogs/?$ /docs/resources/blogs [R=301,L]
2525

2626
# Redirect anything under /docs/blogs/ to /docs/resources/blogs/
2727
RewriteRule ^docs/blogs/(.*)$ /docs/resources/blogs/$1 [R=301,L]

0 commit comments

Comments
 (0)