From dc6b03dd3c02ed4afc06a61a6bca69884afbeb96 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 8 Aug 2022 20:40:38 +0100 Subject: [PATCH] renaming to mixonomer, adding jwt --- .../project.pbxproj | 122 +++++++++--------- .../contents.xcworkspacedata | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/WorkspaceSettings.xcsettings | 0 .../xcshareddata/swiftpm/Package.resolved | 0 .../xcschemes/Music Tools.xcscheme | 22 ++-- .../Application/AppDelegate.swift | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../Application/SceneDelegate.swift | 0 .../APFooter.imageset/Contents.json | 0 .../Assets.xcassets/APFooter.imageset/ap.png | Bin .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/MusicToolsIcon1024.png | Bin .../AppIcon.appiconset/MusicToolsIcon120.png | Bin .../AppIcon.appiconset/MusicToolsIcon180.png | Bin .../AppIcon.appiconset/MusicToolsIcon60.png | Bin .../AppIcon.appiconset/MusicToolsIcon76.png | Bin .../Assets.xcassets/Contents.json | 0 .../MusicToolsLogo.imageset/Contents.json | 0 .../MusicToolsIcon1024.png | Bin .../PlaylistCoverImage.imageset/Contents.json | 0 .../PlaylistCoverImage.imageset/weird-rap.jpg | Bin {Music Tools => Mixonomer}/Info.plist | 2 + .../Mixonomer.entitlements | 0 .../Model/LiveUser.swift | 0 .../Model/Playlist.swift | 0 {Music Tools => Mixonomer}/Model/Tag.swift | 0 {Music Tools => Mixonomer}/Model/User.swift | 0 Mixonomer/Network/AuthApi.swift | 88 +++++++++++++ .../Network/Network.swift | 24 +++- .../Network/NetworkPersister.swift | 0 .../Network/PlaylistApi.swift | 0 .../Network/TagApi.swift | 0 .../Network/UserApi.swift | 0 .../Preview Assets.xcassets/Contents.json | 0 {Music Tools => Mixonomer}/Router.swift | 0 .../Views/AppSkeleton.swift | 0 .../Views/LoginScreen.swift | 22 +++- .../Views/Playlist/AddPlaylistSheet.swift | 0 .../Views/Playlist/PlaylistInputList.swift | 0 .../Views/Playlist/PlaylistList.swift | 0 .../Views/Playlist/PlaylistRow.swift | 0 .../Views/Playlist/PlaylistView.swift | 0 .../Views/Settings/SettingsList.swift | 0 .../Views/Tag/AddTagSheet.swift | 0 .../Views/Tag/TagList.swift | 0 .../Views/Tag/TagObjList.swift | 0 .../Views/Tag/TagRow.swift | 0 .../Views/Tag/TagView.swift | 0 .../Info.plist | 0 .../MixonomerTests.swift | 0 .../Info.plist | 0 .../MixonomerUITests.swift | 0 53 files changed, 208 insertions(+), 74 deletions(-) rename {Music Tools.xcodeproj => Mixonomer.xcodeproj}/project.pbxproj (88%) rename {Music Tools.xcodeproj => Mixonomer.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (56%) rename {Music Tools.xcodeproj => Mixonomer.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {Music Tools.xcodeproj => Mixonomer.xcodeproj}/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (100%) rename {Music Tools.xcodeproj => Mixonomer.xcodeproj}/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (100%) rename {Music Tools.xcodeproj => Mixonomer.xcodeproj}/xcshareddata/xcschemes/Music Tools.xcscheme (84%) rename {Music Tools => Mixonomer}/Application/AppDelegate.swift (100%) rename {Music Tools => Mixonomer}/Application/Base.lproj/LaunchScreen.storyboard (100%) rename {Music Tools => Mixonomer}/Application/SceneDelegate.swift (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/APFooter.imageset/Contents.json (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/APFooter.imageset/ap.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon1024.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon120.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon180.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon60.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon76.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/Contents.json (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/MusicToolsLogo.imageset/Contents.json (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/MusicToolsLogo.imageset/MusicToolsIcon1024.png (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json (100%) rename {Music Tools => Mixonomer}/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg (100%) rename {Music Tools => Mixonomer}/Info.plist (97%) rename Music Tools/Music Tools.entitlements => Mixonomer/Mixonomer.entitlements (100%) rename {Music Tools => Mixonomer}/Model/LiveUser.swift (100%) rename {Music Tools => Mixonomer}/Model/Playlist.swift (100%) rename {Music Tools => Mixonomer}/Model/Tag.swift (100%) rename {Music Tools => Mixonomer}/Model/User.swift (100%) create mode 100644 Mixonomer/Network/AuthApi.swift rename {Music Tools => Mixonomer}/Network/Network.swift (78%) rename {Music Tools => Mixonomer}/Network/NetworkPersister.swift (100%) rename {Music Tools => Mixonomer}/Network/PlaylistApi.swift (100%) rename {Music Tools => Mixonomer}/Network/TagApi.swift (100%) rename {Music Tools => Mixonomer}/Network/UserApi.swift (100%) rename {Music Tools => Mixonomer}/Preview Content/Preview Assets.xcassets/Contents.json (100%) rename {Music Tools => Mixonomer}/Router.swift (100%) rename {Music Tools => Mixonomer}/Views/AppSkeleton.swift (100%) rename {Music Tools => Mixonomer}/Views/LoginScreen.swift (73%) rename {Music Tools => Mixonomer}/Views/Playlist/AddPlaylistSheet.swift (100%) rename {Music Tools => Mixonomer}/Views/Playlist/PlaylistInputList.swift (100%) rename {Music Tools => Mixonomer}/Views/Playlist/PlaylistList.swift (100%) rename {Music Tools => Mixonomer}/Views/Playlist/PlaylistRow.swift (100%) rename {Music Tools => Mixonomer}/Views/Playlist/PlaylistView.swift (100%) rename {Music Tools => Mixonomer}/Views/Settings/SettingsList.swift (100%) rename {Music Tools => Mixonomer}/Views/Tag/AddTagSheet.swift (100%) rename {Music Tools => Mixonomer}/Views/Tag/TagList.swift (100%) rename {Music Tools => Mixonomer}/Views/Tag/TagObjList.swift (100%) rename {Music Tools => Mixonomer}/Views/Tag/TagRow.swift (100%) rename {Music Tools => Mixonomer}/Views/Tag/TagView.swift (100%) rename {Music ToolsTests => MixonomerTests}/Info.plist (100%) rename Music ToolsTests/Music_ToolsTests.swift => MixonomerTests/MixonomerTests.swift (100%) rename {Music ToolsUITests => MixonomerUITests}/Info.plist (100%) rename Music ToolsUITests/Music_ToolsUITests.swift => MixonomerUITests/MixonomerUITests.swift (100%) diff --git a/Music Tools.xcodeproj/project.pbxproj b/Mixonomer.xcodeproj/project.pbxproj similarity index 88% rename from Music Tools.xcodeproj/project.pbxproj rename to Mixonomer.xcodeproj/project.pbxproj index 1201083..b499c38 100644 --- a/Music Tools.xcodeproj/project.pbxproj +++ b/Mixonomer.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ A10C8D29281302050018AE12 /* ToastUI in Frameworks */ = {isa = PBXBuildFile; productRef = A10C8D28281302050018AE12 /* ToastUI */; }; + A11AC70628A188AE00645043 /* AuthApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11AC70528A188AE00645043 /* AuthApi.swift */; }; E906F7F42414019C004E1E31 /* NetworkPersister.swift in Sources */ = {isa = PBXBuildFile; fileRef = E906F7F32414019C004E1E31 /* NetworkPersister.swift */; }; E906F7F724143AA7004E1E31 /* SwiftUICharts in Frameworks */ = {isa = PBXBuildFile; productRef = E906F7F624143AA7004E1E31 /* SwiftUICharts */; }; E934AC99240DD0E4009869F4 /* AddTagSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E934AC98240DD0E4009869F4 /* AddTagSheet.swift */; }; @@ -40,8 +41,8 @@ E9EA691123F9A54A0012C3E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E9EA691023F9A54A0012C3E8 /* Assets.xcassets */; }; E9EA691423F9A54B0012C3E8 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E9EA691323F9A54B0012C3E8 /* Preview Assets.xcassets */; }; E9EA691723F9A54B0012C3E8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E9EA691523F9A54B0012C3E8 /* LaunchScreen.storyboard */; }; - E9EA692223F9A54B0012C3E8 /* Music_ToolsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA692123F9A54B0012C3E8 /* Music_ToolsTests.swift */; }; - E9EA692D23F9A54B0012C3E8 /* Music_ToolsUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA692C23F9A54B0012C3E8 /* Music_ToolsUITests.swift */; }; + E9EA692223F9A54B0012C3E8 /* MixonomerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA692123F9A54B0012C3E8 /* MixonomerTests.swift */; }; + E9EA692D23F9A54B0012C3E8 /* MixonomerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9EA692C23F9A54B0012C3E8 /* MixonomerUITests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,7 +63,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - A146915A28118F940052999D /* Music Tools.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Music Tools.entitlements"; sourceTree = ""; }; + A11AC70528A188AE00645043 /* AuthApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthApi.swift; sourceTree = ""; }; + A146915A28118F940052999D /* Mixonomer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Mixonomer.entitlements; sourceTree = ""; }; E906F7F32414019C004E1E31 /* NetworkPersister.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkPersister.swift; sourceTree = ""; }; E934AC98240DD0E4009869F4 /* AddTagSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTagSheet.swift; sourceTree = ""; }; E971F8B8245462D500B543B6 /* Router.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = ""; }; @@ -85,7 +87,7 @@ E9E30C2C23FEAB0200574EEF /* TagView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagView.swift; sourceTree = ""; }; E9E30C3023FEAF2B00574EEF /* TagObjList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagObjList.swift; sourceTree = ""; }; E9E30C3223FF255C00574EEF /* SettingsList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsList.swift; sourceTree = ""; }; - E9EA690723F9A5430012C3E8 /* Music Tools.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Music Tools.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + E9EA690723F9A5430012C3E8 /* Mixonomer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mixonomer.app; sourceTree = BUILT_PRODUCTS_DIR; }; E9EA690A23F9A5430012C3E8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; E9EA690C23F9A5430012C3E8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; E9EA690E23F9A5430012C3E8 /* AppSkeleton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSkeleton.swift; sourceTree = ""; }; @@ -93,11 +95,11 @@ E9EA691323F9A54B0012C3E8 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; E9EA691623F9A54B0012C3E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; E9EA691823F9A54B0012C3E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E9EA691D23F9A54B0012C3E8 /* Music ToolsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Music ToolsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - E9EA692123F9A54B0012C3E8 /* Music_ToolsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Music_ToolsTests.swift; sourceTree = ""; }; + E9EA691D23F9A54B0012C3E8 /* MixonomerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MixonomerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + E9EA692123F9A54B0012C3E8 /* MixonomerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixonomerTests.swift; sourceTree = ""; }; E9EA692323F9A54B0012C3E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E9EA692823F9A54B0012C3E8 /* Music ToolsUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Music ToolsUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - E9EA692C23F9A54B0012C3E8 /* Music_ToolsUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Music_ToolsUITests.swift; sourceTree = ""; }; + E9EA692823F9A54B0012C3E8 /* MixonomerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MixonomerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + E9EA692C23F9A54B0012C3E8 /* MixonomerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixonomerUITests.swift; sourceTree = ""; }; E9EA692E23F9A54B0012C3E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -150,6 +152,7 @@ E97AF45A23FC748D00635494 /* UserApi.swift */, E9E30C2523FEA4EF00574EEF /* TagApi.swift */, E906F7F32414019C004E1E31 /* NetworkPersister.swift */, + A11AC70528A188AE00645043 /* AuthApi.swift */, ); path = Network; sourceTree = ""; @@ -211,9 +214,9 @@ E9EA68FE23F9A5430012C3E8 = { isa = PBXGroup; children = ( - E9EA690923F9A5430012C3E8 /* Music Tools */, - E9EA692023F9A54B0012C3E8 /* Music ToolsTests */, - E9EA692B23F9A54B0012C3E8 /* Music ToolsUITests */, + E9EA690923F9A5430012C3E8 /* Mixonomer */, + E9EA692023F9A54B0012C3E8 /* MixonomerTests */, + E9EA692B23F9A54B0012C3E8 /* MixonomerUITests */, E9EA690823F9A5430012C3E8 /* Products */, ); sourceTree = ""; @@ -221,17 +224,17 @@ E9EA690823F9A5430012C3E8 /* Products */ = { isa = PBXGroup; children = ( - E9EA690723F9A5430012C3E8 /* Music Tools.app */, - E9EA691D23F9A54B0012C3E8 /* Music ToolsTests.xctest */, - E9EA692823F9A54B0012C3E8 /* Music ToolsUITests.xctest */, + E9EA690723F9A5430012C3E8 /* Mixonomer.app */, + E9EA691D23F9A54B0012C3E8 /* MixonomerTests.xctest */, + E9EA692823F9A54B0012C3E8 /* MixonomerUITests.xctest */, ); name = Products; sourceTree = ""; }; - E9EA690923F9A5430012C3E8 /* Music Tools */ = { + E9EA690923F9A5430012C3E8 /* Mixonomer */ = { isa = PBXGroup; children = ( - A146915A28118F940052999D /* Music Tools.entitlements */, + A146915A28118F940052999D /* Mixonomer.entitlements */, E98254C623FA25280056D9D3 /* Application */, E9EA691023F9A54A0012C3E8 /* Assets.xcassets */, E9EA691823F9A54B0012C3E8 /* Info.plist */, @@ -241,7 +244,7 @@ E98254C023F9FFDD0056D9D3 /* Views */, E971F8B8245462D500B543B6 /* Router.swift */, ); - path = "Music Tools"; + path = Mixonomer; sourceTree = ""; }; E9EA691223F9A54B0012C3E8 /* Preview Content */ = { @@ -252,30 +255,30 @@ path = "Preview Content"; sourceTree = ""; }; - E9EA692023F9A54B0012C3E8 /* Music ToolsTests */ = { + E9EA692023F9A54B0012C3E8 /* MixonomerTests */ = { isa = PBXGroup; children = ( - E9EA692123F9A54B0012C3E8 /* Music_ToolsTests.swift */, + E9EA692123F9A54B0012C3E8 /* MixonomerTests.swift */, E9EA692323F9A54B0012C3E8 /* Info.plist */, ); - path = "Music ToolsTests"; + path = MixonomerTests; sourceTree = ""; }; - E9EA692B23F9A54B0012C3E8 /* Music ToolsUITests */ = { + E9EA692B23F9A54B0012C3E8 /* MixonomerUITests */ = { isa = PBXGroup; children = ( - E9EA692C23F9A54B0012C3E8 /* Music_ToolsUITests.swift */, + E9EA692C23F9A54B0012C3E8 /* MixonomerUITests.swift */, E9EA692E23F9A54B0012C3E8 /* Info.plist */, ); - path = "Music ToolsUITests"; + path = MixonomerUITests; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - E9EA690623F9A5430012C3E8 /* Music Tools */ = { + E9EA690623F9A5430012C3E8 /* Mixonomer */ = { isa = PBXNativeTarget; - buildConfigurationList = E9EA693123F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Music Tools" */; + buildConfigurationList = E9EA693123F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Mixonomer" */; buildPhases = ( E9EA690323F9A5430012C3E8 /* Sources */, E9EA690423F9A5430012C3E8 /* Frameworks */, @@ -285,7 +288,7 @@ ); dependencies = ( ); - name = "Music Tools"; + name = Mixonomer; packageProductDependencies = ( E98254D823FB53780056D9D3 /* Alamofire */, E97AF45823FC50EC00635494 /* SwiftyJSON */, @@ -294,12 +297,12 @@ A10C8D28281302050018AE12 /* ToastUI */, ); productName = "Music Tools"; - productReference = E9EA690723F9A5430012C3E8 /* Music Tools.app */; + productReference = E9EA690723F9A5430012C3E8 /* Mixonomer.app */; productType = "com.apple.product-type.application"; }; - E9EA691C23F9A54B0012C3E8 /* Music ToolsTests */ = { + E9EA691C23F9A54B0012C3E8 /* MixonomerTests */ = { isa = PBXNativeTarget; - buildConfigurationList = E9EA693423F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Music ToolsTests" */; + buildConfigurationList = E9EA693423F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "MixonomerTests" */; buildPhases = ( E9EA691923F9A54B0012C3E8 /* Sources */, E9EA691A23F9A54B0012C3E8 /* Frameworks */, @@ -310,14 +313,14 @@ dependencies = ( E9EA691F23F9A54B0012C3E8 /* PBXTargetDependency */, ); - name = "Music ToolsTests"; + name = MixonomerTests; productName = "Music ToolsTests"; - productReference = E9EA691D23F9A54B0012C3E8 /* Music ToolsTests.xctest */; + productReference = E9EA691D23F9A54B0012C3E8 /* MixonomerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - E9EA692723F9A54B0012C3E8 /* Music ToolsUITests */ = { + E9EA692723F9A54B0012C3E8 /* MixonomerUITests */ = { isa = PBXNativeTarget; - buildConfigurationList = E9EA693723F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Music ToolsUITests" */; + buildConfigurationList = E9EA693723F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "MixonomerUITests" */; buildPhases = ( E9EA692423F9A54B0012C3E8 /* Sources */, E9EA692523F9A54B0012C3E8 /* Frameworks */, @@ -328,9 +331,9 @@ dependencies = ( E9EA692A23F9A54B0012C3E8 /* PBXTargetDependency */, ); - name = "Music ToolsUITests"; + name = MixonomerUITests; productName = "Music ToolsUITests"; - productReference = E9EA692823F9A54B0012C3E8 /* Music ToolsUITests.xctest */; + productReference = E9EA692823F9A54B0012C3E8 /* MixonomerUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; /* End PBXNativeTarget section */ @@ -356,7 +359,7 @@ }; }; }; - buildConfigurationList = E9EA690223F9A5430012C3E8 /* Build configuration list for PBXProject "Music Tools" */; + buildConfigurationList = E9EA690223F9A5430012C3E8 /* Build configuration list for PBXProject "Mixonomer" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -376,9 +379,9 @@ projectDirPath = ""; projectRoot = ""; targets = ( - E9EA690623F9A5430012C3E8 /* Music Tools */, - E9EA691C23F9A54B0012C3E8 /* Music ToolsTests */, - E9EA692723F9A54B0012C3E8 /* Music ToolsUITests */, + E9EA690623F9A5430012C3E8 /* Mixonomer */, + E9EA691C23F9A54B0012C3E8 /* MixonomerTests */, + E9EA692723F9A54B0012C3E8 /* MixonomerUITests */, ); }; /* End PBXProject section */ @@ -429,6 +432,7 @@ E9E30C2A23FEAA3A00574EEF /* TagRow.swift in Sources */, E9CCD5BB2454C57300B5CD6C /* PlaylistList.swift in Sources */, E97AF46023FC85D600635494 /* PlaylistApi.swift in Sources */, + A11AC70628A188AE00645043 /* AuthApi.swift in Sources */, E9EA690F23F9A5430012C3E8 /* AppSkeleton.swift in Sources */, E98254BD23F9B7A90056D9D3 /* Playlist.swift in Sources */, E97AF46723FD650800635494 /* AddPlaylistSheet.swift in Sources */, @@ -447,7 +451,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E9EA692223F9A54B0012C3E8 /* Music_ToolsTests.swift in Sources */, + E9EA692223F9A54B0012C3E8 /* MixonomerTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -455,7 +459,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E9EA692D23F9A54B0012C3E8 /* Music_ToolsUITests.swift in Sources */, + E9EA692D23F9A54B0012C3E8 /* MixonomerUITests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -464,12 +468,12 @@ /* Begin PBXTargetDependency section */ E9EA691F23F9A54B0012C3E8 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = E9EA690623F9A5430012C3E8 /* Music Tools */; + target = E9EA690623F9A5430012C3E8 /* Mixonomer */; targetProxy = E9EA691E23F9A54B0012C3E8 /* PBXContainerItemProxy */; }; E9EA692A23F9A54B0012C3E8 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = E9EA690623F9A5430012C3E8 /* Music Tools */; + target = E9EA690623F9A5430012C3E8 /* Mixonomer */; targetProxy = E9EA692923F9A54B0012C3E8 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -606,17 +610,17 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = "Music Tools/Music Tools.entitlements"; + CODE_SIGN_ENTITLEMENTS = Mixonomer/Mixonomer.entitlements; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content"; + DEVELOPMENT_ASSET_PATHS = "Mixonomer/Preview\\ Content"; DEVELOPMENT_TEAM = 8UZ2659FDY; ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = "Music Tools/Info.plist"; + INFOPLIST_FILE = Mixonomer/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools"; + PRODUCT_BUNDLE_IDENTIFIER = xyz.sarsoo.Mixonomer; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; @@ -628,17 +632,17 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = "Music Tools/Music Tools.entitlements"; + CODE_SIGN_ENTITLEMENTS = Mixonomer/Mixonomer.entitlements; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "Music\\ Tools/Preview\\ Content"; + DEVELOPMENT_ASSET_PATHS = "Mixonomer/Preview\\ Content"; DEVELOPMENT_TEAM = 8UZ2659FDY; ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = "Music Tools/Info.plist"; + INFOPLIST_FILE = Mixonomer/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "xyz.sarsoo.Music-Tools"; + PRODUCT_BUNDLE_IDENTIFIER = xyz.sarsoo.Mixonomer; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; @@ -654,7 +658,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8UZ2659FDY; INFOPLIST_FILE = "Music ToolsTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.2; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -664,7 +668,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Music Tools.app/Music Tools"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mixonomer.app/Mixonomer"; }; name = Debug; }; @@ -676,7 +680,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8UZ2659FDY; INFOPLIST_FILE = "Music ToolsTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.2; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -686,7 +690,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Music Tools.app/Music Tools"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mixonomer.app/Mixonomer"; }; name = Release; }; @@ -733,7 +737,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - E9EA690223F9A5430012C3E8 /* Build configuration list for PBXProject "Music Tools" */ = { + E9EA690223F9A5430012C3E8 /* Build configuration list for PBXProject "Mixonomer" */ = { isa = XCConfigurationList; buildConfigurations = ( E9EA692F23F9A54B0012C3E8 /* Debug */, @@ -742,7 +746,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E9EA693123F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Music Tools" */ = { + E9EA693123F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Mixonomer" */ = { isa = XCConfigurationList; buildConfigurations = ( E9EA693223F9A54B0012C3E8 /* Debug */, @@ -751,7 +755,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E9EA693423F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Music ToolsTests" */ = { + E9EA693423F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "MixonomerTests" */ = { isa = XCConfigurationList; buildConfigurations = ( E9EA693523F9A54B0012C3E8 /* Debug */, @@ -760,7 +764,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E9EA693723F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "Music ToolsUITests" */ = { + E9EA693723F9A54B0012C3E8 /* Build configuration list for PBXNativeTarget "MixonomerUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( E9EA693823F9A54B0012C3E8 /* Debug */, diff --git a/Music Tools.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Mixonomer.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 56% rename from Music Tools.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Mixonomer.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a..605273a 100644 --- a/Music Tools.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Mixonomer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:/Users/andy/dev/swift/Music-Tools-iOS/Mixonomer.xcodeproj"> diff --git a/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Mixonomer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Music Tools.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Mixonomer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Mixonomer.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from Music Tools.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to Mixonomer.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/Music Tools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Mixonomer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved similarity index 100% rename from Music Tools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename to Mixonomer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/Music Tools.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme b/Mixonomer.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme similarity index 84% rename from Music Tools.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme rename to Mixonomer.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme index e39914e..3eab776 100644 --- a/Music Tools.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme +++ b/Mixonomer.xcodeproj/xcshareddata/xcschemes/Music Tools.xcscheme @@ -16,8 +16,8 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "E9EA690623F9A5430012C3E8" BuildableName = "Music Tools.app" - BlueprintName = "Music Tools" - ReferencedContainer = "container:Music Tools.xcodeproj"> + BlueprintName = "Mixonomer" + ReferencedContainer = "container:Mixonomer.xcodeproj"> @@ -34,8 +34,8 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "E9EA691C23F9A54B0012C3E8" BuildableName = "Music ToolsTests.xctest" - BlueprintName = "Music ToolsTests" - ReferencedContainer = "container:Music Tools.xcodeproj"> + BlueprintName = "MixonomerTests" + ReferencedContainer = "container:Mixonomer.xcodeproj"> + BlueprintName = "MixonomerUITests" + ReferencedContainer = "container:Mixonomer.xcodeproj"> @@ -66,15 +66,15 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "E9EA690623F9A5430012C3E8" BuildableName = "Music Tools.app" - BlueprintName = "Music Tools" - ReferencedContainer = "container:Music Tools.xcodeproj"> + BlueprintName = "Mixonomer" + ReferencedContainer = "container:Mixonomer.xcodeproj"> + isEnabled = "YES"> @@ -90,8 +90,8 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "E9EA690623F9A5430012C3E8" BuildableName = "Music Tools.app" - BlueprintName = "Music Tools" - ReferencedContainer = "container:Music Tools.xcodeproj"> + BlueprintName = "Mixonomer" + ReferencedContainer = "container:Mixonomer.xcodeproj"> diff --git a/Music Tools/Application/AppDelegate.swift b/Mixonomer/Application/AppDelegate.swift similarity index 100% rename from Music Tools/Application/AppDelegate.swift rename to Mixonomer/Application/AppDelegate.swift diff --git a/Music Tools/Application/Base.lproj/LaunchScreen.storyboard b/Mixonomer/Application/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Music Tools/Application/Base.lproj/LaunchScreen.storyboard rename to Mixonomer/Application/Base.lproj/LaunchScreen.storyboard diff --git a/Music Tools/Application/SceneDelegate.swift b/Mixonomer/Application/SceneDelegate.swift similarity index 100% rename from Music Tools/Application/SceneDelegate.swift rename to Mixonomer/Application/SceneDelegate.swift diff --git a/Music Tools/Assets.xcassets/APFooter.imageset/Contents.json b/Mixonomer/Assets.xcassets/APFooter.imageset/Contents.json similarity index 100% rename from Music Tools/Assets.xcassets/APFooter.imageset/Contents.json rename to Mixonomer/Assets.xcassets/APFooter.imageset/Contents.json diff --git a/Music Tools/Assets.xcassets/APFooter.imageset/ap.png b/Mixonomer/Assets.xcassets/APFooter.imageset/ap.png similarity index 100% rename from Music Tools/Assets.xcassets/APFooter.imageset/ap.png rename to Mixonomer/Assets.xcassets/APFooter.imageset/ap.png diff --git a/Music Tools/Assets.xcassets/AppIcon.appiconset/Contents.json b/Mixonomer/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Music Tools/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Mixonomer/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon1024.png b/Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon1024.png similarity index 100% rename from Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon1024.png rename to Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon1024.png diff --git a/Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon120.png b/Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon120.png similarity index 100% rename from Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon120.png rename to Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon120.png diff --git a/Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon180.png b/Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon180.png similarity index 100% rename from Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon180.png rename to Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon180.png diff --git a/Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon60.png b/Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon60.png similarity index 100% rename from Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon60.png rename to Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon60.png diff --git a/Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon76.png b/Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon76.png similarity index 100% rename from Music Tools/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon76.png rename to Mixonomer/Assets.xcassets/AppIcon.appiconset/MusicToolsIcon76.png diff --git a/Music Tools/Assets.xcassets/Contents.json b/Mixonomer/Assets.xcassets/Contents.json similarity index 100% rename from Music Tools/Assets.xcassets/Contents.json rename to Mixonomer/Assets.xcassets/Contents.json diff --git a/Music Tools/Assets.xcassets/MusicToolsLogo.imageset/Contents.json b/Mixonomer/Assets.xcassets/MusicToolsLogo.imageset/Contents.json similarity index 100% rename from Music Tools/Assets.xcassets/MusicToolsLogo.imageset/Contents.json rename to Mixonomer/Assets.xcassets/MusicToolsLogo.imageset/Contents.json diff --git a/Music Tools/Assets.xcassets/MusicToolsLogo.imageset/MusicToolsIcon1024.png b/Mixonomer/Assets.xcassets/MusicToolsLogo.imageset/MusicToolsIcon1024.png similarity index 100% rename from Music Tools/Assets.xcassets/MusicToolsLogo.imageset/MusicToolsIcon1024.png rename to Mixonomer/Assets.xcassets/MusicToolsLogo.imageset/MusicToolsIcon1024.png diff --git a/Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json b/Mixonomer/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json similarity index 100% rename from Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json rename to Mixonomer/Assets.xcassets/PlaylistCoverImage.imageset/Contents.json diff --git a/Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg b/Mixonomer/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg similarity index 100% rename from Music Tools/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg rename to Mixonomer/Assets.xcassets/PlaylistCoverImage.imageset/weird-rap.jpg diff --git a/Music Tools/Info.plist b/Mixonomer/Info.plist similarity index 97% rename from Music Tools/Info.plist rename to Mixonomer/Info.plist index d9d3b42..d53f3f0 100644 --- a/Music Tools/Info.plist +++ b/Mixonomer/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Mixonomer CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/Music Tools/Music Tools.entitlements b/Mixonomer/Mixonomer.entitlements similarity index 100% rename from Music Tools/Music Tools.entitlements rename to Mixonomer/Mixonomer.entitlements diff --git a/Music Tools/Model/LiveUser.swift b/Mixonomer/Model/LiveUser.swift similarity index 100% rename from Music Tools/Model/LiveUser.swift rename to Mixonomer/Model/LiveUser.swift diff --git a/Music Tools/Model/Playlist.swift b/Mixonomer/Model/Playlist.swift similarity index 100% rename from Music Tools/Model/Playlist.swift rename to Mixonomer/Model/Playlist.swift diff --git a/Music Tools/Model/Tag.swift b/Mixonomer/Model/Tag.swift similarity index 100% rename from Music Tools/Model/Tag.swift rename to Mixonomer/Model/Tag.swift diff --git a/Music Tools/Model/User.swift b/Mixonomer/Model/User.swift similarity index 100% rename from Music Tools/Model/User.swift rename to Mixonomer/Model/User.swift diff --git a/Mixonomer/Network/AuthApi.swift b/Mixonomer/Network/AuthApi.swift new file mode 100644 index 0000000..0cfa57c --- /dev/null +++ b/Mixonomer/Network/AuthApi.swift @@ -0,0 +1,88 @@ +// +// AuthApi.swift +// Mixonomer +// +// Created by Andy Pack on 08/08/2022. +// Copyright © 2022 Sarsoo. All rights reserved. +// + +import Foundation +import Alamofire +import SwiftyJSON + + +public enum AuthApi { + case token(username: String, password: String) +} + +extension AuthApi: ApiRequest { + var domain: String { + return ApiRequestDefaults.domain + } + + var path: String { + switch self { + case .token: + return "auth/token" + } + } + + + var httpMethod: HTTPMethod { + switch self { + case .token: + return .post + } + } + + var parameters: JSON? { + switch self { + case .token(let username, let password): + return JSON(["username": username, "password": password]) + } + } + + var parameterType: ParameterEncoder? { + switch self { + case .token: + return JSONParameterEncoder.default + } + } + + var headers: HTTPHeaders? { + return nil + } + + var authMethod: AuthMethod? { + return AuthMethod.none + } + + static func fromJSON(playlist: Data) -> Playlist? { + + let decoder = JSONDecoder() + do { + let playlist = try decoder.decode(Playlist.self, from: playlist) + return playlist + } catch { + print(error) + } + return nil + } + + static func fromJSON(playlist: JSON) -> Playlist? { + + let _json = playlist.rawString()?.data(using: .utf8) + + if let data = _json { + let decoder = JSONDecoder() + do { + let playlist = try decoder.decode(Playlist.self, from: data) + return playlist + } catch { + print(error) + } + } + print(playlist) + return nil + } +} diff --git a/Music Tools/Network/Network.swift b/Mixonomer/Network/Network.swift similarity index 78% rename from Music Tools/Network/Network.swift rename to Mixonomer/Network/Network.swift index 33a3446..0739612 100644 --- a/Music Tools/Network/Network.swift +++ b/Mixonomer/Network/Network.swift @@ -13,6 +13,8 @@ import KeychainAccess public enum AuthMethod { case basic + case jwt + case none func auth(headers: Alamofire.HTTPHeaders?) -> Alamofire.HTTPHeaders { switch self { @@ -22,6 +24,18 @@ public enum AuthMethod { let keychain = Keychain(service: "xyz.sarsoo.music.login") txHeaders.add(.authorization(username: keychain["username"] ?? "", password: keychain["password"] ?? "")) return txHeaders + + case .jwt: + var txHeaders = headers ?? HTTPHeaders() + + let keychain = Keychain(service: "xyz.sarsoo.music.login") + txHeaders.add(.authorization(bearerToken: keychain["jwt"] ?? "")) + return txHeaders + + case .none: + let txHeaders = headers ?? HTTPHeaders() + + return txHeaders } } } @@ -29,8 +43,16 @@ public enum AuthMethod { struct RequestBuilder { static func buildRequest(apiRequest: ApiRequest) -> Alamofire.DataRequest { + print(apiRequest.authMethod) + print(apiRequest.headers) + print(apiRequest.httpMethod) + let txHeaders = apiRequest.authMethod?.auth(headers: apiRequest.headers) + print(txHeaders) + print(apiRequest.parameters) + print(apiRequest.domain + apiRequest.path) + if apiRequest.parameters != nil { if apiRequest.parameterType != nil { @@ -55,7 +77,7 @@ struct RequestBuilder { } struct ApiRequestDefaults { - static let authMethod: AuthMethod = .basic + static let authMethod: AuthMethod = .jwt static var domain: String { get { let default_url = "https://mixonomer.sarsoo.xyz/" diff --git a/Music Tools/Network/NetworkPersister.swift b/Mixonomer/Network/NetworkPersister.swift similarity index 100% rename from Music Tools/Network/NetworkPersister.swift rename to Mixonomer/Network/NetworkPersister.swift diff --git a/Music Tools/Network/PlaylistApi.swift b/Mixonomer/Network/PlaylistApi.swift similarity index 100% rename from Music Tools/Network/PlaylistApi.swift rename to Mixonomer/Network/PlaylistApi.swift diff --git a/Music Tools/Network/TagApi.swift b/Mixonomer/Network/TagApi.swift similarity index 100% rename from Music Tools/Network/TagApi.swift rename to Mixonomer/Network/TagApi.swift diff --git a/Music Tools/Network/UserApi.swift b/Mixonomer/Network/UserApi.swift similarity index 100% rename from Music Tools/Network/UserApi.swift rename to Mixonomer/Network/UserApi.swift diff --git a/Music Tools/Preview Content/Preview Assets.xcassets/Contents.json b/Mixonomer/Preview Content/Preview Assets.xcassets/Contents.json similarity index 100% rename from Music Tools/Preview Content/Preview Assets.xcassets/Contents.json rename to Mixonomer/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/Music Tools/Router.swift b/Mixonomer/Router.swift similarity index 100% rename from Music Tools/Router.swift rename to Mixonomer/Router.swift diff --git a/Music Tools/Views/AppSkeleton.swift b/Mixonomer/Views/AppSkeleton.swift similarity index 100% rename from Music Tools/Views/AppSkeleton.swift rename to Mixonomer/Views/AppSkeleton.swift diff --git a/Music Tools/Views/LoginScreen.swift b/Mixonomer/Views/LoginScreen.swift similarity index 73% rename from Music Tools/Views/LoginScreen.swift rename to Mixonomer/Views/LoginScreen.swift index 3b46928..a6d46d6 100644 --- a/Music Tools/Views/LoginScreen.swift +++ b/Mixonomer/Views/LoginScreen.swift @@ -9,6 +9,7 @@ import SwiftUI import ToastUI import KeychainAccess +import SwiftyJSON struct LoginScreen: View { @@ -40,18 +41,35 @@ struct LoginScreen: View { keychain["username"] = username keychain["password"] = password - let api = UserApi.getUser + print(username) + print(password) + + let api = AuthApi.token(username: username, password: password) RequestBuilder.buildRequest(apiRequest: api) .validate() - .responseData { response in + .responseJSON { response in switch response.result { case .success: + + guard let data = response.data else { + fatalError("error getting token") + } + + guard let json = try? JSON(data: data) else { + fatalError("error parsing reponse") + } + + let token = json["token"].stringValue + + keychain["jwt"] = token self.liveUser.loggedIn = true + case .failure: keychain["username"] = nil keychain["password"] = nil + keychain["jwt"] = nil toastText = "Login Failed" showingToast = true diff --git a/Music Tools/Views/Playlist/AddPlaylistSheet.swift b/Mixonomer/Views/Playlist/AddPlaylistSheet.swift similarity index 100% rename from Music Tools/Views/Playlist/AddPlaylistSheet.swift rename to Mixonomer/Views/Playlist/AddPlaylistSheet.swift diff --git a/Music Tools/Views/Playlist/PlaylistInputList.swift b/Mixonomer/Views/Playlist/PlaylistInputList.swift similarity index 100% rename from Music Tools/Views/Playlist/PlaylistInputList.swift rename to Mixonomer/Views/Playlist/PlaylistInputList.swift diff --git a/Music Tools/Views/Playlist/PlaylistList.swift b/Mixonomer/Views/Playlist/PlaylistList.swift similarity index 100% rename from Music Tools/Views/Playlist/PlaylistList.swift rename to Mixonomer/Views/Playlist/PlaylistList.swift diff --git a/Music Tools/Views/Playlist/PlaylistRow.swift b/Mixonomer/Views/Playlist/PlaylistRow.swift similarity index 100% rename from Music Tools/Views/Playlist/PlaylistRow.swift rename to Mixonomer/Views/Playlist/PlaylistRow.swift diff --git a/Music Tools/Views/Playlist/PlaylistView.swift b/Mixonomer/Views/Playlist/PlaylistView.swift similarity index 100% rename from Music Tools/Views/Playlist/PlaylistView.swift rename to Mixonomer/Views/Playlist/PlaylistView.swift diff --git a/Music Tools/Views/Settings/SettingsList.swift b/Mixonomer/Views/Settings/SettingsList.swift similarity index 100% rename from Music Tools/Views/Settings/SettingsList.swift rename to Mixonomer/Views/Settings/SettingsList.swift diff --git a/Music Tools/Views/Tag/AddTagSheet.swift b/Mixonomer/Views/Tag/AddTagSheet.swift similarity index 100% rename from Music Tools/Views/Tag/AddTagSheet.swift rename to Mixonomer/Views/Tag/AddTagSheet.swift diff --git a/Music Tools/Views/Tag/TagList.swift b/Mixonomer/Views/Tag/TagList.swift similarity index 100% rename from Music Tools/Views/Tag/TagList.swift rename to Mixonomer/Views/Tag/TagList.swift diff --git a/Music Tools/Views/Tag/TagObjList.swift b/Mixonomer/Views/Tag/TagObjList.swift similarity index 100% rename from Music Tools/Views/Tag/TagObjList.swift rename to Mixonomer/Views/Tag/TagObjList.swift diff --git a/Music Tools/Views/Tag/TagRow.swift b/Mixonomer/Views/Tag/TagRow.swift similarity index 100% rename from Music Tools/Views/Tag/TagRow.swift rename to Mixonomer/Views/Tag/TagRow.swift diff --git a/Music Tools/Views/Tag/TagView.swift b/Mixonomer/Views/Tag/TagView.swift similarity index 100% rename from Music Tools/Views/Tag/TagView.swift rename to Mixonomer/Views/Tag/TagView.swift diff --git a/Music ToolsTests/Info.plist b/MixonomerTests/Info.plist similarity index 100% rename from Music ToolsTests/Info.plist rename to MixonomerTests/Info.plist diff --git a/Music ToolsTests/Music_ToolsTests.swift b/MixonomerTests/MixonomerTests.swift similarity index 100% rename from Music ToolsTests/Music_ToolsTests.swift rename to MixonomerTests/MixonomerTests.swift diff --git a/Music ToolsUITests/Info.plist b/MixonomerUITests/Info.plist similarity index 100% rename from Music ToolsUITests/Info.plist rename to MixonomerUITests/Info.plist diff --git a/Music ToolsUITests/Music_ToolsUITests.swift b/MixonomerUITests/MixonomerUITests.swift similarity index 100% rename from Music ToolsUITests/Music_ToolsUITests.swift rename to MixonomerUITests/MixonomerUITests.swift