Compare commits

..

26 Commits

Author SHA1 Message Date
fba724741b 3.0.18 2024-02-29 19:41:34 +01:00
854cc93644 fix(core): update 2024-02-29 19:41:34 +01:00
ec7fa07855 3.0.17 2024-02-24 14:51:09 +01:00
b34e88123d fix(core): update 2024-02-24 14:51:08 +01:00
b680ab8c23 3.0.16 2024-02-24 14:45:32 +01:00
f0547b33d3 fix(core): update 2024-02-24 14:45:31 +01:00
20c5b115d8 3.0.15 2024-02-24 14:45:18 +01:00
c3801ecd53 fix(core): update 2024-02-24 14:45:17 +01:00
51f03a45b6 3.0.14 2024-02-24 11:10:04 +01:00
ed8879a4c8 fix(core): update 2024-02-24 11:10:03 +01:00
806970c701 3.0.13 2024-02-23 20:18:20 +01:00
9638f74440 fix(core): update 2024-02-23 20:18:19 +01:00
b538c4fbdb 3.0.12 2024-02-23 17:02:13 +01:00
1d3dc08e39 fix(core): update 2024-02-23 17:02:12 +01:00
56f59bf640 3.0.11 2024-02-23 16:00:37 +01:00
268df991c4 fix(core): update 2024-02-23 16:00:36 +01:00
b3d8dd1573 3.0.10 2024-02-23 15:48:32 +01:00
0fb36ea928 fix(core): update 2024-02-23 15:48:31 +01:00
10148f7c50 3.0.9 2024-02-22 15:15:45 +01:00
274bf30973 fix(core): update 2024-02-22 15:15:44 +01:00
e3ff1c3c4b 3.0.8 2024-02-22 13:28:47 +01:00
446a9d1723 fix(core): update 2024-02-22 13:28:47 +01:00
a749f91a8f 3.0.7 2024-02-21 21:01:35 +01:00
8ea6db7b7f fix(core): update 2024-02-21 21:01:35 +01:00
715ee43bcc 3.0.6 2024-02-21 14:54:45 +01:00
c314b4e86f fix(core): update 2024-02-21 14:54:45 +01:00
4 changed files with 84 additions and 22 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@api.global/typedrequest-interfaces",
"version": "3.0.5",
"version": "3.0.18",
"private": false,
"description": "interfaces for making typed requests",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedrequest-interfaces',
version: '3.0.5',
version: '3.0.18',
description: 'interfaces for making typed requests'
}

View File

@ -17,7 +17,7 @@ export interface ITypedRequest {
*/
localData?: {
firstTypedrouter?: any;
}
};
/**
* server data that is added for dealing with the request server side. Will be omitted when sending the response
@ -76,19 +76,78 @@ 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;
};
// stream stuff
export interface IVirtualStream<T = ArrayBufferLike> {
// Properties
side: 'requesting' | 'responding';
streamId: string;
sendMethod: any;
typedrouter: any;
// Methods
handleStreamTr(streamTrArg: IStreamRequest): Promise<IStreamRequest>;
cleanup(): Promise<void>;
sendData(dataArg: T): Promise<void>;
fetchData(): Promise<T>;
readFromWebstream(readableStreamArg: ReadableStream<T>): Promise<void>;
writeToWebstream(wwritableStreamArg: WritableStream<T>): Promise<void>; // Consider defining a more specific type for webStream if possible
}
export interface IUnifiedStreamDataPackage {
/**
* the stream id, so Virtual Streams can talk to each other
*/
streamId: string;
/**
* stream data is sent in cycles. This id is used to match the request and response
*/
cycleId: string;
cycle: 'request' | 'response';
/**
* the main purpose of the data package
* start: indicates the start of a stream
* chunk: indicates a binary chunk of data
* read: indicates the introduction to send data
* end: indicates the end of a stream
* feedback: indicates a feedback message
*/
mainPurpose: 'start' | 'chunk' | 'read' | 'end' | 'feedback' | 'keepAlive';
/**
* the data package
*/
chunkData?: any;
/**
* feedback message
*/
feedback?: {
message?: string;
data?: any;
sha265?: string;
};
/**
* keepAlive boolean
*/
keepAlive?: boolean;
/**
* is backpressure detected on the readable side?
*/
backpressure?: boolean;
/**
* does the writable side have more data scheduled to be sent?
*/
next?: boolean;
}
export interface IStreamRequest extends implementsTR<ITypedRequest, IStreamRequest> {
method: '##VirtualStream##';
request: IUnifiedStreamDataPackage;
response: IUnifiedStreamDataPackage;
}

View File

@ -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"
]
}