feat(hub-client): forward locale to FetchModuleDocs
Some checks failed
Security / Security check (push) Failing after 1s
Some checks failed
Security / Security check (push) Failing after 1s
Hub now accepts a locale field on FetchModuleDocsRequest so README.<locale>.md (e.g. README.de.md) gets tried before the generic README.md. SDK passes it via an optional named param; empty string keeps the previous behaviour. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
ab2205466a
commit
b8bcae4b14
3 changed files with 27 additions and 3 deletions
|
|
@ -1911,11 +1911,15 @@ class UninstallModuleResponse extends $pb.GeneratedMessage {
|
||||||
class FetchModuleDocsRequest extends $pb.GeneratedMessage {
|
class FetchModuleDocsRequest extends $pb.GeneratedMessage {
|
||||||
factory FetchModuleDocsRequest({
|
factory FetchModuleDocsRequest({
|
||||||
$core.String? name,
|
$core.String? name,
|
||||||
|
$core.String? locale,
|
||||||
}) {
|
}) {
|
||||||
final $result = create();
|
final $result = create();
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
$result.name = name;
|
$result.name = name;
|
||||||
}
|
}
|
||||||
|
if (locale != null) {
|
||||||
|
$result.locale = locale;
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
FetchModuleDocsRequest._() : super();
|
FetchModuleDocsRequest._() : super();
|
||||||
|
|
@ -1924,6 +1928,7 @@ class FetchModuleDocsRequest extends $pb.GeneratedMessage {
|
||||||
|
|
||||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'FetchModuleDocsRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create)
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'FetchModuleDocsRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create)
|
||||||
..aOS(1, _omitFieldNames ? '' : 'name')
|
..aOS(1, _omitFieldNames ? '' : 'name')
|
||||||
|
..aOS(2, _omitFieldNames ? '' : 'locale')
|
||||||
..hasRequiredFields = false
|
..hasRequiredFields = false
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -1954,6 +1959,18 @@ class FetchModuleDocsRequest extends $pb.GeneratedMessage {
|
||||||
$core.bool hasName() => $_has(0);
|
$core.bool hasName() => $_has(0);
|
||||||
@$pb.TagNumber(1)
|
@$pb.TagNumber(1)
|
||||||
void clearName() => $_clearField(1);
|
void clearName() => $_clearField(1);
|
||||||
|
|
||||||
|
/// Preferred locale code (e.g. "de", "en"). When set, the hub
|
||||||
|
/// first tries `README.<locale>.md` before falling back to the
|
||||||
|
/// generic `README.md`. Empty string = no locale preference.
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.String get locale => $_getSZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set locale($core.String v) { $_setString(1, v); }
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasLocale() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearLocale() => $_clearField(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
class FetchModuleDocsResponse extends $pb.GeneratedMessage {
|
class FetchModuleDocsResponse extends $pb.GeneratedMessage {
|
||||||
|
|
|
||||||
|
|
@ -508,12 +508,14 @@ const FetchModuleDocsRequest$json = {
|
||||||
'1': 'FetchModuleDocsRequest',
|
'1': 'FetchModuleDocsRequest',
|
||||||
'2': [
|
'2': [
|
||||||
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
|
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
|
||||||
|
{'1': 'locale', '3': 2, '4': 1, '5': 9, '10': 'locale'},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `FetchModuleDocsRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `FetchModuleDocsRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List fetchModuleDocsRequestDescriptor = $convert.base64Decode(
|
final $typed_data.Uint8List fetchModuleDocsRequestDescriptor = $convert.base64Decode(
|
||||||
'ChZGZXRjaE1vZHVsZURvY3NSZXF1ZXN0EhIKBG5hbWUYASABKAlSBG5hbWU=');
|
'ChZGZXRjaE1vZHVsZURvY3NSZXF1ZXN0EhIKBG5hbWUYASABKAlSBG5hbWUSFgoGbG9jYWxlGA'
|
||||||
|
'IgASgJUgZsb2NhbGU=');
|
||||||
|
|
||||||
@$core.Deprecated('Use fetchModuleDocsResponseDescriptor instead')
|
@$core.Deprecated('Use fetchModuleDocsResponseDescriptor instead')
|
||||||
const FetchModuleDocsResponse$json = {
|
const FetchModuleDocsResponse$json = {
|
||||||
|
|
|
||||||
|
|
@ -240,8 +240,13 @@ class HubClient {
|
||||||
/// when set, so Studio doesn't have to handle credentials.
|
/// when set, so Studio doesn't have to handle credentials.
|
||||||
/// Errors come back inside [FetchModuleDocsResponse.errorKind]
|
/// Errors come back inside [FetchModuleDocsResponse.errorKind]
|
||||||
/// (not as exceptions) so the UI can render fallbacks.
|
/// (not as exceptions) so the UI can render fallbacks.
|
||||||
Future<FetchModuleDocsResponse> fetchModuleDocs(String name) {
|
Future<FetchModuleDocsResponse> fetchModuleDocs(
|
||||||
return _admin.fetchModuleDocs(pb.FetchModuleDocsRequest(name: name));
|
String name, {
|
||||||
|
String locale = '',
|
||||||
|
}) {
|
||||||
|
return _admin.fetchModuleDocs(
|
||||||
|
pb.FetchModuleDocsRequest(name: name, locale: locale),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List every configured MCP server with the last-discovery
|
/// List every configured MCP server with the last-discovery
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue