mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3032 Protocol | Integrate 0.37.0-alpha01 (#1767)
This commit is contained in:
parent
d60a10f115
commit
ad47b0159a
11 changed files with 76 additions and 18 deletions
|
@ -6,6 +6,7 @@ package com.anytypeio.anytype.core_models
|
|||
* @property profile id of the current profile
|
||||
* @property gateway url of the gateway for fetching files.
|
||||
* @property spaceView id of space view - UI-representation of space object
|
||||
* @property workspaceObjectId used for space-level chat
|
||||
*/
|
||||
data class Config(
|
||||
val home: Id,
|
||||
|
@ -17,5 +18,6 @@ data class Config(
|
|||
val widgets: Id,
|
||||
val analytics: Id,
|
||||
val device: Id,
|
||||
val network: Id
|
||||
val network: Id,
|
||||
val workspaceObjectId: Id
|
||||
)
|
|
@ -51,6 +51,7 @@ data class ObjectType(
|
|||
SPACE_VIEW(18),
|
||||
PARTICIPANT(19),
|
||||
PDF(20),
|
||||
@Deprecated("Will be deprecated")
|
||||
CHAT(21),
|
||||
CHAT_DERIVED(22),
|
||||
TAG(23);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[versions]
|
||||
middlewareVersion = "v0.36.7"
|
||||
middlewareVersion = "v0.37.0-alpha01"
|
||||
kotlinVersion = '2.0.21'
|
||||
kspVersion = "2.0.21-1.0.25"
|
||||
|
||||
|
|
|
@ -45,7 +45,8 @@ fun Rpc.Account.Select.Response.toAccountSetup(): AccountSetup {
|
|||
analytics = info.analyticsId,
|
||||
device = info.deviceId,
|
||||
network = info.networkId,
|
||||
techSpace = info.techSpaceId
|
||||
techSpace = info.techSpaceId,
|
||||
workspaceObjectId = info.workspaceObjectId
|
||||
),
|
||||
status = status?.core() ?: AccountStatus.Unknown
|
||||
)
|
||||
|
|
|
@ -1584,7 +1584,7 @@ class Middleware @Inject constructor(
|
|||
platform: String,
|
||||
version: String
|
||||
) {
|
||||
val request = Rpc.Metrics.SetParameters.Request(
|
||||
val request = Rpc.Initial.SetParameters.Request(
|
||||
platform = platform,
|
||||
version = version
|
||||
)
|
||||
|
|
|
@ -829,7 +829,8 @@ fun Account.Info.config(): Config = Config(
|
|||
widgets = widgetsId,
|
||||
analytics = analyticsId,
|
||||
device = deviceId,
|
||||
network = networkId
|
||||
network = networkId,
|
||||
workspaceObjectId = workspaceObjectId
|
||||
)
|
||||
|
||||
fun MManifestInfo.toCoreModel(): ManifestInfo {
|
||||
|
|
|
@ -10,7 +10,7 @@ interface MiddlewareService {
|
|||
//region APP commands
|
||||
|
||||
@Throws(Exception::class)
|
||||
fun metricsSetParameters(request: Rpc.Metrics.SetParameters.Request): Rpc.Metrics.SetParameters.Response
|
||||
fun metricsSetParameters(request: Rpc.Initial.SetParameters.Request): Rpc.Initial.SetParameters.Response
|
||||
|
||||
@Throws(Exception::class)
|
||||
fun versionGet(request: Rpc.App.GetVersion.Request): Rpc.App.GetVersion.Response
|
||||
|
|
|
@ -1156,11 +1156,11 @@ class MiddlewareServiceImplementation @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
override fun metricsSetParameters(request: Rpc.Metrics.SetParameters.Request): Rpc.Metrics.SetParameters.Response {
|
||||
val encoded = Service.metricsSetParameters(Rpc.Metrics.SetParameters.Request.ADAPTER.encode(request))
|
||||
val response = Rpc.Metrics.SetParameters.Response.ADAPTER.decode(encoded)
|
||||
override fun metricsSetParameters(request: Rpc.Initial.SetParameters.Request): Rpc.Initial.SetParameters.Response {
|
||||
val encoded = Service.initialSetParameters(Rpc.Initial.SetParameters.Request.ADAPTER.encode(request))
|
||||
val response = Rpc.Initial.SetParameters.Response.ADAPTER.decode(encoded)
|
||||
val error = response.error
|
||||
if (error != null && error.code != Rpc.Metrics.SetParameters.Response.Error.Code.NULL) {
|
||||
if (error != null && error.code != Rpc.Initial.SetParameters.Response.Error.Code.NULL) {
|
||||
throw Exception(error.description)
|
||||
} else {
|
||||
return response
|
||||
|
|
|
@ -1131,6 +1131,7 @@ message Rpc {
|
|||
message Request {
|
||||
google.protobuf.Struct details = 1; // object details
|
||||
anytype.Rpc.Object.ImportUseCase.Request.UseCase useCase = 2; // use case
|
||||
bool withChat = 3; // create space-level chat; temporary solution, should be removed after chats released for all users
|
||||
}
|
||||
|
||||
message Response {
|
||||
|
@ -1154,6 +1155,7 @@ message Rpc {
|
|||
message Open {
|
||||
message Request {
|
||||
string spaceId = 1;
|
||||
bool withChat = 2; // create space-level chat if not exists; temporary solution, should be removed after chats released for all users
|
||||
}
|
||||
|
||||
message Response {
|
||||
|
@ -6523,6 +6525,30 @@ message Rpc {
|
|||
}
|
||||
}
|
||||
|
||||
message ExportLog {
|
||||
message Request {
|
||||
option (no_auth) = true;
|
||||
string dir = 1; // empty means using OS-provided temp dir
|
||||
}
|
||||
|
||||
message Response {
|
||||
Error error = 1;
|
||||
string path = 2;
|
||||
|
||||
message Error {
|
||||
Code code = 1;
|
||||
string description = 2;
|
||||
|
||||
enum Code {
|
||||
NULL = 0;
|
||||
UNKNOWN_ERROR = 1;
|
||||
BAD_INPUT = 2;
|
||||
NO_FOLDER = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message Ping {
|
||||
message Request {
|
||||
int32 index = 1;
|
||||
|
@ -6581,14 +6607,41 @@ message Rpc {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
message NetCheck {
|
||||
message Request {
|
||||
string clientYml = 1;
|
||||
}
|
||||
|
||||
message Response {
|
||||
Error error = 1;
|
||||
string result = 2;
|
||||
|
||||
message Error {
|
||||
Code code = 1;
|
||||
string description = 2;
|
||||
|
||||
enum Code {
|
||||
NULL = 0;
|
||||
UNKNOWN_ERROR = 1;
|
||||
BAD_INPUT = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message Metrics {
|
||||
message Initial {
|
||||
message SetParameters {
|
||||
message Request {
|
||||
option (no_auth) = true;
|
||||
string platform = 1;
|
||||
string version = 2;
|
||||
string workdir = 3;
|
||||
string logLevel = 4;
|
||||
bool doNotSendLogs = 5;
|
||||
bool doNotSaveLogs = 6;
|
||||
bool doNotSendTelemetry = 7;
|
||||
}
|
||||
|
||||
message Response {
|
||||
|
|
|
@ -639,6 +639,7 @@ message Account {
|
|||
string archiveObjectId = 3; // archive block id
|
||||
string profileObjectId = 4; // profile block id
|
||||
string marketplaceWorkspaceId = 11; // marketplace workspace id
|
||||
string workspaceObjectId = 15; // workspace object id. used for space-level chat
|
||||
|
||||
string deviceId = 8;
|
||||
string accountSpaceId = 9;
|
||||
|
@ -762,7 +763,7 @@ message ObjectType {
|
|||
participant = 19;
|
||||
|
||||
pdf = 20;
|
||||
chat = 21;
|
||||
chat = 21; // deprecated
|
||||
chatDerived = 22;
|
||||
tag = 23;
|
||||
}
|
||||
|
|
|
@ -13,10 +13,7 @@ fun StubAccountSetup(
|
|||
)
|
||||
|
||||
fun StubAccount(
|
||||
id : Id = MockDataFactory.randomUuid(),
|
||||
name: String = MockDataFactory.randomString(),
|
||||
avatar: Url? = null,
|
||||
color: String? = null
|
||||
id : Id = MockDataFactory.randomUuid()
|
||||
) : Account = Account(
|
||||
id = id
|
||||
)
|
||||
|
@ -31,7 +28,8 @@ fun StubConfig(
|
|||
device: Id = MockDataFactory.randomUuid(),
|
||||
space: Id = MockDataFactory.randomUuid(),
|
||||
techSpace: Id = MockDataFactory.randomUuid(),
|
||||
network: Id = MockDataFactory.randomUuid()
|
||||
network: Id = MockDataFactory.randomUuid(),
|
||||
workspaceObjectId: Id = MockDataFactory.randomUuid()
|
||||
) : Config = Config(
|
||||
home = home,
|
||||
profile = profile,
|
||||
|
@ -42,5 +40,6 @@ fun StubConfig(
|
|||
widgets = widgets,
|
||||
analytics = analytics,
|
||||
device = device,
|
||||
network = network
|
||||
network = network,
|
||||
workspaceObjectId = workspaceObjectId
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue