fix(core): update
This commit is contained in:
parent
10148f7c50
commit
0fb36ea928
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@api.global/typedrequest-interfaces',
|
name: '@api.global/typedrequest-interfaces',
|
||||||
version: '3.0.9',
|
version: '3.0.10',
|
||||||
description: 'interfaces for making typed requests'
|
description: 'interfaces for making typed requests'
|
||||||
}
|
}
|
||||||
|
56
ts/index.ts
56
ts/index.ts
@ -17,7 +17,7 @@ export interface ITypedRequest {
|
|||||||
*/
|
*/
|
||||||
localData?: {
|
localData?: {
|
||||||
firstTypedrouter?: any;
|
firstTypedrouter?: any;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* server data that is added for dealing with the request server side. Will be omitted when sending the response
|
* server data that is added for dealing with the request server side. Will be omitted when sending the response
|
||||||
@ -76,21 +76,55 @@ export interface ITag {
|
|||||||
|
|
||||||
export type implementsTag<T, U extends T> = {};
|
export type implementsTag<T, U extends T> = {};
|
||||||
|
|
||||||
export interface IUnifiedStreamReqResObject {
|
export interface IUnifiedStreamDataPackage {
|
||||||
|
/**
|
||||||
|
* the stream id, so Virtual Streams can talk to each other
|
||||||
|
*/
|
||||||
streamId: string;
|
streamId: string;
|
||||||
cycle: 'request' | 'response';
|
|
||||||
|
/**
|
||||||
|
* stream data is sent in cycles. This id is used to match the request and response
|
||||||
|
*/
|
||||||
cycleId: string;
|
cycleId: string;
|
||||||
type: 'start' | 'binaryChunk' | 'object' | 'end' | 'keepAlive';
|
cycle: 'request' | 'response';
|
||||||
streamChunk?: any;
|
|
||||||
|
/**
|
||||||
|
* the main purpose of the data package
|
||||||
|
* start: indicates the start of a stream
|
||||||
|
* binaryChunk: indicates a binary chunk of data
|
||||||
|
* object: indicates a json object
|
||||||
|
* end: indicates the end of a stream
|
||||||
|
* feedback: indicates a feedback message
|
||||||
|
*/
|
||||||
|
mainPurpose: 'start' | 'binaryChunk' | 'object' | 'end' | 'feedback' | 'keepAlive';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the data package
|
||||||
|
*/
|
||||||
|
chunkData?: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* feedback message
|
||||||
|
*/
|
||||||
|
feedback: {
|
||||||
|
message?: string;
|
||||||
|
data?: any;
|
||||||
|
sha265?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* keepAlive boolean
|
||||||
|
*/
|
||||||
keepAlive?: boolean;
|
keepAlive?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* is there more data scheduled to be sent?
|
||||||
|
*/
|
||||||
next?: boolean;
|
next?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IStreamRequest extends implementsTR<
|
export interface IStreamRequest extends implementsTR<ITypedRequest, IStreamRequest> {
|
||||||
ITypedRequest,
|
|
||||||
IStreamRequest
|
|
||||||
> {
|
|
||||||
method: '##VirtualStream##';
|
method: '##VirtualStream##';
|
||||||
request: IUnifiedStreamReqResObject;
|
request: IUnifiedStreamDataPackage;
|
||||||
response: IUnifiedStreamReqResObject;
|
response: IUnifiedStreamDataPackage;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user