diff --git a/api.swagger.json b/api.swagger.json index 98b72f5..10f15ce 100644 --- a/api.swagger.json +++ b/api.swagger.json @@ -23,9 +23,6 @@ { "name": "DevicesService" }, - { - "name": "ShadowService" - }, { "name": "InternalService" }, @@ -292,24 +289,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "defaultNamespace": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/nodeAccountsServiceUpdateBody" } } ], @@ -464,12 +444,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "credentials": { - "$ref": "#/definitions/accountsCredentials" - } - } + "$ref": "#/definitions/AccountsServiceSetCredentialsBody" } } ], @@ -631,12 +606,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "namespace": { - "type": "string" - } - } + "$ref": "#/definitions/nodeAccountsServiceMoveBody" } } ], @@ -674,24 +644,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "defaultNamespace": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/nodeAccountsServiceToggleBody" } } ], @@ -1183,6 +1136,13 @@ "in": "query", "required": false, "type": "object" + }, + { + "name": "lastUpdated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" } ], "tags": [ @@ -1302,6 +1262,13 @@ "in": "query", "required": false, "type": "object" + }, + { + "name": "lastUpdated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" } ], "tags": [ @@ -1336,36 +1303,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "certificate": { - "$ref": "#/definitions/devicesCertificate" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "basicEnabled": { - "type": "boolean" - }, - "token": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/nodeDevicesServiceUpdateBody" } } ], @@ -1403,36 +1341,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "certificate": { - "$ref": "#/definitions/devicesCertificate" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "basicEnabled": { - "type": "boolean" - }, - "token": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/DevicesServicePatchConfigBody" } } ], @@ -1556,6 +1465,13 @@ "in": "query", "required": false, "type": "object" + }, + { + "name": "lastUpdated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" } ], "tags": [ @@ -1593,12 +1509,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "namespace": { - "type": "string" - } - } + "$ref": "#/definitions/nodeDevicesServiceMoveBody" } } ], @@ -1636,36 +1547,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "certificate": { - "$ref": "#/definitions/devicesCertificate" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "basicEnabled": { - "type": "boolean" - }, - "token": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/nodeDevicesServiceToggleBody" } } ], @@ -1703,36 +1585,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "certificate": { - "$ref": "#/definitions/devicesCertificate" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "basicEnabled": { - "type": "boolean" - }, - "token": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/DevicesServiceToggleBasicBody" } } ], @@ -1927,15 +1780,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "account": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessLevel" - } - } + "$ref": "#/definitions/nodeNamespacesServiceJoinBody" } } ], @@ -2143,21 +1988,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "plugin": { - "$ref": "#/definitions/nodenamespacesPlugin" - }, - "config": { - "type": "object" - } - } + "$ref": "#/definitions/nodeNamespacesServiceUpdateBody" } } ], @@ -2787,46 +2618,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "logo": { - "type": "string", - "title": "Plugin logo url in format supported by \u003cimg\u003e tag" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string", - "title": "(optionally Markdown) long description Marketplace like" - }, - "public": { - "type": "boolean", - "title": "see Namespace field" - }, - "namespace": { - "type": "string", - "title": "Required to get not-public Plugin" - }, - "access": { - "$ref": "#/definitions/accessAccess" - }, - "kind": { - "$ref": "#/definitions/pluginsPluginKind" - }, - "vars": { - "type": "array", - "items": { - "type": "string" - } - }, - "embeddedConf": { - "$ref": "#/definitions/pluginsEmbededPluginConf" - }, - "deviceConf": { - "$ref": "#/definitions/pluginsDevicePluginConf" - } - } + "$ref": "#/definitions/pluginsPluginsServiceUpdateBody" } } ], @@ -2969,6 +2761,86 @@ } }, "definitions": { + "AccountsServiceSetCredentialsBody": { + "type": "object", + "properties": { + "credentials": { + "$ref": "#/definitions/accountsCredentials" + } + } + }, + "DevicesServicePatchConfigBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "certificate": { + "$ref": "#/definitions/devicesCertificate" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "basicEnabled": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "config": { + "type": "object" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + } + } + }, + "DevicesServiceToggleBasicBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "certificate": { + "$ref": "#/definitions/devicesCertificate" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "basicEnabled": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "config": { + "type": "object" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + } + } + }, "accessAccess": { "type": "object", "properties": { @@ -3130,6 +3002,10 @@ }, "config": { "type": "object" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" } } }, @@ -3269,9 +3145,137 @@ } } }, + "nodeAccountsServiceMoveBody": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + } + } + }, + "nodeAccountsServiceToggleBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "defaultNamespace": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "config": { + "type": "object" + } + } + }, + "nodeAccountsServiceUpdateBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "defaultNamespace": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "config": { + "type": "object" + } + } + }, "nodeDeleteResponse": { "type": "object" }, + "nodeDevicesServiceMoveBody": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + } + } + }, + "nodeDevicesServiceToggleBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "certificate": { + "$ref": "#/definitions/devicesCertificate" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "basicEnabled": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "config": { + "type": "object" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + } + } + }, + "nodeDevicesServiceUpdateBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "certificate": { + "$ref": "#/definitions/devicesCertificate" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "basicEnabled": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "config": { + "type": "object" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + } + } + }, "nodeDevicesTokenRequest": { "type": "object", "properties": { @@ -3333,6 +3337,34 @@ } } }, + "nodeNamespacesServiceJoinBody": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessLevel" + } + } + }, + "nodeNamespacesServiceUpdateBody": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "plugin": { + "$ref": "#/definitions/nodenamespacesPlugin" + }, + "config": { + "type": "object" + } + } + }, "nodeSetCredentialsResponse": { "type": "object" }, @@ -3473,6 +3505,48 @@ } } }, + "pluginsPluginsServiceUpdateBody": { + "type": "object", + "properties": { + "logo": { + "type": "string", + "title": "Plugin logo url in format supported by \u003cimg\u003e tag" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string", + "title": "(optionally Markdown) long description Marketplace like" + }, + "public": { + "type": "boolean", + "title": "see Namespace field" + }, + "namespace": { + "type": "string", + "title": "Required to get not-public Plugin" + }, + "access": { + "$ref": "#/definitions/accessAccess" + }, + "kind": { + "$ref": "#/definitions/pluginsPluginKind" + }, + "vars": { + "type": "array", + "items": { + "type": "string" + } + }, + "embeddedConf": { + "$ref": "#/definitions/pluginsEmbededPluginConf" + }, + "deviceConf": { + "$ref": "#/definitions/pluginsDevicePluginConf" + } + } + }, "protobufAny": { "type": "object", "properties": { diff --git a/build/es/node/devices/devices_pb.d.ts b/build/es/node/devices/devices_pb.d.ts index efbd242..634e601 100644 --- a/build/es/node/devices/devices_pb.d.ts +++ b/build/es/node/devices/devices_pb.d.ts @@ -18,7 +18,7 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Struct } from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Struct, Timestamp } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import type { Access } from "../access/access_pb.js"; @@ -71,6 +71,11 @@ export declare class Device extends Message { */ config?: Struct; + /** + * @generated from field: google.protobuf.Timestamp last_updated = 10; + */ + lastUpdated?: Timestamp; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; diff --git a/build/es/node/devices/devices_pb.js b/build/es/node/devices/devices_pb.js index 63c4371..3921600 100644 --- a/build/es/node/devices/devices_pb.js +++ b/build/es/node/devices/devices_pb.js @@ -18,7 +18,7 @@ /* eslint-disable */ // @ts-nocheck -import { proto3, Struct } from "@bufbuild/protobuf"; +import { proto3, Struct, Timestamp } from "@bufbuild/protobuf"; import { Access } from "../access/access_pb.js"; /** @@ -36,6 +36,7 @@ export const Device = proto3.makeMessageType( { no: 7, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 8, name: "access", kind: "message", T: Access, opt: true }, { no: 9, name: "config", kind: "message", T: Struct }, + { no: 10, name: "last_updated", kind: "message", T: Timestamp }, ], ); diff --git a/handsfree/handsfreeconnect/handsfree.connect.go b/handsfree/handsfreeconnect/handsfree.connect.go index 13662e5..866700d 100644 --- a/handsfree/handsfreeconnect/handsfree.connect.go +++ b/handsfree/handsfreeconnect/handsfree.connect.go @@ -33,7 +33,7 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. -const _ = connect.IsAtLeastVersion0_1_0 +const _ = connect.IsAtLeastVersion1_13_0 const ( // HandsfreeServiceName is the fully-qualified name of the HandsfreeService service. @@ -55,6 +55,13 @@ const ( HandsfreeServiceConnectProcedure = "/infinimesh.handsfree.HandsfreeService/Connect" ) +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + handsfreeServiceServiceDescriptor = handsfree.File_handsfree_handsfree_proto.Services().ByName("HandsfreeService") + handsfreeServiceSendMethodDescriptor = handsfreeServiceServiceDescriptor.Methods().ByName("Send") + handsfreeServiceConnectMethodDescriptor = handsfreeServiceServiceDescriptor.Methods().ByName("Connect") +) + // HandsfreeServiceClient is a client for the infinimesh.handsfree.HandsfreeService service. type HandsfreeServiceClient interface { Send(context.Context, *connect.Request[handsfree.ControlPacket]) (*connect.Response[handsfree.ControlPacket], error) @@ -74,12 +81,14 @@ func NewHandsfreeServiceClient(httpClient connect.HTTPClient, baseURL string, op send: connect.NewClient[handsfree.ControlPacket, handsfree.ControlPacket]( httpClient, baseURL+HandsfreeServiceSendProcedure, - opts..., + connect.WithSchema(handsfreeServiceSendMethodDescriptor), + connect.WithClientOptions(opts...), ), connect: connect.NewClient[handsfree.ConnectionRequest, handsfree.ControlPacket]( httpClient, baseURL+HandsfreeServiceConnectProcedure, - opts..., + connect.WithSchema(handsfreeServiceConnectMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -116,12 +125,14 @@ func NewHandsfreeServiceHandler(svc HandsfreeServiceHandler, opts ...connect.Han handsfreeServiceSendHandler := connect.NewUnaryHandler( HandsfreeServiceSendProcedure, svc.Send, - opts..., + connect.WithSchema(handsfreeServiceSendMethodDescriptor), + connect.WithHandlerOptions(opts...), ) handsfreeServiceConnectHandler := connect.NewServerStreamHandler( HandsfreeServiceConnectProcedure, svc.Connect, - opts..., + connect.WithSchema(handsfreeServiceConnectMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.handsfree.HandsfreeService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/node/devices/devices.pb.go b/node/devices/devices.pb.go index 1ce2f51..f221464 100644 --- a/node/devices/devices.pb.go +++ b/node/devices/devices.pb.go @@ -26,6 +26,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -42,15 +43,16 @@ type Device struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` - Certificate *Certificate `protobuf:"bytes,4,opt,name=certificate,proto3" json:"certificate,omitempty"` - Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` - BasicEnabled bool `protobuf:"varint,6,opt,name=basic_enabled,json=basicEnabled,proto3" json:"basic_enabled,omitempty"` - Token string `protobuf:"bytes,7,opt,name=token,proto3" json:"token,omitempty"` - Access *access.Access `protobuf:"bytes,8,opt,name=access,proto3,oneof" json:"access,omitempty"` - Config *structpb.Struct `protobuf:"bytes,9,opt,name=config,proto3" json:"config,omitempty"` + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` + Certificate *Certificate `protobuf:"bytes,4,opt,name=certificate,proto3" json:"certificate,omitempty"` + Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` + BasicEnabled bool `protobuf:"varint,6,opt,name=basic_enabled,json=basicEnabled,proto3" json:"basic_enabled,omitempty"` + Token string `protobuf:"bytes,7,opt,name=token,proto3" json:"token,omitempty"` + Access *access.Access `protobuf:"bytes,8,opt,name=access,proto3,oneof" json:"access,omitempty"` + Config *structpb.Struct `protobuf:"bytes,9,opt,name=config,proto3" json:"config,omitempty"` + LastUpdated *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` } func (x *Device) Reset() { @@ -148,6 +150,13 @@ func (x *Device) GetConfig() *structpb.Struct { return nil } +func (x *Device) GetLastUpdated() *timestamppb.Timestamp { + if x != nil { + return x.LastUpdated + } + return nil +} + type Certificate struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -484,32 +493,38 @@ var file_node_devices_devices_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x02, - 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x0b, - 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x6e, - 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x69, - 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x62, 0x61, 0x73, 0x69, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x73, 0x68, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, - 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x68, 0x0a, 0x0b, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, + 0x03, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x46, 0x0a, + 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x61, 0x73, + 0x69, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0c, 0x62, 0x61, 0x73, 0x69, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x88, 0x01, + 0x01, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x3d, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x68, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x6d, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, @@ -586,20 +601,22 @@ var file_node_devices_devices_proto_goTypes = []interface{}{ (*GetByFingerprintRequest)(nil), // 6: infinimesh.node.devices.GetByFingerprintRequest (*access.Access)(nil), // 7: infinimesh.node.access.Access (*structpb.Struct)(nil), // 8: google.protobuf.Struct + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp } var file_node_devices_devices_proto_depIdxs = []int32{ 1, // 0: infinimesh.node.devices.Device.certificate:type_name -> infinimesh.node.devices.Certificate 7, // 1: infinimesh.node.devices.Device.access:type_name -> infinimesh.node.access.Access 8, // 2: infinimesh.node.devices.Device.config:type_name -> google.protobuf.Struct - 0, // 3: infinimesh.node.devices.Devices.devices:type_name -> infinimesh.node.devices.Device - 0, // 4: infinimesh.node.devices.CreateRequest.device:type_name -> infinimesh.node.devices.Device - 3, // 5: infinimesh.node.devices.CreateRequest.handsfree:type_name -> infinimesh.node.devices.HandsfreeCreate - 0, // 6: infinimesh.node.devices.CreateResponse.device:type_name -> infinimesh.node.devices.Device - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 9, // 3: infinimesh.node.devices.Device.last_updated:type_name -> google.protobuf.Timestamp + 0, // 4: infinimesh.node.devices.Devices.devices:type_name -> infinimesh.node.devices.Device + 0, // 5: infinimesh.node.devices.CreateRequest.device:type_name -> infinimesh.node.devices.Device + 3, // 6: infinimesh.node.devices.CreateRequest.handsfree:type_name -> infinimesh.node.devices.HandsfreeCreate + 0, // 7: infinimesh.node.devices.CreateResponse.device:type_name -> infinimesh.node.devices.Device + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_node_devices_devices_proto_init() } diff --git a/node/devices/devices.pb.validate.go b/node/devices/devices.pb.validate.go index bd1d205..b244bc2 100644 --- a/node/devices/devices.pb.validate.go +++ b/node/devices/devices.pb.validate.go @@ -124,6 +124,35 @@ func (m *Device) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetLastUpdated()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeviceValidationError{ + field: "LastUpdated", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeviceValidationError{ + field: "LastUpdated", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLastUpdated()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeviceValidationError{ + field: "LastUpdated", + reason: "embedded message failed validation", + cause: err, + } + } + } + if m.Access != nil { if all { diff --git a/node/devices/devices.proto b/node/devices/devices.proto index 7c506b0..c6949fa 100644 --- a/node/devices/devices.proto +++ b/node/devices/devices.proto @@ -1,23 +1,24 @@ /* -Copyright © 2021-2023 Infinite Devices GmbH + Copyright © 2021-2023 Infinite Devices GmbH -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ syntax = "proto3"; package infinimesh.node.devices; -import "node/access/access.proto"; import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "node/access/access.proto"; message Device { string uuid = 1; @@ -29,6 +30,7 @@ message Device { string token = 7; optional infinimesh.node.access.Access access = 8; google.protobuf.Struct config = 9; + google.protobuf.Timestamp last_updated = 10; } message Certificate { @@ -37,7 +39,7 @@ message Certificate { bytes fingerprint = 3; } -message Devices { +message Devices { repeated Device devices = 1; int64 total = 2; } @@ -49,11 +51,15 @@ message HandsfreeCreate { message CreateRequest { Device device = 1; - string namespace = 2; // Namespace to put device under + string namespace = 2; // Namespace to put device under optional HandsfreeCreate handsfree = 3; // if present, will attempt to obtain - // cert from handsfree control packet + // cert from handsfree control packet } -message CreateResponse { Device device = 1; } +message CreateResponse { + Device device = 1; +} -message GetByFingerprintRequest { bytes fingerprint = 1; } \ No newline at end of file +message GetByFingerprintRequest { + bytes fingerprint = 1; +} diff --git a/node/nodeconnect/node.connect.go b/node/nodeconnect/node.connect.go index 3ddb36e..6e70fb3 100644 --- a/node/nodeconnect/node.connect.go +++ b/node/nodeconnect/node.connect.go @@ -39,7 +39,7 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. -const _ = connect.IsAtLeastVersion0_1_0 +const _ = connect.IsAtLeastVersion1_13_0 const ( // AccountsServiceName is the fully-qualified name of the AccountsService service. @@ -175,6 +175,61 @@ const ( InternalServiceGetLDAPProvidersProcedure = "/infinimesh.node.InternalService/GetLDAPProviders" ) +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + accountsServiceServiceDescriptor = node.File_node_node_proto.Services().ByName("AccountsService") + accountsServiceTokenMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Token") + accountsServiceGetMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Get") + accountsServiceListMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("List") + accountsServiceCreateMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Create") + accountsServiceUpdateMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Update") + accountsServiceToggleMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Toggle") + accountsServiceDeleteMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Delete") + accountsServiceAccessiblesMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Accessibles") + accountsServiceDeletablesMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Deletables") + accountsServiceMoveMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("Move") + accountsServiceGetCredentialsMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("GetCredentials") + accountsServiceSetCredentialsMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("SetCredentials") + accountsServiceDelCredentialsMethodDescriptor = accountsServiceServiceDescriptor.Methods().ByName("DelCredentials") + sessionsServiceServiceDescriptor = node.File_node_node_proto.Services().ByName("SessionsService") + sessionsServiceGetMethodDescriptor = sessionsServiceServiceDescriptor.Methods().ByName("Get") + sessionsServiceRevokeMethodDescriptor = sessionsServiceServiceDescriptor.Methods().ByName("Revoke") + sessionsServiceGetActivityMethodDescriptor = sessionsServiceServiceDescriptor.Methods().ByName("GetActivity") + namespacesServiceServiceDescriptor = node.File_node_node_proto.Services().ByName("NamespacesService") + namespacesServiceGetMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Get") + namespacesServiceListMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("List") + namespacesServiceCreateMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Create") + namespacesServiceUpdateMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Update") + namespacesServiceDeleteMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Delete") + namespacesServiceAccessiblesMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Accessibles") + namespacesServiceDeletablesMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Deletables") + namespacesServiceJoinsMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Joins") + namespacesServiceJoinMethodDescriptor = namespacesServiceServiceDescriptor.Methods().ByName("Join") + devicesServiceServiceDescriptor = node.File_node_node_proto.Services().ByName("DevicesService") + devicesServiceGetMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Get") + devicesServiceListMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("List") + devicesServiceCreateMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Create") + devicesServiceUpdateMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Update") + devicesServicePatchConfigMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("PatchConfig") + devicesServiceDeleteMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Delete") + devicesServiceToggleMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Toggle") + devicesServiceToggleBasicMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("ToggleBasic") + devicesServiceMakeDevicesTokenMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("MakeDevicesToken") + devicesServiceMoveMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Move") + devicesServiceJoinsMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Joins") + devicesServiceJoinMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("Join") + devicesServiceGetByTokenMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("GetByToken") + devicesServiceGetByFingerprintMethodDescriptor = devicesServiceServiceDescriptor.Methods().ByName("GetByFingerprint") + shadowServiceServiceDescriptor = node.File_node_node_proto.Services().ByName("ShadowService") + shadowServiceGetMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("Get") + shadowServicePatchMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("Patch") + shadowServiceRemoveMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("Remove") + shadowServiceStreamShadowMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("StreamShadow") + shadowServiceStreamShadowSyncMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("StreamShadowSync") + internalServiceServiceDescriptor = node.File_node_node_proto.Services().ByName("InternalService") + internalServiceGetLDAPProvidersMethodDescriptor = internalServiceServiceDescriptor.Methods().ByName("GetLDAPProviders") +) + // AccountsServiceClient is a client for the infinimesh.node.AccountsService service. type AccountsServiceClient interface { Token(context.Context, *connect.Request[node.TokenRequest]) (*connect.Response[node.TokenResponse], error) @@ -205,67 +260,80 @@ func NewAccountsServiceClient(httpClient connect.HTTPClient, baseURL string, opt token: connect.NewClient[node.TokenRequest, node.TokenResponse]( httpClient, baseURL+AccountsServiceTokenProcedure, - opts..., + connect.WithSchema(accountsServiceTokenMethodDescriptor), + connect.WithClientOptions(opts...), ), get: connect.NewClient[accounts.Account, accounts.Account]( httpClient, baseURL+AccountsServiceGetProcedure, - opts..., + connect.WithSchema(accountsServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), list: connect.NewClient[node.EmptyMessage, accounts.Accounts]( httpClient, baseURL+AccountsServiceListProcedure, - opts..., + connect.WithSchema(accountsServiceListMethodDescriptor), + connect.WithClientOptions(opts...), ), create: connect.NewClient[accounts.CreateRequest, accounts.CreateResponse]( httpClient, baseURL+AccountsServiceCreateProcedure, - opts..., + connect.WithSchema(accountsServiceCreateMethodDescriptor), + connect.WithClientOptions(opts...), ), update: connect.NewClient[accounts.Account, accounts.Account]( httpClient, baseURL+AccountsServiceUpdateProcedure, - opts..., + connect.WithSchema(accountsServiceUpdateMethodDescriptor), + connect.WithClientOptions(opts...), ), toggle: connect.NewClient[accounts.Account, accounts.Account]( httpClient, baseURL+AccountsServiceToggleProcedure, - opts..., + connect.WithSchema(accountsServiceToggleMethodDescriptor), + connect.WithClientOptions(opts...), ), delete: connect.NewClient[accounts.Account, node.DeleteResponse]( httpClient, baseURL+AccountsServiceDeleteProcedure, - opts..., + connect.WithSchema(accountsServiceDeleteMethodDescriptor), + connect.WithClientOptions(opts...), ), accessibles: connect.NewClient[namespaces.Namespace, access.Nodes]( httpClient, baseURL+AccountsServiceAccessiblesProcedure, - opts..., + connect.WithSchema(accountsServiceAccessiblesMethodDescriptor), + connect.WithClientOptions(opts...), ), deletables: connect.NewClient[accounts.Account, access.Nodes]( httpClient, baseURL+AccountsServiceDeletablesProcedure, - opts..., + connect.WithSchema(accountsServiceDeletablesMethodDescriptor), + connect.WithClientOptions(opts...), ), move: connect.NewClient[node.MoveRequest, node.EmptyMessage]( httpClient, baseURL+AccountsServiceMoveProcedure, - opts..., + connect.WithSchema(accountsServiceMoveMethodDescriptor), + connect.WithClientOptions(opts...), ), getCredentials: connect.NewClient[node.GetCredentialsRequest, node.GetCredentialsResponse]( httpClient, baseURL+AccountsServiceGetCredentialsProcedure, - opts..., + connect.WithSchema(accountsServiceGetCredentialsMethodDescriptor), + connect.WithClientOptions(opts...), ), setCredentials: connect.NewClient[node.SetCredentialsRequest, node.SetCredentialsResponse]( httpClient, baseURL+AccountsServiceSetCredentialsProcedure, - opts..., + connect.WithSchema(accountsServiceSetCredentialsMethodDescriptor), + connect.WithClientOptions(opts...), ), delCredentials: connect.NewClient[node.DeleteCredentialsRequest, node.DeleteResponse]( httpClient, baseURL+AccountsServiceDelCredentialsProcedure, - opts..., + connect.WithSchema(accountsServiceDelCredentialsMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -378,67 +446,80 @@ func NewAccountsServiceHandler(svc AccountsServiceHandler, opts ...connect.Handl accountsServiceTokenHandler := connect.NewUnaryHandler( AccountsServiceTokenProcedure, svc.Token, - opts..., + connect.WithSchema(accountsServiceTokenMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceGetHandler := connect.NewUnaryHandler( AccountsServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(accountsServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceListHandler := connect.NewUnaryHandler( AccountsServiceListProcedure, svc.List, - opts..., + connect.WithSchema(accountsServiceListMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceCreateHandler := connect.NewUnaryHandler( AccountsServiceCreateProcedure, svc.Create, - opts..., + connect.WithSchema(accountsServiceCreateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceUpdateHandler := connect.NewUnaryHandler( AccountsServiceUpdateProcedure, svc.Update, - opts..., + connect.WithSchema(accountsServiceUpdateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceToggleHandler := connect.NewUnaryHandler( AccountsServiceToggleProcedure, svc.Toggle, - opts..., + connect.WithSchema(accountsServiceToggleMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceDeleteHandler := connect.NewUnaryHandler( AccountsServiceDeleteProcedure, svc.Delete, - opts..., + connect.WithSchema(accountsServiceDeleteMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceAccessiblesHandler := connect.NewUnaryHandler( AccountsServiceAccessiblesProcedure, svc.Accessibles, - opts..., + connect.WithSchema(accountsServiceAccessiblesMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceDeletablesHandler := connect.NewUnaryHandler( AccountsServiceDeletablesProcedure, svc.Deletables, - opts..., + connect.WithSchema(accountsServiceDeletablesMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceMoveHandler := connect.NewUnaryHandler( AccountsServiceMoveProcedure, svc.Move, - opts..., + connect.WithSchema(accountsServiceMoveMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceGetCredentialsHandler := connect.NewUnaryHandler( AccountsServiceGetCredentialsProcedure, svc.GetCredentials, - opts..., + connect.WithSchema(accountsServiceGetCredentialsMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceSetCredentialsHandler := connect.NewUnaryHandler( AccountsServiceSetCredentialsProcedure, svc.SetCredentials, - opts..., + connect.WithSchema(accountsServiceSetCredentialsMethodDescriptor), + connect.WithHandlerOptions(opts...), ) accountsServiceDelCredentialsHandler := connect.NewUnaryHandler( AccountsServiceDelCredentialsProcedure, svc.DelCredentials, - opts..., + connect.WithSchema(accountsServiceDelCredentialsMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.node.AccountsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -549,17 +630,20 @@ func NewSessionsServiceClient(httpClient connect.HTTPClient, baseURL string, opt get: connect.NewClient[node.EmptyMessage, sessions.Sessions]( httpClient, baseURL+SessionsServiceGetProcedure, - opts..., + connect.WithSchema(sessionsServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), revoke: connect.NewClient[sessions.Session, node.DeleteResponse]( httpClient, baseURL+SessionsServiceRevokeProcedure, - opts..., + connect.WithSchema(sessionsServiceRevokeMethodDescriptor), + connect.WithClientOptions(opts...), ), getActivity: connect.NewClient[node.EmptyMessage, sessions.Activity]( httpClient, baseURL+SessionsServiceGetActivityProcedure, - opts..., + connect.WithSchema(sessionsServiceGetActivityMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -602,17 +686,20 @@ func NewSessionsServiceHandler(svc SessionsServiceHandler, opts ...connect.Handl sessionsServiceGetHandler := connect.NewUnaryHandler( SessionsServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(sessionsServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) sessionsServiceRevokeHandler := connect.NewUnaryHandler( SessionsServiceRevokeProcedure, svc.Revoke, - opts..., + connect.WithSchema(sessionsServiceRevokeMethodDescriptor), + connect.WithHandlerOptions(opts...), ) sessionsServiceGetActivityHandler := connect.NewUnaryHandler( SessionsServiceGetActivityProcedure, svc.GetActivity, - opts..., + connect.WithSchema(sessionsServiceGetActivityMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.node.SessionsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -672,47 +759,56 @@ func NewNamespacesServiceClient(httpClient connect.HTTPClient, baseURL string, o get: connect.NewClient[namespaces.Namespace, namespaces.Namespace]( httpClient, baseURL+NamespacesServiceGetProcedure, - opts..., + connect.WithSchema(namespacesServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), list: connect.NewClient[node.EmptyMessage, namespaces.Namespaces]( httpClient, baseURL+NamespacesServiceListProcedure, - opts..., + connect.WithSchema(namespacesServiceListMethodDescriptor), + connect.WithClientOptions(opts...), ), create: connect.NewClient[namespaces.Namespace, namespaces.Namespace]( httpClient, baseURL+NamespacesServiceCreateProcedure, - opts..., + connect.WithSchema(namespacesServiceCreateMethodDescriptor), + connect.WithClientOptions(opts...), ), update: connect.NewClient[namespaces.Namespace, namespaces.Namespace]( httpClient, baseURL+NamespacesServiceUpdateProcedure, - opts..., + connect.WithSchema(namespacesServiceUpdateMethodDescriptor), + connect.WithClientOptions(opts...), ), delete: connect.NewClient[namespaces.Namespace, node.DeleteResponse]( httpClient, baseURL+NamespacesServiceDeleteProcedure, - opts..., + connect.WithSchema(namespacesServiceDeleteMethodDescriptor), + connect.WithClientOptions(opts...), ), accessibles: connect.NewClient[namespaces.Namespace, access.Nodes]( httpClient, baseURL+NamespacesServiceAccessiblesProcedure, - opts..., + connect.WithSchema(namespacesServiceAccessiblesMethodDescriptor), + connect.WithClientOptions(opts...), ), deletables: connect.NewClient[namespaces.Namespace, access.Nodes]( httpClient, baseURL+NamespacesServiceDeletablesProcedure, - opts..., + connect.WithSchema(namespacesServiceDeletablesMethodDescriptor), + connect.WithClientOptions(opts...), ), joins: connect.NewClient[namespaces.Namespace, accounts.Accounts]( httpClient, baseURL+NamespacesServiceJoinsProcedure, - opts..., + connect.WithSchema(namespacesServiceJoinsMethodDescriptor), + connect.WithClientOptions(opts...), ), join: connect.NewClient[node.JoinRequest, accounts.Accounts]( httpClient, baseURL+NamespacesServiceJoinProcedure, - opts..., + connect.WithSchema(namespacesServiceJoinMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -800,47 +896,56 @@ func NewNamespacesServiceHandler(svc NamespacesServiceHandler, opts ...connect.H namespacesServiceGetHandler := connect.NewUnaryHandler( NamespacesServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(namespacesServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceListHandler := connect.NewUnaryHandler( NamespacesServiceListProcedure, svc.List, - opts..., + connect.WithSchema(namespacesServiceListMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceCreateHandler := connect.NewUnaryHandler( NamespacesServiceCreateProcedure, svc.Create, - opts..., + connect.WithSchema(namespacesServiceCreateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceUpdateHandler := connect.NewUnaryHandler( NamespacesServiceUpdateProcedure, svc.Update, - opts..., + connect.WithSchema(namespacesServiceUpdateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceDeleteHandler := connect.NewUnaryHandler( NamespacesServiceDeleteProcedure, svc.Delete, - opts..., + connect.WithSchema(namespacesServiceDeleteMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceAccessiblesHandler := connect.NewUnaryHandler( NamespacesServiceAccessiblesProcedure, svc.Accessibles, - opts..., + connect.WithSchema(namespacesServiceAccessiblesMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceDeletablesHandler := connect.NewUnaryHandler( NamespacesServiceDeletablesProcedure, svc.Deletables, - opts..., + connect.WithSchema(namespacesServiceDeletablesMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceJoinsHandler := connect.NewUnaryHandler( NamespacesServiceJoinsProcedure, svc.Joins, - opts..., + connect.WithSchema(namespacesServiceJoinsMethodDescriptor), + connect.WithHandlerOptions(opts...), ) namespacesServiceJoinHandler := connect.NewUnaryHandler( NamespacesServiceJoinProcedure, svc.Join, - opts..., + connect.WithSchema(namespacesServiceJoinMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.node.NamespacesService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -943,72 +1048,86 @@ func NewDevicesServiceClient(httpClient connect.HTTPClient, baseURL string, opts get: connect.NewClient[devices.Device, devices.Device]( httpClient, baseURL+DevicesServiceGetProcedure, - opts..., + connect.WithSchema(devicesServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), list: connect.NewClient[node.QueryRequest, devices.Devices]( httpClient, baseURL+DevicesServiceListProcedure, - opts..., + connect.WithSchema(devicesServiceListMethodDescriptor), + connect.WithClientOptions(opts...), ), create: connect.NewClient[devices.CreateRequest, devices.CreateResponse]( httpClient, baseURL+DevicesServiceCreateProcedure, - opts..., + connect.WithSchema(devicesServiceCreateMethodDescriptor), + connect.WithClientOptions(opts...), ), update: connect.NewClient[devices.Device, devices.Device]( httpClient, baseURL+DevicesServiceUpdateProcedure, - opts..., + connect.WithSchema(devicesServiceUpdateMethodDescriptor), + connect.WithClientOptions(opts...), ), patchConfig: connect.NewClient[devices.Device, devices.Device]( httpClient, baseURL+DevicesServicePatchConfigProcedure, - opts..., + connect.WithSchema(devicesServicePatchConfigMethodDescriptor), + connect.WithClientOptions(opts...), ), delete: connect.NewClient[devices.Device, node.DeleteResponse]( httpClient, baseURL+DevicesServiceDeleteProcedure, - opts..., + connect.WithSchema(devicesServiceDeleteMethodDescriptor), + connect.WithClientOptions(opts...), ), toggle: connect.NewClient[devices.Device, devices.Device]( httpClient, baseURL+DevicesServiceToggleProcedure, - opts..., + connect.WithSchema(devicesServiceToggleMethodDescriptor), + connect.WithClientOptions(opts...), ), toggleBasic: connect.NewClient[devices.Device, devices.Device]( httpClient, baseURL+DevicesServiceToggleBasicProcedure, - opts..., + connect.WithSchema(devicesServiceToggleBasicMethodDescriptor), + connect.WithClientOptions(opts...), ), makeDevicesToken: connect.NewClient[node.DevicesTokenRequest, node.TokenResponse]( httpClient, baseURL+DevicesServiceMakeDevicesTokenProcedure, - opts..., + connect.WithSchema(devicesServiceMakeDevicesTokenMethodDescriptor), + connect.WithClientOptions(opts...), ), move: connect.NewClient[node.MoveRequest, node.EmptyMessage]( httpClient, baseURL+DevicesServiceMoveProcedure, - opts..., + connect.WithSchema(devicesServiceMoveMethodDescriptor), + connect.WithClientOptions(opts...), ), joins: connect.NewClient[devices.Device, access.Nodes]( httpClient, baseURL+DevicesServiceJoinsProcedure, - opts..., + connect.WithSchema(devicesServiceJoinsMethodDescriptor), + connect.WithClientOptions(opts...), ), join: connect.NewClient[node.JoinGeneralRequest, access.Node]( httpClient, baseURL+DevicesServiceJoinProcedure, - opts..., + connect.WithSchema(devicesServiceJoinMethodDescriptor), + connect.WithClientOptions(opts...), ), getByToken: connect.NewClient[devices.Device, devices.Device]( httpClient, baseURL+DevicesServiceGetByTokenProcedure, - opts..., + connect.WithSchema(devicesServiceGetByTokenMethodDescriptor), + connect.WithClientOptions(opts...), ), getByFingerprint: connect.NewClient[devices.GetByFingerprintRequest, devices.Device]( httpClient, baseURL+DevicesServiceGetByFingerprintProcedure, - opts..., + connect.WithSchema(devicesServiceGetByFingerprintMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -1133,72 +1252,86 @@ func NewDevicesServiceHandler(svc DevicesServiceHandler, opts ...connect.Handler devicesServiceGetHandler := connect.NewUnaryHandler( DevicesServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(devicesServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceListHandler := connect.NewUnaryHandler( DevicesServiceListProcedure, svc.List, - opts..., + connect.WithSchema(devicesServiceListMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceCreateHandler := connect.NewUnaryHandler( DevicesServiceCreateProcedure, svc.Create, - opts..., + connect.WithSchema(devicesServiceCreateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceUpdateHandler := connect.NewUnaryHandler( DevicesServiceUpdateProcedure, svc.Update, - opts..., + connect.WithSchema(devicesServiceUpdateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServicePatchConfigHandler := connect.NewUnaryHandler( DevicesServicePatchConfigProcedure, svc.PatchConfig, - opts..., + connect.WithSchema(devicesServicePatchConfigMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceDeleteHandler := connect.NewUnaryHandler( DevicesServiceDeleteProcedure, svc.Delete, - opts..., + connect.WithSchema(devicesServiceDeleteMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceToggleHandler := connect.NewUnaryHandler( DevicesServiceToggleProcedure, svc.Toggle, - opts..., + connect.WithSchema(devicesServiceToggleMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceToggleBasicHandler := connect.NewUnaryHandler( DevicesServiceToggleBasicProcedure, svc.ToggleBasic, - opts..., + connect.WithSchema(devicesServiceToggleBasicMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceMakeDevicesTokenHandler := connect.NewUnaryHandler( DevicesServiceMakeDevicesTokenProcedure, svc.MakeDevicesToken, - opts..., + connect.WithSchema(devicesServiceMakeDevicesTokenMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceMoveHandler := connect.NewUnaryHandler( DevicesServiceMoveProcedure, svc.Move, - opts..., + connect.WithSchema(devicesServiceMoveMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceJoinsHandler := connect.NewUnaryHandler( DevicesServiceJoinsProcedure, svc.Joins, - opts..., + connect.WithSchema(devicesServiceJoinsMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceJoinHandler := connect.NewUnaryHandler( DevicesServiceJoinProcedure, svc.Join, - opts..., + connect.WithSchema(devicesServiceJoinMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceGetByTokenHandler := connect.NewUnaryHandler( DevicesServiceGetByTokenProcedure, svc.GetByToken, - opts..., + connect.WithSchema(devicesServiceGetByTokenMethodDescriptor), + connect.WithHandlerOptions(opts...), ) devicesServiceGetByFingerprintHandler := connect.NewUnaryHandler( DevicesServiceGetByFingerprintProcedure, svc.GetByFingerprint, - opts..., + connect.WithSchema(devicesServiceGetByFingerprintMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.node.DevicesService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -1317,27 +1450,32 @@ func NewShadowServiceClient(httpClient connect.HTTPClient, baseURL string, opts get: connect.NewClient[shadow.GetRequest, shadow.GetResponse]( httpClient, baseURL+ShadowServiceGetProcedure, - opts..., + connect.WithSchema(shadowServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), patch: connect.NewClient[shadow.Shadow, shadow.Shadow]( httpClient, baseURL+ShadowServicePatchProcedure, - opts..., + connect.WithSchema(shadowServicePatchMethodDescriptor), + connect.WithClientOptions(opts...), ), remove: connect.NewClient[shadow.RemoveRequest, shadow.Shadow]( httpClient, baseURL+ShadowServiceRemoveProcedure, - opts..., + connect.WithSchema(shadowServiceRemoveMethodDescriptor), + connect.WithClientOptions(opts...), ), streamShadow: connect.NewClient[shadow.StreamShadowRequest, shadow.Shadow]( httpClient, baseURL+ShadowServiceStreamShadowProcedure, - opts..., + connect.WithSchema(shadowServiceStreamShadowMethodDescriptor), + connect.WithClientOptions(opts...), ), streamShadowSync: connect.NewClient[shadow.StreamShadowRequest, shadow.Shadow]( httpClient, baseURL+ShadowServiceStreamShadowSyncProcedure, - opts..., + connect.WithSchema(shadowServiceStreamShadowSyncMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -1394,27 +1532,32 @@ func NewShadowServiceHandler(svc ShadowServiceHandler, opts ...connect.HandlerOp shadowServiceGetHandler := connect.NewUnaryHandler( ShadowServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(shadowServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServicePatchHandler := connect.NewUnaryHandler( ShadowServicePatchProcedure, svc.Patch, - opts..., + connect.WithSchema(shadowServicePatchMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServiceRemoveHandler := connect.NewUnaryHandler( ShadowServiceRemoveProcedure, svc.Remove, - opts..., + connect.WithSchema(shadowServiceRemoveMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServiceStreamShadowHandler := connect.NewServerStreamHandler( ShadowServiceStreamShadowProcedure, svc.StreamShadow, - opts..., + connect.WithSchema(shadowServiceStreamShadowMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServiceStreamShadowSyncHandler := connect.NewServerStreamHandler( ShadowServiceStreamShadowSyncProcedure, svc.StreamShadowSync, - opts..., + connect.WithSchema(shadowServiceStreamShadowSyncMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.node.ShadowService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -1475,7 +1618,8 @@ func NewInternalServiceClient(httpClient connect.HTTPClient, baseURL string, opt getLDAPProviders: connect.NewClient[node.EmptyMessage, node.LDAPProviders]( httpClient, baseURL+InternalServiceGetLDAPProvidersProcedure, - opts..., + connect.WithSchema(internalServiceGetLDAPProvidersMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -1504,7 +1648,8 @@ func NewInternalServiceHandler(svc InternalServiceHandler, opts ...connect.Handl internalServiceGetLDAPProvidersHandler := connect.NewUnaryHandler( InternalServiceGetLDAPProvidersProcedure, svc.GetLDAPProviders, - opts..., + connect.WithSchema(internalServiceGetLDAPProvidersMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.node.InternalService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/plugins/pluginsconnect/plugins.connect.go b/plugins/pluginsconnect/plugins.connect.go index cad80af..cbd8332 100644 --- a/plugins/pluginsconnect/plugins.connect.go +++ b/plugins/pluginsconnect/plugins.connect.go @@ -33,7 +33,7 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. -const _ = connect.IsAtLeastVersion0_1_0 +const _ = connect.IsAtLeastVersion1_13_0 const ( // PluginsServiceName is the fully-qualified name of the PluginsService service. @@ -60,6 +60,16 @@ const ( PluginsServiceDeleteProcedure = "/infinimesh.plugins.PluginsService/Delete" ) +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + pluginsServiceServiceDescriptor = plugins.File_plugins_plugins_proto.Services().ByName("PluginsService") + pluginsServiceGetMethodDescriptor = pluginsServiceServiceDescriptor.Methods().ByName("Get") + pluginsServiceListMethodDescriptor = pluginsServiceServiceDescriptor.Methods().ByName("List") + pluginsServiceCreateMethodDescriptor = pluginsServiceServiceDescriptor.Methods().ByName("Create") + pluginsServiceUpdateMethodDescriptor = pluginsServiceServiceDescriptor.Methods().ByName("Update") + pluginsServiceDeleteMethodDescriptor = pluginsServiceServiceDescriptor.Methods().ByName("Delete") +) + // PluginsServiceClient is a client for the infinimesh.plugins.PluginsService service. type PluginsServiceClient interface { Get(context.Context, *connect.Request[plugins.Plugin]) (*connect.Response[plugins.Plugin], error) @@ -82,27 +92,32 @@ func NewPluginsServiceClient(httpClient connect.HTTPClient, baseURL string, opts get: connect.NewClient[plugins.Plugin, plugins.Plugin]( httpClient, baseURL+PluginsServiceGetProcedure, - opts..., + connect.WithSchema(pluginsServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), list: connect.NewClient[plugins.ListRequest, plugins.Plugins]( httpClient, baseURL+PluginsServiceListProcedure, - opts..., + connect.WithSchema(pluginsServiceListMethodDescriptor), + connect.WithClientOptions(opts...), ), create: connect.NewClient[plugins.Plugin, plugins.Plugin]( httpClient, baseURL+PluginsServiceCreateProcedure, - opts..., + connect.WithSchema(pluginsServiceCreateMethodDescriptor), + connect.WithClientOptions(opts...), ), update: connect.NewClient[plugins.Plugin, plugins.Plugin]( httpClient, baseURL+PluginsServiceUpdateProcedure, - opts..., + connect.WithSchema(pluginsServiceUpdateMethodDescriptor), + connect.WithClientOptions(opts...), ), delete: connect.NewClient[plugins.Plugin, plugins.Plugin]( httpClient, baseURL+PluginsServiceDeleteProcedure, - opts..., + connect.WithSchema(pluginsServiceDeleteMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -159,27 +174,32 @@ func NewPluginsServiceHandler(svc PluginsServiceHandler, opts ...connect.Handler pluginsServiceGetHandler := connect.NewUnaryHandler( PluginsServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(pluginsServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) pluginsServiceListHandler := connect.NewUnaryHandler( PluginsServiceListProcedure, svc.List, - opts..., + connect.WithSchema(pluginsServiceListMethodDescriptor), + connect.WithHandlerOptions(opts...), ) pluginsServiceCreateHandler := connect.NewUnaryHandler( PluginsServiceCreateProcedure, svc.Create, - opts..., + connect.WithSchema(pluginsServiceCreateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) pluginsServiceUpdateHandler := connect.NewUnaryHandler( PluginsServiceUpdateProcedure, svc.Update, - opts..., + connect.WithSchema(pluginsServiceUpdateMethodDescriptor), + connect.WithHandlerOptions(opts...), ) pluginsServiceDeleteHandler := connect.NewUnaryHandler( PluginsServiceDeleteProcedure, svc.Delete, - opts..., + connect.WithSchema(pluginsServiceDeleteMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.plugins.PluginsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/shadow/shadowconnect/shadow.connect.go b/shadow/shadowconnect/shadow.connect.go index 2027088..26bf106 100644 --- a/shadow/shadowconnect/shadow.connect.go +++ b/shadow/shadowconnect/shadow.connect.go @@ -33,7 +33,7 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. -const _ = connect.IsAtLeastVersion0_1_0 +const _ = connect.IsAtLeastVersion1_13_0 const ( // ShadowServiceName is the fully-qualified name of the ShadowService service. @@ -59,6 +59,15 @@ const ( ShadowServiceStreamShadowProcedure = "/infinimesh.shadow.ShadowService/StreamShadow" ) +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + shadowServiceServiceDescriptor = shadow.File_shadow_shadow_proto.Services().ByName("ShadowService") + shadowServiceGetMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("Get") + shadowServicePatchMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("Patch") + shadowServiceRemoveMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("Remove") + shadowServiceStreamShadowMethodDescriptor = shadowServiceServiceDescriptor.Methods().ByName("StreamShadow") +) + // ShadowServiceClient is a client for the infinimesh.shadow.ShadowService service. type ShadowServiceClient interface { Get(context.Context, *connect.Request[shadow.GetRequest]) (*connect.Response[shadow.GetResponse], error) @@ -80,22 +89,26 @@ func NewShadowServiceClient(httpClient connect.HTTPClient, baseURL string, opts get: connect.NewClient[shadow.GetRequest, shadow.GetResponse]( httpClient, baseURL+ShadowServiceGetProcedure, - opts..., + connect.WithSchema(shadowServiceGetMethodDescriptor), + connect.WithClientOptions(opts...), ), patch: connect.NewClient[shadow.Shadow, shadow.Shadow]( httpClient, baseURL+ShadowServicePatchProcedure, - opts..., + connect.WithSchema(shadowServicePatchMethodDescriptor), + connect.WithClientOptions(opts...), ), remove: connect.NewClient[shadow.RemoveRequest, shadow.Shadow]( httpClient, baseURL+ShadowServiceRemoveProcedure, - opts..., + connect.WithSchema(shadowServiceRemoveMethodDescriptor), + connect.WithClientOptions(opts...), ), streamShadow: connect.NewClient[shadow.StreamShadowRequest, shadow.Shadow]( httpClient, baseURL+ShadowServiceStreamShadowProcedure, - opts..., + connect.WithSchema(shadowServiceStreamShadowMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -145,22 +158,26 @@ func NewShadowServiceHandler(svc ShadowServiceHandler, opts ...connect.HandlerOp shadowServiceGetHandler := connect.NewUnaryHandler( ShadowServiceGetProcedure, svc.Get, - opts..., + connect.WithSchema(shadowServiceGetMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServicePatchHandler := connect.NewUnaryHandler( ShadowServicePatchProcedure, svc.Patch, - opts..., + connect.WithSchema(shadowServicePatchMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServiceRemoveHandler := connect.NewUnaryHandler( ShadowServiceRemoveProcedure, svc.Remove, - opts..., + connect.WithSchema(shadowServiceRemoveMethodDescriptor), + connect.WithHandlerOptions(opts...), ) shadowServiceStreamShadowHandler := connect.NewServerStreamHandler( ShadowServiceStreamShadowProcedure, svc.StreamShadow, - opts..., + connect.WithSchema(shadowServiceStreamShadowMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.shadow.ShadowService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/timeseries/timeseriesconnect/timeseries.connect.go b/timeseries/timeseriesconnect/timeseries.connect.go index ab58d76..310c8f6 100644 --- a/timeseries/timeseriesconnect/timeseries.connect.go +++ b/timeseries/timeseriesconnect/timeseries.connect.go @@ -18,7 +18,7 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. -const _ = connect.IsAtLeastVersion0_1_0 +const _ = connect.IsAtLeastVersion1_13_0 const ( // TimeseriesServiceName is the fully-qualified name of the TimeseriesService service. @@ -46,6 +46,16 @@ const ( TimeseriesServiceFlushProcedure = "/infinimesh.timeseries.TimeseriesService/Flush" ) +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + timeseriesServiceServiceDescriptor = timeseries.File_timeseries_timeseries_proto.Services().ByName("TimeseriesService") + timeseriesServiceWriteMethodDescriptor = timeseriesServiceServiceDescriptor.Methods().ByName("Write") + timeseriesServiceWriteBulkMethodDescriptor = timeseriesServiceServiceDescriptor.Methods().ByName("WriteBulk") + timeseriesServiceReadMethodDescriptor = timeseriesServiceServiceDescriptor.Methods().ByName("Read") + timeseriesServiceStatMethodDescriptor = timeseriesServiceServiceDescriptor.Methods().ByName("Stat") + timeseriesServiceFlushMethodDescriptor = timeseriesServiceServiceDescriptor.Methods().ByName("Flush") +) + // TimeseriesServiceClient is a client for the infinimesh.timeseries.TimeseriesService service. type TimeseriesServiceClient interface { Write(context.Context, *connect.Request[timeseries.WriteRequest]) (*connect.Response[timeseries.WriteResponse], error) @@ -68,27 +78,32 @@ func NewTimeseriesServiceClient(httpClient connect.HTTPClient, baseURL string, o write: connect.NewClient[timeseries.WriteRequest, timeseries.WriteResponse]( httpClient, baseURL+TimeseriesServiceWriteProcedure, - opts..., + connect.WithSchema(timeseriesServiceWriteMethodDescriptor), + connect.WithClientOptions(opts...), ), writeBulk: connect.NewClient[timeseries.WriteBulkRequest, timeseries.WriteBulkResponse]( httpClient, baseURL+TimeseriesServiceWriteBulkProcedure, - opts..., + connect.WithSchema(timeseriesServiceWriteBulkMethodDescriptor), + connect.WithClientOptions(opts...), ), read: connect.NewClient[timeseries.ReadRequest, timeseries.ReadResponse]( httpClient, baseURL+TimeseriesServiceReadProcedure, - opts..., + connect.WithSchema(timeseriesServiceReadMethodDescriptor), + connect.WithClientOptions(opts...), ), stat: connect.NewClient[timeseries.StatRequest, timeseries.StatResponse]( httpClient, baseURL+TimeseriesServiceStatProcedure, - opts..., + connect.WithSchema(timeseriesServiceStatMethodDescriptor), + connect.WithClientOptions(opts...), ), flush: connect.NewClient[timeseries.FlushRequest, timeseries.FlushResponse]( httpClient, baseURL+TimeseriesServiceFlushProcedure, - opts..., + connect.WithSchema(timeseriesServiceFlushMethodDescriptor), + connect.WithClientOptions(opts...), ), } } @@ -146,27 +161,32 @@ func NewTimeseriesServiceHandler(svc TimeseriesServiceHandler, opts ...connect.H timeseriesServiceWriteHandler := connect.NewUnaryHandler( TimeseriesServiceWriteProcedure, svc.Write, - opts..., + connect.WithSchema(timeseriesServiceWriteMethodDescriptor), + connect.WithHandlerOptions(opts...), ) timeseriesServiceWriteBulkHandler := connect.NewUnaryHandler( TimeseriesServiceWriteBulkProcedure, svc.WriteBulk, - opts..., + connect.WithSchema(timeseriesServiceWriteBulkMethodDescriptor), + connect.WithHandlerOptions(opts...), ) timeseriesServiceReadHandler := connect.NewUnaryHandler( TimeseriesServiceReadProcedure, svc.Read, - opts..., + connect.WithSchema(timeseriesServiceReadMethodDescriptor), + connect.WithHandlerOptions(opts...), ) timeseriesServiceStatHandler := connect.NewUnaryHandler( TimeseriesServiceStatProcedure, svc.Stat, - opts..., + connect.WithSchema(timeseriesServiceStatMethodDescriptor), + connect.WithHandlerOptions(opts...), ) timeseriesServiceFlushHandler := connect.NewUnaryHandler( TimeseriesServiceFlushProcedure, svc.Flush, - opts..., + connect.WithSchema(timeseriesServiceFlushMethodDescriptor), + connect.WithHandlerOptions(opts...), ) return "/infinimesh.timeseries.TimeseriesService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path {