Skip to content

Commit

Permalink
IOS-2402 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mgolovko committed Mar 1, 2024
1 parent 2d9ce60 commit 5f4cebe
Show file tree
Hide file tree
Showing 7 changed files with 283 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Libraryfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MIDDLE_VERSION=v0.32.0-rc8
MIDDLE_VERSION=v0.32.0-rc10
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,11 @@ extension Anytype_Rpc.Space.RequestDecline.Response.Error: ResponseError {
public var isNull: Bool { code == .null }
}

extension Anytype_Rpc.Space.StopSharing.Response: ResultWithError {}
extension Anytype_Rpc.Space.StopSharing.Response.Error: ResponseError {
public var isNull: Bool { code == .null }
}

extension Anytype_Rpc.Template.Clone.Response: ResultWithError {}
extension Anytype_Rpc.Template.Clone.Response.Error: ResponseError {
public var isNull: Bool { code == .null }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,16 @@ public struct ClientCommands {
}
}

public static func spaceStopSharing(
_ request: Anytype_Rpc.Space.StopSharing.Request = .init()
) -> Invocation<Anytype_Rpc.Space.StopSharing.Request, Anytype_Rpc.Space.StopSharing.Response> {
return Invocation(messageName: "SpaceStopSharing", request: request) { request in
let requestData = try request.serializedData()
let responseData = Lib.ServiceSpaceStopSharing(requestData) ?? Data()
return try Anytype_Rpc.Space.StopSharing.Response(serializedData: responseData)
}
}

public static func spaceRequestApprove(
_ request: Anytype_Rpc.Space.RequestApprove.Request = .init()
) -> Invocation<Anytype_Rpc.Space.RequestApprove.Request, Anytype_Rpc.Space.RequestApprove.Response> {
Expand Down
258 changes: 258 additions & 0 deletions Modules/ProtobufMessages/Sources/Protocol/commands.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,103 @@ public struct Anytype_Rpc {
public init() {}
}

public struct StopSharing {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

public var unknownFields = SwiftProtobuf.UnknownStorage()

public struct Request {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

public var spaceID: String = String()

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}
}

public struct Response {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

public var error: Anytype_Rpc.Space.StopSharing.Response.Error {
get {return _error ?? Anytype_Rpc.Space.StopSharing.Response.Error()}
set {_error = newValue}
}
/// Returns true if `error` has been explicitly set.
public var hasError: Bool {return self._error != nil}
/// Clears the value of `error`. Subsequent reads from it will return its default value.
public mutating func clearError() {self._error = nil}

public var unknownFields = SwiftProtobuf.UnknownStorage()

public struct Error {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

public var code: Anytype_Rpc.Space.StopSharing.Response.Error.Code = .null

public var description_p: String = String()

public var unknownFields = SwiftProtobuf.UnknownStorage()

public enum Code: SwiftProtobuf.Enum {
public typealias RawValue = Int
case null // = 0
case unknownError // = 1
case badInput // = 2
case noSuchSpace // = 101
case spaceIsDeleted // = 102
case requestFailed // = 103
case UNRECOGNIZED(Int)

public init() {
self = .null
}

public init?(rawValue: Int) {
switch rawValue {
case 0: self = .null
case 1: self = .unknownError
case 2: self = .badInput
case 101: self = .noSuchSpace
case 102: self = .spaceIsDeleted
case 103: self = .requestFailed
default: self = .UNRECOGNIZED(rawValue)
}
}

public var rawValue: Int {
switch self {
case .null: return 0
case .unknownError: return 1
case .badInput: return 2
case .noSuchSpace: return 101
case .spaceIsDeleted: return 102
case .requestFailed: return 103
case .UNRECOGNIZED(let i): return i
}
}

}

public init() {}
}

public init() {}

fileprivate var _error: Anytype_Rpc.Space.StopSharing.Response.Error? = nil
}

public init() {}
}

