|  | 
|  | 1 | +/* | 
|  | 2 | +Copyright 2021 The Dapr Authors | 
|  | 3 | +Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 4 | +you may not use this file except in compliance with the License. | 
|  | 5 | +You may obtain a copy of the License at | 
|  | 6 | +    http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 7 | +Unless required by applicable law or agreed to in writing, software | 
|  | 8 | +distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 9 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 10 | +See the License for the specific language governing permissions and | 
|  | 11 | +limitations under the License. | 
|  | 12 | +*/ | 
|  | 13 | + | 
|  | 14 | +syntax = "proto3"; | 
|  | 15 | + | 
|  | 16 | +package dapr.proto.common.v1; | 
|  | 17 | + | 
|  | 18 | +import "google/protobuf/any.proto"; | 
|  | 19 | + | 
|  | 20 | +option csharp_namespace = "Dapr.Client.Autogen.Grpc.v1"; | 
|  | 21 | +option java_outer_classname = "CommonProtos"; | 
|  | 22 | +option java_package = "io.dapr.v1"; | 
|  | 23 | +option go_package = "github.com/dapr/dapr/pkg/proto/common/v1;common"; | 
|  | 24 | + | 
|  | 25 | +// HTTPExtension includes HTTP verb and querystring | 
|  | 26 | +// when Dapr runtime delivers HTTP content. | 
|  | 27 | +//  | 
|  | 28 | +// For example, when callers calls http invoke api | 
|  | 29 | +// POST http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2 | 
|  | 30 | +//  | 
|  | 31 | +// Dapr runtime will parse POST as a verb and extract querystring to quersytring map. | 
|  | 32 | +message HTTPExtension { | 
|  | 33 | +  // Type of HTTP 1.1 Methods | 
|  | 34 | +  // RFC 7231: https://tools.ietf.org/html/rfc7231#page-24 | 
|  | 35 | +  // RFC 5789: https://datatracker.ietf.org/doc/html/rfc5789 | 
|  | 36 | +  enum Verb { | 
|  | 37 | +    NONE = 0; | 
|  | 38 | +    GET = 1; | 
|  | 39 | +    HEAD = 2; | 
|  | 40 | +    POST = 3; | 
|  | 41 | +    PUT = 4; | 
|  | 42 | +    DELETE = 5; | 
|  | 43 | +    CONNECT = 6; | 
|  | 44 | +    OPTIONS = 7; | 
|  | 45 | +    TRACE = 8; | 
|  | 46 | +    PATCH = 9; | 
|  | 47 | +  } | 
|  | 48 | + | 
|  | 49 | +  // Required. HTTP verb. | 
|  | 50 | +  Verb verb = 1; | 
|  | 51 | + | 
|  | 52 | +  // Optional. querystring represents an encoded HTTP url query string in the following format: name=value&name2=value2 | 
|  | 53 | +  string querystring = 2; | 
|  | 54 | +} | 
|  | 55 | + | 
|  | 56 | +// InvokeRequest is the message to invoke a method with the data. | 
|  | 57 | +// This message is used in InvokeService of Dapr gRPC Service and OnInvoke | 
|  | 58 | +// of AppCallback gRPC service. | 
|  | 59 | +message InvokeRequest { | 
|  | 60 | +  // Required. method is a method name which will be invoked by caller. | 
|  | 61 | +  string method = 1; | 
|  | 62 | + | 
|  | 63 | +  // Required in unary RPCs. Bytes value or Protobuf message which caller sent. | 
|  | 64 | +  // Dapr treats Any.value as bytes type if Any.type_url is unset. | 
|  | 65 | +  google.protobuf.Any data = 2; | 
|  | 66 | + | 
|  | 67 | +  // The type of data content. | 
|  | 68 | +  // | 
|  | 69 | +  // This field is required if data delivers http request body | 
|  | 70 | +  // Otherwise, this is optional. | 
|  | 71 | +  string content_type = 3; | 
|  | 72 | + | 
|  | 73 | +  // HTTP specific fields if request conveys http-compatible request. | 
|  | 74 | +  // | 
|  | 75 | +  // This field is required for http-compatible request. Otherwise, | 
|  | 76 | +  // this field is optional. | 
|  | 77 | +  HTTPExtension http_extension = 4; | 
|  | 78 | +} | 
|  | 79 | + | 
|  | 80 | +// InvokeResponse is the response message including data and its content type | 
|  | 81 | +// from app callback. | 
|  | 82 | +// This message is used in InvokeService of Dapr gRPC Service and OnInvoke | 
|  | 83 | +// of AppCallback gRPC service. | 
|  | 84 | +message InvokeResponse { | 
|  | 85 | +  // Required in unary RPCs. The content body of InvokeService response. | 
|  | 86 | +  google.protobuf.Any data = 1; | 
|  | 87 | + | 
|  | 88 | +  // Required. The type of data content. | 
|  | 89 | +  string content_type = 2; | 
|  | 90 | +} | 
|  | 91 | + | 
|  | 92 | +// Chunk of data sent in a streaming request or response. | 
|  | 93 | +// This is used in requests including InternalInvokeRequestStream. | 
|  | 94 | +message StreamPayload { | 
|  | 95 | +  // Data sent in the chunk. | 
|  | 96 | +  // The amount of data included in each chunk is up to the discretion of the sender, and can be empty. | 
|  | 97 | +  // Additionally, the amount of data doesn't need to be fixed and subsequent messages can send more, or less, data. | 
|  | 98 | +  // Receivers must not make assumptions about the number of bytes they'll receive in each chunk. | 
|  | 99 | +  bytes data = 1; | 
|  | 100 | + | 
|  | 101 | +  // Sequence number. This is a counter that starts from 0 and increments by 1 on each chunk sent. | 
|  | 102 | +  uint64 seq = 2; | 
|  | 103 | +} | 
|  | 104 | + | 
|  | 105 | +// StateItem represents state key, value, and additional options to save state. | 
|  | 106 | +message StateItem { | 
|  | 107 | +  // Required. The state key | 
|  | 108 | +  string key = 1; | 
|  | 109 | + | 
|  | 110 | +  // Required. The state data for key | 
|  | 111 | +  bytes value = 2; | 
|  | 112 | + | 
|  | 113 | +  // The entity tag which represents the specific version of data. | 
|  | 114 | +  // The exact ETag format is defined by the corresponding data store. | 
|  | 115 | +  Etag etag = 3; | 
|  | 116 | + | 
|  | 117 | +  // The metadata which will be passed to state store component. | 
|  | 118 | +  map<string,string> metadata = 4; | 
|  | 119 | + | 
|  | 120 | +  // Options for concurrency and consistency to save the state. | 
|  | 121 | +  StateOptions options = 5; | 
|  | 122 | +} | 
|  | 123 | + | 
|  | 124 | +// Etag represents a state item version | 
|  | 125 | +message Etag { | 
|  | 126 | +  // value sets the etag value | 
|  | 127 | +  string value = 1; | 
|  | 128 | +} | 
|  | 129 | + | 
|  | 130 | +// StateOptions configures concurrency and consistency for state operations | 
|  | 131 | +message StateOptions { | 
|  | 132 | +  // Enum describing the supported concurrency for state. | 
|  | 133 | +  enum StateConcurrency { | 
|  | 134 | +    CONCURRENCY_UNSPECIFIED = 0; | 
|  | 135 | +    CONCURRENCY_FIRST_WRITE = 1; | 
|  | 136 | +    CONCURRENCY_LAST_WRITE = 2; | 
|  | 137 | +  } | 
|  | 138 | + | 
|  | 139 | +  // Enum describing the supported consistency for state. | 
|  | 140 | +  enum StateConsistency { | 
|  | 141 | +    CONSISTENCY_UNSPECIFIED = 0; | 
|  | 142 | +    CONSISTENCY_EVENTUAL = 1; | 
|  | 143 | +    CONSISTENCY_STRONG = 2; | 
|  | 144 | +  } | 
|  | 145 | + | 
|  | 146 | +  StateConcurrency concurrency = 1; | 
|  | 147 | +  StateConsistency consistency = 2; | 
|  | 148 | +} | 
|  | 149 | + | 
|  | 150 | +// ConfigurationItem represents all the configuration with its name(key). | 
|  | 151 | +message ConfigurationItem { | 
|  | 152 | +  // Required. The value of configuration item. | 
|  | 153 | +  string value = 1; | 
|  | 154 | + | 
|  | 155 | +  // Version is response only and cannot be fetched. Store is not expected to keep all versions available | 
|  | 156 | +  string version = 2; | 
|  | 157 | + | 
|  | 158 | +  // the metadata which will be passed to/from configuration store component. | 
|  | 159 | +  map<string,string> metadata = 3; | 
|  | 160 | +} | 
0 commit comments