Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
5824d34764 | |||
5eb9035dfe | |||
a49b1813fb | |||
e33ae24f17 | |||
2e13632fec | |||
9175af027b | |||
f9524a62d7 | |||
7889e04915 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@api.global/typedrequest-interfaces",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.5",
|
||||
"private": false,
|
||||
"description": "interfaces for making typed requests",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@api.global/typedrequest-interfaces',
|
||||
version: '3.0.1',
|
||||
version: '3.0.5',
|
||||
description: 'interfaces for making typed requests'
|
||||
}
|
||||
|
27
ts/index.ts
27
ts/index.ts
@ -11,6 +11,14 @@ export interface ITypedRequest {
|
||||
jwt: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* localData tracks things within typedrequest.
|
||||
* needed for VirtualStreams
|
||||
*/
|
||||
localData?: {
|
||||
firstTypedrouter?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* server data that is added for dealing with the request server side. Will be omitted when sending the response
|
||||
*/
|
||||
@ -44,6 +52,8 @@ export interface ITypedRequest {
|
||||
|
||||
/**
|
||||
* a correlation id that
|
||||
* used for matching request and response
|
||||
* !important. Don't remove.
|
||||
*/
|
||||
correlation?: {
|
||||
id: string;
|
||||
@ -65,3 +75,20 @@ export interface ITag {
|
||||
}
|
||||
|
||||
export type implementsTag<T, U extends T> = {};
|
||||
|
||||
export interface IStreamRequest extends implementsTR<
|
||||
ITypedRequest,
|
||||
IStreamRequest
|
||||
> {
|
||||
method: '##VirtualStream##';
|
||||
request: {
|
||||
streamId: string;
|
||||
streamChunk: any;
|
||||
close: boolean;
|
||||
};
|
||||
response: {
|
||||
streamId: string;
|
||||
streamChunk: any;
|
||||
close: boolean;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user