public struct InviteGetCurrent {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
Expand Down Expand Up @@ -5904,6 +6001,8 @@ public struct Anytype_Rpc {
/// Clears the value of `details`. Subsequent reads from it will return its default value.
public mutating func clearDetails() {self._details = nil}

public var addPageContent: Bool = false

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}
Expand Down Expand Up @@ -26140,6 +26239,18 @@ extension Anytype_Rpc.Space.InviteGenerate.Response.Error.Code: CaseIterable {
]
}

extension Anytype_Rpc.Space.StopSharing.Response.Error.Code: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
public static let allCases: [Anytype_Rpc.Space.StopSharing.Response.Error.Code] = [
.null,
.unknownError,
.badInput,
.noSuchSpace,
.spaceIsDeleted,
.requestFailed,
]
}

extension Anytype_Rpc.Space.InviteGetCurrent.Response.Error.Code: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
public static let allCases: [Anytype_Rpc.Space.InviteGetCurrent.Response.Error.Code] = [
Expand Down Expand Up @@ -28501,6 +28612,11 @@ extension Anytype_Rpc.Space.InviteGenerate.Request: @unchecked Sendable {}
extension Anytype_Rpc.Space.InviteGenerate.Response: @unchecked Sendable {}
extension Anytype_Rpc.Space.InviteGenerate.Response.Error: @unchecked Sendable {}
extension Anytype_Rpc.Space.InviteGenerate.Response.Error.Code: @unchecked Sendable {}
extension Anytype_Rpc.Space.StopSharing: @unchecked Sendable {}
extension Anytype_Rpc.Space.StopSharing.Request: @unchecked Sendable {}
extension Anytype_Rpc.Space.StopSharing.Response: @unchecked Sendable {}
extension Anytype_Rpc.Space.StopSharing.Response.Error: @unchecked Sendable {}
extension Anytype_Rpc.Space.StopSharing.Response.Error.Code: @unchecked Sendable {}
extension Anytype_Rpc.Space.InviteGetCurrent: @unchecked Sendable {}
extension Anytype_Rpc.Space.InviteGetCurrent.Request: @unchecked Sendable {}
extension Anytype_Rpc.Space.InviteGetCurrent.Response: @unchecked Sendable {}
Expand Down Expand Up @@ -30385,6 +30501,142 @@ extension Anytype_Rpc.Space.InviteGenerate.Response.Error.Code: SwiftProtobuf._P
]
}

