inanis 0.0.7-beta.13 → 0.0.7-beta.14
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/stream/context.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ type Events = {
|
|
|
15
15
|
after: any;
|
|
16
16
|
};
|
|
17
17
|
export declare class StreamRouterContext<Path extends string = any, Body extends Record<string, any> = any, Query extends Record<string, any> = any, Chunk extends Record<string, any> = any, Messages extends FailData = any> {
|
|
18
|
+
_isEnd: boolean;
|
|
19
|
+
_emitter: Event<{
|
|
20
|
+
lostConnection: Record<string, unknown>;
|
|
21
|
+
}>;
|
|
18
22
|
ip: string;
|
|
19
23
|
meta: Record<any, any>;
|
|
20
24
|
mode: RunningMode;
|
|
@@ -31,13 +35,9 @@ export declare class StreamRouterContext<Path extends string = any, Body extends
|
|
|
31
35
|
interaction: Interaction;
|
|
32
36
|
interactionStepMessage: string;
|
|
33
37
|
methodStream: ResponseStream;
|
|
34
|
-
|
|
35
|
-
_emitter: Event<{
|
|
36
|
-
lostConnection: Record<string, unknown>;
|
|
37
|
-
}>;
|
|
38
|
+
on: any;
|
|
38
39
|
constructor(method: Method);
|
|
39
40
|
static fromAwsLambda(method: Method, event: APIGatewayEvent, responseStream: ResponseStream): Promise<StreamRouterContext<any, any, any, any, any>>;
|
|
40
|
-
get on(): any;
|
|
41
41
|
_validate(): void;
|
|
42
42
|
isEnded(): boolean;
|
|
43
43
|
step(name: string): void;
|
package/dist/stream/context.js
CHANGED
|
@@ -5,6 +5,8 @@ import { rootException } from '../exception.js';
|
|
|
5
5
|
import { ValidationError } from '../utils/errors.js';
|
|
6
6
|
const exception = rootException.checkout('Api/Context');
|
|
7
7
|
export class StreamRouterContext {
|
|
8
|
+
_isEnd = false;
|
|
9
|
+
_emitter = new Event();
|
|
8
10
|
ip = '';
|
|
9
11
|
meta = {};
|
|
10
12
|
mode = 'lambda';
|
|
@@ -21,8 +23,7 @@ export class StreamRouterContext {
|
|
|
21
23
|
interaction;
|
|
22
24
|
interactionStepMessage = '';
|
|
23
25
|
methodStream;
|
|
24
|
-
|
|
25
|
-
_emitter = new Event();
|
|
26
|
+
on = this._emitter.on.bind(this._emitter);
|
|
26
27
|
constructor(method) {
|
|
27
28
|
this.method = method;
|
|
28
29
|
this.interaction = new Interaction({
|
|
@@ -56,9 +57,6 @@ export class StreamRouterContext {
|
|
|
56
57
|
context.body = json.nonStrictJSONParse(event.body || '{}');
|
|
57
58
|
return context;
|
|
58
59
|
}
|
|
59
|
-
get on() {
|
|
60
|
-
return this._emitter.on.bind(this._emitter);
|
|
61
|
-
}
|
|
62
60
|
_validate() {
|
|
63
61
|
try {
|
|
64
62
|
if (this.method.verify.body) {
|