@arrirpc/server 0.80.2 → 0.80.3
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/index.cjs +5 -2
- package/dist/index.d.cts +3 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +5 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -616,7 +616,7 @@ function registerEventStreamRpc(router, path, procedure, opts) {
|
|
|
616
616
|
);
|
|
617
617
|
}
|
|
618
618
|
const stream = new EventStreamConnection(event, {
|
|
619
|
-
heartbeatMs: procedure.heartbeatMs,
|
|
619
|
+
heartbeatMs: procedure.heartbeatMs ?? opts.heartbeatMs,
|
|
620
620
|
heartbeatEnabled: procedure.heartbeatEnabled,
|
|
621
621
|
validator: responseValidator
|
|
622
622
|
});
|
|
@@ -836,6 +836,7 @@ class ArriApp {
|
|
|
836
836
|
_onError;
|
|
837
837
|
_debug;
|
|
838
838
|
definitionPath;
|
|
839
|
+
_heartbeatMs;
|
|
839
840
|
constructor(opts = {}) {
|
|
840
841
|
this.appInfo = opts?.appInfo;
|
|
841
842
|
this.h3App = h3.createApp({
|
|
@@ -846,6 +847,7 @@ class ArriApp {
|
|
|
846
847
|
this._onError = opts.onError;
|
|
847
848
|
this._onAfterResponse = opts.onAfterResponse;
|
|
848
849
|
this._onBeforeResponse = opts.onBeforeResponse;
|
|
850
|
+
this._heartbeatMs = opts.heartbeatMs ?? 2e4;
|
|
849
851
|
this._rpcRoutePrefix = opts?.rpcRoutePrefix ?? "";
|
|
850
852
|
this._rpcDefinitionPath = opts?.rpcDefinitionPath ?? "__definition";
|
|
851
853
|
this.h3App.use(this.h3Router);
|
|
@@ -950,7 +952,8 @@ class ArriApp {
|
|
|
950
952
|
onError: this._onError,
|
|
951
953
|
onAfterResponse: this._onAfterResponse,
|
|
952
954
|
onBeforeResponse: this._onBeforeResponse,
|
|
953
|
-
debug: this._debug
|
|
955
|
+
debug: this._debug,
|
|
956
|
+
heartbeatMs: this._heartbeatMs
|
|
954
957
|
});
|
|
955
958
|
return;
|
|
956
959
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -73,7 +73,7 @@ interface ArriRoute<TPath extends string, TQuery extends AObjectSchema<any, any>
|
|
|
73
73
|
postHandler?: (event: PostRouteEvent<TPath, InferType<TQuery>, InferType<TBody>, Awaited<TResponse>>) => any;
|
|
74
74
|
}
|
|
75
75
|
declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends AObjectSchema<any, any> = any, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): ArriRoute<TPath, TQuery, TBody, TResponse>;
|
|
76
|
-
type RouteOptions = Pick<ArriOptions, 'onAfterResponse' | 'onBeforeResponse' | 'onError' | 'onRequest' | 'debug'> & {
|
|
76
|
+
type RouteOptions = Pick<ArriOptions, 'onAfterResponse' | 'onBeforeResponse' | 'onError' | 'onRequest' | 'debug' | 'heartbeatMs'> & {
|
|
77
77
|
middleware: Middleware[];
|
|
78
78
|
};
|
|
79
79
|
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
@@ -216,6 +216,7 @@ declare class ArriApp {
|
|
|
216
216
|
private readonly _onError;
|
|
217
217
|
private readonly _debug;
|
|
218
218
|
readonly definitionPath: string;
|
|
219
|
+
private readonly _heartbeatMs;
|
|
219
220
|
constructor(opts?: ArriOptions);
|
|
220
221
|
use(input: Middleware): void;
|
|
221
222
|
use(input: ArriRouter): void;
|
|
@@ -239,6 +240,7 @@ interface ArriOptions {
|
|
|
239
240
|
rpcDefinitionPath?: string;
|
|
240
241
|
disableDefaultRoute?: boolean;
|
|
241
242
|
disableDefinitionRoute?: boolean;
|
|
243
|
+
heartbeatMs?: number;
|
|
242
244
|
onRequest?: (event: MiddlewareEvent) => void | Promise<void>;
|
|
243
245
|
onAfterResponse?: (event: RequestHookEvent) => void | Promise<void>;
|
|
244
246
|
onBeforeResponse?: (event: RequestHookEvent) => void | Promise<void>;
|
package/dist/index.d.mts
CHANGED
|
@@ -73,7 +73,7 @@ interface ArriRoute<TPath extends string, TQuery extends AObjectSchema<any, any>
|
|
|
73
73
|
postHandler?: (event: PostRouteEvent<TPath, InferType<TQuery>, InferType<TBody>, Awaited<TResponse>>) => any;
|
|
74
74
|
}
|
|
75
75
|
declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends AObjectSchema<any, any> = any, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): ArriRoute<TPath, TQuery, TBody, TResponse>;
|
|
76
|
-
type RouteOptions = Pick<ArriOptions, 'onAfterResponse' | 'onBeforeResponse' | 'onError' | 'onRequest' | 'debug'> & {
|
|
76
|
+
type RouteOptions = Pick<ArriOptions, 'onAfterResponse' | 'onBeforeResponse' | 'onError' | 'onRequest' | 'debug' | 'heartbeatMs'> & {
|
|
77
77
|
middleware: Middleware[];
|
|
78
78
|
};
|
|
79
79
|
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
@@ -216,6 +216,7 @@ declare class ArriApp {
|
|
|
216
216
|
private readonly _onError;
|
|
217
217
|
private readonly _debug;
|
|
218
218
|
readonly definitionPath: string;
|
|
219
|
+
private readonly _heartbeatMs;
|
|
219
220
|
constructor(opts?: ArriOptions);
|
|
220
221
|
use(input: Middleware): void;
|
|
221
222
|
use(input: ArriRouter): void;
|
|
@@ -239,6 +240,7 @@ interface ArriOptions {
|
|
|
239
240
|
rpcDefinitionPath?: string;
|
|
240
241
|
disableDefaultRoute?: boolean;
|
|
241
242
|
disableDefinitionRoute?: boolean;
|
|
243
|
+
heartbeatMs?: number;
|
|
242
244
|
onRequest?: (event: MiddlewareEvent) => void | Promise<void>;
|
|
243
245
|
onAfterResponse?: (event: RequestHookEvent) => void | Promise<void>;
|
|
244
246
|
onBeforeResponse?: (event: RequestHookEvent) => void | Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ interface ArriRoute<TPath extends string, TQuery extends AObjectSchema<any, any>
|
|
|
73
73
|
postHandler?: (event: PostRouteEvent<TPath, InferType<TQuery>, InferType<TBody>, Awaited<TResponse>>) => any;
|
|
74
74
|
}
|
|
75
75
|
declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends AObjectSchema<any, any> = any, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): ArriRoute<TPath, TQuery, TBody, TResponse>;
|
|
76
|
-
type RouteOptions = Pick<ArriOptions, 'onAfterResponse' | 'onBeforeResponse' | 'onError' | 'onRequest' | 'debug'> & {
|
|
76
|
+
type RouteOptions = Pick<ArriOptions, 'onAfterResponse' | 'onBeforeResponse' | 'onError' | 'onRequest' | 'debug' | 'heartbeatMs'> & {
|
|
77
77
|
middleware: Middleware[];
|
|
78
78
|
};
|
|
79
79
|
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
@@ -216,6 +216,7 @@ declare class ArriApp {
|
|
|
216
216
|
private readonly _onError;
|
|
217
217
|
private readonly _debug;
|
|
218
218
|
readonly definitionPath: string;
|
|
219
|
+
private readonly _heartbeatMs;
|
|
219
220
|
constructor(opts?: ArriOptions);
|
|
220
221
|
use(input: Middleware): void;
|
|
221
222
|
use(input: ArriRouter): void;
|
|
@@ -239,6 +240,7 @@ interface ArriOptions {
|
|
|
239
240
|
rpcDefinitionPath?: string;
|
|
240
241
|
disableDefaultRoute?: boolean;
|
|
241
242
|
disableDefinitionRoute?: boolean;
|
|
243
|
+
heartbeatMs?: number;
|
|
242
244
|
onRequest?: (event: MiddlewareEvent) => void | Promise<void>;
|
|
243
245
|
onAfterResponse?: (event: RequestHookEvent) => void | Promise<void>;
|
|
244
246
|
onBeforeResponse?: (event: RequestHookEvent) => void | Promise<void>;
|
package/dist/index.mjs
CHANGED
|
@@ -615,7 +615,7 @@ function registerEventStreamRpc(router, path, procedure, opts) {
|
|
|
615
615
|
);
|
|
616
616
|
}
|
|
617
617
|
const stream = new EventStreamConnection(event, {
|
|
618
|
-
heartbeatMs: procedure.heartbeatMs,
|
|
618
|
+
heartbeatMs: procedure.heartbeatMs ?? opts.heartbeatMs,
|
|
619
619
|
heartbeatEnabled: procedure.heartbeatEnabled,
|
|
620
620
|
validator: responseValidator
|
|
621
621
|
});
|
|
@@ -835,6 +835,7 @@ class ArriApp {
|
|
|
835
835
|
_onError;
|
|
836
836
|
_debug;
|
|
837
837
|
definitionPath;
|
|
838
|
+
_heartbeatMs;
|
|
838
839
|
constructor(opts = {}) {
|
|
839
840
|
this.appInfo = opts?.appInfo;
|
|
840
841
|
this.h3App = createApp({
|
|
@@ -845,6 +846,7 @@ class ArriApp {
|
|
|
845
846
|
this._onError = opts.onError;
|
|
846
847
|
this._onAfterResponse = opts.onAfterResponse;
|
|
847
848
|
this._onBeforeResponse = opts.onBeforeResponse;
|
|
849
|
+
this._heartbeatMs = opts.heartbeatMs ?? 2e4;
|
|
848
850
|
this._rpcRoutePrefix = opts?.rpcRoutePrefix ?? "";
|
|
849
851
|
this._rpcDefinitionPath = opts?.rpcDefinitionPath ?? "__definition";
|
|
850
852
|
this.h3App.use(this.h3Router);
|
|
@@ -949,7 +951,8 @@ class ArriApp {
|
|
|
949
951
|
onError: this._onError,
|
|
950
952
|
onAfterResponse: this._onAfterResponse,
|
|
951
953
|
onBeforeResponse: this._onBeforeResponse,
|
|
952
|
-
debug: this._debug
|
|
954
|
+
debug: this._debug,
|
|
955
|
+
heartbeatMs: this._heartbeatMs
|
|
953
956
|
});
|
|
954
957
|
return;
|
|
955
958
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arrirpc/server",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"scule": "^1.3.0",
|
|
29
29
|
"source-map-support": "^0.5.21",
|
|
30
30
|
"uncrypto": "^0.1.3",
|
|
31
|
-
"@arrirpc/codegen-utils": "0.80.
|
|
32
|
-
"@arrirpc/schema": "0.80.
|
|
33
|
-
"arri": "0.80.
|
|
31
|
+
"@arrirpc/codegen-utils": "0.80.3",
|
|
32
|
+
"@arrirpc/schema": "0.80.3",
|
|
33
|
+
"arri": "0.80.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"bun-types": "^1.2.
|
|
36
|
+
"bun-types": "^1.2.16"
|
|
37
37
|
}
|
|
38
38
|
}
|