aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/schema.d.ts5
-rw-r--r--src/api/schema.js16
-rw-r--r--src/api/schema.peechy6
-rw-r--r--src/api/schema.zig18
4 files changed, 14 insertions, 31 deletions
diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts
index 902c376ff..e5370097c 100644
--- a/src/api/schema.d.ts
+++ b/src/api/schema.d.ts
@@ -312,8 +312,7 @@ type uint32 = number;
id: uint32;
from_timestamp: uint32;
loader: Loader;
- module_path: alphanumeric;
- log: Log;
+ module_path: string;
blob_length: uint32;
}
@@ -321,7 +320,7 @@ type uint32 = number;
id: uint32;
from_timestamp: uint32;
loader: Loader;
- module_path: alphanumeric;
+ module_path: string;
log: Log;
}
diff --git a/src/api/schema.js b/src/api/schema.js
index 9fdd5e73d..8882ecc30 100644
--- a/src/api/schema.js
+++ b/src/api/schema.js
@@ -1391,8 +1391,7 @@ function decodeWebsocketMessageBuildSuccess(bb) {
result["id"] = bb.readUint32();
result["from_timestamp"] = bb.readUint32();
result["loader"] = Loader[bb.readByte()];
- result["module_path"] = bb.readAlphanumeric();
- result["log"] = decodeLog(bb);
+ result["module_path"] = bb.readString();
result["blob_length"] = bb.readUint32();
return result;
}
@@ -1424,18 +1423,11 @@ bb.writeByte(encoded);
var value = message["module_path"];
if (value != null) {
- bb.writeAlphanumeric(value);
+ bb.writeString(value);
} else {
throw new Error("Missing required field \"module_path\"");
}
- var value = message["log"];
- if (value != null) {
- encodeLog(value, bb);
- } else {
- throw new Error("Missing required field \"log\"");
- }
-
var value = message["blob_length"];
if (value != null) {
bb.writeUint32(value);
@@ -1451,7 +1443,7 @@ function decodeWebsocketMessageBuildFailure(bb) {
result["id"] = bb.readUint32();
result["from_timestamp"] = bb.readUint32();
result["loader"] = Loader[bb.readByte()];
- result["module_path"] = bb.readAlphanumeric();
+ result["module_path"] = bb.readString();
result["log"] = decodeLog(bb);
return result;
}
@@ -1483,7 +1475,7 @@ bb.writeByte(encoded);
var value = message["module_path"];
if (value != null) {
- bb.writeAlphanumeric(value);
+ bb.writeString(value);
} else {
throw new Error("Missing required field \"module_path\"");
}
diff --git a/src/api/schema.peechy b/src/api/schema.peechy
index 48387906b..e65319dc4 100644
--- a/src/api/schema.peechy
+++ b/src/api/schema.peechy
@@ -287,10 +287,8 @@ struct WebsocketMessageBuildSuccess {
uint32 from_timestamp;
Loader loader;
- alphanumeric module_path;
+ string module_path;
- Log log;
-
// This is the length of the blob that immediately follows this message.
uint32 blob_length;
}
@@ -301,7 +299,7 @@ struct WebsocketMessageBuildFailure {
uint32 from_timestamp;
Loader loader;
- alphanumeric module_path;
+ string module_path;
Log log;
}
diff --git a/src/api/schema.zig b/src/api/schema.zig
index 94c5bb643..6c4b539f8 100644
--- a/src/api/schema.zig
+++ b/src/api/schema.zig
@@ -206,16 +206,11 @@ pub fn Writer(comptime WritableStream: type) type {
pub fn writeValue(this: *Self, slice: anytype) !void {
switch (@TypeOf(slice)) {
- []u8, []const u8 => {
- try this.writeArray(u8, slice);
- },
-
[]u16,
[]u32,
[]i16,
[]i32,
[]i8,
-
[]const u16,
[]const u32,
[]const i16,
@@ -225,6 +220,10 @@ pub fn Writer(comptime WritableStream: type) type {
try this.writeArray(@TypeOf(slice), slice);
},
+ []u8, []const u8 => {
+ try this.writeArray(u8, slice);
+ },
+
u8 => {
try this.write(slice);
},
@@ -1413,9 +1412,6 @@ pub const Api = struct {
/// module_path
module_path: []const u8,
- /// log
- log: Log,
-
/// blob_length
blob_length: u32 = 0,
@@ -1426,7 +1422,6 @@ pub const Api = struct {
this.from_timestamp = try reader.readValue(u32);
this.loader = try reader.readValue(Loader);
this.module_path = try reader.readValue([]const u8);
- this.log = try reader.readValue(Log);
this.blob_length = try reader.readValue(u32);
return this;
}
@@ -1435,8 +1430,7 @@ pub const Api = struct {
try writer.writeInt(this.id);
try writer.writeInt(this.from_timestamp);
try writer.writeEnum(this.loader);
- try writer.writeArray(u8, this.module_path);
- try writer.writeValue(this.log);
+ try writer.writeValue(this.module_path);
try writer.writeInt(this.blob_length);
}
};
@@ -1472,7 +1466,7 @@ pub const Api = struct {
try writer.writeInt(this.id);
try writer.writeInt(this.from_timestamp);
try writer.writeEnum(this.loader);
- try writer.writeArray(u8, this.module_path);
+ try writer.writeValue(this.module_path);
try writer.writeValue(this.log);
}
};