Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors, SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2), PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager, all feature UIs (Login, Connect, Browse, Backup, History, Settings), Shared components and theme. Builds clean with zero errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
25
Core/Protocols/NASTransferProtocol.swift
Normal file
25
Core/Protocols/NASTransferProtocol.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
import Foundation
|
||||
|
||||
struct NASItem: Identifiable {
|
||||
let id = UUID()
|
||||
let name: String
|
||||
let path: String
|
||||
let isDirectory: Bool
|
||||
let size: Int64
|
||||
let modifiedDate: Date?
|
||||
}
|
||||
|
||||
protocol NASTransferProtocol: AnyObject {
|
||||
var isConnected: Bool { get }
|
||||
|
||||
func connect(to host: String, port: Int, username: String, password: String) async throws
|
||||
func disconnect()
|
||||
func listDirectory(at path: String) async throws -> [NASItem]
|
||||
func createDirectory(at path: String) async throws
|
||||
func fileExists(at remotePath: String) async throws -> Bool
|
||||
func upload(
|
||||
localURL: URL,
|
||||
remotePath: String,
|
||||
progress: @escaping (Int64, Int64) -> Void
|
||||
) async throws
|
||||
}
|
||||
29
Core/Protocols/PhotoLibraryProtocol.swift
Normal file
29
Core/Protocols/PhotoLibraryProtocol.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
import Foundation
|
||||
import Photos
|
||||
|
||||
struct PhotoAsset {
|
||||
let localIdentifier: String
|
||||
let filename: String
|
||||
let creationDate: Date?
|
||||
let mediaType: PHAssetMediaType
|
||||
let pixelWidth: Int
|
||||
let pixelHeight: Int
|
||||
let duration: TimeInterval
|
||||
let isScreenshot: Bool
|
||||
let isRAW: Bool
|
||||
}
|
||||
|
||||
protocol PhotoLibraryProtocol: AnyObject {
|
||||
var authorizationStatus: PHAuthorizationStatus { get }
|
||||
func requestAuthorization() async -> PHAuthorizationStatus
|
||||
func fetchAssets(filter: BackupFilter) -> [PhotoAsset]
|
||||
func exportAsset(_ asset: PhotoAsset) async throws -> URL
|
||||
}
|
||||
|
||||
struct BackupFilter: Codable {
|
||||
var includePhotos: Bool = true
|
||||
var includeVideos: Bool = true
|
||||
var includeScreenshots: Bool = false
|
||||
var includeRAW: Bool = false
|
||||
var newFilesOnly: Bool = true
|
||||
}
|
||||
Reference in New Issue
Block a user