From 45f60ef77b12d227861f44252c6d239d6b3ef6d6 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Fri, 8 May 2026 01:00:03 +0200 Subject: [PATCH] feat: n8n endpoints federation surface (v0.13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sister of the MCP-client surface — four new HubAdmin RPCs (`ListN8nEndpoints`, `RefreshN8nEndpoints`, `AddN8nEndpoint`, `RemoveN8nEndpoint`) plus the matching typedefs so callers read configuration off `N8nEndpointStatus` without importing generated/. Signed-off-by: flemming-it --- lib/src/generated/fai/v1/hub.pb.dart | 257 +++++++++++++++++++++++ lib/src/generated/fai/v1/hub.pbgrpc.dart | 82 ++++++++ lib/src/generated/fai/v1/hub.pbjson.dart | 60 ++++++ lib/src/hub_client.dart | 27 +++ pubspec.yaml | 2 +- 5 files changed, 427 insertions(+), 1 deletion(-) diff --git a/lib/src/generated/fai/v1/hub.pb.dart b/lib/src/generated/fai/v1/hub.pb.dart index 14cfec3..8a4187a 100644 --- a/lib/src/generated/fai/v1/hub.pb.dart +++ b/lib/src/generated/fai/v1/hub.pb.dart @@ -4847,6 +4847,263 @@ class RemoveMcpClientRequest extends $pb.GeneratedMessage { void clearName() => $_clearField(1); } +class N8nEndpointConfigEntry extends $pb.GeneratedMessage { + factory N8nEndpointConfigEntry({ + $core.String? name, + $core.String? baseUrl, + $core.String? apiKeyEnv, + $core.String? description, + }) { + final $result = create(); + if (name != null) { + $result.name = name; + } + if (baseUrl != null) { + $result.baseUrl = baseUrl; + } + if (apiKeyEnv != null) { + $result.apiKeyEnv = apiKeyEnv; + } + if (description != null) { + $result.description = description; + } + return $result; + } + N8nEndpointConfigEntry._() : super(); + factory N8nEndpointConfigEntry.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory N8nEndpointConfigEntry.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'N8nEndpointConfigEntry', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'name') + ..aOS(2, _omitFieldNames ? '' : 'baseUrl') + ..aOS(3, _omitFieldNames ? '' : 'apiKeyEnv') + ..aOS(4, _omitFieldNames ? '' : 'description') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + N8nEndpointConfigEntry clone() => N8nEndpointConfigEntry()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + N8nEndpointConfigEntry copyWith(void Function(N8nEndpointConfigEntry) updates) => super.copyWith((message) => updates(message as N8nEndpointConfigEntry)) as N8nEndpointConfigEntry; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static N8nEndpointConfigEntry create() => N8nEndpointConfigEntry._(); + N8nEndpointConfigEntry createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static N8nEndpointConfigEntry getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static N8nEndpointConfigEntry? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => $_clearField(1); + + /// Base URL without the /api/v1 suffix. + @$pb.TagNumber(2) + $core.String get baseUrl => $_getSZ(1); + @$pb.TagNumber(2) + set baseUrl($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasBaseUrl() => $_has(1); + @$pb.TagNumber(2) + void clearBaseUrl() => $_clearField(2); + + @$pb.TagNumber(3) + $core.String get apiKeyEnv => $_getSZ(2); + @$pb.TagNumber(3) + set apiKeyEnv($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasApiKeyEnv() => $_has(2); + @$pb.TagNumber(3) + void clearApiKeyEnv() => $_clearField(3); + + @$pb.TagNumber(4) + $core.String get description => $_getSZ(3); + @$pb.TagNumber(4) + set description($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasDescription() => $_has(3); + @$pb.TagNumber(4) + void clearDescription() => $_clearField(4); +} + +class ListN8nEndpointsResponse extends $pb.GeneratedMessage { + factory ListN8nEndpointsResponse({ + $core.Iterable? endpoints, + }) { + final $result = create(); + if (endpoints != null) { + $result.endpoints.addAll(endpoints); + } + return $result; + } + ListN8nEndpointsResponse._() : super(); + factory ListN8nEndpointsResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ListN8nEndpointsResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ListN8nEndpointsResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'endpoints', $pb.PbFieldType.PM, subBuilder: N8nEndpointStatus.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ListN8nEndpointsResponse clone() => ListN8nEndpointsResponse()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ListN8nEndpointsResponse copyWith(void Function(ListN8nEndpointsResponse) updates) => super.copyWith((message) => updates(message as ListN8nEndpointsResponse)) as ListN8nEndpointsResponse; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ListN8nEndpointsResponse create() => ListN8nEndpointsResponse._(); + ListN8nEndpointsResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ListN8nEndpointsResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ListN8nEndpointsResponse? _defaultInstance; + + @$pb.TagNumber(1) + $pb.PbList get endpoints => $_getList(0); +} + +class N8nEndpointStatus extends $pb.GeneratedMessage { + factory N8nEndpointStatus({ + N8nEndpointConfigEntry? config, + $core.int? workflowCount, + $core.String? errorKind, + $core.String? message, + }) { + final $result = create(); + if (config != null) { + $result.config = config; + } + if (workflowCount != null) { + $result.workflowCount = workflowCount; + } + if (errorKind != null) { + $result.errorKind = errorKind; + } + if (message != null) { + $result.message = message; + } + return $result; + } + N8nEndpointStatus._() : super(); + factory N8nEndpointStatus.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory N8nEndpointStatus.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'N8nEndpointStatus', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'config', subBuilder: N8nEndpointConfigEntry.create) + ..a<$core.int>(2, _omitFieldNames ? '' : 'workflowCount', $pb.PbFieldType.OU3) + ..aOS(3, _omitFieldNames ? '' : 'errorKind') + ..aOS(4, _omitFieldNames ? '' : 'message') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + N8nEndpointStatus clone() => N8nEndpointStatus()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + N8nEndpointStatus copyWith(void Function(N8nEndpointStatus) updates) => super.copyWith((message) => updates(message as N8nEndpointStatus)) as N8nEndpointStatus; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static N8nEndpointStatus create() => N8nEndpointStatus._(); + N8nEndpointStatus createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static N8nEndpointStatus getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static N8nEndpointStatus? _defaultInstance; + + @$pb.TagNumber(1) + N8nEndpointConfigEntry get config => $_getN(0); + @$pb.TagNumber(1) + set config(N8nEndpointConfigEntry v) { $_setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasConfig() => $_has(0); + @$pb.TagNumber(1) + void clearConfig() => $_clearField(1); + @$pb.TagNumber(1) + N8nEndpointConfigEntry ensureConfig() => $_ensure(0); + + @$pb.TagNumber(2) + $core.int get workflowCount => $_getIZ(1); + @$pb.TagNumber(2) + set workflowCount($core.int v) { $_setUnsignedInt32(1, v); } + @$pb.TagNumber(2) + $core.bool hasWorkflowCount() => $_has(1); + @$pb.TagNumber(2) + void clearWorkflowCount() => $_clearField(2); + + @$pb.TagNumber(3) + $core.String get errorKind => $_getSZ(2); + @$pb.TagNumber(3) + set errorKind($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasErrorKind() => $_has(2); + @$pb.TagNumber(3) + void clearErrorKind() => $_clearField(3); + + @$pb.TagNumber(4) + $core.String get message => $_getSZ(3); + @$pb.TagNumber(4) + set message($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasMessage() => $_has(3); + @$pb.TagNumber(4) + void clearMessage() => $_clearField(4); +} + +class RemoveN8nEndpointRequest extends $pb.GeneratedMessage { + factory RemoveN8nEndpointRequest({ + $core.String? name, + }) { + final $result = create(); + if (name != null) { + $result.name = name; + } + return $result; + } + RemoveN8nEndpointRequest._() : super(); + factory RemoveN8nEndpointRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RemoveN8nEndpointRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RemoveN8nEndpointRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'name') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + RemoveN8nEndpointRequest clone() => RemoveN8nEndpointRequest()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + RemoveN8nEndpointRequest copyWith(void Function(RemoveN8nEndpointRequest) updates) => super.copyWith((message) => updates(message as RemoveN8nEndpointRequest)) as RemoveN8nEndpointRequest; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static RemoveN8nEndpointRequest create() => RemoveN8nEndpointRequest._(); + RemoveN8nEndpointRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static RemoveN8nEndpointRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RemoveN8nEndpointRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => $_clearField(1); +} + const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/src/generated/fai/v1/hub.pbgrpc.dart b/lib/src/generated/fai/v1/hub.pbgrpc.dart index 0fe42bf..46014ce 100644 --- a/lib/src/generated/fai/v1/hub.pbgrpc.dart +++ b/lib/src/generated/fai/v1/hub.pbgrpc.dart @@ -219,6 +219,22 @@ class HubAdminClient extends $grpc.Client { '/fai.v1.HubAdmin/RemoveMcpClient', ($0.RemoveMcpClientRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.ListMcpClientsResponse.fromBuffer(value)); + static final _$listN8nEndpoints = $grpc.ClientMethod<$1.Empty, $0.ListN8nEndpointsResponse>( + '/fai.v1.HubAdmin/ListN8nEndpoints', + ($1.Empty value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.ListN8nEndpointsResponse.fromBuffer(value)); + static final _$refreshN8nEndpoints = $grpc.ClientMethod<$1.Empty, $0.ListN8nEndpointsResponse>( + '/fai.v1.HubAdmin/RefreshN8nEndpoints', + ($1.Empty value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.ListN8nEndpointsResponse.fromBuffer(value)); + static final _$addN8nEndpoint = $grpc.ClientMethod<$0.N8nEndpointConfigEntry, $0.ListN8nEndpointsResponse>( + '/fai.v1.HubAdmin/AddN8nEndpoint', + ($0.N8nEndpointConfigEntry value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.ListN8nEndpointsResponse.fromBuffer(value)); + static final _$removeN8nEndpoint = $grpc.ClientMethod<$0.RemoveN8nEndpointRequest, $0.ListN8nEndpointsResponse>( + '/fai.v1.HubAdmin/RemoveN8nEndpoint', + ($0.RemoveN8nEndpointRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.ListN8nEndpointsResponse.fromBuffer(value)); static final _$systemAiStatus = $grpc.ClientMethod<$1.Empty, $0.SystemAiStatusResponse>( '/fai.v1.HubAdmin/SystemAiStatus', ($1.Empty value) => value.writeToBuffer(), @@ -419,6 +435,24 @@ class HubAdminClient extends $grpc.Client { return $createUnaryCall(_$removeMcpClient, request, options: options); } + /// n8n bridges. Same shape as the MCP client RPCs above — + /// every active workflow surfaces as `n8n..`. + $grpc.ResponseFuture<$0.ListN8nEndpointsResponse> listN8nEndpoints($1.Empty request, {$grpc.CallOptions? options}) { + return $createUnaryCall(_$listN8nEndpoints, request, options: options); + } + + $grpc.ResponseFuture<$0.ListN8nEndpointsResponse> refreshN8nEndpoints($1.Empty request, {$grpc.CallOptions? options}) { + return $createUnaryCall(_$refreshN8nEndpoints, request, options: options); + } + + $grpc.ResponseFuture<$0.ListN8nEndpointsResponse> addN8nEndpoint($0.N8nEndpointConfigEntry request, {$grpc.CallOptions? options}) { + return $createUnaryCall(_$addN8nEndpoint, request, options: options); + } + + $grpc.ResponseFuture<$0.ListN8nEndpointsResponse> removeN8nEndpoint($0.RemoveN8nEndpointRequest request, {$grpc.CallOptions? options}) { + return $createUnaryCall(_$removeN8nEndpoint, request, options: options); + } + /// Read-only system-AI status. Lets Studio render the /// "configure in Settings" affordance when the feature is /// off, and the privacy-mode badge when it is on. @@ -671,6 +705,34 @@ abstract class HubAdminServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $0.RemoveMcpClientRequest.fromBuffer(value), ($0.ListMcpClientsResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$1.Empty, $0.ListN8nEndpointsResponse>( + 'ListN8nEndpoints', + listN8nEndpoints_Pre, + false, + false, + ($core.List<$core.int> value) => $1.Empty.fromBuffer(value), + ($0.ListN8nEndpointsResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$1.Empty, $0.ListN8nEndpointsResponse>( + 'RefreshN8nEndpoints', + refreshN8nEndpoints_Pre, + false, + false, + ($core.List<$core.int> value) => $1.Empty.fromBuffer(value), + ($0.ListN8nEndpointsResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.N8nEndpointConfigEntry, $0.ListN8nEndpointsResponse>( + 'AddN8nEndpoint', + addN8nEndpoint_Pre, + false, + false, + ($core.List<$core.int> value) => $0.N8nEndpointConfigEntry.fromBuffer(value), + ($0.ListN8nEndpointsResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.RemoveN8nEndpointRequest, $0.ListN8nEndpointsResponse>( + 'RemoveN8nEndpoint', + removeN8nEndpoint_Pre, + false, + false, + ($core.List<$core.int> value) => $0.RemoveN8nEndpointRequest.fromBuffer(value), + ($0.ListN8nEndpointsResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$1.Empty, $0.SystemAiStatusResponse>( 'SystemAiStatus', systemAiStatus_Pre, @@ -839,6 +901,22 @@ abstract class HubAdminServiceBase extends $grpc.Service { return removeMcpClient($call, await $request); } + $async.Future<$0.ListN8nEndpointsResponse> listN8nEndpoints_Pre($grpc.ServiceCall $call, $async.Future<$1.Empty> $request) async { + return listN8nEndpoints($call, await $request); + } + + $async.Future<$0.ListN8nEndpointsResponse> refreshN8nEndpoints_Pre($grpc.ServiceCall $call, $async.Future<$1.Empty> $request) async { + return refreshN8nEndpoints($call, await $request); + } + + $async.Future<$0.ListN8nEndpointsResponse> addN8nEndpoint_Pre($grpc.ServiceCall $call, $async.Future<$0.N8nEndpointConfigEntry> $request) async { + return addN8nEndpoint($call, await $request); + } + + $async.Future<$0.ListN8nEndpointsResponse> removeN8nEndpoint_Pre($grpc.ServiceCall $call, $async.Future<$0.RemoveN8nEndpointRequest> $request) async { + return removeN8nEndpoint($call, await $request); + } + $async.Future<$0.SystemAiStatusResponse> systemAiStatus_Pre($grpc.ServiceCall $call, $async.Future<$1.Empty> $request) async { return systemAiStatus($call, await $request); } @@ -903,6 +981,10 @@ abstract class HubAdminServiceBase extends $grpc.Service { $async.Future<$0.ListMcpClientsResponse> refreshMcpClients($grpc.ServiceCall call, $1.Empty request); $async.Future<$0.ListMcpClientsResponse> addMcpClient($grpc.ServiceCall call, $0.McpClientConfigEntry request); $async.Future<$0.ListMcpClientsResponse> removeMcpClient($grpc.ServiceCall call, $0.RemoveMcpClientRequest request); + $async.Future<$0.ListN8nEndpointsResponse> listN8nEndpoints($grpc.ServiceCall call, $1.Empty request); + $async.Future<$0.ListN8nEndpointsResponse> refreshN8nEndpoints($grpc.ServiceCall call, $1.Empty request); + $async.Future<$0.ListN8nEndpointsResponse> addN8nEndpoint($grpc.ServiceCall call, $0.N8nEndpointConfigEntry request); + $async.Future<$0.ListN8nEndpointsResponse> removeN8nEndpoint($grpc.ServiceCall call, $0.RemoveN8nEndpointRequest request); $async.Future<$0.SystemAiStatusResponse> systemAiStatus($grpc.ServiceCall call, $1.Empty request); $async.Future<$0.AskAiResponse> askAi($grpc.ServiceCall call, $0.AskAiRequest request); $async.Future<$0.SystemAiStatusResponse> updateSystemAi($grpc.ServiceCall call, $0.UpdateSystemAiRequest request); diff --git a/lib/src/generated/fai/v1/hub.pbjson.dart b/lib/src/generated/fai/v1/hub.pbjson.dart index 5dd31cd..aaf94aa 100644 --- a/lib/src/generated/fai/v1/hub.pbjson.dart +++ b/lib/src/generated/fai/v1/hub.pbjson.dart @@ -1064,3 +1064,63 @@ const RemoveMcpClientRequest$json = { final $typed_data.Uint8List removeMcpClientRequestDescriptor = $convert.base64Decode( 'ChZSZW1vdmVNY3BDbGllbnRSZXF1ZXN0EhIKBG5hbWUYASABKAlSBG5hbWU='); +@$core.Deprecated('Use n8nEndpointConfigEntryDescriptor instead') +const N8nEndpointConfigEntry$json = { + '1': 'N8nEndpointConfigEntry', + '2': [ + {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + {'1': 'base_url', '3': 2, '4': 1, '5': 9, '10': 'baseUrl'}, + {'1': 'api_key_env', '3': 3, '4': 1, '5': 9, '10': 'apiKeyEnv'}, + {'1': 'description', '3': 4, '4': 1, '5': 9, '10': 'description'}, + ], +}; + +/// Descriptor for `N8nEndpointConfigEntry`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List n8nEndpointConfigEntryDescriptor = $convert.base64Decode( + 'ChZOOG5FbmRwb2ludENvbmZpZ0VudHJ5EhIKBG5hbWUYASABKAlSBG5hbWUSGQoIYmFzZV91cm' + 'wYAiABKAlSB2Jhc2VVcmwSHgoLYXBpX2tleV9lbnYYAyABKAlSCWFwaUtleUVudhIgCgtkZXNj' + 'cmlwdGlvbhgEIAEoCVILZGVzY3JpcHRpb24='); + +@$core.Deprecated('Use listN8nEndpointsResponseDescriptor instead') +const ListN8nEndpointsResponse$json = { + '1': 'ListN8nEndpointsResponse', + '2': [ + {'1': 'endpoints', '3': 1, '4': 3, '5': 11, '6': '.fai.v1.N8nEndpointStatus', '10': 'endpoints'}, + ], +}; + +/// Descriptor for `ListN8nEndpointsResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List listN8nEndpointsResponseDescriptor = $convert.base64Decode( + 'ChhMaXN0TjhuRW5kcG9pbnRzUmVzcG9uc2USNwoJZW5kcG9pbnRzGAEgAygLMhkuZmFpLnYxLk' + '44bkVuZHBvaW50U3RhdHVzUgllbmRwb2ludHM='); + +@$core.Deprecated('Use n8nEndpointStatusDescriptor instead') +const N8nEndpointStatus$json = { + '1': 'N8nEndpointStatus', + '2': [ + {'1': 'config', '3': 1, '4': 1, '5': 11, '6': '.fai.v1.N8nEndpointConfigEntry', '10': 'config'}, + {'1': 'workflow_count', '3': 2, '4': 1, '5': 13, '10': 'workflowCount'}, + {'1': 'error_kind', '3': 3, '4': 1, '5': 9, '10': 'errorKind'}, + {'1': 'message', '3': 4, '4': 1, '5': 9, '10': 'message'}, + ], +}; + +/// Descriptor for `N8nEndpointStatus`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List n8nEndpointStatusDescriptor = $convert.base64Decode( + 'ChFOOG5FbmRwb2ludFN0YXR1cxI2CgZjb25maWcYASABKAsyHi5mYWkudjEuTjhuRW5kcG9pbn' + 'RDb25maWdFbnRyeVIGY29uZmlnEiUKDndvcmtmbG93X2NvdW50GAIgASgNUg13b3JrZmxvd0Nv' + 'dW50Eh0KCmVycm9yX2tpbmQYAyABKAlSCWVycm9yS2luZBIYCgdtZXNzYWdlGAQgASgJUgdtZX' + 'NzYWdl'); + +@$core.Deprecated('Use removeN8nEndpointRequestDescriptor instead') +const RemoveN8nEndpointRequest$json = { + '1': 'RemoveN8nEndpointRequest', + '2': [ + {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + ], +}; + +/// Descriptor for `RemoveN8nEndpointRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List removeN8nEndpointRequestDescriptor = $convert.base64Decode( + 'ChhSZW1vdmVOOG5FbmRwb2ludFJlcXVlc3QSEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); + diff --git a/lib/src/hub_client.dart b/lib/src/hub_client.dart index e703cd2..673cc70 100644 --- a/lib/src/hub_client.dart +++ b/lib/src/hub_client.dart @@ -60,6 +60,9 @@ typedef FetchModuleDocsResponse = pb.FetchModuleDocsResponse; typedef ListMcpClientsResponse = pb.ListMcpClientsResponse; typedef McpClientStatus = pb.McpClientStatus; typedef McpClientConfigEntry = pb.McpClientConfigEntry; +typedef ListN8nEndpointsResponse = pb.ListN8nEndpointsResponse; +typedef N8nEndpointStatus = pb.N8nEndpointStatus; +typedef N8nEndpointConfigEntry = pb.N8nEndpointConfigEntry; typedef ModuleInfoResponse = pb.ModuleInfoResponse; typedef FlowSummary = pb.FlowSummary; typedef StoreEntry = pb.StoreEntry; @@ -273,6 +276,30 @@ class HubClient { return _admin.removeMcpClient(pb.RemoveMcpClientRequest(name: name)); } + /// Sister methods for n8n-endpoint federation. Same shape + /// as the MCP-client surface above; Studio's n8n editor + /// reuses the MCP editor patterns wholesale. + Future listN8nEndpoints() => + _admin.listN8nEndpoints(Empty()); + Future refreshN8nEndpoints() => + _admin.refreshN8nEndpoints(Empty()); + Future addN8nEndpoint({ + required String name, + required String baseUrl, + String apiKeyEnv = '', + String description = '', + }) { + return _admin.addN8nEndpoint(pb.N8nEndpointConfigEntry( + name: name, + baseUrl: baseUrl, + apiKeyEnv: apiKeyEnv, + description: description, + )); + } + Future removeN8nEndpoint(String name) { + return _admin.removeN8nEndpoint(pb.RemoveN8nEndpointRequest(name: name)); + } + /// Read-only system-AI status. `enabled=false` lets Studio /// render "configure in Settings" without making a request. Future systemAiStatus() { diff --git a/pubspec.yaml b/pubspec.yaml index 49f1cfc..800ed01 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fai_dart_sdk description: gRPC client SDK for the F∆I Platform hub. Used by F∆I Studio and Tier-3 domain apps. -version: 0.12.1 +version: 0.13.0 publish_to: 'none' repository: https://git.flemming.ws/fai/dart-sdk