Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
e3ff1c3c4b | |||
446a9d1723 | |||
a749f91a8f | |||
8ea6db7b7f | |||
715ee43bcc | |||
c314b4e86f | |||
5824d34764 | |||
5eb9035dfe | |||
a49b1813fb | |||
e33ae24f17 | |||
2e13632fec | |||
9175af027b | |||
f9524a62d7 | |||
7889e04915 | |||
a81b9eced6 | |||
4aa06fe830 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@api.global/typedrequest-interfaces",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.8",
|
||||
"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.0',
|
||||
version: '3.0.8',
|
||||
description: 'interfaces for making typed requests'
|
||||
}
|
||||
|
31
ts/index.ts
31
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,24 @@ export interface ITag {
|
||||
}
|
||||
|
||||
export type implementsTag<T, U extends T> = {};
|
||||
|
||||
export interface IStreamRequest extends implementsTR<
|
||||
ITypedRequest,
|
||||
IStreamRequest
|
||||
> {
|
||||
method: '##VirtualStream##';
|
||||
request: {
|
||||
streamId: string;
|
||||
type: 'start' | 'binaryChunk' | 'object' | 'end' | 'keepAlive';
|
||||
streamChunk?: any;
|
||||
keepAlive?: boolean;
|
||||
next?: boolean;
|
||||
};
|
||||
response: {
|
||||
streamId: string;
|
||||
type: 'start' | 'binaryChunk' | 'object' | 'end' | 'keepAlive';
|
||||
streamChunk?: any;
|
||||
keepAlive?: boolean;
|
||||
next?: boolean;
|
||||
};
|
||||
}
|
||||
|
@ -3,9 +3,12 @@
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
}
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user