-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply updates from yorkie-js-sdk v0.4.27 (#192)
* Added the generated ErrorInfo model from googleapis/google/rpc/error_details.proto * Add YorkieService wrapper for YorkieServiceClient with API mocking support * Handle retry for syncLoop and watchLoop / Handle ErrClientNotActivated and ErrClientNotFound * Fix watch loop reconnect timer issue in manual syncMode * Fix ensure onlineClients are reset on document detach * Handle local changes correctly when receiving snapshot * Fix Xcode warnings * Apply SwiftFormat * Fix 1 failing test in ClientIntegrationTests * Apply review comments by coderabbitai
- Loading branch information
1 parent
095ad46
commit 1aa3dd8
Showing
16 changed files
with
832 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
Sources/API/V1/Generated/googleapis/google/rpc/error_details.pb.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// DO NOT EDIT. | ||
// swift-format-ignore-file | ||
// swiftlint:disable all | ||
// | ||
// Generated by the Swift generator plugin for the protocol buffer compiler. | ||
// Source: googleapis/google/rpc/error_details.proto | ||
// | ||
// For information on using the generated types, please see the documentation: | ||
// https://github.com/apple/swift-protobuf/ | ||
|
||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import SwiftProtobuf | ||
|
||
// If the compiler emits an error on this type, it is because this file | ||
// was generated by a version of the `protoc` Swift plug-in that is | ||
// incompatible with the version of SwiftProtobuf to which you are linking. | ||
// Please ensure that you are building against the same version of the API | ||
// that was used to generate this file. | ||
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { | ||
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} | ||
typealias Version = _2 | ||
} | ||
|
||
public struct Google_Rpc_ErrorInfo: @unchecked Sendable { | ||
// 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. | ||
|
||
/// The reason of the error. This is a constant value that identifies the | ||
/// proximate cause of the error. Error reasons are unique within a particular | ||
/// domain of errors. This should be at most 63 characters and match a | ||
/// regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents | ||
/// UPPER_SNAKE_CASE. | ||
public var reason: String = String() | ||
|
||
/// The logical grouping to which the "reason" belongs. The error domain | ||
/// is typically the registered service name of the tool or product that | ||
/// generates the error. Example: "pubsub.googleapis.com". If the error is | ||
/// generated by some common infrastructure, the error domain must be a | ||
/// globally unique value that identifies the infrastructure. For Google API | ||
/// infrastructure, the error domain is "googleapis.com". | ||
public var domain: String = String() | ||
|
||
/// Additional structured details about this error. | ||
/// | ||
/// Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should | ||
/// ideally be lowerCamelCase. Also, they must be limited to 64 characters in | ||
/// length. When identifying the current value of an exceeded limit, the units | ||
/// should be contained in the key, not the value. For example, rather than | ||
/// `{"instanceLimit": "100/request"}`, should be returned as, | ||
/// `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of | ||
/// instances that can be created in a single (batch) request. | ||
public var metadata: Dictionary<String,String> = [:] | ||
|
||
public var unknownFields = SwiftProtobuf.UnknownStorage() | ||
|
||
public init() {} | ||
} | ||
|
||
// MARK: - Code below here is support for the SwiftProtobuf runtime. | ||
|
||
fileprivate let _protobuf_package = "google.rpc" | ||
|
||
extension Google_Rpc_ErrorInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { | ||
public static let protoMessageName: String = _protobuf_package + ".ErrorInfo" | ||
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ | ||
1: .same(proto: "reason"), | ||
2: .same(proto: "domain"), | ||
3: .same(proto: "metadata"), | ||
] | ||
|
||
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.reason) }() | ||
case 2: try { try decoder.decodeSingularStringField(value: &self.domain) }() | ||
case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.metadata) }() | ||
default: break | ||
} | ||
} | ||
} | ||
|
||
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { | ||
if !self.reason.isEmpty { | ||
try visitor.visitSingularStringField(value: self.reason, fieldNumber: 1) | ||
} | ||
if !self.domain.isEmpty { | ||
try visitor.visitSingularStringField(value: self.domain, fieldNumber: 2) | ||
} | ||
if !self.metadata.isEmpty { | ||
try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.metadata, fieldNumber: 3) | ||
} | ||
try unknownFields.traverse(visitor: &visitor) | ||
} | ||
|
||
public static func ==(lhs: Google_Rpc_ErrorInfo, rhs: Google_Rpc_ErrorInfo) -> Bool { | ||
if lhs.reason != rhs.reason {return false} | ||
if lhs.domain != rhs.domain {return false} | ||
if lhs.metadata != rhs.metadata {return false} | ||
if lhs.unknownFields != rhs.unknownFields {return false} | ||
return true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.rpc; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "ErrorDetailsProto"; | ||
option java_package = "com.google.rpc"; | ||
option objc_class_prefix = "RPC"; | ||
|
||
message ErrorInfo { | ||
// The reason of the error. This is a constant value that identifies the | ||
// proximate cause of the error. Error reasons are unique within a particular | ||
// domain of errors. This should be at most 63 characters and match a | ||
// regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents | ||
// UPPER_SNAKE_CASE. | ||
string reason = 1; | ||
|
||
// The logical grouping to which the "reason" belongs. The error domain | ||
// is typically the registered service name of the tool or product that | ||
// generates the error. Example: "pubsub.googleapis.com". If the error is | ||
// generated by some common infrastructure, the error domain must be a | ||
// globally unique value that identifies the infrastructure. For Google API | ||
// infrastructure, the error domain is "googleapis.com". | ||
string domain = 2; | ||
|
||
// Additional structured details about this error. | ||
// | ||
// Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should | ||
// ideally be lowerCamelCase. Also, they must be limited to 64 characters in | ||
// length. When identifying the current value of an exceeded limit, the units | ||
// should be contained in the key, not the value. For example, rather than | ||
// `{"instanceLimit": "100/request"}`, should be returned as, | ||
// `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of | ||
// instances that can be created in a single (batch) request. | ||
map<string, string> metadata = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.