deno/cli/msg.fbs

581 lines
7.8 KiB
Plaintext
Raw Normal View History

union Any {
2019-03-12 03:25:18 +00:00
Accept,
Cache,
2019-03-12 03:25:18 +00:00
Chdir,
Chmod,
2019-05-08 01:58:58 +00:00
Chown,
2019-03-12 03:25:18 +00:00
Close,
CopyFile,
CreateWorker,
CreateWorkerRes,
2019-03-12 03:25:18 +00:00
Cwd,
CwdRes,
Dial,
Environ,
EnvironRes,
2019-03-12 03:25:18 +00:00
Exit,
2018-10-30 19:02:18 +00:00
Fetch,
2019-03-12 03:25:18 +00:00
FetchModuleMetaData,
FetchModuleMetaDataRes,
FetchRes,
2019-03-12 03:25:18 +00:00
FormatError,
FormatErrorRes,
2019-05-17 18:03:01 +00:00
GetRandomValues,
GlobalTimer,
GlobalTimerRes,
GlobalTimerStop,
HostGetMessage,
HostGetMessageRes,
HostGetWorkerClosed,
HostPostMessage,
2019-03-12 03:25:18 +00:00
IsTTY,
IsTTYRes,
Kill,
Link,
2019-03-12 03:25:18 +00:00
Listen,
ListenRes,
2018-08-23 22:36:45 +00:00
MakeTempDir,
MakeTempDirRes,
2019-03-12 03:25:18 +00:00
Metrics,
MetricsRes,
2018-09-10 09:48:36 +00:00
Mkdir,
2019-03-12 03:25:18 +00:00
NewConn,
Now,
NowRes,
Open,
OpenRes,
PermissionRevoke,
Permissions,
PermissionsRes,
Read,
2018-10-03 21:56:56 +00:00
ReadDir,
ReadDirRes,
2019-03-12 03:25:18 +00:00
ReadRes,
2018-09-25 04:20:49 +00:00
Readlink,
ReadlinkRes,
2019-03-12 03:25:18 +00:00
Remove,
Rename,
ReplReadline,
ReplReadlineRes,
2019-03-12 03:25:18 +00:00
ReplStart,
ReplStartRes,
2018-10-30 19:58:55 +00:00
Resources,
ResourcesRes,
Run,
RunRes,
RunStatus,
2019-02-02 06:27:42 +00:00
RunStatusRes,
Seek,
2019-03-12 03:25:18 +00:00
SetEnv,
Shutdown,
Start,
StartRes,
Stat,
StatRes,
Symlink,
Truncate,
Utime,
2019-03-12 03:25:18 +00:00
WorkerGetMessage,
WorkerGetMessageRes,
WorkerPostMessage,
Write,
WriteRes,
2018-07-04 18:50:28 +00:00
}
enum ErrorKind: byte {
NoError = 0,
// io errors
NotFound,
PermissionDenied,
ConnectionRefused,
ConnectionReset,
ConnectionAborted,
NotConnected,
AddrInUse,
AddrNotAvailable,
BrokenPipe,
AlreadyExists,
WouldBlock,
InvalidInput,
InvalidData,
TimedOut,
Interrupted,
WriteZero,
Other,
UnexpectedEof,
2018-10-10 15:15:47 +00:00
BadResource,
CommandFailed,
// url errors
EmptyHost,
IdnaError,
InvalidPort,
InvalidIpv4Address,
InvalidIpv6Address,
InvalidDomainCharacter,
RelativeUrlWithoutBase,
RelativeUrlWithCannotBeABaseBase,
SetHostOnCannotBeABaseUrl,
Overflow,
// hyper errors
HttpUser,
HttpClosed,
HttpCanceled,
HttpParse,
HttpOther,
TooLarge,
// custom errors
InvalidUri,
InvalidSeekMode,
OpNotAvaiable,
WorkerInitFailed,
UnixError,
}
2018-10-13 20:03:27 +00:00
table Cwd {}
table CwdRes {
cwd: string;
}
2018-10-22 02:14:27 +00:00
enum MediaType: byte {
JavaScript = 0,
TypeScript,
Json,
Unknown
}
table Base {
2018-08-17 20:59:57 +00:00
cmd_id: uint32;
2018-12-12 13:24:36 +00:00
sync: bool = false;
error_kind: ErrorKind = NoError;
error: string;
inner: Any;
2018-07-04 18:50:28 +00:00
}
table Start {
unused: int8;
}
table StartRes {
cwd: string;
2019-01-06 19:16:42 +00:00
pid: uint32;
argv: [string];
2019-02-15 16:22:02 +00:00
exec_path: string;
2019-02-13 02:14:02 +00:00
main_module: string; // Absolute URL.
debug_flag: bool;
deps_flag: bool;
2018-10-11 21:23:22 +00:00
types_flag: bool;
version_flag: bool;
deno_version: string;
v8_version: string;
2019-02-09 03:13:04 +00:00
no_color: bool;
2019-05-03 20:24:09 +00:00
xeval_delim: string;
}
table FormatError {
error: string;
}
table FormatErrorRes {
error: string;
}
// Create worker as host
table CreateWorker {
specifier: string;
}
table CreateWorkerRes {
rid: uint32;
}
table HostGetWorkerClosed {
rid: uint32;
}
// Get message from guest worker as host
table HostGetMessage {
rid: uint32;
}
table HostGetMessageRes {
data: [ubyte];
}
// Post message to guest worker as host
table HostPostMessage {
rid: uint32;
// data passed thru the zero-copy data parameter.
}
// Get message from host as guest worker
table WorkerGetMessage {
unused: int8;
}
table WorkerGetMessageRes {
data: [ubyte];
}
// Post message to host as guest worker
table WorkerPostMessage {
// data passed thru the zero-copy data parameter.
}
2019-02-18 15:42:15 +00:00
table FetchModuleMetaData {
specifier: string;
referrer: string;
}
2019-02-18 15:42:15 +00:00
table FetchModuleMetaDataRes {
// If it's a non-http module, moduleName and filename will be the same.
// For http modules, module_name is its resolved http URL, and filename
// is the location of the locally downloaded source code.
module_name: string;
filename: string;
2018-10-22 02:14:27 +00:00
media_type: MediaType;
2019-02-18 15:42:15 +00:00
data: [ubyte];
}
table Cache {
extension: string;
module_id: string;
contents: string;
}
2018-10-13 20:03:27 +00:00
table Chdir {
directory: string;
}
table GlobalTimer {
timeout: int;
}
table GlobalTimerRes { }
table GlobalTimerStop { }
table Exit {
code: int;
}
table Environ {}
table SetEnv {
2018-09-07 22:59:02 +00:00
key: string;
value: string;
}
table EnvironRes {
2018-11-03 00:09:10 +00:00
map: [KeyValue];
}
2018-11-03 00:09:10 +00:00
table KeyValue {
2018-09-07 22:59:02 +00:00
key: string;
value: string;
}
table Permissions {}
table PermissionRevoke {
permission: string;
}
table PermissionsRes {
run: bool;
read: bool;
write: bool;
net: bool;
env: bool;
hrtime: bool;
}
// Note this represents The WHOLE header of an http message, not just the key
// value pairs. That means it includes method and url for Requests and status
// for responses. This is why it is singular "Header" instead of "Headers".
table HttpHeader {
is_request: bool;
// Request only:
method: string;
url: string;
// Response only:
status: uint16;
// Both:
fields: [KeyValue];
}
table Fetch {
header: HttpHeader;
}
table FetchRes {
header: HttpHeader;
body_rid: uint32;
}
2018-08-23 22:36:45 +00:00
table MakeTempDir {
dir: string;
prefix: string;
suffix: string;
}
table MakeTempDirRes {
path: string;
}
2018-09-10 09:48:36 +00:00
table Mkdir {
2018-08-26 06:26:30 +00:00
path: string;
recursive: bool;
mode: uint; // Specified by https://godoc.org/os#FileMode
2018-08-26 06:26:30 +00:00
}
table Chmod {
path: string;
mode: uint; // Specified by https://godoc.org/os#FileMode
}
2019-05-08 01:58:58 +00:00
table Chown {
path: string;
uid: uint;
gid: uint; // Specified by https://godoc.org/os#Chown
}
table Remove {
path: string;
recursive: bool;
}
2018-10-03 21:56:56 +00:00
table ReadDir {
path: string;
}
table ReadDirRes {
entries: [StatRes];
}
2018-09-30 22:06:41 +00:00
table CopyFile {
from: string;
to: string;
}
2018-09-12 15:44:58 +00:00
table Rename {
2018-09-04 00:22:30 +00:00
oldpath: string;
newpath: string;
}
2018-09-25 04:20:49 +00:00
table Readlink {
name: string;
}
table ReadlinkRes {
path: string;
}
table ReplStart {
history_file: string;
// TODO add config
}
table ReplStartRes {
rid: uint32;
}
table ReplReadline {
rid: uint32;
prompt: string;
}
table ReplReadlineRes {
line: string;
}
2018-10-30 19:58:55 +00:00
table Resources {}
table Resource {
rid: uint32;
2018-10-30 19:58:55 +00:00
repr: string;
}
table ResourcesRes {
resources: [Resource];
}
2018-09-19 04:38:24 +00:00
table Symlink {
oldname: string;
newname: string;
}
table Link {
oldname: string;
newname: string;
}
2018-09-11 19:38:53 +00:00
table Stat {
2018-08-29 13:22:25 +00:00
filename: string;
lstat: bool;
}
2018-09-11 19:38:53 +00:00
table StatRes {
2018-08-29 13:22:25 +00:00
is_file: bool;
is_symlink: bool;
len: ulong;
modified:ulong;
accessed:ulong;
created:ulong;
mode: uint;
has_mode: bool; // false on windows
2018-10-03 21:56:56 +00:00
name: string;
2018-08-29 13:22:25 +00:00
}
2018-09-30 19:06:20 +00:00
table Truncate {
name: string;
len: uint;
}
table Utime {
filename: string;
atime: uint64;
mtime: uint64;
}
table Open {
filename: string;
perm: uint;
2018-12-12 17:05:58 +00:00
mode: string;
}
table OpenRes {
rid: uint32;
}
table Read {
rid: uint32;
// (ptr, len) is passed as second parameter to Deno.core.send().
}
table ReadRes {
nread: uint;
eof: bool;
}
table Write {
rid: uint32;
}
table WriteRes {
nbyte: uint;
}
table Close {
rid: uint32;
}
table Kill {
pid: int32;
signo: int32;
}
table Shutdown {
rid: uint32;
how: uint;
}
table Listen {
network: string;
address: string;
}
table ListenRes {
rid: uint32;
}
table Accept {
rid: uint32;
}
table Dial {
network: string;
address: string;
}
// Response to Accept and Dial.
table NewConn {
rid: uint32;
remote_addr: string;
local_addr: string;
}
2018-10-05 17:21:15 +00:00
table Metrics {}
table MetricsRes {
ops_dispatched: uint64;
ops_completed: uint64;
bytes_sent_control: uint64;
bytes_sent_data: uint64;
bytes_received: uint64;
}
enum ProcessStdio: byte { Inherit, Piped, Null }
table Run {
args: [string];
cwd: string;
2019-02-15 15:37:04 +00:00
env: [KeyValue];
stdin: ProcessStdio;
stdout: ProcessStdio;
stderr: ProcessStdio;
}
table RunRes {
rid: uint32;
pid: uint32;
// The following stdio rids are only valid if "Piped" was specified for the
// corresponding stdio stream. The caller MUST issue a close op for all valid
// stdio streams.
stdin_rid: uint32;
stdout_rid: uint32;
stderr_rid: uint32;
}
table RunStatus {
rid: uint32;
}
table RunStatusRes {
got_signal: bool;
exit_code: int;
exit_signal: int;
}
2019-02-02 06:27:42 +00:00
table Now {}
table NowRes {
seconds: uint64;
subsec_nanos: uint32;
2019-02-02 06:27:42 +00:00
}
2019-02-03 03:05:30 +00:00
table IsTTY {}
table IsTTYRes {
stdin: bool;
stdout: bool;
stderr: bool;
}
table Seek {
rid: uint32;
offset: int;
whence: uint;
}
2019-05-17 18:03:01 +00:00
table GetRandomValues {}
root_type Base;