@orion-js/echoes 4.4.1 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/echo/index.d.ts +4 -4
- package/dist/errors.d.ts +26 -0
- package/dist/events/PulseManager.d.ts +2 -2
- package/dist/index.cjs +420 -188
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +395 -175
- package/dist/index.js.map +1 -1
- package/dist/request/getSignature.d.ts +1 -1
- package/dist/requestsHandler/index.d.ts +18 -1
- package/dist/runtime.d.ts +49 -0
- package/dist/schema.d.ts +42 -0
- package/dist/startService/KafkaManager.d.ts +2 -2
- package/dist/types.d.ts +48 -19
- package/package.json +8 -12
package/dist/echo/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EchoesSchema } from '../schema';
|
|
2
2
|
import { EchoConfig, EchoEventConfig, EchoRequestConfig, EchoType } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated Use createEchoRequest and createEchoEvent instead
|
|
5
5
|
*/
|
|
6
|
-
declare const echo: <TParamsSchema extends
|
|
7
|
-
export declare function createEchoRequest<TParamsSchema extends
|
|
8
|
-
export declare function createEchoEvent<TParamsSchema extends
|
|
6
|
+
declare const echo: <TParamsSchema extends EchoesSchema, TReturnsSchema extends EchoesSchema, TEchoType extends 'event' | 'request'>(options: EchoConfig<TParamsSchema, TReturnsSchema, TEchoType>) => EchoType<TParamsSchema, TReturnsSchema, TEchoType>;
|
|
7
|
+
export declare function createEchoRequest<TParamsSchema extends EchoesSchema, TReturnsSchema extends EchoesSchema>(options: EchoRequestConfig<TParamsSchema, TReturnsSchema>): EchoType<TParamsSchema, TReturnsSchema, 'request'>;
|
|
8
|
+
export declare function createEchoEvent<TParamsSchema extends EchoesSchema, TReturnsSchema extends EchoesSchema>(options: EchoEventConfig<TParamsSchema, TReturnsSchema>): EchoType<TParamsSchema, TReturnsSchema, 'event'>;
|
|
9
9
|
export { echo };
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface EchoesErrorInfo {
|
|
2
|
+
error: string;
|
|
3
|
+
message: string;
|
|
4
|
+
extra?: any;
|
|
5
|
+
validationErrors?: Record<string, string>;
|
|
6
|
+
labels?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export declare class EchoesUserError extends Error {
|
|
9
|
+
readonly isEchoesError = true;
|
|
10
|
+
readonly isOrionError = true;
|
|
11
|
+
readonly isUserError = true;
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly extra: any;
|
|
14
|
+
constructor(code: string, message?: string, extra?: any);
|
|
15
|
+
getInfo(): EchoesErrorInfo;
|
|
16
|
+
}
|
|
17
|
+
export declare class EchoesValidationError extends Error {
|
|
18
|
+
readonly isEchoesError = true;
|
|
19
|
+
readonly isOrionError = true;
|
|
20
|
+
readonly isValidationError = true;
|
|
21
|
+
readonly code = "validationError";
|
|
22
|
+
readonly validationErrors: Record<string, string>;
|
|
23
|
+
readonly labels: Record<string, string>;
|
|
24
|
+
constructor(validationErrors: Record<string, string>, labels?: Record<string, string>);
|
|
25
|
+
getInfo(): EchoesErrorInfo;
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EchoesPulseEventsConfig, PublishOptions } from '../types';
|
|
2
2
|
import type { EventTransport, EventTransportStartOptions } from './EventTransport';
|
|
3
3
|
export default class PulseManager implements EventTransport {
|
|
4
4
|
readonly name: 'pulse';
|
|
@@ -7,7 +7,7 @@ export default class PulseManager implements EventTransport {
|
|
|
7
7
|
private subscriptions;
|
|
8
8
|
constructor(options: EchoesPulseEventsConfig);
|
|
9
9
|
start(options: EventTransportStartOptions): Promise<void>;
|
|
10
|
-
publish<TParams = any>(options: PublishOptions<TParams>): Promise<
|
|
10
|
+
publish<TParams = any>(options: PublishOptions<TParams>): Promise<any>;
|
|
11
11
|
close(): Promise<void>;
|
|
12
12
|
private getSubscribeOptions;
|
|
13
13
|
private createReceivedEvent;
|