extension Anytype_Rpc.Space.StopSharing: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Anytype_Rpc.Space.protoMessageName + ".StopSharing"
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let _ = try decoder.nextFieldNumber() {
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Anytype_Rpc.Space.StopSharing, rhs: Anytype_Rpc.Space.StopSharing) -> Bool {
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Anytype_Rpc.Space.StopSharing.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Anytype_Rpc.Space.StopSharing.protoMessageName + ".Request"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "spaceId"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.spaceID) }()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.spaceID.isEmpty {
try visitor.visitSingularStringField(value: self.spaceID, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Anytype_Rpc.Space.StopSharing.Request, rhs: Anytype_Rpc.Space.StopSharing.Request) -> Bool {
if lhs.spaceID != rhs.spaceID {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Anytype_Rpc.Space.StopSharing.Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Anytype_Rpc.Space.StopSharing.protoMessageName + ".Response"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "error"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularMessageField(value: &self._error) }()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every if/case branch local when no optimizations
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
// https://github.com/apple/swift-protobuf/issues/1182
try { if let v = self._error {
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
} }()
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Anytype_Rpc.Space.StopSharing.Response, rhs: Anytype_Rpc.Space.StopSharing.Response) -> Bool {
if lhs._error != rhs._error {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Anytype_Rpc.Space.StopSharing.Response.Error: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Anytype_Rpc.Space.StopSharing.Response.protoMessageName + ".Error"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "code"),
2: .same(proto: "description"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.description_p) }()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.code != .null {
try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1)
}
if !self.description_p.isEmpty {
try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Anytype_Rpc.Space.StopSharing.Response.Error, rhs: Anytype_Rpc.Space.StopSharing.Response.Error) -> Bool {
if lhs.code != rhs.code {return false}
if lhs.description_p != rhs.description_p {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Anytype_Rpc.Space.StopSharing.Response.Error.Code: SwiftProtobuf._ProtoNameProviding {
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
0: .same(proto: "NULL"),
1: .same(proto: "UNKNOWN_ERROR"),
2: .same(proto: "BAD_INPUT"),
101: .same(proto: "NO_SUCH_SPACE"),
102: .same(proto: "SPACE_IS_DELETED"),
103: .same(proto: "REQUEST_FAILED"),
]
}

extension Anytype_Rpc.Space.InviteGetCurrent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Anytype_Rpc.Space.protoMessageName + ".InviteGetCurrent"
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()
Expand Down Expand Up @@ -37803,6 +38055,7 @@ extension Anytype_Rpc.Object.CreateFromUrl.Request: SwiftProtobuf.Message, Swift
2: .same(proto: "objectTypeUniqueKey"),
3: .same(proto: "url"),
4: .same(proto: "details"),
5: .same(proto: "addPageContent"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
Expand All @@ -37815,6 +38068,7 @@ extension Anytype_Rpc.Object.CreateFromUrl.Request: SwiftProtobuf.Message, Swift
case 2: try { try decoder.decodeSingularStringField(value: &self.objectTypeUniqueKey) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.url) }()
case 4: try { try decoder.decodeSingularMessageField(value: &self._details) }()
case 5: try { try decoder.decodeSingularBoolField(value: &self.addPageContent) }()
default: break
}
}
Expand All @@ -37837,6 +38091,9 @@ extension Anytype_Rpc.Object.CreateFromUrl.Request: SwiftProtobuf.Message, Swift
try { if let v = self._details {
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
} }()
if self.addPageContent != false {
try visitor.visitSingularBoolField(value: self.addPageContent, fieldNumber: 5)
}
try unknownFields.traverse(visitor: &visitor)
}

Expand All @@ -37845,6 +38102,7 @@ extension Anytype_Rpc.Object.CreateFromUrl.Request: SwiftProtobuf.Message, Swift
if lhs.objectTypeUniqueKey != rhs.objectTypeUniqueKey {return false}
if lhs.url != rhs.url {return false}
if lhs._details != rhs._details {return false}
if lhs.addPageContent != rhs.addPageContent {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public extension BundledRelationKey {
.spaceInviteFileKey,
.participantPermissions,
.participantStatus,
.latestAclHeadId,
.identity,
]
}
3 changes: 3 additions & 0 deletions Modules/Services/Sources/Generated/BundledRelationKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public enum BundledRelationKey: String {
/// Relation option color
case relationOptionColor = "relationOptionColor"

/// Latest Acl head id
case latestAclHeadId = "latestAclHeadId"

case instructions = "instructions"

/// Done checkbox used to render action layout.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public protocol BundledRelationsValueProvider {
var relationFormatObjectTypes: [ObjectId] { get }
var relationKey: String { get }
var relationOptionColor: String { get }
var latestAclHeadId: String { get }
var instructions: String { get }
var done: Bool { get }
var mediaArtistURL: AnytypeURL? { get }
Expand Down Expand Up @@ -207,6 +208,10 @@ public extension BundledRelationsValueProvider where Self: RelationValueProvider
var relationOptionColor: String {
return value(for: BundledRelationKey.relationOptionColor.rawValue)
}
/// Latest Acl head id
var latestAclHeadId: String {
return value(for: BundledRelationKey.latestAclHeadId.rawValue)
}
var instructions: String {
return value(for: BundledRelationKey.instructions.rawValue)
}
Expand Down

0 comments on commit 5f4cebe

Please sign in to comment.