// M-Files Server gRPC API 26.11. Generated from the M-Files Server IDL; do not edit.
// Documentation: https://developer.m-files.com/APIs/gRPC-API/
syntax = "proto3";

package MFiles;

import "mfiles/api/annotations.proto";

option csharp_namespace = "MFiles.Grpc";
option go_package = "github.com/M-Files/mfiles-grpc-api/go/mfiles;mfiles";
option java_multiple_files = true;
option java_package = "com.mfiles.grpc";
option objc_class_prefix = "MF_";

// An interface for querying server version information.
//
// This interface provides a method for querying server version information. This is used to
// check the compatibility of the server and client.
// Also methods for querying information about the versions
// of other M-Files components can be placed here.
//
// The only service you can call before anything else: it needs no session and no login, so it is the
// standard "is the server there, and which version is it?" probe.
//
// - [QueryVersion](mfiles:MFiles.IRPCQueryVersion.QueryVersion) returns the server version. Call it
//   first to check connectivity and to decide which methods and fields you can rely on.
// - [GetUIVersionInfo](mfiles:MFiles.IRPCQueryVersion.GetUIVersionInfo) is used by M-Files clients
//   to find the web UI assets to load; applications rarely need it.
//
// Typical order: `QueryVersion`, then
// [GetServerCapabilities](mfiles:MFiles.IRPCLogin.GetServerCapabilities) for optional features, then
// [LogIn](mfiles:MFiles.IRPCLogin.LogIn). See
// [Connecting to the server](https://developer.m-files.com/APIs/gRPC-API/runtime/connecting/) and
// [Versions and compatibility](https://developer.m-files.com/APIs/gRPC-API/runtime/versioning/).
service IRPCQueryVersion {
	option (mfiles.api.service) = { book: "vault" level: LEVEL_CORE title: "Server version" };

	// Gets the server version and the oldest client version the server accepts.
	//
	// Needs no session and no `mfiles-session-id-bin` header. The response is the same for every caller,
	// so the result can be cached for the lifetime of the connection.
	//
	// All four fields are 64-bit packed versions: `major << 48 | minor << 32 | build << 16 | patch`.
	// For example `7318397729964032` is 26.11.16645.0. Unpack them with shifts, not by formatting the
	// decimal number.
	//
	// Over gRPC all three "oldest compatible" fields carry the same value: the oldest client version the
	// gRPC interface supports.
	rpc QueryVersion( QueryVersionRequest ) returns ( QueryVersionResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_NONE highlighted: true };
	}

	// Gets the version of the web UI assets that M-Files clients should load, and where to load them from.
	//
	// Used by M-Files clients to update their UI; applications rarely need it. Needs no session.
	//
	// When the server has no UI delivery point configured (the normal case on premises), the call
	// succeeds with all fields empty. `desktop_version` is never filled in by the server.
	rpc GetUIVersionInfo( GetUIVersionInfoRequest ) returns ( GetUIVersionInfoResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_NONE };
	}
}

// The request of QueryVersion.
message QueryVersionRequest {
}

// The response of QueryVersion.
message QueryVersionResponse {

	// The server version, packed as `major << 48 | minor << 32 | build << 16 | patch`.
	uint64 server_version = 1;

	// The oldest client version that the server accepts over gRPC, packed like `server_version`.
	uint64 oldest_compatible_client_version = 2;

	// The oldest admin client version that the server accepts, packed like `server_version`. Over gRPC this equals `oldest_compatible_client_version`.
	uint64 oldest_compatible_admin_client_version = 3;

	// The oldest replica server version that the server accepts, packed like `server_version`. Over gRPC this equals `oldest_compatible_client_version`.
	uint64 oldest_compatible_replica_server_version = 4;
}

// The request of GetUIVersionInfo.
message GetUIVersionInfoRequest {
}

// The response of GetUIVersionInfo.
message GetUIVersionInfoResponse {

	// Delivery Point from which to download UI assets.
	string delivery_point_url = 1;

	// The version of the UI assets currently in use.
	string ui_version = 2;

	// The latest available version for this Vault. Empty when not known.
	string available_ui_version = 3;

	// The version of M-Files Desktop installed on the machine. Undefined in Web.
	string desktop_version = 4;
}
