diff options
author | 2021-06-18 00:51:11 -0700 | |
---|---|---|
committer | 2021-06-18 00:51:11 -0700 | |
commit | 6dce0c1e032edd9ff70f4a1c417a8662d1012e8b (patch) | |
tree | 23e3af849a0bbbf8943227941f900dc91421a358 /src/api/schema.zig | |
parent | 9ca283bb43ebee74bf36af50807474b962ac44a1 (diff) | |
download | bun-6dce0c1e032edd9ff70f4a1c417a8662d1012e8b.tar.gz bun-6dce0c1e032edd9ff70f4a1c417a8662d1012e8b.tar.zst bun-6dce0c1e032edd9ff70f4a1c417a8662d1012e8b.zip |
100x!!
Former-commit-id: e0fa2e78da8083dc590c4b1f3d016ba545261b84
Diffstat (limited to 'src/api/schema.zig')
-rw-r--r-- | src/api/schema.zig | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/api/schema.zig b/src/api/schema.zig index 6c4b539f8..00460fcc6 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -1285,6 +1285,12 @@ pub const Api = struct { /// build_fail build_fail, + /// manifest_success + manifest_success, + + /// manifest_fail + manifest_fail, + _, pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { @@ -1297,6 +1303,9 @@ pub const Api = struct { /// build build, + /// manifest + manifest, + _, pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { @@ -1399,6 +1408,22 @@ pub const Api = struct { } }; + pub const WebsocketCommandManifest = packed struct { + /// id + id: u32 = 0, + + pub fn decode(reader: anytype) anyerror!WebsocketCommandManifest { + var this = std.mem.zeroes(WebsocketCommandManifest); + + this.id = try reader.readValue(u32); + return this; + } + + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + } + }; + pub const WebsocketMessageBuildSuccess = struct { /// id id: u32 = 0, @@ -1470,6 +1495,84 @@ pub const Api = struct { try writer.writeValue(this.log); } }; + + pub const DependencyManifest = struct { + /// ids + ids: []const u32, + + pub fn decode(reader: anytype) anyerror!DependencyManifest { + var this = std.mem.zeroes(DependencyManifest); + + this.ids = try reader.readArray(u32); + return this; + } + + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(u32, this.ids); + } + }; + + pub const WebsocketMessageManifestSuccess = struct { + /// id + id: u32 = 0, + + /// module_path + module_path: []const u8, + + /// loader + loader: Loader, + + /// manifest + manifest: DependencyManifest, + + pub fn decode(reader: anytype) anyerror!WebsocketMessageManifestSuccess { + var this = std.mem.zeroes(WebsocketMessageManifestSuccess); + + this.id = try reader.readValue(u32); + this.module_path = try reader.readValue([]const u8); + this.loader = try reader.readValue(Loader); + this.manifest = try reader.readValue(DependencyManifest); + return this; + } + + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeValue(this.module_path); + try writer.writeEnum(this.loader); + try writer.writeValue(this.manifest); + } + }; + + pub const WebsocketMessageManifestFailure = struct { + /// id + id: u32 = 0, + + /// from_timestamp + from_timestamp: u32 = 0, + + /// loader + loader: Loader, + + /// log + log: Log, + + pub fn decode(reader: anytype) anyerror!WebsocketMessageManifestFailure { + var this = std.mem.zeroes(WebsocketMessageManifestFailure); + + this.id = try reader.readValue(u32); + this.from_timestamp = try reader.readValue(u32); + this.loader = try reader.readValue(Loader); + this.log = try reader.readValue(Log); + return this; + } + + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeInt(this.from_timestamp); + try writer.writeEnum(this.loader); + try writer.writeValue(this.log); + } + }; }; const ExamplePackedStruct = packed struct { |