Skip to content

Commit

Permalink
add mux APIs for generic artifact upload (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowp authored Feb 19, 2025
1 parent 03eedbe commit 8f2288b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions src/bitdrift_public/protobuf/client/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ message ApiRequest {
OpaqueRequest opaque_upload = 9;
SankeyPathUploadRequest sankey_path_upload = 10;
SankeyIntentRequest sankey_intent = 11;
UploadArtifactRequest artifact_upload = 12;
UploadArtifactIntentRequest artifact_intent = 13;
}
}

Expand Down Expand Up @@ -244,6 +246,56 @@ message SankeyIntentRequest {
string sankey_diagram_id = 3 [(validate.rules).string = {min_len: 1}];
}

message UploadArtifactIntentRequest {
// The UUID of the intent being negotiated. This is used to correlate the response with the request.
string intent_uuid = 1 [(validate.rules).string = {min_len: 1}];

// The type of the artifact being considered for upload.
string type_id = 2 [(validate.rules).string = {min_len: 1}];

// The metadata associated with the artifact. This is a binary blob that is interpreted by the server
// based on the type_id.
bytes metadata = 3;
}

message UploadArtifactIntentResponse {
// The UUID of the intent being negotiated. This is used to correlate the response with the request.
string intent_uuid = 1 [(validate.rules).string = {min_len: 1}];

message UploadImmediately {
}

message Drop {
}

oneof decision {
// The artifact should be uploaded immediately.
UploadImmediately upload_immediately = 3;

// The candidate artifact should be dropped.
Drop drop = 4;
}
}

message UploadArtifactRequest {
// Upload UUID used to provide idempotence and to correlate a response with this request.
string upload_uuid = 1 [(validate.rules).string = {min_len: 1}];

// The type of the artifact being uploaded.
string type_id = 2 [(validate.rules).string = {min_len: 1}];

// The artifact to upload. This is a binary blob that is interpreted by the server based on the type_id.
bytes contents = 3 [(validate.rules).bytes = {min_len: 1}];
}

message UploadArtifactResponse {
// The UUID corresponding to the upload request.
string upload_uuid = 1 [(validate.rules).string = {min_len: 1}];

// Optional error message which indicates that artifact upload failed.
string error = 2;
}

// The response sent as part of stream establishment.
message HandshakeResponse {
message StreamSettings {
Expand Down Expand Up @@ -474,6 +526,8 @@ message ApiResponse {
OpaqueResponse opaque_upload = 11;
SankeyPathUploadResponse sankey_diagram_upload = 12;
SankeyIntentResponse sankey_intent_response = 13;
UploadArtifactResponse artifact_upload = 14;
UploadArtifactIntentResponse artifact_intent = 15;
}
}

Expand Down

0 comments on commit 8f2288b

Please sign in to comment.