From c61a72011ca39bc9d03b640ba7cc330e1d3c7fd5 Mon Sep 17 00:00:00 2001 From: Joel-David <4586209+joeldavidw@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:23:50 +0800 Subject: [PATCH] Renamed ChronosData to Vault (#3) --- Chronos.xcodeproj/project.pbxproj | 8 +- .../xcshareddata/swiftpm/Package.resolved | 78 ------------------- .../Data/{ChronosData.swift => Vault.swift} | 2 +- Chronos/Services/ExportService.swift | 10 +-- 4 files changed, 10 insertions(+), 88 deletions(-) delete mode 100644 Chronos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename Chronos/Data/{ChronosData.swift => Vault.swift} (71%) diff --git a/Chronos.xcodeproj/project.pbxproj b/Chronos.xcodeproj/project.pbxproj index 5ba3738..55f76ae 100644 --- a/Chronos.xcodeproj/project.pbxproj +++ b/Chronos.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 6B12B0A02C19DB7800E9ED2D /* ExportService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B12B09F2C19DB7800E9ED2D /* ExportService.swift */; }; - 6B12B0A22C19F1E600E9ED2D /* ChronosData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B12B0A12C19F1E600E9ED2D /* ChronosData.swift */; }; + 6B12B0A22C19F1E600E9ED2D /* Vault.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B12B0A12C19F1E600E9ED2D /* Vault.swift */; }; 6B19CA722B7A70B800690390 /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B19CA712B7A70B800690390 /* WelcomeView.swift */; }; 6B19CA742B7A769900690390 /* PasswordSetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B19CA732B7A769900690390 /* PasswordSetupView.swift */; }; 6B2583AF2B96048700938F3A /* SettingsTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2583AE2B96048700938F3A /* SettingsTab.swift */; }; @@ -53,7 +53,7 @@ /* Begin PBXFileReference section */ 6B12B09F2C19DB7800E9ED2D /* ExportService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportService.swift; sourceTree = ""; }; - 6B12B0A12C19F1E600E9ED2D /* ChronosData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChronosData.swift; sourceTree = ""; }; + 6B12B0A12C19F1E600E9ED2D /* Vault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vault.swift; sourceTree = ""; }; 6B19CA712B7A70B800690390 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = ""; }; 6B19CA732B7A769900690390 /* PasswordSetupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordSetupView.swift; sourceTree = ""; }; 6B2583AE2B96048700938F3A /* SettingsTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTab.swift; sourceTree = ""; }; @@ -258,7 +258,7 @@ isa = PBXGroup; children = ( 6B4B48F22BD7BB3C007D357D /* Token.swift */, - 6B12B0A12C19F1E600E9ED2D /* ChronosData.swift */, + 6B12B0A12C19F1E600E9ED2D /* Vault.swift */, ); path = Data; sourceTree = ""; @@ -410,7 +410,7 @@ files = ( 6B3BB0B32B4EA87C00DCEF0B /* ContentView.swift in Sources */, 6B3BB0B12B4EA87C00DCEF0B /* ChronosApp.swift in Sources */, - 6B12B0A22C19F1E600E9ED2D /* ChronosData.swift in Sources */, + 6B12B0A22C19F1E600E9ED2D /* Vault.swift in Sources */, 6B7383E52B9C4230008E8867 /* Container.swift in Sources */, 6B3C7A382BE764E70043FEBD /* StorageSetupView.swift in Sources */, 6BC3C3B52BA6B91E00B181B9 /* BiometricsSetupView.swift in Sources */, diff --git a/Chronos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Chronos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 412b946..0000000 --- a/Chronos.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,78 +0,0 @@ -{ - "originHash" : "fce3d4a72e08c7c2acd350debe307850f30913bd1e53ad0114fb221b3f8ffe73", - "pins" : [ - { - "identity" : "alertkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/sparrowcode/AlertKit", - "state" : { - "revision" : "3b73be8db5a7e7efaf474c6ed919f5a437d843c9", - "version" : "5.1.9" - } - }, - { - "identity" : "codescanner", - "kind" : "remoteSourceControl", - "location" : "https://github.com/twostraws/CodeScanner.git", - "state" : { - "revision" : "34da57fb63b47add20de8a85da58191523ccce57", - "version" : "2.5.0" - } - }, - { - "identity" : "cryptoswift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", - "state" : { - "revision" : "c9c3df6ab812de32bae61fc0cd1bf6d45170ebf0", - "version" : "1.8.2" - } - }, - { - "identity" : "factory", - "kind" : "remoteSourceControl", - "location" : "https://github.com/hmlongco/Factory", - "state" : { - "revision" : "587995f7d5cc667951d635fbf6b4252324ba0439", - "version" : "2.3.2" - } - }, - { - "identity" : "swift-crypto", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-crypto.git", - "state" : { - "revision" : "ddb07e896a2a8af79512543b1c7eb9797f8898a5", - "version" : "1.1.7" - } - }, - { - "identity" : "swift-log", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-log.git", - "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" - } - }, - { - "identity" : "swiftotp", - "kind" : "remoteSourceControl", - "location" : "https://github.com/lachlanbell/SwiftOTP.git", - "state" : { - "revision" : "9660551ea3df153c3cbacfa34ac3abbec73a8b84", - "version" : "3.0.2" - } - }, - { - "identity" : "valet", - "kind" : "remoteSourceControl", - "location" : "https://github.com/square/Valet", - "state" : { - "revision" : "3df8eaa90e1fa0d80830733cdc3c9e098146af3d", - "version" : "4.3.0" - } - } - ], - "version" : 3 -} diff --git a/Chronos/Data/ChronosData.swift b/Chronos/Data/Vault.swift similarity index 71% rename from Chronos/Data/ChronosData.swift rename to Chronos/Data/Vault.swift index 32794e7..5e1482a 100644 --- a/Chronos/Data/ChronosData.swift +++ b/Chronos/Data/Vault.swift @@ -1,6 +1,6 @@ import Foundation -class ChronosData: Codable { +class Vault: Codable { var tokens: [Token]? var errors: [String]? } diff --git a/Chronos/Services/ExportService.swift b/Chronos/Services/ExportService.swift index 8ed09cb..9b24e1a 100644 --- a/Chronos/Services/ExportService.swift +++ b/Chronos/Services/ExportService.swift @@ -18,7 +18,7 @@ public class ExportService { let context = ModelContext(swiftDataService.getModelContainer()) let encryptedTokenArr = try! context.fetch(FetchDescriptor()) - let chronosData = ChronosData() + let vault = Vault() var tokens: [Token] = [] var errors: [String] = [] @@ -39,15 +39,15 @@ public class ExportService { errors.append("\(numOfTokenFailedToDecode) out of \(encryptedTokenArr.count) tokens failed to be export") } - chronosData.tokens = tokens - chronosData.errors = errors + vault.tokens = tokens + vault.errors = errors let url = FileManager.default.temporaryDirectory .appendingPathComponent("Chronos_" + Date().formatted(verbatimStyle)) .appendingPathExtension("json") - guard let jsonData = try? JSONEncoder().encode(chronosData) else { - logger.error("Unable to encode ChronosData") + guard let jsonData = try? JSONEncoder().encode(vault) else { + logger.error("Unable to encode vault") return nil }