Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Remove unused Darwin Ente packages

Manav Rathi81fbef09b6b4
diff --git a/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.pbxproj b/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.pbxproj
index 0289e9184d..b998bac731 100644
--- a/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.pbxproj
+++ b/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.pbxproj
@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
A10000012F11111100AA0001 /* InferenceIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A10000022F11111100AA0001 /* InferenceIntegrationTests.swift */; };
- DACC3DCA2E618D6A00DAF993 /* EnteCore in Frameworks */ = {isa = PBXBuildFile; productRef = DACC3DCB2E618D6A00DAF993 /* EnteCore */; };
DAF584672E61BB8300F8A08F /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = DAF584662E61BB8300F8A08F /* ZIPFoundation */; };
DB9F1C3C2F9D123400ABCD02 /* Markdown in Frameworks */ = {isa = PBXBuildFile; productRef = DB9F1C3B2F9D123400ABCD02 /* Markdown */; };
DBA3E91C2F7A6B9000AA11BB /* SwiftMath in Frameworks */ = {isa = PBXBuildFile; productRef = DBA3E91B2F7A6B9000AA11BB /* SwiftMath */; };
@@ -64,7 +63,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- DACC3DCA2E618D6A00DAF993 /* EnteCore in Frameworks */,
DAF584672E61BB8300F8A08F /* ZIPFoundation in Frameworks */,
DBA3E91C2F7A6B9000AA11BB /* SwiftMath in Frameworks */,
DB9F1C3C2F9D123400ABCD02 /* Markdown in Frameworks */,
@@ -150,7 +148,6 @@
);
name = Ensu;
packageProductDependencies = (
- DACC3DCB2E618D6A00DAF993 /* EnteCore */,
DAF584662E61BB8300F8A08F /* ZIPFoundation */,
DBA3E91B2F7A6B9000AA11BB /* SwiftMath */,
DB9F1C3B2F9D123400ABCD02 /* Markdown */,
@@ -189,7 +186,6 @@
mainGroup = DA72BC582E5F87A000D128FF;
minimizedProjectReferenceProxies = 1;
packageReferences = (
- DACC3DCC2E618D5300DAF993 /* XCLocalSwiftPackageReference "../../Packages/EnteCore" */,
DBA3E91A2F7A6B9000AA11BB /* XCRemoteSwiftPackageReference "SwiftMath" */,
DAF584652E61BB6300F8A08F /* XCRemoteSwiftPackageReference "ZIPFoundation" */,
DB9F1C3A2F9D123400ABCD02 /* XCRemoteSwiftPackageReference "swift-markdown" */,
@@ -587,13 +583,6 @@
};
/* End XCConfigurationList section */
-/* Begin XCLocalSwiftPackageReference section */
- DACC3DCC2E618D5300DAF993 /* XCLocalSwiftPackageReference "../../Packages/EnteCore" */ = {
- isa = XCLocalSwiftPackageReference;
- relativePath = ../../Packages/EnteCore;
- };
-/* End XCLocalSwiftPackageReference section */
-
/* Begin XCRemoteSwiftPackageReference section */
DAF584652E61BB6300F8A08F /* XCRemoteSwiftPackageReference "ZIPFoundation" */ = {
isa = XCRemoteSwiftPackageReference;
@@ -630,10 +619,6 @@
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
- DACC3DCB2E618D6A00DAF993 /* EnteCore */ = {
- isa = XCSwiftPackageProductDependency;
- productName = EnteCore;
- };
DAF584662E61BB8300F8A08F /* ZIPFoundation */ = {
isa = XCSwiftPackageProductDependency;
package = DAF584652E61BB6300F8A08F /* XCRemoteSwiftPackageReference "ZIPFoundation" */;
diff --git a/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 92ceb566dc..8f4aaba647 100644
--- a/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/mobile/native/darwin/Apps/Ensu/Ensu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -19,15 +19,6 @@
"version" : "0.7.1"
}
},
- {
- "identity" : "swift-log",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/apple/swift-log.git",
- "state" : {
- "revision" : "2778fd4e5a12a8aaa30a3ee8285f4ce54c5f3181",
- "version" : "1.9.1"
- }
- },
{
"identity" : "swift-markdown",
"kind" : "remoteSourceControl",
@@ -37,15 +28,6 @@
"version" : "0.7.3"
}
},
- {
- "identity" : "swift-tagged",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/pointfreeco/swift-tagged.git",
- "state" : {
- "revision" : "3907a9438f5b57d317001dc99f3f11b46882272b",
- "version" : "0.10.0"
- }
- },
{
"identity" : "swiftmath",
"kind" : "remoteSourceControl",
diff --git a/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift b/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift
index d3aad6b74c..5ba9d0bd94 100644
--- a/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift
+++ b/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift
@@ -1,7 +1,5 @@
import Foundation
import SwiftUI
-import EnteCore
-
typealias LlmChatSession = Session
diff --git a/mobile/native/darwin/Packages/EnteCore/Package.resolved b/mobile/native/darwin/Packages/EnteCore/Package.resolved
deleted file mode 100644
index 1e52e1ff8f..0000000000
--- a/mobile/native/darwin/Packages/EnteCore/Package.resolved
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "pins" : [
- {
- "identity" : "swift-log",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/apple/swift-log.git",
- "state" : {
- "revision" : "ce592ae52f982c847a4efc0dd881cc9eb32d29f2",
- "version" : "1.6.4"
- }
- },
- {
- "identity" : "swift-tagged",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/pointfreeco/swift-tagged.git",
- "state" : {
- "revision" : "3907a9438f5b57d317001dc99f3f11b46882272b",
- "version" : "0.10.0"
- }
- }
- ],
- "version" : 2
-}
diff --git a/mobile/native/darwin/Packages/EnteCore/Package.swift b/mobile/native/darwin/Packages/EnteCore/Package.swift
deleted file mode 100644
index 96298b6e6c..0000000000
--- a/mobile/native/darwin/Packages/EnteCore/Package.swift
+++ /dev/null
@@ -1,34 +0,0 @@
-// swift-tools-version: 5.9
-import PackageDescription
-
-let package = Package(
- name: "EnteCore",
- platforms: [
- .iOS(.v15),
- .tvOS(.v15),
- .macOS(.v12)
- ],
- products: [
- .library(
- name: "EnteCore",
- targets: ["EnteCore"]
- ),
- ],
- dependencies: [
- .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
- .package(url: "https://github.com/pointfreeco/swift-tagged.git", from: "0.10.0"),
- ],
- targets: [
- .target(
- name: "EnteCore",
- dependencies: [
- .product(name: "Logging", package: "swift-log"),
- .product(name: "Tagged", package: "swift-tagged"),
- ]
- ),
- .testTarget(
- name: "EnteCoreTests",
- dependencies: ["EnteCore"]
- ),
- ]
-)
diff --git a/mobile/native/darwin/Packages/EnteCore/Sources/EnteCore/EnteCore.swift b/mobile/native/darwin/Packages/EnteCore/Sources/EnteCore/EnteCore.swift
deleted file mode 100644
index 0954ab691c..0000000000
--- a/mobile/native/darwin/Packages/EnteCore/Sources/EnteCore/EnteCore.swift
+++ /dev/null
@@ -1,131 +0,0 @@
-import Foundation
-import Tagged
-
-// MARK: - Basic Types
-
-/// Strongly typed User ID
-public typealias UserID = Tagged<UserIDTag, Int64>
-public enum UserIDTag {}
-
-/// Strongly typed File ID
-public typealias FileID = Tagged<FileIDTag, Int64>
-public enum FileIDTag {}
-
-/// Strongly typed Collection ID
-public typealias CollectionID = Tagged<CollectionIDTag, Int64>
-public enum CollectionIDTag {}
-
-// MARK: - App Types
-
-public enum EnteApp: String, CaseIterable, Codable {
- case photos = "photos"
- case auth = "auth"
- case locker = "locker"
- case cast = "cast"
- case ensu = "ensu"
-
- public var displayName: String {
- switch self {
- case .photos: return "Ente Photos"
- case .auth: return "Ente Auth"
- case .locker: return "Ente Locker"
- case .cast: return "Ente Cast"
- case .ensu: return "Ensu"
- }
- }
-
- public var packageIdentifier: String {
- switch self {
- case .photos: return "io.ente.photos"
- case .auth: return "io.ente.auth"
- case .locker: return "io.ente.locker"
- case .cast: return "io.ente.photos.cast"
- case .ensu: return "io.ente.ensu"
- }
- }
-}
-
-// MARK: - Platform Detection
-
-public enum EntePlatform: String {
- case iOS = "ios"
- case tvOS = "tvos"
- case macOS = "macos"
-
- public static var current: EntePlatform {
- #if os(iOS)
- return .iOS
- #elseif os(tvOS)
- return .tvOS
- #elseif os(macOS)
- return .macOS
- #endif
- }
-
- public var userAgent: String {
- switch self {
- case .iOS: return "EnteNative-iOS"
- case .tvOS: return "EnteNative-tvOS"
- case .macOS: return "EnteNative-macOS"
- }
- }
-}
-
-// MARK: - Encrypted Data
-
-public struct EncryptedData: Codable, Equatable {
- public let data: String
- public let nonce: String?
-
- public init(data: String, nonce: String? = nil) {
- self.data = data
- self.nonce = nonce
- }
-}
-
-// MARK: - Error Types
-
-public enum EnteError: Error, Equatable {
- case networkError(String)
- case authenticationError(String)
- case cryptographicError(String)
- case configurationError(String)
- case invalidResponse
- case unauthorized
- case serverError(Int, String?)
-
- public var localizedDescription: String {
- switch self {
- case .networkError(let message):
- return "Network error: \(message)"
- case .authenticationError(let message):
- return "Authentication error: \(message)"
- case .cryptographicError(let message):
- return "Cryptographic error: \(message)"
- case .configurationError(let message):
- return "Configuration error: \(message)"
- case .invalidResponse:
- return "Invalid server response"
- case .unauthorized:
- return "Unauthorized access"
- case .serverError(let code, let message):
- return "Server error (\(code)): \(message ?? "Unknown error")"
- }
- }
-}
-
-// MARK: - Common Response Types
-
-public struct EmptyResponse: Codable {
- public init() {}
-}
-
-public struct ErrorResponse: Codable {
- public let code: String?
- public let message: String
-
- public init(code: String? = nil, message: String) {
- self.code = code
- self.message = message
- }
-}
diff --git a/mobile/native/darwin/Packages/EnteCore/Tests/EnteCoreTests/EnteCoreTests.swift b/mobile/native/darwin/Packages/EnteCore/Tests/EnteCoreTests/EnteCoreTests.swift
deleted file mode 100644
index 60bef3b345..0000000000
--- a/mobile/native/darwin/Packages/EnteCore/Tests/EnteCoreTests/EnteCoreTests.swift
+++ /dev/null
@@ -1,6 +0,0 @@
-import Testing
-@testable import EnteCore
-
-@Test func example() async throws {
- // Write your test here and use APIs like `#expect(...)` to check expected conditions.
-}
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Package.resolved b/mobile/native/darwin/Packages/EnteNetwork/Package.resolved
deleted file mode 100644
index 1e52e1ff8f..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Package.resolved
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "pins" : [
- {
- "identity" : "swift-log",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/apple/swift-log.git",
- "state" : {
- "revision" : "ce592ae52f982c847a4efc0dd881cc9eb32d29f2",
- "version" : "1.6.4"
- }
- },
- {
- "identity" : "swift-tagged",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/pointfreeco/swift-tagged.git",
- "state" : {
- "revision" : "3907a9438f5b57d317001dc99f3f11b46882272b",
- "version" : "0.10.0"
- }
- }
- ],
- "version" : 2
-}
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Package.swift b/mobile/native/darwin/Packages/EnteNetwork/Package.swift
deleted file mode 100644
index aa57f8386f..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Package.swift
+++ /dev/null
@@ -1,34 +0,0 @@
-// swift-tools-version: 5.9
-import PackageDescription
-
-let package = Package(
- name: "EnteNetwork",
- platforms: [
- .iOS(.v15),
- .tvOS(.v15),
- .macOS(.v12)
- ],
- products: [
- .library(
- name: "EnteNetwork",
- targets: ["EnteNetwork"]
- ),
- ],
- dependencies: [
- .package(path: "../EnteCore"),
- .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
- ],
- targets: [
- .target(
- name: "EnteNetwork",
- dependencies: [
- "EnteCore",
- .product(name: "Logging", package: "swift-log"),
- ]
- ),
- .testTarget(
- name: "EnteNetworkTests",
- dependencies: ["EnteNetwork"]
- ),
- ]
-)
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift
deleted file mode 100644
index 27c5cbf576..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift
+++ /dev/null
@@ -1,114 +0,0 @@
-import Foundation
-import EnteCore
-
-// MARK: - Network Configuration
-
-public struct NetworkConfiguration {
- public let apiEndpoint: URL
- public let accountsEndpoint: URL?
- public let castEndpoint: URL?
- public let publicAlbumsEndpoint: URL?
- public let familyEndpoint: URL?
-
- public init(
- apiEndpoint: URL,
- accountsEndpoint: URL? = nil,
- castEndpoint: URL? = nil,
- publicAlbumsEndpoint: URL? = nil,
- familyEndpoint: URL? = nil
- ) {
- self.apiEndpoint = apiEndpoint
- self.accountsEndpoint = accountsEndpoint
- self.castEndpoint = castEndpoint
- self.publicAlbumsEndpoint = publicAlbumsEndpoint
- self.familyEndpoint = familyEndpoint
- }
-
- // Convenience initializer for self-hosted instances
- public static func selfHosted(baseURL: URL) -> NetworkConfiguration {
- return NetworkConfiguration(
- apiEndpoint: baseURL,
- accountsEndpoint: baseURL.appendingPathComponent("accounts"),
- castEndpoint: baseURL.appendingPathComponent("cast"),
- publicAlbumsEndpoint: baseURL.appendingPathComponent("public-albums"),
- familyEndpoint: baseURL.appendingPathComponent("family")
- )
- }
-
- // Default Ente configuration
- public static let `default` = NetworkConfiguration(
- apiEndpoint: URL(string: "https://api.ente.com")!,
- accountsEndpoint: URL(string: "https://accounts.ente.com"),
- castEndpoint: URL(string: "https://api.ente.com"), // Fix: Use same endpoint as web app
- publicAlbumsEndpoint: URL(string: "https://albums.ente.com"),
- familyEndpoint: URL(string: "https://family.ente.io")
- )
-}
-
-// MARK: - Environment Configuration
-
-public enum EnteEnvironment {
- case production
- case staging
- case development
- case selfHosted(URL)
-
- public var networkConfiguration: NetworkConfiguration {
- switch self {
- case .production:
- return .default
- case .staging:
- return NetworkConfiguration(
- apiEndpoint: URL(string: "https://api.staging.ente.io")!,
- accountsEndpoint: URL(string: "https://accounts.staging.ente.io"),
- castEndpoint: URL(string: "https://cast.staging.ente.io")
- )
- case .development:
- return NetworkConfiguration(
- apiEndpoint: URL(string: "http://localhost:8080")!
- )
- case .selfHosted(let baseURL):
- return NetworkConfiguration.selfHosted(baseURL: baseURL)
- }
- }
-}
-
-// MARK: - API Domain
-
-public enum APIDomain {
- case api // Main API server
- case accounts // Account management
- case cast // TV/Cast operations
- case publicAlbums // Public album sharing
- case family // Family plan management
-}
-
-// MARK: - Endpoint Resolver
-
-public class EndpointResolver {
- private let configuration: NetworkConfiguration
-
- public init(configuration: NetworkConfiguration) {
- self.configuration = configuration
- }
-
- public func resolveURL(for endpoint: APIEndpoint) -> URL {
- let baseURL = resolveBaseURL(for: endpoint.domain)
- return baseURL.appendingPathComponent(endpoint.path)
- }
-
- private func resolveBaseURL(for domain: APIDomain) -> URL {
- switch domain {
- case .api:
- return configuration.apiEndpoint
- case .accounts:
- return configuration.accountsEndpoint ?? configuration.apiEndpoint
- case .cast:
- return configuration.castEndpoint ?? configuration.apiEndpoint
- case .publicAlbums:
- return configuration.publicAlbumsEndpoint ?? configuration.apiEndpoint
- case .family:
- return configuration.familyEndpoint ?? configuration.apiEndpoint
- }
- }
-}
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/APIClient.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/APIClient.swift
deleted file mode 100644
index 5fee3cc711..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/APIClient.swift
+++ /dev/null
@@ -1,98 +0,0 @@
-import Foundation
-import EnteCore
-import Logging
-
-// MARK: - API Client
-
-public class APIClient {
- private let httpClient: HTTPClient
- private let endpointResolver: EndpointResolver
- private let headersManager: RequestHeadersManager
- private let authTokenProvider: AuthTokenProvider?
- private let app: EnteApp
- private let logger = Logger(label: "APIClient")
-
- public init(
- configuration: NetworkConfiguration,
- app: EnteApp,
- authTokenProvider: AuthTokenProvider? = nil,
- httpClient: HTTPClient = HTTPClient()
- ) {
- self.httpClient = httpClient
- self.endpointResolver = EndpointResolver(configuration: configuration)
- self.headersManager = RequestHeadersManager()
- self.authTokenProvider = authTokenProvider
- self.app = app
- }
-
- public func request<T: Codable>(_ endpoint: APIEndpoint, responseType: T.Type) async throws -> T {
- let url = endpointResolver.resolveURL(for: endpoint)
- let headers = await buildHeaders(for: endpoint)
-
- logger.debug("Making request to \(url.enteRedactedForLogging)")
-
- return try await httpClient.request(
- url: url,
- method: endpoint.method,
- parameters: endpoint.parameters,
- headers: headers,
- responseType: responseType
- )
- }
-
- public func request(_ endpoint: APIEndpoint) async throws -> EmptyResponse {
- return try await request(endpoint, responseType: EmptyResponse.self)
- }
-
- public func upload(_ endpoint: APIEndpoint, data: Data) async throws -> Data {
- let url = endpointResolver.resolveURL(for: endpoint)
- let headers = await buildHeaders(for: endpoint)
-
- return try await httpClient.upload(url: url, data: data, headers: headers)
- }
-
- public func download(_ endpoint: APIEndpoint) async throws -> Data {
- let url = endpointResolver.resolveURL(for: endpoint)
- let headers = await buildHeaders(for: endpoint)
-
- return try await httpClient.download(url: url, headers: headers)
- }
-
- private func buildHeaders(for endpoint: APIEndpoint) async -> [String: String] {
- // Start with endpoint-specific headers
- var headers = endpoint.headers ?? [:]
-
- // Add common headers (mirrors mobile network.dart pattern)
- let commonHeaders = await headersManager.buildHeaders(
- app: app,
- authTokenProvider: authTokenProvider
- )
-
- // Merge headers (endpoint headers take precedence)
- for (key, value) in commonHeaders {
- if headers[key] == nil {
- headers[key] = value
- }
- }
-
- return headers
- }
-}
-
-// MARK: - Simple Auth Token Provider
-
-public class SimpleAuthTokenProvider: AuthTokenProvider {
- private var token: String?
-
- public init(token: String? = nil) {
- self.token = token
- }
-
- public func getAuthToken() async throws -> String? {
- return token
- }
-
- public func setAuthToken(_ token: String?) {
- self.token = token
- }
-}
\ No newline at end of file
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/APIEndpoint.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/APIEndpoint.swift
deleted file mode 100644
index 483fdadf18..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/APIEndpoint.swift
+++ /dev/null
@@ -1,196 +0,0 @@
-import Foundation
-import EnteCore
-
-// MARK: - API Endpoint Protocol
-
-public protocol APIEndpoint {
- var domain: APIDomain { get }
- var path: String { get }
- var method: HTTPMethod { get }
- var parameters: [String: Any]? { get }
- var headers: [String: String]? { get }
-}
-
-// MARK: - Authentication Endpoints
-
-public enum AuthEndpoint: APIEndpoint {
- case getSRPAttributes(email: String)
- case createSRPSession(srpUserID: String, clientPub: String)
- case verifySRPSession(srpUserID: String, sessionID: String, clientM1: String)
- case sendLoginOTP(email: String, purpose: String)
- case verifyEmail(email: String, otp: String)
- case verifyTOTP(sessionID: String, otp: String)
- case getTokenForPasskeySession(sessionID: String)
-
- public var domain: APIDomain {
- return .api
- }
-
- public var path: String {
- switch self {
- case .getSRPAttributes:
- return "/users/srp/attributes"
- case .createSRPSession:
- return "/users/srp/create-session"
- case .verifySRPSession:
- return "/users/srp/verify-session"
- case .sendLoginOTP:
- return "/users/ott"
- case .verifyEmail:
- return "/users/verify-email"
- case .verifyTOTP:
- return "/users/two-factor/verify"
- case .getTokenForPasskeySession:
- return "/users/two-factor/passkeys/get-token"
- }
- }
-
- public var method: HTTPMethod {
- switch self {
- case .getSRPAttributes, .getTokenForPasskeySession:
- return .GET
- case .createSRPSession, .verifySRPSession, .sendLoginOTP, .verifyEmail, .verifyTOTP:
- return .POST
- }
- }
-
- public var parameters: [String: Any]? {
- switch self {
- case .getSRPAttributes(let email):
- return ["email": email]
- case .createSRPSession(let srpUserID, let clientPub):
- return ["srpUserID": srpUserID, "srpA": clientPub]
- case .verifySRPSession(let srpUserID, let sessionID, let clientM1):
- return ["srpUserID": srpUserID, "sessionID": sessionID, "srpM1": clientM1]
- case .sendLoginOTP(let email, let purpose):
- return ["email": email, "purpose": purpose]
- case .verifyEmail(let email, let otp):
- return ["email": email, "ott": otp]
- case .verifyTOTP(let sessionID, let otp):
- return ["sessionID": sessionID, "code": otp]
- case .getTokenForPasskeySession(let sessionID):
- return ["sessionID": sessionID]
- }
- }
-
- public var headers: [String: String]? { return nil }
-}
-
-// MARK: - Cast Endpoints (TV-specific)
-
-public enum CastEndpoint: APIEndpoint {
- case registerDevice
- case getDeviceInfo(deviceCode: String)
- case getCastData(deviceCode: String)
- case insertCastData([String: Any])
- case revokeAllTokens
- case getThumbnail(fileID: FileID)
- case getFile(fileID: FileID)
- case getDiff(sinceTime: Int64)
- case getCollection
-
- public var domain: APIDomain {
- return .cast // All cast operations use cast domain
- }
-
- public var path: String {
- switch self {
- case .registerDevice:
- return "/cast/device-info"
- case .getDeviceInfo(let code):
- return "/cast/device-info/\(code)"
- case .getCastData(let code):
- return "/cast/cast-data/\(code)"
- case .insertCastData:
- return "/cast/cast-data"
- case .revokeAllTokens:
- return "/cast/revoke-all-tokens"
- case .getThumbnail(let fileID):
- return "/files/preview/\(fileID.rawValue)"
- case .getFile(let fileID):
- return "/files/download/\(fileID.rawValue)"
- case .getDiff:
- return "/diff"
- case .getCollection:
- return "/info"
- }
- }
-
- public var method: HTTPMethod {
- switch self {
- case .registerDevice, .insertCastData:
- return .POST
- case .revokeAllTokens:
- return .DELETE
- case .getDeviceInfo, .getCastData, .getThumbnail, .getFile, .getDiff, .getCollection:
- return .GET
- }
- }
-
- public var parameters: [String: Any]? {
- switch self {
- case .getDiff(let sinceTime):
- return ["sinceTime": sinceTime]
- case .insertCastData(let data):
- return data
- default:
- return nil
- }
- }
-
- public var headers: [String: String]? { return nil }
-}
-
-// MARK: - User Endpoints
-
-public enum UserEndpoint: APIEndpoint {
- case getUserDetails(fetchMemoryCount: Bool)
- case logout
- case getActiveSessions
- case terminateSession(sessionID: String)
- case deleteUser(challenge: String)
- case getDeleteChallenge
-
- public var domain: APIDomain { return .api }
-
- public var path: String {
- switch self {
- case .getUserDetails:
- return "/users/details/v2"
- case .logout:
- return "/users/logout"
- case .getActiveSessions:
- return "/users/sessions"
- case .terminateSession:
- return "/users/session"
- case .deleteUser:
- return "/users/delete"
- case .getDeleteChallenge:
- return "/users/delete-challenge"
- }
- }
-
- public var method: HTTPMethod {
- switch self {
- case .getUserDetails, .getActiveSessions, .getDeleteChallenge:
- return .GET
- case .logout:
- return .POST
- case .terminateSession, .deleteUser:
- return .DELETE
- }
- }
-
- public var parameters: [String: Any]? {
- switch self {
- case .getUserDetails(let fetchMemoryCount):
- return ["memoryCount": fetchMemoryCount]
- case .deleteUser(let challenge):
- return ["challenge": challenge]
- default:
- return nil
- }
- }
-
- public var headers: [String: String]? { return nil }
-}
\ No newline at end of file
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/HTTPClient.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/HTTPClient.swift
deleted file mode 100644
index b5dba5d2cd..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Core/HTTPClient.swift
+++ /dev/null
@@ -1,237 +0,0 @@
-import Foundation
-import EnteCore
-import Logging
-
-extension URL {
- /// A log-safe representation of the URL that strips query parameters.
- ///
- /// Query parameters can contain user identifiers (e.g. email) or tokens in some flows.
- var enteRedactedForLogging: String {
- guard var components = URLComponents(url: self, resolvingAgainstBaseURL: false) else {
- return absoluteString
- }
- components.query = nil
- return components.url?.absoluteString ?? absoluteString
- }
-}
-
-// MARK: - HTTP Method
-
-public enum HTTPMethod: String {
- case GET = "GET"
- case POST = "POST"
- case PUT = "PUT"
- case DELETE = "DELETE"
- case PATCH = "PATCH"
-}
-
-// MARK: - Auth Token Provider
-
-public protocol AuthTokenProvider {
- func getAuthToken() async throws -> String?
-}
-
-// MARK: - HTTP Headers Builder
-
-public struct HTTPHeaders {
- private var headers: [String: String] = [:]
-
- public init() {}
-
- public mutating func add(name: String, value: String) {
- headers[name] = value
- }
-
- public func build() -> [String: String] {
- return headers
- }
-}
-
-// MARK: - Request Headers Manager
-
-public class RequestHeadersManager {
- private let logger = Logger(label: "RequestHeadersManager")
-
- public init() {}
-
- /// Builds headers based on mobile packages pattern - mirrors network.dart
- public func buildHeaders(
- app: EnteApp,
- authTokenProvider: AuthTokenProvider? = nil
- ) async -> [String: String] {
- var headers = HTTPHeaders()
-
- // Platform-specific User-Agent (mirrors mobile pattern)
- let platform = EntePlatform.current
- headers.add(name: "User-Agent", value: platform.userAgent)
-
- // Client version - using bundle version
- if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
- headers.add(name: "X-Client-Version", value: version)
- }
-
- // Client package - mirrors mobile packageName pattern
- headers.add(name: "X-Client-Package", value: app.packageIdentifier)
-
- // Request ID for tracing (mirrors mobile x-request-id)
- headers.add(name: "x-request-id", value: UUID().uuidString)
-
- // Auth token if available (mirrors mobile X-Auth-Token)
- if let token = try? await authTokenProvider?.getAuthToken() {
- headers.add(name: "X-Auth-Token", value: token)
- }
-
- return headers.build()
- }
-}
-
-// MARK: - HTTP Client
-
-public class HTTPClient {
- private let session: URLSession
- private let headersManager: RequestHeadersManager
- private let logger = Logger(label: "HTTPClient")
-
- public init(
- session: URLSession = .shared,
- headersManager: RequestHeadersManager = RequestHeadersManager()
- ) {
- self.session = session
- self.headersManager = headersManager
- }
-
- public func request<T: Codable>(
- url: URL,
- method: HTTPMethod,
- parameters: [String: Any]? = nil,
- headers: [String: String]? = nil,
- responseType: T.Type
- ) async throws -> T {
- var finalURL = url
-
- // For GET requests, add parameters as query parameters
- if let parameters = parameters, method == .GET {
- var components = URLComponents(url: url, resolvingAgainstBaseURL: false)!
- var queryItems = components.queryItems ?? []
-
- for (key, value) in parameters {
- // URLQueryItem will handle proper encoding automatically
- queryItems.append(URLQueryItem(name: key, value: "\(value)"))
- }
-
- components.queryItems = queryItems
- components.percentEncodedQuery = components.percentEncodedQuery?.replacingOccurrences(of: "+", with: "%2B")
- finalURL = components.url!
- }
-
- var request = URLRequest(url: finalURL)
- request.httpMethod = method.rawValue
-
- // Add headers
- if let headers = headers {
- for (key, value) in headers {
- request.setValue(value, forHTTPHeaderField: key)
- }
- }
-
- // Add JSON body for POST/PUT requests
- if let parameters = parameters,
- method == .POST || method == .PUT || method == .PATCH {
- request.setValue("application/json", forHTTPHeaderField: "Content-Type")
- request.httpBody = try JSONSerialization.data(withJSONObject: parameters)
- }
-
- logger.debug("Making \(method.rawValue) request to \(finalURL.enteRedactedForLogging)")
-
- let (data, response) = try await session.data(for: request)
-
- guard let httpResponse = response as? HTTPURLResponse else {
- throw EnteError.networkError("Invalid response type")
- }
-
- logger.debug("Response status: \(httpResponse.statusCode)")
-
- // Handle error responses
- if httpResponse.statusCode >= 400 {
- if let errorResponse = try? JSONDecoder().decode(ErrorResponse.self, from: data) {
- throw EnteError.serverError(httpResponse.statusCode, errorResponse.message)
- } else {
- throw EnteError.serverError(httpResponse.statusCode, nil)
- }
- }
-
- // Handle empty responses
- if T.self == EmptyResponse.self {
- return EmptyResponse() as! T
- }
-
- // Decode JSON response
- do {
- let decoder = JSONDecoder()
- return try decoder.decode(T.self, from: data)
- } catch {
- logger.error("Failed to decode response: \(error)")
- throw EnteError.invalidResponse
- }
- }
-
- public func upload(
- url: URL,
- data: Data,
- headers: [String: String]? = nil
- ) async throws -> Data {
- var request = URLRequest(url: url)
- request.httpMethod = "POST"
- request.httpBody = data
-
- // Add headers
- if let headers = headers {
- for (key, value) in headers {
- request.setValue(value, forHTTPHeaderField: key)
- }
- }
-
- logger.debug("Uploading data to \(url.enteRedactedForLogging)")
-
- let (responseData, response) = try await session.data(for: request)
-
- guard let httpResponse = response as? HTTPURLResponse else {
- throw EnteError.networkError("Invalid response type")
- }
-
- if httpResponse.statusCode >= 400 {
- throw EnteError.serverError(httpResponse.statusCode, nil)
- }
-
- return responseData
- }
-
- public func download(
- url: URL,
- headers: [String: String]? = nil
- ) async throws -> Data {
- var request = URLRequest(url: url)
- request.httpMethod = "GET"
-
- // Add headers
- if let headers = headers {
- for (key, value) in headers {
- request.setValue(value, forHTTPHeaderField: key)
- }
- }
-
- logger.debug("Downloading from \(url.enteRedactedForLogging)")
-
- let (data, response) = try await session.data(for: request)
-
- guard let httpResponse = response as? HTTPURLResponse else {
- throw EnteError.networkError("Invalid response type")
- }
-
- if httpResponse.statusCode >= 400 {
- throw EnteError.serverError(httpResponse.statusCode, nil)
- }
-
- return data
- }
-}
\ No newline at end of file
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/EnteNetwork.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/EnteNetwork.swift
deleted file mode 100644
index 93e8aaf160..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/EnteNetwork.swift
+++ /dev/null
@@ -1,7 +0,0 @@
-// EnteNetwork - Native iOS/tvOS networking layer for Ente apps
-// Provides domain-specific gateways with custom endpoint support
-
-@_exported import EnteCore
-
-// Re-export key types for convenience
-public typealias NetworkFactory = EnteNetworkFactory
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/EnteNetworkFactory.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/EnteNetworkFactory.swift
deleted file mode 100644
index 6917de9385..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/EnteNetworkFactory.swift
+++ /dev/null
@@ -1,85 +0,0 @@
-import Foundation
-import EnteCore
-import Logging
-
-// MARK: - Ente Network Factory
-
-public class EnteNetworkFactory {
- private let apiClient: APIClient
- public let configuration: NetworkConfiguration
- private let logger = Logger(label: "EnteNetworkFactory")
-
- public init(
- configuration: NetworkConfiguration = .default,
- app: EnteApp,
- authTokenProvider: AuthTokenProvider? = nil
- ) {
- self.configuration = configuration
- self.apiClient = APIClient(
- configuration: configuration,
- app: app,
- authTokenProvider: authTokenProvider
- )
-
- logger.info("Initialized network factory for app: \(app.displayName)")
- logger.info("API endpoint: \(configuration.apiEndpoint)")
- if let castEndpoint = configuration.castEndpoint {
- logger.info("Cast endpoint: \(castEndpoint)")
- }
- }
-
- // MARK: - Convenience Initializers
-
- public convenience init(
- environment: EnteEnvironment,
- app: EnteApp,
- authTokenProvider: AuthTokenProvider? = nil
- ) {
- self.init(
- configuration: environment.networkConfiguration,
- app: app,
- authTokenProvider: authTokenProvider
- )
- }
-
- public convenience init(
- customEndpoint: URL,
- app: EnteApp,
- authTokenProvider: AuthTokenProvider? = nil
- ) {
- let config = NetworkConfiguration.selfHosted(baseURL: customEndpoint)
- self.init(
- configuration: config,
- app: app,
- authTokenProvider: authTokenProvider
- )
- }
-
- // MARK: - Gateway Access
-
- /// Core authentication gateway for sign-in flows
- public lazy var authentication = AuthenticationGateway(client: apiClient)
-
- /// TV/Cast specific gateway - uses dedicated cast endpoints
- public lazy var cast = CastGateway(client: apiClient)
-
- // TODO: Add other gateways as needed
- // public lazy var users = UserGateway(client: apiClient)
- // public lazy var files = FilesGateway(client: apiClient)
- // public lazy var collections = CollectionsGateway(client: apiClient)
- // public lazy var billing = BillingGateway(client: apiClient)
- // public lazy var trash = TrashGateway(client: apiClient)
- // public lazy var storageBonus = StorageBonusGateway(client: apiClient)
- // public lazy var family = FamilyGateway(client: apiClient)
- // public lazy var remoteStore = RemoteStoreGateway(client: apiClient)
- // public lazy var push = PushGateway(client: apiClient)
- // public lazy var keyExchange = KeyExchangeGateway(client: apiClient)
-
- // MARK: - Configuration Updates
-
- public func updateConfiguration(_ newConfiguration: NetworkConfiguration) {
- // This would require updating the APIClient's configuration
- // For now, we recommend creating a new factory instance
- logger.warning("Configuration updates require creating a new NetworkFactory instance")
- }
-}
\ No newline at end of file
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Gateways/AuthenticationGateway.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Gateways/AuthenticationGateway.swift
deleted file mode 100644
index 9110953cff..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Gateways/AuthenticationGateway.swift
+++ /dev/null
@@ -1,176 +0,0 @@
-import Foundation
-import EnteCore
-import Logging
-
-// MARK: - Authentication Models
-
-public struct SRPAttributes: Codable {
- public let srpUserID: String
- public let srpSalt: String
- public let kekSalt: String
- public let memLimit: Int
- public let opsLimit: Int
- public let isEmailMFAEnabled: Bool
-
- public init(srpUserID: String, srpSalt: String, kekSalt: String, memLimit: Int, opsLimit: Int, isEmailMFAEnabled: Bool) {
- self.srpUserID = srpUserID
- self.srpSalt = srpSalt
- self.kekSalt = kekSalt
- self.memLimit = memLimit
- self.opsLimit = opsLimit
- self.isEmailMFAEnabled = isEmailMFAEnabled
- }
-}
-
-public struct CreateSRPSessionResponse: Codable {
- public let sessionID: String
- public let srpB: String
-
- public init(sessionID: String, srpB: String) {
- self.sessionID = sessionID
- self.srpB = srpB
- }
-}
-
-public struct KeyAttributes: Codable {
- public let kekSalt: String
- public let encryptedKey: String
- public let keyDecryptionNonce: String
- public let publicKey: String
- public let encryptedSecretKey: String
- public let secretKeyDecryptionNonce: String
- public let memLimit: Int
- public let opsLimit: Int
-
- public init(kekSalt: String, encryptedKey: String, keyDecryptionNonce: String, publicKey: String, encryptedSecretKey: String, secretKeyDecryptionNonce: String, memLimit: Int, opsLimit: Int) {
- self.kekSalt = kekSalt
- self.encryptedKey = encryptedKey
- self.keyDecryptionNonce = keyDecryptionNonce
- self.publicKey = publicKey
- self.encryptedSecretKey = encryptedSecretKey
- self.secretKeyDecryptionNonce = secretKeyDecryptionNonce
- self.memLimit = memLimit
- self.opsLimit = opsLimit
- }
-}
-
-public struct AuthorizationResponse: Codable {
- public let keyAttributes: KeyAttributes?
- public let encryptedToken: String?
- public let token: String?
- public let srpM2: String?
- public let twoFactorSessionID: String?
- public let twoFactorSessionIDV2: String?
- public let passkeySessionID: String?
- public let accountsUrl: String?
- public let id: UserID
-
- public init(keyAttributes: KeyAttributes?, encryptedToken: String?, token: String?, srpM2: String?, twoFactorSessionID: String?, twoFactorSessionIDV2: String?, passkeySessionID: String?, accountsUrl: String?, id: UserID) {
- self.keyAttributes = keyAttributes
- self.encryptedToken = encryptedToken
- self.token = token
- self.srpM2 = srpM2
- self.twoFactorSessionID = twoFactorSessionID
- self.twoFactorSessionIDV2 = twoFactorSessionIDV2
- self.passkeySessionID = passkeySessionID
- self.accountsUrl = accountsUrl
- self.id = id
- }
-
- public var effectiveTwoFactorSessionID: String? {
- return twoFactorSessionIDV2 ?? twoFactorSessionID
- }
-
- public var isMFARequired: Bool {
- return effectiveTwoFactorSessionID?.isEmpty == false
- }
-
- public var isPasskeyRequired: Bool {
- return passkeySessionID?.isEmpty == false
- }
-}
-
-// MARK: - Authentication Gateway
-
-public class AuthenticationGateway {
- private let client: APIClient
- private let logger = Logger(label: "AuthenticationGateway")
-
- internal init(client: APIClient) {
- self.client = client
- }
-
- // MARK: - SRP Authentication
-
- public func getSRPAttributes(email: String) async throws -> SRPAttributes {
- logger.info("Getting SRP attributes for email")
-
- struct Response: Codable {
- let attributes: SRPAttributes
- }
-
- let response = try await client.request(
- AuthEndpoint.getSRPAttributes(email: email),
- responseType: Response.self
- )
-
- return response.attributes
- }
-
- public func createSRPSession(srpUserID: String, clientPub: String) async throws -> CreateSRPSessionResponse {
- logger.info("Creating SRP session")
-
- return try await client.request(
- AuthEndpoint.createSRPSession(srpUserID: srpUserID, clientPub: clientPub),
- responseType: CreateSRPSessionResponse.self
- )
- }
-
- public func verifySRPSession(srpUserID: String, sessionID: String, clientM1: String) async throws -> AuthorizationResponse {
- logger.info("Verifying SRP session")
-
- return try await client.request(
- AuthEndpoint.verifySRPSession(srpUserID: srpUserID, sessionID: sessionID, clientM1: clientM1),
- responseType: AuthorizationResponse.self
- )
- }
-
- // MARK: - Email OTP
-
- public func sendLoginOTP(email: String, purpose: String = "login") async throws {
- logger.info("Sending login OTP")
-
- try await client.request(AuthEndpoint.sendLoginOTP(email: email, purpose: purpose))
- }
-
- public func verifyEmail(email: String, otp: String) async throws -> AuthorizationResponse {
- logger.info("Verifying email with OTP")
-
- return try await client.request(
- AuthEndpoint.verifyEmail(email: email, otp: otp),
- responseType: AuthorizationResponse.self
- )
- }
-
- // MARK: - Two-Factor Authentication
-
- public func verifyTOTP(sessionID: String, otp: String) async throws -> AuthorizationResponse {
- logger.info("Verifying TOTP")
-
- return try await client.request(
- AuthEndpoint.verifyTOTP(sessionID: sessionID, otp: otp),
- responseType: AuthorizationResponse.self
- )
- }
-
- // MARK: - Passkeys
-
- public func getTokenForPasskeySession(sessionID: String) async throws -> AuthorizationResponse {
- logger.info("Getting token for passkey session")
-
- return try await client.request(
- AuthEndpoint.getTokenForPasskeySession(sessionID: sessionID),
- responseType: AuthorizationResponse.self
- )
- }
-}
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Gateways/CastGateway.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Gateways/CastGateway.swift
deleted file mode 100644
index b51ff493a0..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Gateways/CastGateway.swift
+++ /dev/null
@@ -1,155 +0,0 @@
-import Foundation
-import EnteCore
-import Logging
-
-// MARK: - Cast Models
-
-public struct CastDevice: Codable {
- public let code: String
- public let deviceID: String?
- public let publicKey: String?
-
- public init(code: String, deviceID: String?, publicKey: String?) {
- self.code = code
- self.deviceID = deviceID
- self.publicKey = publicKey
- }
-}
-
-public struct CastData: Codable {
- public let deviceCode: String
- public let collectionID: CollectionID
- public let castToken: String
-
- public init(deviceCode: String, collectionID: CollectionID, castToken: String) {
- self.deviceCode = deviceCode
- self.collectionID = collectionID
- self.castToken = castToken
- }
-
- public func toDictionary() -> [String: Any] {
- return [
- "deviceCode": deviceCode,
- "collectionID": collectionID.rawValue,
- "castToken": castToken
- ]
- }
-}
-
-public struct CastDiff: Codable {
- public let diff: [CastFile]
- public let hasMore: Bool
-
- public init(diff: [CastFile], hasMore: Bool) {
- self.diff = diff
- self.hasMore = hasMore
- }
-}
-
-public struct CastFile: Codable {
- public let id: FileID
- public let updationTime: Int64
- public let isDeleted: Bool
-
- public init(id: FileID, updationTime: Int64, isDeleted: Bool) {
- self.id = id
- self.updationTime = updationTime
- self.isDeleted = isDeleted
- }
-}
-
-public struct CastCollection: Codable {
- public let id: CollectionID
- public let name: String
- public let fileCount: Int
-
- public init(id: CollectionID, name: String, fileCount: Int) {
- self.id = id
- self.name = name
- self.fileCount = fileCount
- }
-}
-
-// MARK: - Cast Gateway
-
-public class CastGateway {
- private let client: APIClient
- private let logger = Logger(label: "CastGateway")
-
- internal init(client: APIClient) {
- self.client = client
- }
-
- // MARK: - Cast Device Management
-
- public func registerDevice() async throws -> CastDevice {
- logger.info("Registering cast device")
-
- return try await client.request(
- CastEndpoint.registerDevice,
- responseType: CastDevice.self
- )
- }
-
- public func getDeviceInfo(deviceCode: String) async throws -> CastDevice {
- logger.info("Getting device info for code: \(deviceCode)")
-
- return try await client.request(
- CastEndpoint.getDeviceInfo(deviceCode: deviceCode),
- responseType: CastDevice.self
- )
- }
-
- public func getCastData(deviceCode: String) async throws -> CastData {
- logger.info("Getting cast data for device: \(deviceCode)")
-
- return try await client.request(
- CastEndpoint.getCastData(deviceCode: deviceCode),
- responseType: CastData.self
- )
- }
-
- public func insertCastData(_ data: CastData) async throws {
- logger.info("Inserting cast data")
-
- try await client.request(CastEndpoint.insertCastData(data.toDictionary()))
- }
-
- public func revokeAllTokens() async throws {
- logger.info("Revoking all cast tokens")
-
- try await client.request(CastEndpoint.revokeAllTokens)
- }
-
- // MARK: - Cast File Operations
-
- public func getThumbnail(fileID: FileID) async throws -> Data {
- logger.info("Getting thumbnail for file: \(fileID)")
-
- return try await client.download(CastEndpoint.getThumbnail(fileID: fileID))
- }
-
- public func getFile(fileID: FileID) async throws -> Data {
- logger.info("Getting file: \(fileID)")
-
- return try await client.download(CastEndpoint.getFile(fileID: fileID))
- }
-
- public func getDiff(sinceTime: Int64) async throws -> CastDiff {
- logger.info("Getting cast diff since: \(sinceTime)")
-
- return try await client.request(
- CastEndpoint.getDiff(sinceTime: sinceTime),
- responseType: CastDiff.self
- )
- }
-
- public func getCollection() async throws -> CastCollection {
- logger.info("Getting cast collection info")
-
- return try await client.request(
- CastEndpoint.getCollection,
- responseType: CastCollection.self
- )
- }
-}
\ No newline at end of file
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Tests/EnteNetworkTests/EnteNetworkTests.swift b/mobile/native/darwin/Packages/EnteNetwork/Tests/EnteNetworkTests/EnteNetworkTests.swift
deleted file mode 100644
index bdcfe7f88a..0000000000
--- a/mobile/native/darwin/Packages/EnteNetwork/Tests/EnteNetworkTests/EnteNetworkTests.swift
+++ /dev/null
@@ -1,6 +0,0 @@
-import Testing
-@testable import EnteNetwork
-
-@Test func example() async throws {
- // Write your test here and use APIs like `#expect(...)` to check expected conditions.
-}
diff --git a/mobile/native/darwin/darwin.xcworkspace/contents.xcworkspacedata b/mobile/native/darwin/darwin.xcworkspace/contents.xcworkspacedata
index 8bc88fa8e1..ee6e117ddf 100644
--- a/mobile/native/darwin/darwin.xcworkspace/contents.xcworkspacedata
+++ b/mobile/native/darwin/darwin.xcworkspace/contents.xcworkspacedata
@@ -117,9 +117,6 @@
<Group
location = "group:Packages"
name = "Packages">
- <FileRef
- location = "group:EnteNetwork">
- </FileRef>
<Group
location = "group:EnteConfiguration"
name = "EnteConfiguration">
@@ -128,8 +125,5 @@
location = "group:EnteLogging"
name = "EnteLogging">
</Group>
- <FileRef
- location = "group:EnteCore">
- </FileRef>
</Group>
</Workspace>
diff --git a/mobile/native/darwin/darwin.xcworkspace/xcshareddata/swiftpm/Package.resolved b/mobile/native/darwin/darwin.xcworkspace/xcshareddata/swiftpm/Package.resolved
index e588ae5bb8..600b11c2dc 100644
--- a/mobile/native/darwin/darwin.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/mobile/native/darwin/darwin.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -18,15 +18,6 @@
"version" : "0.7.1"
}
},
- {
- "identity" : "swift-log",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/apple/swift-log.git",
- "state" : {
- "revision" : "ce592ae52f982c847a4efc0dd881cc9eb32d29f2",
- "version" : "1.6.4"
- }
- },
{
"identity" : "swift-markdown",
"kind" : "remoteSourceControl",
@@ -36,15 +27,6 @@
"version" : "0.7.3"
}
},
- {
- "identity" : "swift-tagged",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/pointfreeco/swift-tagged.git",
- "state" : {
- "revision" : "3907a9438f5b57d317001dc99f3f11b46882272b",
- "version" : "0.10.0"
- }
- },
{
"identity" : "swiftmath",
"kind" : "remoteSourceControl",