diff --git a/core-models/src/main/java/com/anytypeio/anytype/core_models/restrictions/ObjectRestriction.kt b/core-models/src/main/java/com/anytypeio/anytype/core_models/restrictions/ObjectRestriction.kt index c99b972ae9..92ba9c7c5a 100644 --- a/core-models/src/main/java/com/anytypeio/anytype/core_models/restrictions/ObjectRestriction.kt +++ b/core-models/src/main/java/com/anytypeio/anytype/core_models/restrictions/ObjectRestriction.kt @@ -41,6 +41,8 @@ enum class ObjectRestriction(val code: Int) { CREATE_OBJECT_OF_THIS_TYPE(9), - NONE(0) + NONE(0), + + PUBLISH(10) } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 005f2231b3..4dce397804 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -middlewareVersion = "v0.39.0-rc05" +middlewareVersion = "v0.39.0-rc07" kotlinVersion = '2.0.21' kspVersion = "2.0.21-1.0.25" diff --git a/middleware/src/main/java/com/anytypeio/anytype/middleware/mappers/ToCoreModelMappers.kt b/middleware/src/main/java/com/anytypeio/anytype/middleware/mappers/ToCoreModelMappers.kt index 701a2a35cf..5ecfe54462 100644 --- a/middleware/src/main/java/com/anytypeio/anytype/middleware/mappers/ToCoreModelMappers.kt +++ b/middleware/src/main/java/com/anytypeio/anytype/middleware/mappers/ToCoreModelMappers.kt @@ -759,6 +759,7 @@ fun MObjectRestriction.toCoreModel(): ObjectRestriction = when (this) { MObjectRestriction.None -> ObjectRestriction.NONE MObjectRestriction.Duplicate -> ObjectRestriction.DUPLICATE MObjectRestriction.CreateObjectOfThisType -> ObjectRestriction.CREATE_OBJECT_OF_THIS_TYPE + MObjectRestriction.Publish -> ObjectRestriction.PUBLISH } fun MDVRestrictions.toCoreModel(): DataViewRestrictions { diff --git a/protocol/src/main/proto/commands.proto b/protocol/src/main/proto/commands.proto index 866d67e760..5781ff69cb 100644 --- a/protocol/src/main/proto/commands.proto +++ b/protocol/src/main/proto/commands.proto @@ -1359,6 +1359,133 @@ message Rpc { } } + message Publishing { + enum PublishStatus { + // PublishStatusCreated means publish is created but not uploaded yet + PublishStatusCreated = 0; + // PublishStatusCreated means publish is active + PublishStatusPublished = 1; + } + message PublishState { + string spaceId = 1; + string objectId = 2; + string uri = 3; + PublishStatus status = 4; + string version = 5; + int64 timestamp = 6; + int64 size = 7; + bool joinSpace = 8; + } + + message Create { + message Request { + string spaceId = 1; + string objectId = 2; + string uri = 3; + bool joinSpace = 4; + } + message Response { + Error error = 1; + string uri = 2; + + message Error { + Code code = 1; + string description = 2; + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + NO_SUCH_OBJECT = 101; + NO_SUCH_SPACE = 102; + LIMIT_EXCEEDED = 103; + } + } + } + } + message Remove { + message Request { + string spaceId = 1; + string objectId = 2; + } + message Response { + Error error = 1; + + message Error { + Code code = 1; + string description = 2; + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + NO_SUCH_OBJECT = 101; + NO_SUCH_SPACE = 102; + } + } + } + } + message List { + message Request { + string spaceId = 1; + } + message Response { + Error error = 1; + repeated PublishState publishes = 2; + + message Error { + Code code = 1; + string description = 2; + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + NO_SUCH_SPACE = 102; + } + } + } + } + message ResolveUri { + message Request { + string uri = 1; + } + message Response { + Error error = 1; + PublishState publish = 2; + + message Error { + Code code = 1; + string description = 2; + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + NO_SUCH_URI = 101; + } + } + } + } + message GetStatus { + message Request { + string spaceId = 1; + string objectId = 2; + } + message Response { + Error error = 1; + PublishState publish = 2; + + message Error { + Code code = 1; + string description = 2; + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + NO_SUCH_OBJECT = 101; + NO_SUCH_SPACE = 102; + } + } + } + } + } message Object { message Open { diff --git a/protocol/src/main/proto/models.proto b/protocol/src/main/proto/models.proto index b3b2e548f0..9cb7d05039 100644 --- a/protocol/src/main/proto/models.proto +++ b/protocol/src/main/proto/models.proto @@ -716,6 +716,8 @@ message Restrictions { Duplicate = 8; // can be set only for types. Restricts creating objects of this type CreateObjectOfThisType = 9; + // object is not allowed to publish + Publish = 10; }