Skip to content

Commit e46d17c

Browse files
authored
Update protos for 1.11 (#490)
Signed-off-by: ItalyPaleAle <[email protected]>
1 parent b4335c1 commit e46d17c

27 files changed

+14440
-4540
lines changed

scripts/fetch-proto.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')
33
ARCH=$(uname -m)
44
ORG_NAME="dapr"
55
REPO_NAME="dapr"
6-
BRANCH_NAME="v1.10.2"
6+
BRANCH_NAME="release-1.11"
77

88
# Path to store output
99
PATH_ROOT=$(pwd)
@@ -141,6 +141,7 @@ echo ""
141141
echo "Downloading latest Google Protobuf gRPC files"
142142
downloadFile "https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/any.proto" "$PATH_ROOT/src/proto/google/protobuf/any.proto"
143143
downloadFile "https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/empty.proto" "$PATH_ROOT/src/proto/google/protobuf/empty.proto"
144+
downloadFile "https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/timestamp.proto" "$PATH_ROOT/src/proto/google/protobuf/timestamp.proto"
144145

145146
echo ""
146147
echo "Compiling gRPC files"
@@ -156,6 +157,7 @@ generateGrpc "$PATH_ROOT/src/proto" "dapr/proto/sentry/v1/sentry.proto"
156157

157158
generateGrpc "$PATH_ROOT/src/proto" "google/protobuf/any.proto"
158159
generateGrpc "$PATH_ROOT/src/proto" "google/protobuf/empty.proto"
160+
generateGrpc "$PATH_ROOT/src/proto" "google/protobuf/timestamp.proto"
159161

160162

161163
echo ""

src/implementation/Client/DaprClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default class DaprClient {
104104
this.proxy = new GRPCClientProxy(client);
105105
this.configuration = new GRPCClientConfiguration(client);
106106
this.lock = new GRPCClientLock(client);
107-
this.actor = new GRPCClientActor(client); // we use a abstractor here since we interface through a builder with the Actor Runtime
107+
this.actor = new GRPCClientActor(client); // we use an abstractor here since we interface through a builder with the Actor Runtime
108108
break;
109109
}
110110
case CommunicationProtocolEnum.HTTP:
@@ -123,7 +123,7 @@ export default class DaprClient {
123123
this.configuration = new HTTPClientConfiguration(client);
124124
this.proxy = new HTTPClientProxy(client);
125125
this.lock = new HTTPClientLock(client);
126-
this.actor = new HTTPClientActor(client); // we use a abstractor here since we interface through a builder with the Actor Runtime
126+
this.actor = new HTTPClientActor(client); // we use an abstractor here since we interface through a builder with the Actor Runtime
127127
break;
128128
}
129129
}

src/implementation/Client/GRPCClient/lock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class GRPCClientLock implements IClientLock {
3939
.setStoreName(storeName)
4040
.setResourceId(resourceId)
4141
.setLockOwner(lockOwner)
42-
.setExpiryinseconds(expiryInSeconds);
42+
.setExpiryInSeconds(expiryInSeconds);
4343

4444
const client = await this.client.getClient();
4545
return new Promise((resolve, reject) => {

src/proto/dapr/proto/common/v1/common.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ message InvokeRequest {
7777
HTTPExtension http_extension = 4;
7878
}
7979

80-
// InvokeResponse is the response message inclduing data and its content type
80+
// InvokeResponse is the response message including data and its content type
8181
// from app callback.
8282
// This message is used in InvokeService of Dapr gRPC Service and OnInvoke
8383
// of AppCallback gRPC service.
@@ -99,7 +99,7 @@ message StreamPayload {
9999
bytes data = 1;
100100

101101
// Sequence number. This is a counter that starts from 0 and increments by 1 on each chunk sent.
102-
uint32 seq = 2;
102+
uint64 seq = 2;
103103
}
104104

105105
// StateItem represents state key, value, and additional options to save state.

src/proto/dapr/proto/common/v1/common_pb.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ proto.dapr.proto.common.v1.StreamPayload.deserializeBinaryFromReader = function(
890890
msg.setData(value);
891891
break;
892892
case 2:
893-
var value = /** @type {number} */ (reader.readUint32());
893+
var value = /** @type {number} */ (reader.readUint64());
894894
msg.setSeq(value);
895895
break;
896896
default:
@@ -931,7 +931,7 @@ proto.dapr.proto.common.v1.StreamPayload.serializeBinaryToWriter = function(mess
931931
}
932932
f = message.getSeq();
933933
if (f !== 0) {
934-
writer.writeUint32(
934+
writer.writeUint64(
935935
2,
936936
f
937937
);
@@ -982,7 +982,7 @@ proto.dapr.proto.common.v1.StreamPayload.prototype.setData = function(value) {
982982

983983

984984
/**
985-
* optional uint32 seq = 2;
985+
* optional uint64 seq = 2;
986986
* @return {number}
987987
*/
988988
proto.dapr.proto.common.v1.StreamPayload.prototype.getSeq = function() {

src/proto/dapr/proto/operator/v1/operator.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ service Operator {
3434
rpc ListResiliency (ListResiliencyRequest) returns (ListResiliencyResponse) {}
3535
// Returns a list of pub/sub subscriptions, ListSubscriptionsRequest to expose pod info
3636
rpc ListSubscriptionsV2 (ListSubscriptionsRequest) returns (ListSubscriptionsResponse) {}
37+
// Returns a list of http endpoints
38+
rpc ListHTTPEndpoints (ListHTTPEndpointsRequest) returns (ListHTTPEndpointsResponse) {}
39+
// Sends events to Dapr sidecars upon http endpoint changes.
40+
rpc HTTPEndpointUpdate (HTTPEndpointUpdateRequest) returns (stream HTTPEndpointUpdateEvent) {}
3741
}
3842

3943
// ListComponentsRequest is the request to get components for a sidecar in namespace.
@@ -100,3 +104,34 @@ message ListSubscriptionsRequest {
100104
string podName = 1;
101105
string namespace = 2;
102106
}
107+
108+
// GetHTTPEndpointRequest is the request to get an http endpoint configuration.
109+
message GetHTTPEndpointRequest {
110+
string name = 1;
111+
string namespace = 2;
112+
}
113+
114+
// GetHTTPEndpointResponse includes the requested http endpoint configuration.
115+
message GetHTTPEndpointResponse {
116+
bytes http_endpoint = 1;
117+
}
118+
119+
// ListHTTPEndpointsResponse includes the list of available http endpoint configurations.
120+
message ListHTTPEndpointsResponse {
121+
repeated bytes http_endpoints = 1;
122+
}
123+
124+
message ListHTTPEndpointsRequest {
125+
string namespace = 1;
126+
}
127+
128+
// HTTPEndpointsUpdateRequest is the request to get updates about new http endpoints for a given namespace.
129+
message HTTPEndpointUpdateRequest {
130+
string namespace = 1;
131+
string pod_name = 2;
132+
}
133+
134+
// HTTPEndpointsUpdateEvent includes the updated http endpoint event.
135+
message HTTPEndpointUpdateEvent {
136+
bytes http_endpoints = 1;
137+
}

src/proto/dapr/proto/operator/v1/operator_grpc_pb.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ interface IOperatorService extends grpc.ServiceDefinition<grpc.UntypedServiceImp
1616
getResiliency: IOperatorService_IGetResiliency;
1717
listResiliency: IOperatorService_IListResiliency;
1818
listSubscriptionsV2: IOperatorService_IListSubscriptionsV2;
19+
listHTTPEndpoints: IOperatorService_IListHTTPEndpoints;
20+
hTTPEndpointUpdate: IOperatorService_IHTTPEndpointUpdate;
1921
}
2022

2123
interface IOperatorService_IComponentUpdate extends grpc.MethodDefinition<dapr_proto_operator_v1_operator_pb.ComponentUpdateRequest, dapr_proto_operator_v1_operator_pb.ComponentUpdateEvent> {
@@ -81,6 +83,24 @@ interface IOperatorService_IListSubscriptionsV2 extends grpc.MethodDefinition<da
8183
responseSerialize: grpc.serialize<dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse>;
8284
responseDeserialize: grpc.deserialize<dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse>;
8385
}
86+
interface IOperatorService_IListHTTPEndpoints extends grpc.MethodDefinition<dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse> {
87+
path: "/dapr.proto.operator.v1.Operator/ListHTTPEndpoints";
88+
requestStream: false;
89+
responseStream: false;
90+
requestSerialize: grpc.serialize<dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest>;
91+
requestDeserialize: grpc.deserialize<dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest>;
92+
responseSerialize: grpc.serialize<dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse>;
93+
responseDeserialize: grpc.deserialize<dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse>;
94+
}
95+
interface IOperatorService_IHTTPEndpointUpdate extends grpc.MethodDefinition<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest, dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent> {
96+
path: "/dapr.proto.operator.v1.Operator/HTTPEndpointUpdate";
97+
requestStream: false;
98+
responseStream: true;
99+
requestSerialize: grpc.serialize<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest>;
100+
requestDeserialize: grpc.deserialize<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest>;
101+
responseSerialize: grpc.serialize<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
102+
responseDeserialize: grpc.deserialize<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
103+
}
84104

85105
export const OperatorService: IOperatorService;
86106

@@ -92,6 +112,8 @@ export interface IOperatorServer extends grpc.UntypedServiceImplementation {
92112
getResiliency: grpc.handleUnaryCall<dapr_proto_operator_v1_operator_pb.GetResiliencyRequest, dapr_proto_operator_v1_operator_pb.GetResiliencyResponse>;
93113
listResiliency: grpc.handleUnaryCall<dapr_proto_operator_v1_operator_pb.ListResiliencyRequest, dapr_proto_operator_v1_operator_pb.ListResiliencyResponse>;
94114
listSubscriptionsV2: grpc.handleUnaryCall<dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse>;
115+
listHTTPEndpoints: grpc.handleUnaryCall<dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse>;
116+
hTTPEndpointUpdate: grpc.handleServerStreamingCall<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest, dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
95117
}
96118

97119
export interface IOperatorClient {
@@ -115,6 +137,11 @@ export interface IOperatorClient {
115137
listSubscriptionsV2(request: dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse) => void): grpc.ClientUnaryCall;
116138
listSubscriptionsV2(request: dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse) => void): grpc.ClientUnaryCall;
117139
listSubscriptionsV2(request: dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse) => void): grpc.ClientUnaryCall;
140+
listHTTPEndpoints(request: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse) => void): grpc.ClientUnaryCall;
141+
listHTTPEndpoints(request: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse) => void): grpc.ClientUnaryCall;
142+
listHTTPEndpoints(request: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse) => void): grpc.ClientUnaryCall;
143+
hTTPEndpointUpdate(request: dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
144+
hTTPEndpointUpdate(request: dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
118145
}
119146

120147
export class OperatorClient extends grpc.Client implements IOperatorClient {
@@ -139,4 +166,9 @@ export class OperatorClient extends grpc.Client implements IOperatorClient {
139166
public listSubscriptionsV2(request: dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse) => void): grpc.ClientUnaryCall;
140167
public listSubscriptionsV2(request: dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse) => void): grpc.ClientUnaryCall;
141168
public listSubscriptionsV2(request: dapr_proto_operator_v1_operator_pb.ListSubscriptionsRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListSubscriptionsResponse) => void): grpc.ClientUnaryCall;
169+
public listHTTPEndpoints(request: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse) => void): grpc.ClientUnaryCall;
170+
public listHTTPEndpoints(request: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse) => void): grpc.ClientUnaryCall;
171+
public listHTTPEndpoints(request: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse) => void): grpc.ClientUnaryCall;
172+
public hTTPEndpointUpdate(request: dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
173+
public hTTPEndpointUpdate(request: dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent>;
142174
}

src/proto/dapr/proto/operator/v1/operator_grpc_pb.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ function deserialize_dapr_proto_operator_v1_GetResiliencyResponse(buffer_arg) {
8484
return dapr_proto_operator_v1_operator_pb.GetResiliencyResponse.deserializeBinary(new Uint8Array(buffer_arg));
8585
}
8686

87+
function serialize_dapr_proto_operator_v1_HTTPEndpointUpdateEvent(arg) {
88+
if (!(arg instanceof dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent)) {
89+
throw new Error('Expected argument of type dapr.proto.operator.v1.HTTPEndpointUpdateEvent');
90+
}
91+
return Buffer.from(arg.serializeBinary());
92+
}
93+
94+
function deserialize_dapr_proto_operator_v1_HTTPEndpointUpdateEvent(buffer_arg) {
95+
return dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent.deserializeBinary(new Uint8Array(buffer_arg));
96+
}
97+
98+
function serialize_dapr_proto_operator_v1_HTTPEndpointUpdateRequest(arg) {
99+
if (!(arg instanceof dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest)) {
100+
throw new Error('Expected argument of type dapr.proto.operator.v1.HTTPEndpointUpdateRequest');
101+
}
102+
return Buffer.from(arg.serializeBinary());
103+
}
104+
105+
function deserialize_dapr_proto_operator_v1_HTTPEndpointUpdateRequest(buffer_arg) {
106+
return dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest.deserializeBinary(new Uint8Array(buffer_arg));
107+
}
108+
87109
function serialize_dapr_proto_operator_v1_ListComponentResponse(arg) {
88110
if (!(arg instanceof dapr_proto_operator_v1_operator_pb.ListComponentResponse)) {
89111
throw new Error('Expected argument of type dapr.proto.operator.v1.ListComponentResponse');
@@ -106,6 +128,28 @@ function deserialize_dapr_proto_operator_v1_ListComponentsRequest(buffer_arg) {
106128
return dapr_proto_operator_v1_operator_pb.ListComponentsRequest.deserializeBinary(new Uint8Array(buffer_arg));
107129
}
108130

131+
function serialize_dapr_proto_operator_v1_ListHTTPEndpointsRequest(arg) {
132+
if (!(arg instanceof dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest)) {
133+
throw new Error('Expected argument of type dapr.proto.operator.v1.ListHTTPEndpointsRequest');
134+
}
135+
return Buffer.from(arg.serializeBinary());
136+
}
137+
138+
function deserialize_dapr_proto_operator_v1_ListHTTPEndpointsRequest(buffer_arg) {
139+
return dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest.deserializeBinary(new Uint8Array(buffer_arg));
140+
}
141+
142+
function serialize_dapr_proto_operator_v1_ListHTTPEndpointsResponse(arg) {
143+
if (!(arg instanceof dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse)) {
144+
throw new Error('Expected argument of type dapr.proto.operator.v1.ListHTTPEndpointsResponse');
145+
}
146+
return Buffer.from(arg.serializeBinary());
147+
}
148+
149+
function deserialize_dapr_proto_operator_v1_ListHTTPEndpointsResponse(buffer_arg) {
150+
return dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse.deserializeBinary(new Uint8Array(buffer_arg));
151+
}
152+
109153
function serialize_dapr_proto_operator_v1_ListResiliencyRequest(arg) {
110154
if (!(arg instanceof dapr_proto_operator_v1_operator_pb.ListResiliencyRequest)) {
111155
throw new Error('Expected argument of type dapr.proto.operator.v1.ListResiliencyRequest');
@@ -247,6 +291,30 @@ listSubscriptionsV2: {
247291
responseSerialize: serialize_dapr_proto_operator_v1_ListSubscriptionsResponse,
248292
responseDeserialize: deserialize_dapr_proto_operator_v1_ListSubscriptionsResponse,
249293
},
294+
// Returns a list of http endpoints
295+
listHTTPEndpoints: {
296+
path: '/dapr.proto.operator.v1.Operator/ListHTTPEndpoints',
297+
requestStream: false,
298+
responseStream: false,
299+
requestType: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsRequest,
300+
responseType: dapr_proto_operator_v1_operator_pb.ListHTTPEndpointsResponse,
301+
requestSerialize: serialize_dapr_proto_operator_v1_ListHTTPEndpointsRequest,
302+
requestDeserialize: deserialize_dapr_proto_operator_v1_ListHTTPEndpointsRequest,
303+
responseSerialize: serialize_dapr_proto_operator_v1_ListHTTPEndpointsResponse,
304+
responseDeserialize: deserialize_dapr_proto_operator_v1_ListHTTPEndpointsResponse,
305+
},
306+
// Sends events to Dapr sidecars upon http endpoint changes.
307+
hTTPEndpointUpdate: {
308+
path: '/dapr.proto.operator.v1.Operator/HTTPEndpointUpdate',
309+
requestStream: false,
310+
responseStream: true,
311+
requestType: dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateRequest,
312+
responseType: dapr_proto_operator_v1_operator_pb.HTTPEndpointUpdateEvent,
313+
requestSerialize: serialize_dapr_proto_operator_v1_HTTPEndpointUpdateRequest,
314+
requestDeserialize: deserialize_dapr_proto_operator_v1_HTTPEndpointUpdateRequest,
315+
responseSerialize: serialize_dapr_proto_operator_v1_HTTPEndpointUpdateEvent,
316+
responseDeserialize: deserialize_dapr_proto_operator_v1_HTTPEndpointUpdateEvent,
317+
},
250318
};
251319

252320
exports.OperatorClient = grpc.makeGenericClientConstructor(OperatorService);

0 commit comments

Comments
 (0)