├── .gitignore ├── InventoryWatch.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ └── InventoryWatch.xcscheme └── xcuserdata │ └── worthbak.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── InventoryWatch ├── AppleWatchUltra-intl.json ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Artboard-1.png │ │ ├── Artboard-2.png │ │ ├── Artboard-3.png │ │ ├── Artboard-4.png │ │ ├── Artboard-5.png │ │ ├── Artboard-6.png │ │ ├── Artboard-7.png │ │ ├── Artboard-8.png │ │ ├── Artboard.png │ │ ├── Contents.json │ │ └── Logo Bitmap.png │ └── Contents.json ├── ContentView.swift ├── Countries.swift ├── Credits.rtf ├── Helpers.swift ├── InventoryWatch.entitlements ├── InventoryWatchApp.swift ├── Model │ ├── Analytics.swift │ ├── DefaultsVendor.swift │ ├── FulfillmentModel.swift │ ├── GithubModel.swift │ ├── ModelError.swift │ ├── ModelTypes │ │ ├── AllPhoneModels.swift │ │ ├── AppleWatchData.swift │ │ ├── FulfillmentStore.swift │ │ ├── GithubTag.swift │ │ ├── PartAvailability.swift │ │ ├── ProductType.swift │ │ └── StoreBootstrap.swift │ ├── NotificationManager.swift │ ├── NotificationSender.swift │ ├── SKUDataLoader.swift │ └── ViewModel.swift ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── SKUData.swift ├── SettingsView.swift ├── Stores_LocalBootstrap.json ├── iPhoneModels13-intl.json └── iPhoneModels14-intl.json ├── LICENSE.md ├── README.md ├── docs ├── InventoryWatch-0.2.2.zip ├── _config.yml ├── ic-mkt.jpg ├── index.md ├── iw-2.0-mkt.jpg └── logo.png └── product └── InventoryWatch.zip /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /InventoryWatch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 380CF9FB27448E860080472A /* iPhoneModels13-intl.json in Resources */ = {isa = PBXBuildFile; fileRef = 380CF9FA27448E860080472A /* iPhoneModels13-intl.json */; }; 11 | 3817268E273AA898003B8D76 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3817268D273AA898003B8D76 /* SettingsView.swift */; }; 12 | 382981C328E3EA54008C68F7 /* AppleWatchUltra-intl.json in Resources */ = {isa = PBXBuildFile; fileRef = 382981C228E3EA54008C68F7 /* AppleWatchUltra-intl.json */; }; 13 | 385886AD290827A6003D3C80 /* ModelError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385886AC290827A6003D3C80 /* ModelError.swift */; }; 14 | 385886AF290827D6003D3C80 /* SKUDataLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385886AE290827D6003D3C80 /* SKUDataLoader.swift */; }; 15 | 385886B12908280E003D3C80 /* FulfillmentModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385886B02908280E003D3C80 /* FulfillmentModel.swift */; }; 16 | 385886B32908281F003D3C80 /* GithubModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385886B22908281F003D3C80 /* GithubModel.swift */; }; 17 | 385886B529082831003D3C80 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385886B429082831003D3C80 /* ViewModel.swift */; }; 18 | 385886B72908283F003D3C80 /* DefaultsVendor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385886B62908283F003D3C80 /* DefaultsVendor.swift */; }; 19 | 386FDC572739DA7300C1BAC2 /* InventoryWatchApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FDC562739DA7300C1BAC2 /* InventoryWatchApp.swift */; }; 20 | 386FDC592739DA7300C1BAC2 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FDC582739DA7300C1BAC2 /* ContentView.swift */; }; 21 | 386FDC5B2739DA7300C1BAC2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 386FDC5A2739DA7300C1BAC2 /* Assets.xcassets */; }; 22 | 386FDC5E2739DA7300C1BAC2 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 386FDC5D2739DA7300C1BAC2 /* Preview Assets.xcassets */; }; 23 | 386FDC68273A18F800C1BAC2 /* SKUData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FDC67273A18F800C1BAC2 /* SKUData.swift */; }; 24 | 386FDC6A273A200000C1BAC2 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FDC69273A200000C1BAC2 /* NotificationManager.swift */; }; 25 | 387F6E7628CCF5B300E68AC0 /* iPhoneModels14-intl.json in Resources */ = {isa = PBXBuildFile; fileRef = 387F6E7528CCF5B300E68AC0 /* iPhoneModels14-intl.json */; }; 26 | 3885D54C2891711E00BD6A78 /* FulfillmentStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3885D54B2891711E00BD6A78 /* FulfillmentStore.swift */; }; 27 | 3885D54E2891713200BD6A78 /* PartAvailability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3885D54D2891713200BD6A78 /* PartAvailability.swift */; }; 28 | 3885D5502891714400BD6A78 /* ProductType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3885D54F2891714400BD6A78 /* ProductType.swift */; }; 29 | 3885D5522891718600BD6A78 /* AllPhoneModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3885D5512891718600BD6A78 /* AllPhoneModels.swift */; }; 30 | 3885D5542891719600BD6A78 /* GithubTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3885D5532891719600BD6A78 /* GithubTag.swift */; }; 31 | 3891902D28E882070051FE3A /* Stores_LocalBootstrap.json in Resources */ = {isa = PBXBuildFile; fileRef = 3891902C28E882070051FE3A /* Stores_LocalBootstrap.json */; }; 32 | 3891902F28E8831B0051FE3A /* StoreBootstrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3891902E28E8831B0051FE3A /* StoreBootstrap.swift */; }; 33 | 3895BE92290ACE5000FBC188 /* AppleWatchData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3895BE91290ACE5000FBC188 /* AppleWatchData.swift */; }; 34 | 3895BE94290B101B00FBC188 /* NotificationSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3895BE93290B101B00FBC188 /* NotificationSender.swift */; }; 35 | 38D0C3A2273C60B500A7DE65 /* Countries.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D0C3A1273C60B500A7DE65 /* Countries.swift */; }; 36 | 38D307DB2745E2E700A0686D /* Analytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38D307DA2745E2E700A0686D /* Analytics.swift */; }; 37 | 38E1C21A27E6714E0047703D /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38E1C21927E6714E0047703D /* Helpers.swift */; }; 38 | 38E4279E273EF542006BF6D7 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 38E4279D273EF542006BF6D7 /* Credits.rtf */; }; 39 | /* End PBXBuildFile section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 380CF9FA27448E860080472A /* iPhoneModels13-intl.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "iPhoneModels13-intl.json"; sourceTree = ""; }; 43 | 3817268D273AA898003B8D76 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 44 | 382981C228E3EA54008C68F7 /* AppleWatchUltra-intl.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "AppleWatchUltra-intl.json"; sourceTree = ""; }; 45 | 385886AC290827A6003D3C80 /* ModelError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelError.swift; sourceTree = ""; }; 46 | 385886AE290827D6003D3C80 /* SKUDataLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKUDataLoader.swift; sourceTree = ""; }; 47 | 385886B02908280E003D3C80 /* FulfillmentModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FulfillmentModel.swift; sourceTree = ""; }; 48 | 385886B22908281F003D3C80 /* GithubModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GithubModel.swift; sourceTree = ""; }; 49 | 385886B429082831003D3C80 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; 50 | 385886B62908283F003D3C80 /* DefaultsVendor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultsVendor.swift; sourceTree = ""; }; 51 | 386FDC532739DA7300C1BAC2 /* InventoryWatch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InventoryWatch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 386FDC562739DA7300C1BAC2 /* InventoryWatchApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InventoryWatchApp.swift; sourceTree = ""; }; 53 | 386FDC582739DA7300C1BAC2 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 54 | 386FDC5A2739DA7300C1BAC2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 55 | 386FDC5D2739DA7300C1BAC2 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 56 | 386FDC5F2739DA7300C1BAC2 /* InventoryWatch.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = InventoryWatch.entitlements; sourceTree = ""; }; 57 | 386FDC67273A18F800C1BAC2 /* SKUData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKUData.swift; sourceTree = ""; }; 58 | 386FDC69273A200000C1BAC2 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = ""; }; 59 | 387F6E7528CCF5B300E68AC0 /* iPhoneModels14-intl.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "iPhoneModels14-intl.json"; sourceTree = ""; }; 60 | 3885D54B2891711E00BD6A78 /* FulfillmentStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FulfillmentStore.swift; sourceTree = ""; }; 61 | 3885D54D2891713200BD6A78 /* PartAvailability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartAvailability.swift; sourceTree = ""; }; 62 | 3885D54F2891714400BD6A78 /* ProductType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductType.swift; sourceTree = ""; }; 63 | 3885D5512891718600BD6A78 /* AllPhoneModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPhoneModels.swift; sourceTree = ""; }; 64 | 3885D5532891719600BD6A78 /* GithubTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GithubTag.swift; sourceTree = ""; }; 65 | 3891902C28E882070051FE3A /* Stores_LocalBootstrap.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Stores_LocalBootstrap.json; sourceTree = ""; }; 66 | 3891902E28E8831B0051FE3A /* StoreBootstrap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreBootstrap.swift; sourceTree = ""; }; 67 | 3895BE91290ACE5000FBC188 /* AppleWatchData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleWatchData.swift; sourceTree = ""; }; 68 | 3895BE93290B101B00FBC188 /* NotificationSender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSender.swift; sourceTree = ""; }; 69 | 38D0C3A1273C60B500A7DE65 /* Countries.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Countries.swift; sourceTree = ""; }; 70 | 38D307DA2745E2E700A0686D /* Analytics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Analytics.swift; sourceTree = ""; }; 71 | 38E1C21927E6714E0047703D /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; 72 | 38E4279D273EF542006BF6D7 /* Credits.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = ""; }; 73 | /* End PBXFileReference section */ 74 | 75 | /* Begin PBXFrameworksBuildPhase section */ 76 | 386FDC502739DA7300C1BAC2 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 3863FF54290D7F550013C1DE /* ModelTypes */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 3885D54F2891714400BD6A78 /* ProductType.swift */, 90 | 3885D54B2891711E00BD6A78 /* FulfillmentStore.swift */, 91 | 3891902E28E8831B0051FE3A /* StoreBootstrap.swift */, 92 | 3885D5512891718600BD6A78 /* AllPhoneModels.swift */, 93 | 3895BE91290ACE5000FBC188 /* AppleWatchData.swift */, 94 | 3885D54D2891713200BD6A78 /* PartAvailability.swift */, 95 | 3885D5532891719600BD6A78 /* GithubTag.swift */, 96 | ); 97 | path = ModelTypes; 98 | sourceTree = ""; 99 | }; 100 | 386FDC4A2739DA7300C1BAC2 = { 101 | isa = PBXGroup; 102 | children = ( 103 | 386FDC552739DA7300C1BAC2 /* InventoryWatch */, 104 | 386FDC542739DA7300C1BAC2 /* Products */, 105 | ); 106 | sourceTree = ""; 107 | }; 108 | 386FDC542739DA7300C1BAC2 /* Products */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 386FDC532739DA7300C1BAC2 /* InventoryWatch.app */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | 386FDC552739DA7300C1BAC2 /* InventoryWatch */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 386FDC562739DA7300C1BAC2 /* InventoryWatchApp.swift */, 120 | 386FDC582739DA7300C1BAC2 /* ContentView.swift */, 121 | 3817268D273AA898003B8D76 /* SettingsView.swift */, 122 | 3885D54A289170E700BD6A78 /* Model */, 123 | 38E1C21927E6714E0047703D /* Helpers.swift */, 124 | 3891902C28E882070051FE3A /* Stores_LocalBootstrap.json */, 125 | 380CF9FA27448E860080472A /* iPhoneModels13-intl.json */, 126 | 387F6E7528CCF5B300E68AC0 /* iPhoneModels14-intl.json */, 127 | 382981C228E3EA54008C68F7 /* AppleWatchUltra-intl.json */, 128 | 386FDC67273A18F800C1BAC2 /* SKUData.swift */, 129 | 38D0C3A1273C60B500A7DE65 /* Countries.swift */, 130 | 386FDC5A2739DA7300C1BAC2 /* Assets.xcassets */, 131 | 38E4279D273EF542006BF6D7 /* Credits.rtf */, 132 | 386FDC5F2739DA7300C1BAC2 /* InventoryWatch.entitlements */, 133 | 386FDC5C2739DA7300C1BAC2 /* Preview Content */, 134 | ); 135 | path = InventoryWatch; 136 | sourceTree = ""; 137 | }; 138 | 386FDC5C2739DA7300C1BAC2 /* Preview Content */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 386FDC5D2739DA7300C1BAC2 /* Preview Assets.xcassets */, 142 | ); 143 | path = "Preview Content"; 144 | sourceTree = ""; 145 | }; 146 | 3885D54A289170E700BD6A78 /* Model */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 385886B429082831003D3C80 /* ViewModel.swift */, 150 | 386FDC69273A200000C1BAC2 /* NotificationManager.swift */, 151 | 38D307DA2745E2E700A0686D /* Analytics.swift */, 152 | 385886AC290827A6003D3C80 /* ModelError.swift */, 153 | 385886B62908283F003D3C80 /* DefaultsVendor.swift */, 154 | 385886B22908281F003D3C80 /* GithubModel.swift */, 155 | 385886AE290827D6003D3C80 /* SKUDataLoader.swift */, 156 | 385886B02908280E003D3C80 /* FulfillmentModel.swift */, 157 | 3895BE93290B101B00FBC188 /* NotificationSender.swift */, 158 | 3863FF54290D7F550013C1DE /* ModelTypes */, 159 | ); 160 | path = Model; 161 | sourceTree = ""; 162 | }; 163 | /* End PBXGroup section */ 164 | 165 | /* Begin PBXNativeTarget section */ 166 | 386FDC522739DA7300C1BAC2 /* InventoryWatch */ = { 167 | isa = PBXNativeTarget; 168 | buildConfigurationList = 386FDC622739DA7300C1BAC2 /* Build configuration list for PBXNativeTarget "InventoryWatch" */; 169 | buildPhases = ( 170 | 386FDC4F2739DA7300C1BAC2 /* Sources */, 171 | 386FDC502739DA7300C1BAC2 /* Frameworks */, 172 | 386FDC512739DA7300C1BAC2 /* Resources */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | ); 178 | name = InventoryWatch; 179 | productName = InventoryWatch; 180 | productReference = 386FDC532739DA7300C1BAC2 /* InventoryWatch.app */; 181 | productType = "com.apple.product-type.application"; 182 | }; 183 | /* End PBXNativeTarget section */ 184 | 185 | /* Begin PBXProject section */ 186 | 386FDC4B2739DA7300C1BAC2 /* Project object */ = { 187 | isa = PBXProject; 188 | attributes = { 189 | BuildIndependentTargetsInParallel = 1; 190 | LastSwiftUpdateCheck = 1310; 191 | LastUpgradeCheck = 1400; 192 | TargetAttributes = { 193 | 386FDC522739DA7300C1BAC2 = { 194 | CreatedOnToolsVersion = 13.1; 195 | }; 196 | }; 197 | }; 198 | buildConfigurationList = 386FDC4E2739DA7300C1BAC2 /* Build configuration list for PBXProject "InventoryWatch" */; 199 | compatibilityVersion = "Xcode 13.0"; 200 | developmentRegion = en; 201 | hasScannedForEncodings = 0; 202 | knownRegions = ( 203 | en, 204 | Base, 205 | ); 206 | mainGroup = 386FDC4A2739DA7300C1BAC2; 207 | productRefGroup = 386FDC542739DA7300C1BAC2 /* Products */; 208 | projectDirPath = ""; 209 | projectRoot = ""; 210 | targets = ( 211 | 386FDC522739DA7300C1BAC2 /* InventoryWatch */, 212 | ); 213 | }; 214 | /* End PBXProject section */ 215 | 216 | /* Begin PBXResourcesBuildPhase section */ 217 | 386FDC512739DA7300C1BAC2 /* Resources */ = { 218 | isa = PBXResourcesBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | 387F6E7628CCF5B300E68AC0 /* iPhoneModels14-intl.json in Resources */, 222 | 38E4279E273EF542006BF6D7 /* Credits.rtf in Resources */, 223 | 3891902D28E882070051FE3A /* Stores_LocalBootstrap.json in Resources */, 224 | 382981C328E3EA54008C68F7 /* AppleWatchUltra-intl.json in Resources */, 225 | 380CF9FB27448E860080472A /* iPhoneModels13-intl.json in Resources */, 226 | 386FDC5E2739DA7300C1BAC2 /* Preview Assets.xcassets in Resources */, 227 | 386FDC5B2739DA7300C1BAC2 /* Assets.xcassets in Resources */, 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | }; 231 | /* End PBXResourcesBuildPhase section */ 232 | 233 | /* Begin PBXSourcesBuildPhase section */ 234 | 386FDC4F2739DA7300C1BAC2 /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 3885D54E2891713200BD6A78 /* PartAvailability.swift in Sources */, 239 | 386FDC68273A18F800C1BAC2 /* SKUData.swift in Sources */, 240 | 385886B72908283F003D3C80 /* DefaultsVendor.swift in Sources */, 241 | 38D307DB2745E2E700A0686D /* Analytics.swift in Sources */, 242 | 386FDC6A273A200000C1BAC2 /* NotificationManager.swift in Sources */, 243 | 38E1C21A27E6714E0047703D /* Helpers.swift in Sources */, 244 | 3895BE94290B101B00FBC188 /* NotificationSender.swift in Sources */, 245 | 385886AD290827A6003D3C80 /* ModelError.swift in Sources */, 246 | 3885D54C2891711E00BD6A78 /* FulfillmentStore.swift in Sources */, 247 | 3817268E273AA898003B8D76 /* SettingsView.swift in Sources */, 248 | 3891902F28E8831B0051FE3A /* StoreBootstrap.swift in Sources */, 249 | 385886B529082831003D3C80 /* ViewModel.swift in Sources */, 250 | 386FDC592739DA7300C1BAC2 /* ContentView.swift in Sources */, 251 | 385886AF290827D6003D3C80 /* SKUDataLoader.swift in Sources */, 252 | 385886B12908280E003D3C80 /* FulfillmentModel.swift in Sources */, 253 | 3885D5542891719600BD6A78 /* GithubTag.swift in Sources */, 254 | 3895BE92290ACE5000FBC188 /* AppleWatchData.swift in Sources */, 255 | 38D0C3A2273C60B500A7DE65 /* Countries.swift in Sources */, 256 | 385886B32908281F003D3C80 /* GithubModel.swift in Sources */, 257 | 3885D5522891718600BD6A78 /* AllPhoneModels.swift in Sources */, 258 | 386FDC572739DA7300C1BAC2 /* InventoryWatchApp.swift in Sources */, 259 | 3885D5502891714400BD6A78 /* ProductType.swift in Sources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | /* End PBXSourcesBuildPhase section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 386FDC602739DA7300C1BAC2 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | CLANG_ANALYZER_NONNULL = YES; 271 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_ENABLE_OBJC_WEAK = YES; 277 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 278 | CLANG_WARN_BOOL_CONVERSION = YES; 279 | CLANG_WARN_COMMA = YES; 280 | CLANG_WARN_CONSTANT_CONVERSION = YES; 281 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 283 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 284 | CLANG_WARN_EMPTY_BODY = YES; 285 | CLANG_WARN_ENUM_CONVERSION = YES; 286 | CLANG_WARN_INFINITE_RECURSION = YES; 287 | CLANG_WARN_INT_CONVERSION = YES; 288 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 289 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 290 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 291 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 292 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 293 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 294 | CLANG_WARN_STRICT_PROTOTYPES = YES; 295 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 296 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 297 | CLANG_WARN_UNREACHABLE_CODE = YES; 298 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 299 | COPY_PHASE_STRIP = NO; 300 | DEAD_CODE_STRIPPING = YES; 301 | DEBUG_INFORMATION_FORMAT = dwarf; 302 | ENABLE_STRICT_OBJC_MSGSEND = YES; 303 | ENABLE_TESTABILITY = YES; 304 | GCC_C_LANGUAGE_STANDARD = gnu11; 305 | GCC_DYNAMIC_NO_PIC = NO; 306 | GCC_NO_COMMON_BLOCKS = YES; 307 | GCC_OPTIMIZATION_LEVEL = 0; 308 | GCC_PREPROCESSOR_DEFINITIONS = ( 309 | "DEBUG=1", 310 | "$(inherited)", 311 | ); 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | MACOSX_DEPLOYMENT_TARGET = 12.0; 319 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 320 | MTL_FAST_MATH = YES; 321 | ONLY_ACTIVE_ARCH = YES; 322 | SDKROOT = macosx; 323 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 324 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 325 | }; 326 | name = Debug; 327 | }; 328 | 386FDC612739DA7300C1BAC2 /* Release */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ALWAYS_SEARCH_USER_PATHS = NO; 332 | CLANG_ANALYZER_NONNULL = YES; 333 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_ENABLE_OBJC_WEAK = YES; 339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_COMMA = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | COPY_PHASE_STRIP = NO; 362 | DEAD_CODE_STRIPPING = YES; 363 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 364 | ENABLE_NS_ASSERTIONS = NO; 365 | ENABLE_STRICT_OBJC_MSGSEND = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu11; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | MACOSX_DEPLOYMENT_TARGET = 12.0; 375 | MTL_ENABLE_DEBUG_INFO = NO; 376 | MTL_FAST_MATH = YES; 377 | SDKROOT = macosx; 378 | SWIFT_COMPILATION_MODE = wholemodule; 379 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 380 | }; 381 | name = Release; 382 | }; 383 | 386FDC632739DA7300C1BAC2 /* Debug */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 387 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 388 | CODE_SIGN_ENTITLEMENTS = InventoryWatch/InventoryWatch.entitlements; 389 | CODE_SIGN_IDENTITY = "Apple Development"; 390 | CODE_SIGN_STYLE = Automatic; 391 | COMBINE_HIDPI_IMAGES = YES; 392 | CURRENT_PROJECT_VERSION = 1; 393 | DEAD_CODE_STRIPPING = YES; 394 | DEVELOPMENT_ASSET_PATHS = "\"InventoryWatch/Preview Content\""; 395 | DEVELOPMENT_TEAM = 64A6JSYH8N; 396 | ENABLE_HARDENED_RUNTIME = YES; 397 | ENABLE_PREVIEWS = YES; 398 | GENERATE_INFOPLIST_FILE = YES; 399 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.shopping"; 400 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 401 | LD_RUNPATH_SEARCH_PATHS = ( 402 | "$(inherited)", 403 | "@executable_path/../Frameworks", 404 | ); 405 | MACOSX_DEPLOYMENT_TARGET = 11.5; 406 | MARKETING_VERSION = 0.2.2; 407 | PRODUCT_BUNDLE_IDENTIFIER = com.worthbak.InventoryWatch; 408 | PRODUCT_NAME = "$(TARGET_NAME)"; 409 | SWIFT_EMIT_LOC_STRINGS = YES; 410 | SWIFT_STRICT_CONCURRENCY = complete; 411 | SWIFT_VERSION = 5.0; 412 | }; 413 | name = Debug; 414 | }; 415 | 386FDC642739DA7300C1BAC2 /* Release */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 419 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 420 | CODE_SIGN_ENTITLEMENTS = InventoryWatch/InventoryWatch.entitlements; 421 | CODE_SIGN_IDENTITY = "Apple Development"; 422 | CODE_SIGN_STYLE = Automatic; 423 | COMBINE_HIDPI_IMAGES = YES; 424 | CURRENT_PROJECT_VERSION = 1; 425 | DEAD_CODE_STRIPPING = YES; 426 | DEVELOPMENT_ASSET_PATHS = "\"InventoryWatch/Preview Content\""; 427 | DEVELOPMENT_TEAM = 64A6JSYH8N; 428 | ENABLE_HARDENED_RUNTIME = YES; 429 | ENABLE_PREVIEWS = YES; 430 | GENERATE_INFOPLIST_FILE = YES; 431 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.shopping"; 432 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 433 | LD_RUNPATH_SEARCH_PATHS = ( 434 | "$(inherited)", 435 | "@executable_path/../Frameworks", 436 | ); 437 | MACOSX_DEPLOYMENT_TARGET = 11.5; 438 | MARKETING_VERSION = 0.2.2; 439 | PRODUCT_BUNDLE_IDENTIFIER = com.worthbak.InventoryWatch; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | SWIFT_EMIT_LOC_STRINGS = YES; 442 | SWIFT_STRICT_CONCURRENCY = complete; 443 | SWIFT_VERSION = 5.0; 444 | }; 445 | name = Release; 446 | }; 447 | /* End XCBuildConfiguration section */ 448 | 449 | /* Begin XCConfigurationList section */ 450 | 386FDC4E2739DA7300C1BAC2 /* Build configuration list for PBXProject "InventoryWatch" */ = { 451 | isa = XCConfigurationList; 452 | buildConfigurations = ( 453 | 386FDC602739DA7300C1BAC2 /* Debug */, 454 | 386FDC612739DA7300C1BAC2 /* Release */, 455 | ); 456 | defaultConfigurationIsVisible = 0; 457 | defaultConfigurationName = Release; 458 | }; 459 | 386FDC622739DA7300C1BAC2 /* Build configuration list for PBXNativeTarget "InventoryWatch" */ = { 460 | isa = XCConfigurationList; 461 | buildConfigurations = ( 462 | 386FDC632739DA7300C1BAC2 /* Debug */, 463 | 386FDC642739DA7300C1BAC2 /* Release */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 386FDC4B2739DA7300C1BAC2 /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /InventoryWatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InventoryWatch.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InventoryWatch.xcodeproj/xcshareddata/xcschemes/InventoryWatch.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /InventoryWatch.xcodeproj/xcuserdata/worthbak.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | InventoryWatch.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 386FDC522739DA7300C1BAC2 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /InventoryWatch/AppleWatchUltra-intl.json: -------------------------------------------------------------------------------- 1 | { 2 | "us": { 3 | "alpine": { 4 | "MQEY3LL/A": "Titanium Case with Starlight Alpine Loop (small)", 5 | "MQF03LL/A": "Titanium Case with Starlight Alpine Loop (medium)", 6 | "MQF13LL/A": "Titanium Case with Starlight Alpine Loop (large)", 7 | "MNHC3LL/A": "Titanium Case with Green Alpine Loop (small)", 8 | "MQEW3LL/A": "Titanium Case with Green Alpine Loop (medium)", 9 | "MQEX3LL/A": "Titanium Case with Green Alpine Loop (large)", 10 | "MNHA3LL/A": "Titanium Case with Orange Alpine Loop (small)", 11 | "MQEU3LL/A": "Titanium Case with Orange Alpine Loop (medium)", 12 | "MQEV3LL/A": "Titanium Case with Orange Alpine Loop (large)" 13 | }, 14 | "trail": { 15 | "MNHD3LL/A": "Titanium Case with Yellow/Beige Trail Loop (small/medium)", 16 | "MQF23LL/A": "Titanium Case with Yellow/Beige Trail Loop (medium/large)", 17 | "MNHE3LL/A": "Titanium Case with Blue/Gray Trail Loop (small/medium)", 18 | "MQF33LL/A": "Titanium Case with Blue/Gray Trail Loop (medium/large)", 19 | "MQF43LL/A": "Titanium Case with Black/Gray Trail Loop (small/medium)", 20 | "MQF53LL/A": "Titanium Case with Black/Gray Trail Loop (medium/large)" 21 | }, 22 | "ocean": { 23 | "MQET3LL/A": "Titanium Case with Midnight Ocean Band (onesize)", 24 | "MNH83LL/A": "Titanium Case with White Ocean Band (onesize)", 25 | "MNH93LL/A": "Titanium Case with Yellow Ocean Band (onesize)" 26 | } 27 | }, 28 | "ca": { 29 | "alpine": { 30 | "MQEY3VC/A": "Titanium Case with Starlight Alpine Loop (small)", 31 | "MQF03VC/A": "Titanium Case with Starlight Alpine Loop (medium)", 32 | "MQF13VC/A": "Titanium Case with Starlight Alpine Loop (large)", 33 | "MNHC3VC/A": "Titanium Case with Green Alpine Loop (small)", 34 | "MQEW3VC/A": "Titanium Case with Green Alpine Loop (medium)", 35 | "MQEX3VC/A": "Titanium Case with Green Alpine Loop (large)", 36 | "MNHA3VC/A": "Titanium Case with Orange Alpine Loop (small)", 37 | "MQEU3VC/A": "Titanium Case with Orange Alpine Loop (medium)", 38 | "MQEV3VC/A": "Titanium Case with Orange Alpine Loop (large)" 39 | }, 40 | "trail": { 41 | "MNHD3VC/A": "Titanium Case with Yellow/Beige Trail Loop (small/medium)", 42 | "MQF23VC/A": "Titanium Case with Yellow/Beige Trail Loop (medium/large)", 43 | "MNHE3VC/A": "Titanium Case with Blue/Grey Trail Loop (small/medium)", 44 | "MQF33VC/A": "Titanium Case with Blue/Grey Trail Loop (medium/large)", 45 | "MQF43VC/A": "Titanium Case with Black/Grey Trail Loop (small/medium)", 46 | "MQF53VC/A": "Titanium Case with Black/Grey Trail Loop (medium/large)" 47 | }, 48 | "ocean": { 49 | "MQET3VC/A": "Titanium Case with Midnight Ocean Band (onesize)", 50 | "MNH83VC/A": "Titanium Case with White Ocean Band (onesize)", 51 | "MNH93VC/A": "Titanium Case with Yellow Ocean Band (onesize)" 52 | } 53 | }, 54 | "au": { 55 | "alpine": { 56 | "MQFQ3ZP/A": "Titanium Case with Starlight Alpine Loop (small)", 57 | "MQFR3ZP/A": "Titanium Case with Starlight Alpine Loop (medium)", 58 | "MQFT3ZP/A": "Titanium Case with Starlight Alpine Loop (large)", 59 | "MNHJ3ZP/A": "Titanium Case with Green Alpine Loop (small)", 60 | "MQFN3ZP/A": "Titanium Case with Green Alpine Loop (medium)", 61 | "MQFP3ZP/A": "Titanium Case with Green Alpine Loop (large)", 62 | "MNHH3ZP/A": "Titanium Case with Orange Alpine Loop (small)", 63 | "MQFL3ZP/A": "Titanium Case with Orange Alpine Loop (medium)", 64 | "MQFM3ZP/A": "Titanium Case with Orange Alpine Loop (large)" 65 | }, 66 | "trail": { 67 | "MNHK3ZP/A": "Titanium Case with Yellow/Beige Trail Loop (small/medium)", 68 | "MQFU3ZP/A": "Titanium Case with Yellow/Beige Trail Loop (medium/large)", 69 | "MNHL3ZP/A": "Titanium Case with Blue/Grey Trail Loop (small/medium)", 70 | "MQFV3ZP/A": "Titanium Case with Blue/Grey Trail Loop (medium/large)", 71 | "MQFW3ZP/A": "Titanium Case with Black/Grey Trail Loop (small/medium)", 72 | "MQFX3ZP/A": "Titanium Case with Black/Grey Trail Loop (medium/large)" 73 | }, 74 | "ocean": { 75 | "MQFK3ZP/A": "Titanium Case with Midnight Ocean Band (onesize)", 76 | "MNHF3ZP/A": "Titanium Case with White Ocean Band (onesize)", 77 | "MNHG3ZP/A": "Titanium Case with Yellow Ocean Band (onesize)" 78 | } 79 | }, 80 | "de": { 81 | "alpine": { 82 | "MQFQ3FD/A": "Titangehäuse, Alpine Loop Polarstern (small)", 83 | "MQFR3FD/A": "Titangehäuse, Alpine Loop Polarstern (medium)", 84 | "MQFT3FD/A": "Titangehäuse, Alpine Loop Polarstern (large)", 85 | "MNHJ3FD/A": "Titangehäuse, Alpine Loop Grün (small)", 86 | "MQFN3FD/A": "Titangehäuse, Alpine Loop Grün (medium)", 87 | "MQFP3FD/A": "Titangehäuse, Alpine Loop Grün (large)", 88 | "MNHH3FD/A": "Titangehäuse, Alpine Loop Orange (small)", 89 | "MQFL3FD/A": "Titangehäuse, Alpine Loop Orange (medium)", 90 | "MQFM3FD/A": "Titangehäuse, Alpine Loop Orange (large)" 91 | }, 92 | "trail": { 93 | "MNHK3FD/A": "Titangehäuse, Trail Loop Gelb/Beige (small/medium)", 94 | "MQFU3FD/A": "Titangehäuse, Trail Loop Gelb/Beige (medium/large)", 95 | "MNHL3FD/A": "Titangehäuse, Trail Loop Blau/Grau (small/medium)", 96 | "MQFV3FD/A": "Titangehäuse, Trail Loop Blau/Grau (medium/large)", 97 | "MQFW3FD/A": "Titangehäuse, Trail Loop Schwarz/Grau (small/medium)", 98 | "MQFX3FD/A": "Titangehäuse, Trail Loop Schwarz/Grau (medium/large)" 99 | }, 100 | "ocean": { 101 | "MQFK3FD/A": "Titangehäuse, Ocean Armband Mitternacht (onesize)", 102 | "MNHF3FD/A": "Titangehäuse, Ocean Armband Weiß (onesize)", 103 | "MNHG3FD/A": "Titangehäuse, Ocean Armband Gelb (onesize)" 104 | } 105 | }, 106 | "uk": { 107 | "alpine": { 108 | "MQFQ3B/A": "Titanium Case with Starlight Alpine Loop (small)", 109 | "MQFR3B/A": "Titanium Case with Starlight Alpine Loop (medium)", 110 | "MQFT3B/A": "Titanium Case with Starlight Alpine Loop (large)", 111 | "MNHJ3B/A": "Titanium Case with Green Alpine Loop (small)", 112 | "MQFN3B/A": "Titanium Case with Green Alpine Loop (medium)", 113 | "MQFP3B/A": "Titanium Case with Green Alpine Loop (large)", 114 | "MNHH3B/A": "Titanium Case with Orange Alpine Loop (small)", 115 | "MQFL3B/A": "Titanium Case with Orange Alpine Loop (medium)", 116 | "MQFM3B/A": "Titanium Case with Orange Alpine Loop (large)" 117 | }, 118 | "trail": { 119 | "MNHK3B/A": "Titanium Case with Yellow/Beige Trail Loop (small/medium)", 120 | "MQFU3B/A": "Titanium Case with Yellow/Beige Trail Loop (medium/large)", 121 | "MNHL3B/A": "Titanium Case with Blue/Grey Trail Loop (small/medium)", 122 | "MQFV3B/A": "Titanium Case with Blue/Grey Trail Loop (medium/large)", 123 | "MQFW3B/A": "Titanium Case with Black/Grey Trail Loop (small/medium)", 124 | "MQFX3B/A": "Titanium Case with Black/Grey Trail Loop (medium/large)" 125 | }, 126 | "ocean": { 127 | "MQFK3B/A": "Titanium Case with Midnight Ocean Band (onesize)", 128 | "MNHF3B/A": "Titanium Case with White Ocean Band (onesize)", 129 | "MNHG3B/A": "Titanium Case with Yellow Ocean Band (onesize)" 130 | } 131 | }, 132 | "kr": { 133 | "alpine": { 134 | "MQFQ3KH/A": "티타늄 케이스, 그리고 스타라이트 알파인 루프 (small)", 135 | "MQFR3KH/A": "티타늄 케이스, 그리고 스타라이트 알파인 루프 (medium)", 136 | "MQFT3KH/A": "티타늄 케이스, 그리고 스타라이트 알파인 루프 (large)", 137 | "MNHJ3KH/A": "티타늄 케이스, 그리고 그린 알파인 루프 (small)", 138 | "MQFN3KH/A": "티타늄 케이스, 그리고 그린 알파인 루프 (medium)", 139 | "MQFP3KH/A": "티타늄 케이스, 그리고 그린 알파인 루프 (large)", 140 | "MNHH3KH/A": "티타늄 케이스, 그리고 오렌지 알파인 루프 (small)", 141 | "MQFL3KH/A": "티타늄 케이스, 그리고 오렌지 알파인 루프 (medium)", 142 | "MQFM3KH/A": "티타늄 케이스, 그리고 오렌지 알파인 루프 (large)" 143 | }, 144 | "trail": { 145 | "MNHK3KH/A": "티타늄 케이스, 그리고 옐로/베이지 트레일 루프 (small/medium)", 146 | "MQFU3KH/A": "티타늄 케이스, 그리고 옐로/베이지 트레일 루프 (medium/large)", 147 | "MNHL3KH/A": "티타늄 케이스, 그리고 블루/그레이 트레일 루프 (small/medium)", 148 | "MQFV3KH/A": "티타늄 케이스, 그리고 블루/그레이 트레일 루프 (medium/large)", 149 | "MQFW3KH/A": "티타늄 케이스, 그리고 블랙/그레이 트레일 루프 (small/medium)", 150 | "MQFX3KH/A": "티타늄 케이스, 그리고 블랙/그레이 트레일 루프 (medium/large)" 151 | }, 152 | "ocean": { 153 | "MQFK3KH/A": "티타늄 케이스, 그리고 미드나이트 오션 밴드 (onesize)", 154 | "MNHF3KH/A": "티타늄 케이스, 그리고 화이트 오션 밴드 (onesize)", 155 | "MNHG3KH/A": "티타늄 케이스, 그리고 옐로 오션 밴드 (onesize)" 156 | } 157 | }, 158 | "hk": { 159 | "alpine": { 160 | "MQFA3ZA/A": "Titanium Case with Starlight Alpine Loop (small)", 161 | "MQFC3ZA/A": "Titanium Case with Starlight Alpine Loop (medium)", 162 | "MQFD3ZA/A": "Titanium Case with Starlight Alpine Loop (large)", 163 | "MNHQ3ZA/A": "Titanium Case with Green Alpine Loop (small)", 164 | "MQF83ZA/A": "Titanium Case with Green Alpine Loop (medium)", 165 | "MQF93ZA/A": "Titanium Case with Green Alpine Loop (large)", 166 | "MNHP3ZA/A": "Titanium Case with Orange Alpine Loop (small)", 167 | "MQFJ3ZA/A": "Titanium Case with Orange Alpine Loop (medium)", 168 | "MQF73ZA/A": "Titanium Case with Orange Alpine Loop (large)" 169 | }, 170 | "trail": { 171 | "MNHR3ZA/A": "Titanium Case with Yellow/Beige Trail Loop (small/medium)", 172 | "MQFE3ZA/A": "Titanium Case with Yellow/Beige Trail Loop (medium/large)", 173 | "MNHT3ZA/A": "Titanium Case with Blue/Gray Trail Loop (small/medium)", 174 | "MQFF3ZA/A": "Titanium Case with Blue/Gray Trail Loop (medium/large)", 175 | "MQFG3ZA/A": "Titanium Case with Black/Gray Trail Loop (small/medium)", 176 | "MQFH3ZA/A": "Titanium Case with Black/Gray Trail Loop (medium/large)" 177 | }, 178 | "ocean": { 179 | "MQF63ZA/A": "Titanium Case with Midnight Ocean Band (onesize)", 180 | "MNHM3ZA/A": "Titanium Case with White Ocean Band (onesize)", 181 | "MNHN3ZA/A": "Titanium Case with Yellow Ocean Band (onesize)" 182 | } 183 | }, 184 | "fr": { 185 | "alpine": { 186 | "MQFQ3NF/A": "Boîtier en titane, Boucle Alpine lumière stellaire (small)", 187 | "MQFR3NF/A": "Boîtier en titane, Boucle Alpine lumière stellaire (medium)", 188 | "MQFT3NF/A": "Boîtier en titane, Boucle Alpine lumière stellaire (large)", 189 | "MNHJ3NF/A": "Boîtier en titane, Boucle Alpine vert (small)", 190 | "MQFN3NF/A": "Boîtier en titane, Boucle Alpine vert (medium)", 191 | "MQFP3NF/A": "Boîtier en titane, Boucle Alpine vert (large)", 192 | "MNHH3NF/A": "Boîtier en titane, Boucle Alpine orange (small)", 193 | "MQFL3NF/A": "Boîtier en titane, Boucle Alpine orange (medium)", 194 | "MQFM3NF/A": "Boîtier en titane, Boucle Alpine orange (large)" 195 | }, 196 | "trail": { 197 | "MNHK3NF/A": "Boîtier en titane, Boucle Trail jaune/beige (small/medium)", 198 | "MQFU3NF/A": "Boîtier en titane, Boucle Trail jaune/beige (medium/large)", 199 | "MNHL3NF/A": "Boîtier en titane, Boucle Trail bleu/gris (small/medium)", 200 | "MQFV3NF/A": "Boîtier en titane, Boucle Trail bleu/gris (medium/large)", 201 | "MQFW3NF/A": "Boîtier en titane, Boucle Trail noir/gris (small/medium)", 202 | "MQFX3NF/A": "Boîtier en titane, Boucle Trail noir/gris (medium/large)" 203 | }, 204 | "ocean": { 205 | "MQFK3NF/A": "Boîtier en titane, Bracelet Océan minuit (onesize)", 206 | "MNHF3NF/A": "Boîtier en titane, Bracelet Océan blanc (onesize)", 207 | "MNHG3NF/A": "Boîtier en titane, Bracelet Océan jaune (onesize)" 208 | } 209 | }, 210 | "it": { 211 | "alpine": { 212 | "MQFQ3TY/A": "Cassa in titanio con Alpine Loop galassia (small)", 213 | "MQFR3TY/A": "Cassa in titanio con Alpine Loop galassia (medium)", 214 | "MQFT3TY/A": "Cassa in titanio con Alpine Loop galassia (large)", 215 | "MNHJ3TY/A": "Cassa in titanio con Alpine Loop verde (small)", 216 | "MQFN3TY/A": "Cassa in titanio con Alpine Loop verde (medium)", 217 | "MQFP3TY/A": "Cassa in titanio con Alpine Loop verde (large)", 218 | "MNHH3TY/A": "Cassa in titanio con Alpine Loop arancione (small)", 219 | "MQFL3TY/A": "Cassa in titanio con Alpine Loop arancione (medium)", 220 | "MQFM3TY/A": "Cassa in titanio con Alpine Loop arancione (large)" 221 | }, 222 | "trail": { 223 | "MNHK3TY/A": "Cassa in titanio con Trail Loop giallo/beige (small/medium)", 224 | "MQFU3TY/A": "Cassa in titanio con Trail Loop giallo/beige (medium/large)", 225 | "MNHL3TY/A": "Cassa in titanio con Trail Loop blu/grigio (small/medium)", 226 | "MQFV3TY/A": "Cassa in titanio con Trail Loop blu/grigio (medium/large)", 227 | "MQFW3TY/A": "Cassa in titanio con Trail Loop nero/grigio (small/medium)", 228 | "MQFX3TY/A": "Cassa in titanio con Trail Loop nero/grigio (medium/large)" 229 | }, 230 | "ocean": { 231 | "MQFK3TY/A": "Cassa in titanio con Cinturino Ocean mezzanotte (onesize)", 232 | "MNHF3TY/A": "Cassa in titanio con Cinturino Ocean bianco (onesize)", 233 | "MNHG3TY/A": "Cassa in titanio con Cinturino Ocean giallo (onesize)" 234 | } 235 | }, 236 | "jp": { 237 | "alpine": { 238 | "MQFQ3J/A": "チタニウムケースとスターライトアルパインループ (small)", 239 | "MQFR3J/A": "チタニウムケースとスターライトアルパインループ (medium)", 240 | "MQFT3J/A": "チタニウムケースとスターライトアルパインループ (large)", 241 | "MNHJ3J/A": "チタニウムケースとグリーンアルパインループ (small)", 242 | "MQFN3J/A": "チタニウムケースとグリーンアルパインループ (medium)", 243 | "MQFP3J/A": "チタニウムケースとグリーンアルパインループ (large)", 244 | "MNHH3J/A": "チタニウムケースとオレンジアルパインループ (small)", 245 | "MQFL3J/A": "チタニウムケースとオレンジアルパインループ (medium)", 246 | "MQFM3J/A": "チタニウムケースとオレンジアルパインループ (large)" 247 | }, 248 | "trail": { 249 | "MNHK3J/A": "チタニウムケースとイエロー/ベージュトレイルループ (small/medium)", 250 | "MQFU3J/A": "チタニウムケースとイエロー/ベージュトレイルループ (medium/large)", 251 | "MNHL3J/A": "チタニウムケースとブルー/グレイトレイルループ (small/medium)", 252 | "MQFV3J/A": "チタニウムケースとブルー/グレイトレイルループ (medium/large)", 253 | "MQFW3J/A": "チタニウムケースとブラック/グレイトレイルループ (small/medium)", 254 | "MQFX3J/A": "チタニウムケースとブラック/グレイトレイルループ (medium/large)" 255 | }, 256 | "ocean": { 257 | "MQFK3J/A": "チタニウムケースとミッドナイトオーシャンバンド (onesize)", 258 | "MNHF3J/A": "チタニウムケースとホワイトオーシャンバンド (onesize)", 259 | "MNHG3J/A": "チタニウムケースとイエローオーシャンバンド (onesize)" 260 | } 261 | }, 262 | "at": { 263 | "alpine": { 264 | "MQFQ3FD/A": "Titangehäuse, Alpine Loop Polarstern (small)", 265 | "MQFR3FD/A": "Titangehäuse, Alpine Loop Polarstern (medium)", 266 | "MQFT3FD/A": "Titangehäuse, Alpine Loop Polarstern (large)", 267 | "MNHJ3FD/A": "Titangehäuse, Alpine Loop Grün (small)", 268 | "MQFN3FD/A": "Titangehäuse, Alpine Loop Grün (medium)", 269 | "MQFP3FD/A": "Titangehäuse, Alpine Loop Grün (large)", 270 | "MNHH3FD/A": "Titangehäuse, Alpine Loop Orange (small)", 271 | "MQFL3FD/A": "Titangehäuse, Alpine Loop Orange (medium)", 272 | "MQFM3FD/A": "Titangehäuse, Alpine Loop Orange (large)" 273 | }, 274 | "trail": { 275 | "MNHK3FD/A": "Titangehäuse, Trail Loop Gelb/Beige (small/medium)", 276 | "MQFU3FD/A": "Titangehäuse, Trail Loop Gelb/Beige (medium/large)", 277 | "MNHL3FD/A": "Titangehäuse, Trail Loop Blau/Grau (small/medium)", 278 | "MQFV3FD/A": "Titangehäuse, Trail Loop Blau/Grau (medium/large)", 279 | "MQFW3FD/A": "Titangehäuse, Trail Loop Schwarz/Grau (small/medium)", 280 | "MQFX3FD/A": "Titangehäuse, Trail Loop Schwarz/Grau (medium/large)" 281 | }, 282 | "ocean": { 283 | "MQFK3FD/A": "Titangehäuse, Ocean Armband Mitternacht (onesize)", 284 | "MNHF3FD/A": "Titangehäuse, Ocean Armband Weiß (onesize)", 285 | "MNHG3FD/A": "Titangehäuse, Ocean Armband Gelb (onesize)" 286 | } 287 | }, 288 | "nl": { 289 | "alpine": { 290 | "MQFQ3NF/A": "Kast van titanium • Sterrenlicht Alpine-bandje (small)", 291 | "MQFR3NF/A": "Kast van titanium • Sterrenlicht Alpine-bandje (medium)", 292 | "MQFT3NF/A": "Kast van titanium • Sterrenlicht Alpine-bandje (large)", 293 | "MNHJ3NF/A": "Kast van titanium • Groen Alpine-bandje (small)", 294 | "MQFN3NF/A": "Kast van titanium • Groen Alpine-bandje (medium)", 295 | "MQFP3NF/A": "Kast van titanium • Groen Alpine-bandje (large)", 296 | "MNHH3NF/A": "Kast van titanium • Oranje Alpine-bandje (small)", 297 | "MQFL3NF/A": "Kast van titanium • Oranje Alpine-bandje (medium)", 298 | "MQFM3NF/A": "Kast van titanium • Oranje Alpine-bandje (large)" 299 | }, 300 | "trail": { 301 | "MNHK3NF/A": "Kast van titanium • Geel/beige Trail-bandje (small/medium)", 302 | "MQFU3NF/A": "Kast van titanium • Geel/beige Trail-bandje (medium/large)", 303 | "MNHL3NF/A": "Kast van titanium • Blauw/grijs Trail-bandje (small/medium)", 304 | "MQFV3NF/A": "Kast van titanium • Blauw/grijs Trail-bandje (medium/large)", 305 | "MQFW3NF/A": "Kast van titanium • Zwart/grijs Trail-bandje (small/medium)", 306 | "MQFX3NF/A": "Kast van titanium • Zwart/grijs Trail-bandje (medium/large)" 307 | }, 308 | "ocean": { 309 | "MQFK3NF/A": "Kast van titanium • Middernacht Ocean-bandje (onesize)", 310 | "MNHF3NF/A": "Kast van titanium • Wit Ocean-bandje (onesize)", 311 | "MNHG3NF/A": "Kast van titanium • Geel Ocean-bandje (onesize)" 312 | } 313 | }, 314 | "th": { 315 | "alpine": { 316 | "MQFQ3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีสตาร์ไลท์ (small)", 317 | "MQFR3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีสตาร์ไลท์ (medium)", 318 | "MQFT3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีสตาร์ไลท์ (large)", 319 | "MNHJ3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีเขียว (small)", 320 | "MQFN3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีเขียว (medium)", 321 | "MQFP3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีเขียว (large)", 322 | "MNHH3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีส้ม (small)", 323 | "MQFL3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีส้ม (medium)", 324 | "MQFM3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Alpine Loop สีส้ม (large)" 325 | }, 326 | "trail": { 327 | "MNHK3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Trail Loop สีเหลือง/เบจ (small/medium)", 328 | "MQFU3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Trail Loop สีเหลือง/เบจ (medium/large)", 329 | "MNHL3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Trail Loop สีน้ำเงิน/เทา (small/medium)", 330 | "MQFV3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Trail Loop สีน้ำเงิน/เทา (medium/large)", 331 | "MQFW3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Trail Loop สีดำ/เทา (small/medium)", 332 | "MQFX3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Trail Loop สีดำ/เทา (medium/large)" 333 | }, 334 | "ocean": { 335 | "MQFK3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Ocean Band สีมิดไนท์ (onesize)", 336 | "MNHF3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Ocean Band สีขาว (onesize)", 337 | "MNHG3TH/A": "ตัวเรือนไทเทเนียม | สายแบบ Ocean Band สีเหลือง (onesize)" 338 | } 339 | } 340 | } 341 | -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-1.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-2.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-3.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-4.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-5.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-6.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-7.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard-8.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Artboard.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Artboard-8.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "Artboard-7.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "Artboard-6.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "Artboard-5.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "Artboard-4.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "Artboard-3.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "Artboard-2.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "Artboard-1.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "Artboard.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "Logo Bitmap.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/AppIcon.appiconset/Logo Bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/InventoryWatch/Assets.xcassets/AppIcon.appiconset/Logo Bitmap.png -------------------------------------------------------------------------------- /InventoryWatch/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /InventoryWatch/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/8/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | @EnvironmentObject var model: ViewModel 12 | 13 | @AppStorage("lastUpdateDate") private var lastUpdateDate: String = "" 14 | @AppStorage("preferredProductType") private var preferredProductType: String = "MacBookPro" 15 | @AppStorage("useLargeText") private var useLargeText: Bool = false 16 | @AppStorage("shouldIncludeNearbyStores") private var shouldIncludeNearbyStores: Bool = true 17 | 18 | private var onlyShowingPreferredResults: Bool { 19 | return UserDefaults.standard.bool(forKey: "showResultsOnlyForPreferredModels") 20 | } 21 | 22 | var body: some View { 23 | VStack { 24 | HStack { 25 | ZStack { 26 | if model.hasLatestVersion == false { 27 | Text("!") 28 | .bold().foregroundColor(.blue) 29 | .offset(x: 8, y: -8) 30 | } 31 | Button( 32 | action: { 33 | if #available(macOS 13, *) { 34 | NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) 35 | } else { 36 | NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil) 37 | } 38 | }, 39 | label: { Image(systemName: "gearshape.fill") } 40 | ) 41 | .buttonStyle(BorderlessButtonStyle()) 42 | .padding() 43 | } 44 | 45 | Spacer() 46 | 47 | VStack { 48 | let font = useLargeText ? Font.largeTitle : Font.title2 49 | 50 | if let product = ProductType(rawValue: preferredProductType) { 51 | Text("Available \(Text(product.presentableName).font(font).fontWeight(.heavy)) Models") 52 | .font(font) 53 | .fontWeight(.semibold) 54 | } else { 55 | Text("Available Models") 56 | .font(font) 57 | .fontWeight(.semibold) 58 | } 59 | 60 | 61 | if let preferredStoreName = model.preferredStoreName { 62 | Text("\(shouldIncludeNearbyStores ? "near" : "at") \(preferredStoreName)") 63 | .font(.title2) 64 | } 65 | } 66 | 67 | Spacer() 68 | 69 | ProgressView() 70 | .progressViewStyle(CircularProgressViewStyle()) 71 | .opacity(model.isLoading ? 1.0 : 0.0) 72 | .scaleEffect(0.5, anchor: .center) 73 | .padding(.top, 8) 74 | 75 | } 76 | 77 | ZStack(alignment:.center) { 78 | 79 | 80 | List { 81 | if let error = model.errorState { 82 | Text(error.errorMessage) 83 | .font(.subheadline) 84 | .italic() 85 | } 86 | 87 | let storeFont = useLargeText ? Font.largeTitle.bold() : Font.headline.bold() 88 | let cityFont = useLargeText ? Font.title : Font.subheadline.bold() 89 | let productFont = useLargeText ? Font.title.weight(.medium) : Font.body.weight(.medium) 90 | 91 | ForEach(model.availableParts, id: \.0.storeNumber) { data in 92 | Text("\(Text(data.0.storeName).font(storeFont)) \(Text(data.0.locationDescription).font(cityFont))") 93 | 94 | let sortedProductNames = data.1.map { $0.partName } 95 | .sortedNumerically() 96 | 97 | ForEach(sortedProductNames, id: \.self) { productName in 98 | Text(productName) 99 | .font(productFont) 100 | } 101 | } 102 | } 103 | 104 | if model.availableParts.isEmpty && model.isLoading == false { 105 | Text("No models available in-store.") 106 | .foregroundColor(.secondary) 107 | } 108 | } 109 | 110 | HStack { 111 | let font = useLargeText ? Font.title3 : Font.caption 112 | 113 | if onlyShowingPreferredResults { 114 | Text("Only showing results for preferred models.") 115 | .font(font) 116 | .padding(.leading, 8) 117 | } 118 | 119 | Spacer() 120 | 121 | if lastUpdateDate.isEmpty == false { 122 | Text("Last update at \(lastUpdateDate)") 123 | .font(font) 124 | } else { 125 | Text("") 126 | .font(font) 127 | } 128 | 129 | Button( 130 | action: { Task { await model.fetchLatestInventory() } }, 131 | label: { Image(systemName: "arrow.clockwise") } 132 | ) 133 | .buttonStyle(BorderlessButtonStyle()) 134 | .keyboardShortcut("r", modifiers: .command) 135 | .padding(.trailing, 8) 136 | } 137 | .padding(.bottom, 8) 138 | 139 | } 140 | .frame( 141 | minWidth: 500, 142 | maxWidth: .infinity, 143 | minHeight: 300, 144 | maxHeight: .infinity, 145 | alignment: .center 146 | ) 147 | .onAppear { 148 | Task { 149 | await model.fetchLatestInventory() 150 | NotificationManager.shared.requestNotificationPermissions() 151 | } 152 | } 153 | } 154 | } 155 | 156 | //struct ContentView_Previews: PreviewProvider { 157 | // static var previews: some View { 158 | // ContentView() 159 | // .environmentObject(Model.testData) 160 | // } 161 | //} 162 | -------------------------------------------------------------------------------- /InventoryWatch/Countries.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Countries.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/10/21. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Country: Hashable { 11 | let name: String 12 | let shortcode: String 13 | let locale: String 14 | let skuCode: String 15 | 16 | private static let GermanyAltCode = "FD" 17 | private static let CanadaAltCode = "VC" 18 | private static let FranceAltCode = "NF" 19 | private static let ItalyAltCode = "TY" 20 | private static let AustriaAltCode = "FD" 21 | private static let NetherlandsAltCodeStudio = "FN" 22 | private static let NetherlandsAltCodeiPad = "NF" 23 | 24 | /// Some countries have alternate country code schemes for specific products, which are accounted for here. 25 | func skuCode(for product: ProductType) -> String? { 26 | switch product { 27 | case .MacStudio, .StudioDisplay: 28 | switch self.name { 29 | case "Canada": 30 | return Country.CanadaAltCode 31 | case "Netherlands": 32 | return Country.NetherlandsAltCodeStudio 33 | default: 34 | return nil 35 | } 36 | case .iPadMiniWifi, .iPadMiniCellular, .iPad10thGenWifi, .iPad10thGenCellular, .iPadProM2_11in_Wifi, .iPadProM2_11in_Cellular, .iPadProM2_13in_Wifi, .iPadProM2_13in_Cellular: 37 | switch name { 38 | case "Germany": 39 | return Country.GermanyAltCode 40 | case "Canada": 41 | return Country.CanadaAltCode 42 | case "France": 43 | return Country.FranceAltCode 44 | case "Italy": 45 | return Country.ItalyAltCode 46 | case "Austria": 47 | return Country.AustriaAltCode 48 | case "Netherlands": 49 | return Country.NetherlandsAltCodeiPad 50 | default: 51 | return nil 52 | } 53 | case .AirPodsProGen2: 54 | switch self.name { 55 | case "United States", "Canada": 56 | return "AM" 57 | case "Germany", "United Kingdom", "France", "Austria", "Netherlands": 58 | return "ZM" 59 | case "Australia", "Thailand": 60 | return "ZA" 61 | case "Italy": 62 | return "TY" 63 | default: 64 | return nil 65 | } 66 | 67 | case .ApplePencilUSBCAdapter: 68 | switch self.name { 69 | case "United States", "Canada": 70 | return "AM" 71 | case "Germany", "United Kingdom", "France", "Austria", "Netherlands", "Italy": 72 | return "ZM" 73 | case "Thailand": 74 | return "ZA" 75 | case "Australia", "South Korea", "Japan", "Hong Kong": 76 | return "FE" 77 | default: 78 | return nil 79 | } 80 | default: 81 | return nil 82 | } 83 | } 84 | } 85 | 86 | let USData = Country( 87 | name: "United States", 88 | shortcode: "US", 89 | locale: "en_US", 90 | skuCode: "LL" 91 | ) 92 | 93 | let AllCountries = [ 94 | USData, 95 | Country(name: "Canada", shortcode: "CA", locale: "en_CA", skuCode: "LL"), 96 | Country(name: "Australia", shortcode: "AU", locale: "en_AU", skuCode: "X"), 97 | Country(name: "Germany", shortcode: "DE", locale: "de_DE", skuCode: "D"), 98 | Country(name: "United Kingdom", shortcode: "UK", locale: "en_GB", skuCode: "B"), 99 | Country(name: "South Korea", shortcode: "KR", locale: "ko_KR", skuCode: "KH"), 100 | Country(name: "Hong Kong", shortcode: "HK", locale: "en_HK", skuCode: "ZP"), 101 | Country(name: "France", shortcode: "FR", locale: "fr_FR", skuCode: "FN"), 102 | Country(name: "Italy", shortcode: "IT", locale: "it_IT", skuCode: "T"), 103 | Country(name: "Japan", shortcode: "JP", locale: "ja_JP", skuCode: "J"), 104 | Country(name: "Austria", shortcode: "AT", locale: "de_AT", skuCode: "D"), 105 | Country(name: "Netherlands", shortcode: "NL", locale: "nl_NL", skuCode: "N"), 106 | Country(name: "Thailand", shortcode: "TH", locale: "th_TH", skuCode: "TH"), 107 | ] 108 | let Countries: [CountryCode: Country] = Dictionary(uniqueKeysWithValues: AllCountries.map { ($0.shortcode, $0) }) 109 | let OrderedCountries: [CountryCode] = AllCountries.map { $0.shortcode } 110 | -------------------------------------------------------------------------------- /InventoryWatch/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf2636 2 | \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | {\*\expandedcolortbl;;} 5 | \margl1440\margr1440\vieww11520\viewh8400\viewkind0 6 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 7 | 8 | \f0\fs24 \cf0 InventoryWatch, by Worth Baker\ 9 | @worthbak} -------------------------------------------------------------------------------- /InventoryWatch/Helpers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Helpers.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 3/19/22. 6 | // 7 | 8 | import Foundation 9 | 10 | typealias SKUString = String 11 | typealias CountryCode = String 12 | 13 | extension Array where Element == String { 14 | func sortedNumerically() -> [Element] { 15 | sorted { lhs, rhs in 16 | lhs.compare(rhs, options: [.numeric], locale: .current) == .orderedAscending 17 | } 18 | } 19 | } 20 | 21 | func compareNumeric(_ version1: String, _ version2: String) -> ComparisonResult { 22 | return version1.compare(version2, options: .numeric) 23 | } 24 | 25 | // From: https://github.com/JohnSundell/AsyncCompatibilityKit/blob/main/Sources/URLSession%2BAsync.swift 26 | @available(macOS, deprecated: 12.0, message: "AsyncCompatibilityKit is only useful when targeting iOS versions earlier than 15") 27 | public extension URLSession { 28 | /// Start a data task with a URL using async/await. 29 | /// - parameter url: The URL to send a request to. 30 | /// - returns: A tuple containing the binary `Data` that was downloaded, 31 | /// as well as a `URLResponse` representing the server's response. 32 | /// - throws: Any error encountered while performing the data task. 33 | func data(from url: URL) async throws -> (Data, URLResponse) { 34 | try await data(for: URLRequest(url: url)) 35 | } 36 | 37 | /// Start a data task with a `URLRequest` using async/await. 38 | /// - parameter request: The `URLRequest` that the data task should perform. 39 | /// - returns: A tuple containing the binary `Data` that was downloaded, 40 | /// as well as a `URLResponse` representing the server's response. 41 | /// - throws: Any error encountered while performing the data task. 42 | func data(for request: URLRequest) async throws -> (Data, URLResponse) { 43 | var dataTask: URLSessionDataTask? 44 | 45 | return try await withTaskCancellationHandler( 46 | operation: { 47 | try await withCheckedThrowingContinuation { continuation in 48 | dataTask = self.dataTask(with: request) { data, response, error in 49 | guard let data = data, let response = response else { 50 | let error = error ?? URLError(.badServerResponse) 51 | return continuation.resume(throwing: error) 52 | } 53 | continuation.resume(returning: (data, response)) 54 | } 55 | 56 | dataTask?.resume() 57 | } 58 | }, 59 | onCancel: { [dataTask] in 60 | dataTask?.cancel() 61 | } 62 | ) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /InventoryWatch/InventoryWatch.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | com.apple.security.network.client 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /InventoryWatch/InventoryWatchApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InventoryWatchApp.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/8/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct InventoryWatchApp: App { 12 | @StateObject var model = ViewModel() 13 | 14 | var body: some Scene { 15 | WindowGroup { 16 | ContentView() 17 | .environmentObject(model) 18 | } 19 | .windowStyle(HiddenTitleBarWindowStyle()) 20 | .commands { 21 | CommandGroup(replacing: .newItem) { 22 | Button(action: { 23 | Task { await model.fetchLatestInventory() } 24 | }, label: { 25 | Text("Reload Inventory") 26 | }) 27 | .keyboardShortcut("r", modifiers: .command) 28 | } 29 | } 30 | 31 | Settings { 32 | SettingsView() 33 | .environmentObject(model) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /InventoryWatch/Model/Analytics.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Analytics.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/17/21. 6 | // 7 | 8 | import Foundation 9 | 10 | struct AnalyticsData: Codable, Equatable { 11 | let localUUID: String 12 | let country: String 13 | let storeNumber: String? 14 | let productType: ProductType 15 | let preferredModels: String 16 | let updateInterval: Int 17 | let notifyOnlyForPreferredModels: Bool 18 | let hasCustomSku: Bool 19 | let appVersion: String 20 | 21 | var toJsonData: Data? { 22 | let dictionary: [String: Any] = [ 23 | "localUUID": localUUID, 24 | "country": country, 25 | "storeNumber": storeNumber ?? "", 26 | "productType": productType.rawValue, 27 | "preferredModels": preferredModels, 28 | "updateInterval": updateInterval, 29 | "notifyOnlyForPreferredModels": notifyOnlyForPreferredModels, 30 | "hasCustomSku": hasCustomSku, 31 | "appVersion": appVersion 32 | ] 33 | 34 | let reduced = dictionary 35 | .map { key, value in 36 | return "\(key)=\(value)" 37 | } 38 | .joined(separator: "&") 39 | 40 | return reduced.data(using: String.Encoding.ascii) 41 | } 42 | 43 | private static func generateCurrentData() -> AnalyticsData { 44 | let defaults = UserDefaults.standard 45 | 46 | var localUUID = defaults.string(forKey: "localUUID") 47 | if localUUID == nil { 48 | localUUID = UUID().uuidString 49 | defaults.set(localUUID, forKey: "localUUID") 50 | } 51 | 52 | let preferredCountry = defaults.string(forKey: "preferredCountry") 53 | let preferredStoreNumber = defaults.string(forKey: "preferredStoreNumber") 54 | let preferredProductType = defaults.string(forKey: "preferredProductType") ?? "MacBookPro" 55 | let preferredSKUsString = defaults.string(forKey: "preferredSKUs") ?? "" 56 | let notifyOnlyForPreferredModels = defaults.bool(forKey: "notifyOnlyForPreferredModels") 57 | let preferredUpdateInterval = defaults.integer(forKey: "preferredUpdateInterval") 58 | let customSku = defaults.string(forKey: "customSku") 59 | 60 | return AnalyticsData( 61 | localUUID: localUUID!, 62 | country: preferredCountry ?? "US", 63 | storeNumber: preferredStoreNumber, 64 | productType: ProductType(rawValue: preferredProductType) ?? .MacBookPro, 65 | preferredModels: preferredSKUsString, 66 | updateInterval: preferredUpdateInterval, 67 | notifyOnlyForPreferredModels: notifyOnlyForPreferredModels, 68 | hasCustomSku: customSku != nil && customSku?.isEmpty == false, 69 | appVersion: Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unkown_version" 70 | ) 71 | } 72 | 73 | static func updateAnalyticsData() { 74 | let current = generateCurrentData() 75 | 76 | if let previousAnalyticsData = UserDefaults.standard.object(forKey: "previousAnalyticsData") as? Data { 77 | let decoder = JSONDecoder() 78 | if let last = try? decoder.decode(AnalyticsData.self, from: previousAnalyticsData) { 79 | if last == current { 80 | // no change 81 | return 82 | } else { 83 | commitData(current) 84 | } 85 | } else { 86 | commitData(current) 87 | } 88 | } else { 89 | commitData(current) 90 | } 91 | } 92 | 93 | private static func commitData(_ data: AnalyticsData) { 94 | writeDataToDefaults(data) 95 | postUserSettings(data) 96 | } 97 | 98 | private static func writeDataToDefaults(_ data: AnalyticsData) { 99 | print(data) 100 | 101 | let encoder = JSONEncoder() 102 | if let encoded = try? encoder.encode(data) { 103 | UserDefaults.standard.set(encoded, forKey: "previousAnalyticsData") 104 | } 105 | } 106 | 107 | private static func postUserSettings(_ data: AnalyticsData) { 108 | let urlString = "https://api.inventorywatch.app/user-settings" 109 | guard let url = URL(string: urlString) else { 110 | return 111 | } 112 | 113 | Task { 114 | let bodyData = data.toJsonData 115 | 116 | var request = URLRequest(url: url) 117 | request.httpMethod = "POST" 118 | request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") 119 | request.httpBody = bodyData 120 | do { 121 | let (_, response) = try await URLSession.shared.data(for: request) 122 | print("successfully updated analytics: response code \((response as? HTTPURLResponse)?.statusCode ?? 0)") 123 | } catch { 124 | print(error) 125 | } 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /InventoryWatch/Model/DefaultsVendor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultsVendor.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/25/22. 6 | // 7 | 8 | import Foundation 9 | import Combine 10 | 11 | extension UserDefaults { 12 | 13 | @objc dynamic var preferredStoreNumber: String { 14 | get { string(forKey: "preferredStoreNumber") ?? "R032" } 15 | set { setValue(newValue, forKey: "preferredStoreNumber") } 16 | } 17 | 18 | @objc dynamic var lastUpdateDate: String? { 19 | get { string(forKey: "lastUpdateDate") } 20 | set { setValue(newValue, forKey: "lastUpdateDate") } 21 | } 22 | 23 | @objc dynamic var preferredUpdateInterval: Int { 24 | get { 25 | if let currentValue = object(forKey: "preferredUpdateInterval") as? Int { 26 | return currentValue 27 | } else { 28 | // WB 10/28/22: Changing default update interval from 1min to 5min 29 | let presetValue = 5 30 | set(presetValue, forKey: "preferredUpdateInterval") 31 | 32 | return presetValue 33 | } 34 | } 35 | set { setValue(newValue, forKey: "preferredUpdateInterval") } 36 | } 37 | } 38 | 39 | struct DefaultsVendor { 40 | 41 | var preferredCountry: Country { 42 | let value = UserDefaults.standard.string(forKey: "preferredCountry") ?? "US" 43 | 44 | return Countries[value] ?? USData 45 | } 46 | 47 | var preferredProductType: ProductType { 48 | let value = UserDefaults.standard.string(forKey: "preferredProductType") ?? "MacBookPro" 49 | 50 | return ProductType(rawValue: value) ?? .MacBookPro 51 | } 52 | 53 | var countryPathElement: String { 54 | let country = preferredCountry 55 | if country.shortcode == "US" { 56 | return "" 57 | } else { 58 | return country.shortcode + "/" 59 | } 60 | } 61 | 62 | var preferredStoreNumber: String { 63 | get { return UserDefaults.standard.preferredStoreNumber } 64 | set { UserDefaults.standard.preferredStoreNumber = newValue } 65 | } 66 | 67 | var lastUpdateDate: String? { 68 | get { return UserDefaults.standard.lastUpdateDate } 69 | set { UserDefaults.standard.lastUpdateDate = newValue } 70 | } 71 | 72 | // unused - keeping this around as an example implementation 73 | private var preferredStoreNumberStream: AnyPublisher { 74 | return UserDefaults.standard 75 | .publisher(for: \.preferredStoreNumber) 76 | .eraseToAnyPublisher() 77 | } 78 | 79 | var preferredUpdateInterval: Int { 80 | return UserDefaults.standard.preferredUpdateInterval 81 | } 82 | 83 | var shouldIncludeNearbyStores: Bool { 84 | let value = UserDefaults.standard.object(forKey: "shouldIncludeNearbyStores") as? Bool 85 | 86 | return value ?? true 87 | } 88 | 89 | var preferredSKUs: Set { 90 | guard let defaults = UserDefaults.standard.string(forKey: "preferredSKUs") else { 91 | return [] 92 | } 93 | 94 | return defaults.components(separatedBy: ",").reduce(into: Set()) { partialResult, next in 95 | partialResult.insert(next) 96 | } 97 | } 98 | 99 | var customSkuData: (sku: String, nickname: String)? { 100 | guard 101 | let sku = UserDefaults.standard.string(forKey: "customSku"), 102 | let name = UserDefaults.standard.string(forKey: "customSkuNickname") 103 | else { 104 | return nil 105 | } 106 | 107 | return (sku, name) 108 | } 109 | 110 | var showResultsOnlyForPreferredModels: Bool { 111 | UserDefaults.standard.bool(forKey: "showResultsOnlyForPreferredModels") 112 | } 113 | 114 | var notifyOnlyForPreferredModels: Bool { 115 | UserDefaults.standard.bool(forKey: "notifyOnlyForPreferredModels") 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /InventoryWatch/Model/FulfillmentModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FulfillmentModel.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/25/22. 6 | // 7 | 8 | import Foundation 9 | 10 | actor FulfillmentModel { 11 | 12 | let defaultsVendor = DefaultsVendor() 13 | let skuDataLoader = SKUDataLoader() 14 | 15 | var skuDataForPreferredProduct: SKUData { 16 | get async throws { 17 | return try await skuDataLoader.skuDataForPreferredProduct 18 | } 19 | } 20 | 21 | private var cachedStoreData: [String: StoreCountry] = [:] 22 | 23 | private var modelParsingFilter: Set? { 24 | let filterForPreferredModels = defaultsVendor.showResultsOnlyForPreferredModels 25 | var filterModels = filterForPreferredModels ? defaultsVendor.preferredSKUs : nil 26 | if let customSku = defaultsVendor.customSkuData?.sku { 27 | filterModels?.insert(customSku) 28 | } 29 | 30 | return filterModels 31 | } 32 | 33 | func loadStoresByCountry() async throws -> [String: StoreCountry] { 34 | if cachedStoreData.isEmpty == false { 35 | return cachedStoreData 36 | } 37 | 38 | let decoder = JSONDecoder() 39 | 40 | do { 41 | // Try loading remote stores first 42 | let url = URL(string: "https://www.apple.com/rsp-web/store-list?locale=en_US")! 43 | let (data, _) = try await URLSession.shared.data(from: url) 44 | let jsonStores = try decoder.decode(StoreBootstrap.self, from: data) 45 | 46 | cachedStoreData = jsonStores.countryData 47 | return jsonStores.countryData 48 | } catch { 49 | print(error) 50 | } 51 | 52 | // If remote stores failed to load, fallback to local bootstrap 53 | let fileType = "json" 54 | if let path = Bundle.main.path(forResource: "Stores_LocalBootstrap", ofType: fileType) { 55 | do { 56 | let data = try Data(contentsOf: URL(fileURLWithPath: path)) 57 | 58 | let jsonStores = try decoder.decode(StoreBootstrap.self, from: data) 59 | return jsonStores.countryData 60 | 61 | } catch { 62 | print(error) 63 | throw error 64 | } 65 | } else { 66 | throw AppError.invalidProjectState 67 | } 68 | } 69 | 70 | func fetchInventory() async throws -> [(FulfillmentStore, [PartAvailability])] { 71 | let urlRoot = "https://www.apple.com/\(defaultsVendor.countryPathElement.lowercased())shop/fulfillment-messages?" 72 | let query = try await generateQueryString() 73 | 74 | guard let url = URL(string: urlRoot + query) else { 75 | throw AppError.couldNotGenerateURL 76 | } 77 | 78 | var request = URLRequest(url: url) 79 | request.addValue("https://www.apple.com/shop/buy-iphone/", forHTTPHeaderField: "Referer") 80 | 81 | // Log the URL for debugging 82 | print(url.absoluteString) 83 | 84 | let (data, response) = try await URLSession.shared.data(for: request) 85 | return try await parseStoreResponse(data, response: response as? HTTPURLResponse, filterForModels: modelParsingFilter) 86 | } 87 | 88 | func getDefaultStoreForCurrentCountry() async throws -> RetailStore? { 89 | let storesByCountry = try await loadStoresByCountry() 90 | guard let stores = storesByCountry[defaultsVendor.preferredCountry.locale]?.stores else { 91 | throw AppError.invalidProjectState 92 | } 93 | 94 | let defaultStoreNumber: String 95 | switch defaultsVendor.preferredCountry.locale { 96 | case "en_US": defaultStoreNumber = "R032" 97 | case "fr_FR": defaultStoreNumber = "R277" 98 | case "en_CA": defaultStoreNumber = "R121" 99 | case "en_AU": defaultStoreNumber = "R238" 100 | case "de_DE": defaultStoreNumber = "R443" 101 | case "en_GB": defaultStoreNumber = "R092" 102 | default: 103 | return stores.first 104 | } 105 | 106 | return stores.first(where: { $0.storeNumber == defaultStoreNumber }) ?? stores.first 107 | } 108 | 109 | private func generateQueryString() async throws -> String { 110 | 111 | let skuData = try await skuDataLoader.skuDataForPreferredProduct 112 | 113 | var allSkus = skuData.orderedSKUs 114 | if let customSku = defaultsVendor.customSkuData?.sku { 115 | allSkus.append(customSku) 116 | } 117 | 118 | var queryItems: [String] = allSkus 119 | .enumerated() 120 | .compactMap { next in 121 | guard next.element.isEmpty == false else { 122 | return nil 123 | } 124 | 125 | let count = next.offset 126 | let sku = next.element 127 | return "parts.\(count)=\(sku)" 128 | } 129 | 130 | queryItems.append("searchNearby=\(defaultsVendor.shouldIncludeNearbyStores)") 131 | queryItems.append("store=\(defaultsVendor.preferredStoreNumber)") 132 | 133 | return queryItems.joined(separator: "&") 134 | } 135 | 136 | private func parseStoreResponse(_ responseData: Data?, response: HTTPURLResponse?, filterForModels: Set?) async throws -> [(FulfillmentStore, [PartAvailability])] { 137 | guard let responseData = responseData else { 138 | throw errorForStatusCode(response?.statusCode) ?? AppError.invalidStoreResponse 139 | } 140 | 141 | guard let json = try? JSONSerialization.jsonObject(with: responseData, options: []) as? [String : Any] else { 142 | throw errorForStatusCode(response?.statusCode) ?? AppError.invalidStoreResponse 143 | } 144 | 145 | guard 146 | let body = json["body"] as? [String: Any], 147 | let content = body["content"] as? [String: Any], 148 | let pickupMessage = content["pickupMessage"] as? [String: Any] 149 | else { 150 | throw AppError.unexpectedJSONStructure 151 | } 152 | 153 | guard let storeList = pickupMessage["stores"] as? [[String: Any]] else { 154 | throw AppError.noStoresFound 155 | } 156 | 157 | let skuData = try await skuDataForPreferredProduct 158 | let collectedStores: [FulfillmentStore] = storeList.compactMap { storeJSON in 159 | guard let name = storeJSON["storeName"] as? String else { return nil } 160 | guard let number = storeJSON["storeNumber"] as? String else { return nil } 161 | guard let city = storeJSON["city"] as? String else { return nil } 162 | let state = storeJSON["state"] as? String 163 | 164 | guard let partsAvailability = storeJSON["partsAvailability"] as? [String: [String: Any]] else { return nil } 165 | let parsedParts: [PartAvailability] = partsAvailability.values.compactMap { part in 166 | guard let partNumber = part["partNumber"] as? String else { return nil } 167 | guard 168 | let availabilityString = part["pickupDisplay"] as? String, 169 | let availability = PartAvailability.PickupAvailability(rawValue: availabilityString) 170 | else { 171 | return nil 172 | } 173 | 174 | // get name from SKU data, or custom SKU if available 175 | let productName: String 176 | if let name = skuData.productName(forSKU: partNumber) { 177 | productName = name 178 | } else if let customSku = defaultsVendor.customSkuData, partNumber == customSku.sku { 179 | productName = customSku.nickname 180 | } else { 181 | productName = partNumber 182 | } 183 | 184 | return PartAvailability(partNumber: partNumber, partName: productName, availability: availability) 185 | } 186 | 187 | 188 | 189 | return FulfillmentStore(storeName: name, storeNumber: number, city: city, state: state, partsAvailability: parsedParts) 190 | } 191 | 192 | return self.parseAvailableModels(from: collectedStores, filterForModels: filterForModels) 193 | } 194 | 195 | private func parseAvailableModels(from stores: [FulfillmentStore], filterForModels: Set?) -> [(FulfillmentStore, [PartAvailability])] { 196 | let allAvailableModels: [(FulfillmentStore, [PartAvailability])] = stores 197 | .sorted(by: { first, _ in 198 | // always put preferred store first 199 | return first.storeNumber == defaultsVendor.preferredStoreNumber 200 | }) 201 | .compactMap { store in 202 | let rv: [PartAvailability] = store.partsAvailability.filter { part in 203 | switch part.availability { 204 | case .available: 205 | if let filter = filterForModels, filter.contains(part.partNumber) == false { 206 | return false 207 | } 208 | 209 | return true 210 | case .unavailable, .ineligible: 211 | return false 212 | } 213 | } 214 | 215 | if rv.isEmpty { 216 | return nil 217 | } else { 218 | return (store, rv) 219 | } 220 | } 221 | 222 | return allAvailableModels 223 | } 224 | 225 | private func errorForStatusCode(_ statusCode: Int?) -> AppError? { 226 | guard let statusCode else { 227 | return nil 228 | } 229 | 230 | switch statusCode { 231 | case 500...599: 232 | return .storeUnavailable 233 | default: 234 | return nil 235 | } 236 | } 237 | 238 | } 239 | -------------------------------------------------------------------------------- /InventoryWatch/Model/GithubModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GithubModel.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/25/22. 6 | // 7 | 8 | import Foundation 9 | 10 | actor GithubModel { 11 | 12 | let localAppVersion: String = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0" 13 | var latestFetchedReleaseVersion: String? 14 | 15 | func hasLatestGithubRelease() async throws -> Bool { 16 | guard let url = URL(string: "https://api.github.com/repos/worthbak/inventory-checker-app/tags") else { 17 | throw AppError.couldNotGenerateURL 18 | } 19 | 20 | let (data, _) = try await URLSession.shared.data(from: url) 21 | let parsed = try JSONDecoder().decode([GithubTag].self, from: data) 22 | 23 | let processedData = parsed 24 | .filter { !$0.name.hasPrefix("v") } 25 | .sorted { first, second in 26 | switch compareNumeric(first.name, second.name) { 27 | case .orderedAscending, .orderedSame: 28 | return false 29 | case .orderedDescending: 30 | return true 31 | } 32 | } 33 | 34 | guard let latestReleaseVersion = processedData.first?.name else { 35 | throw AppError.failedToParseGithubVersion 36 | } 37 | 38 | latestFetchedReleaseVersion = latestReleaseVersion 39 | 40 | let isLatestRelease: Bool 41 | switch compareNumeric(latestReleaseVersion, localAppVersion) { 42 | case .orderedAscending, .orderedSame: 43 | isLatestRelease = true 44 | case .orderedDescending: 45 | isLatestRelease = false 46 | } 47 | 48 | return isLatestRelease 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ModelError.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/25/22. 6 | // 7 | 8 | import Foundation 9 | 10 | enum AppError: Swift.Error, LocalizedError { 11 | case failedToParseGithubVersion 12 | case invalidLocalModelStore 13 | case invalidProjectState 14 | case couldNotGenerateURL 15 | case noStoresFound 16 | case storeUnavailable 17 | case invalidStoreResponse 18 | case unexpectedJSONStructure 19 | case generic(Error?) 20 | 21 | var errorDescription: String? { 22 | switch self { 23 | case .generic(let error): 24 | return error?.localizedDescription ?? "unknown error" 25 | default: 26 | return "\(self)" 27 | } 28 | } 29 | 30 | var errorMessage: String { 31 | switch self { 32 | case .couldNotGenerateURL: 33 | return "InventoryWatch failed to construct a valid URL for your search." 34 | case .invalidStoreResponse, .unexpectedJSONStructure, .noStoresFound: 35 | return "Unexpected inventory data found. Please confirm that the selected store is valid for the selected country." 36 | case .storeUnavailable: 37 | return "Apple's fulfillment API returned an internal server error and is currently unavailable." 38 | case .invalidLocalModelStore, .invalidProjectState, .failedToParseGithubVersion: 39 | return "InventoryWatch has invalid or currupted local data. Please contact the developer (@worthbak)." 40 | case .generic(let optional): 41 | return "A network error occurred. Details: \(optional?.localizedDescription ?? "unknown")" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/AllPhoneModels.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AllPhoneModels.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 7/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct AllPhoneModels { 11 | struct PhoneModel { 12 | let sku: String 13 | let productName: String 14 | } 15 | 16 | var proMax14: [PhoneModel] 17 | var pro14: [PhoneModel] 18 | var regular14: [PhoneModel] 19 | var plus14: [PhoneModel] 20 | 21 | var mini13: [PhoneModel] 22 | var regular13: [PhoneModel] 23 | 24 | func toSkuData(_ keypath: KeyPath) -> SKUData { 25 | let models = self[keyPath: keypath] 26 | 27 | let lookup: [String: String] = models.reduce(into: [:]) { acc, next in 28 | acc[next.sku] = next.productName 29 | } 30 | 31 | return SKUData(orderedSKUs: models.map { $0.sku }, lookup: lookup) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/AppleWatchData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppleWatchData.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct AppleWatchData { 11 | 12 | struct AppleWatchModel { 13 | let sku: SKUString 14 | let description: String 15 | } 16 | 17 | let alpine: [SKUString: AppleWatchModel] 18 | let trail: [SKUString: AppleWatchModel] 19 | let ocean: [SKUString: AppleWatchModel] 20 | 21 | init(from rawData: [String: [String: String]]) { 22 | var _alpine: [SKUString: AppleWatchModel] = [:] 23 | var _trail: [SKUString: AppleWatchModel] = [:] 24 | var _ocean: [SKUString: AppleWatchModel] = [:] 25 | 26 | for (key, value) in rawData { 27 | switch key { 28 | case "alpine": 29 | _alpine = value.reduce(into: [:], { partialResult, item in 30 | partialResult[item.key] = AppleWatchModel(sku: item.key, description: item.value) 31 | }) 32 | case "trail": 33 | _trail = value.reduce(into: [:], { partialResult, item in 34 | partialResult[item.key] = AppleWatchModel(sku: item.key, description: item.value) 35 | }) 36 | case "ocean": 37 | _ocean = value.reduce(into: [:], { partialResult, item in 38 | partialResult[item.key] = AppleWatchModel(sku: item.key, description: item.value) 39 | }) 40 | default: 41 | print("found unexpected Apple Watch Ultra band type: \(key)") 42 | continue 43 | } 44 | } 45 | 46 | alpine = _alpine 47 | trail = _trail 48 | ocean = _ocean 49 | } 50 | 51 | func toSkuData() -> SKUData { 52 | let allSkus: [SKUString] = [alpine, trail, ocean].flatMap { $0.keys } 53 | let lookup: [SKUString: String] = [alpine, trail, ocean].reduce(into: [:]) { partialResult, map in 54 | map.forEach { key, value in 55 | partialResult[key] = value.description 56 | } 57 | } 58 | 59 | return SKUData(orderedSKUs: allSkus, lookup: lookup) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/FulfillmentStore.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Store.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 7/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | #warning("Would be good to unify this model with `RetailStore`") 11 | struct FulfillmentStore: Equatable { 12 | let storeName: String 13 | let storeNumber: String 14 | let city: String 15 | let state: String? 16 | 17 | var locationDescription: String { 18 | return [city, state].compactMap { $0 }.joined(separator: ", ") 19 | } 20 | 21 | let partsAvailability: [PartAvailability] 22 | } 23 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/GithubTag.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GithubTag.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 7/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct GithubTag: Codable { 11 | let name: String 12 | } 13 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/PartAvailability.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PartAvailability.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 7/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct PartAvailability: Equatable, Hashable { 11 | enum PickupAvailability: String { 12 | case available, unavailable, ineligible 13 | } 14 | 15 | let partNumber: String 16 | let partName: String 17 | let availability: PickupAvailability 18 | } 19 | 20 | extension PartAvailability: Identifiable { 21 | var id: String { 22 | partNumber 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/ProductType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProductType.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 7/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | enum ProductCategory: String, Codable, CaseIterable, Identifiable { 11 | var id: Self { self } 12 | 13 | case Mac, iPad, iPhone, AppleWatch, Accessories 14 | 15 | var products: [ProductType] { 16 | switch self { 17 | case .Mac: 18 | return [.MacStudio, .M2MacBookPro13, .M2MacBookAir, .MacBookPro] 19 | case .iPad: 20 | return [ 21 | .iPadMiniWifi, 22 | .iPadMiniCellular, 23 | .iPad10thGenWifi, 24 | .iPad10thGenCellular, 25 | .iPadProM2_11in_Wifi, 26 | .iPadProM2_11in_Cellular, 27 | .iPadProM2_13in_Wifi, 28 | .iPadProM2_13in_Cellular 29 | ] 30 | case .iPhone: 31 | return [ 32 | .iPhoneRegular13, 33 | .iPhoneMini13, 34 | .iPhoneRegular14, 35 | .iPhonePlus14, 36 | .iPhonePro14, 37 | .iPhoneProMax14 38 | ] 39 | case .AppleWatch: 40 | return [.AppleWatchUltra] 41 | case .Accessories: 42 | return [.StudioDisplay, .AirPodsProGen2, .ApplePencilUSBCAdapter] 43 | } 44 | } 45 | } 46 | 47 | enum ProductType: String, Codable, CaseIterable, Identifiable { 48 | var id: Self { self } 49 | 50 | case MacBookPro 51 | case M2MacBookPro13 52 | case M2MacBookAir 53 | case MacStudio 54 | 55 | case StudioDisplay 56 | case AirPodsProGen2 57 | case ApplePencilUSBCAdapter 58 | 59 | case iPadMiniWifi 60 | case iPadMiniCellular 61 | case iPad10thGenWifi 62 | case iPad10thGenCellular 63 | case iPadProM2_11in_Wifi 64 | case iPadProM2_11in_Cellular 65 | case iPadProM2_13in_Wifi 66 | case iPadProM2_13in_Cellular 67 | 68 | case iPhoneRegular13 69 | case iPhoneMini13 70 | case iPhoneRegular14 71 | case iPhonePlus14 72 | case iPhonePro14 73 | case iPhoneProMax14 74 | 75 | case AppleWatchUltra 76 | 77 | var presentableName: String { 78 | switch self { 79 | case .MacBookPro: 80 | return "MacBook Pro" 81 | case .M2MacBookPro13: 82 | return "M2 MacBook Pro 13in" 83 | case .M2MacBookAir: 84 | return "M2 MacBook Air" 85 | case .MacStudio: 86 | return "Mac Studio" 87 | 88 | case .StudioDisplay: 89 | return "Studio Display" 90 | case .AirPodsProGen2: 91 | return "AirPods Pro" 92 | case .ApplePencilUSBCAdapter: 93 | return "USB-C to Apple Pencil Adapter" 94 | 95 | case .iPadMiniWifi: 96 | return "iPad mini (Wifi)" 97 | case .iPadMiniCellular: 98 | return "iPad mini (Cellular)" 99 | case .iPad10thGenWifi: 100 | return "iPad (10th Gen) (Wifi)" 101 | case .iPad10thGenCellular: 102 | return "iPad (10th Gen) (Cellular)" 103 | case .iPadProM2_11in_Wifi: 104 | return "M2 iPad Pro 11in (Wifi)" 105 | case .iPadProM2_11in_Cellular: 106 | return "M2 iPad Pro 11in (Cellular)" 107 | case .iPadProM2_13in_Wifi: 108 | return "M2 iPad Pro 12.9in (Wifi)" 109 | case .iPadProM2_13in_Cellular: 110 | return "M2 iPad Pro 12.9in (Cellular)" 111 | 112 | case .iPhoneRegular13: 113 | return "iPhone 13" 114 | case .iPhoneMini13: 115 | return "iPhone 13 mini" 116 | case .iPhoneRegular14: 117 | return "iPhone 14" 118 | case .iPhonePlus14: 119 | return "iPhone 14 Plus" 120 | case .iPhonePro14: 121 | return "iPhone 14 Pro" 122 | case .iPhoneProMax14: 123 | return "iPhone 14 Pro Max" 124 | 125 | case.AppleWatchUltra: 126 | return "Apple Watch Ultra" 127 | } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ModelTypes/StoreBootstrap.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StoreBootstrap.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/1/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct StoreBootstrap: Decodable { 11 | 12 | enum CodingKeys: String, CodingKey { 13 | case storeListData 14 | } 15 | 16 | let countryData: [String: StoreCountry] 17 | 18 | init(from decoder: Decoder) throws { 19 | let container = try decoder.container(keyedBy: CodingKeys.self) 20 | let storeListData = try container.decode([StoreCountry].self, forKey: .storeListData) 21 | 22 | countryData = storeListData.reduce(into: [:], { partialResult, country in 23 | partialResult[country.locale] = country 24 | }) 25 | } 26 | } 27 | 28 | struct StoreCountry: Decodable { 29 | enum CodingKeys: String, CodingKey { 30 | case locale, hasStates, store, state 31 | } 32 | 33 | let locale: String 34 | let hasStates: Bool 35 | 36 | /// `stores` is compiled from the raw JSON `state` array, if the country has states. 37 | let stores: [RetailStore] 38 | 39 | init(from decoder: Decoder) throws { 40 | let container = try decoder.container(keyedBy: CodingKeys.self) 41 | 42 | locale = try container.decode(String.self, forKey: .locale) 43 | hasStates = try container.decode(Bool.self, forKey: .hasStates) 44 | 45 | let states: [StoreState] 46 | if hasStates { 47 | states = try container.decode([StoreState].self, forKey: .state) 48 | } else { 49 | let singleStore = try container.decode([RetailStore].self, forKey: .store) 50 | states = [ 51 | StoreState(name: "", store: singleStore) 52 | ] 53 | } 54 | 55 | stores = states.reduce(into: [RetailStore](), { partialResult, state in 56 | partialResult.append(contentsOf: state.store) 57 | }) 58 | 59 | } 60 | } 61 | 62 | private struct StoreState: Decodable { 63 | let name: String 64 | let store: [RetailStore] 65 | } 66 | 67 | struct RetailStore: Decodable, Equatable { 68 | var storeNumber: String { id } 69 | 70 | let id: String 71 | var name: String 72 | var telephone: String 73 | var slug: String 74 | var address: StoreAddress 75 | } 76 | 77 | struct StoreAddress: Decodable, Equatable { 78 | var city: String 79 | 80 | let address1: String? 81 | let address2: String? 82 | 83 | let stateName: String? 84 | let stateCode: String? 85 | let postalCode: String? 86 | 87 | var cityStateDisplay: String { 88 | let stateText: String 89 | if let stateCode, !stateCode.isEmpty { 90 | stateText = ", \(stateCode)" 91 | } else if let stateName, !stateName.isEmpty { 92 | stateText = ", \(stateName)" 93 | } else { 94 | stateText = "" 95 | } 96 | 97 | return city + stateText 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /InventoryWatch/Model/NotificationManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationManager.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/8/21. 6 | // 7 | 8 | import Foundation 9 | import UserNotifications 10 | 11 | final class NotificationManager: NSObject { 12 | 13 | static let shared = NotificationManager() 14 | 15 | func requestNotificationPermissions() { 16 | let center = UNUserNotificationCenter.current() 17 | center.delegate = self 18 | 19 | center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in 20 | if granted { 21 | print("Notifications are enabled.") 22 | } else { 23 | print("Notifications are disabled.") 24 | } 25 | } 26 | } 27 | 28 | func sendNotification(title: String, body: String) { 29 | let content = UNMutableNotificationContent() 30 | content.title = title 31 | content.body = body 32 | content.sound = UNNotificationSound.default 33 | 34 | let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) 35 | 36 | let uuidString = UUID().uuidString 37 | let request = UNNotificationRequest(identifier: uuidString,content: content, trigger: trigger) 38 | 39 | // Schedule the request with the system. 40 | let notificationCenter = UNUserNotificationCenter.current() 41 | notificationCenter.add(request) { (error) in 42 | if error != nil { 43 | print(error ?? "notification error!") 44 | } 45 | } 46 | } 47 | } 48 | 49 | extension NotificationManager: UNUserNotificationCenterDelegate { 50 | public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Swift.Void) { 51 | completionHandler( [.banner, .badge, .sound]) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /InventoryWatch/Model/NotificationSender.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationSender.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/27/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct NotificationSender { 11 | 12 | private let defaultsVendor = DefaultsVendor() 13 | 14 | func sendNotificationIfNeeded(availableParts: [(FulfillmentStore, [PartAvailability])], skuData: SKUData) async { 15 | var hasPreferredModel = false 16 | let preferredModels = defaultsVendor.preferredSKUs 17 | for model in availableParts { 18 | for submodel in model.1 { 19 | if hasPreferredModel == false && preferredModels.contains(submodel.partNumber) { 20 | hasPreferredModel = true 21 | break 22 | } 23 | 24 | if hasPreferredModel == false, let customSku = defaultsVendor.customSkuData?.sku, submodel.partNumber == customSku { 25 | hasPreferredModel = true 26 | break 27 | } 28 | } 29 | } 30 | 31 | if defaultsVendor.notifyOnlyForPreferredModels && !hasPreferredModel { 32 | return 33 | } 34 | 35 | let message = self.generateNotificationText(from: availableParts, skuData: skuData, preferredModels: preferredModels) 36 | NotificationManager.shared.sendNotification(title: hasPreferredModel ? "Preferred Model Found!" : "Apple Store Inventory", body: message) 37 | } 38 | 39 | private func generateNotificationText(from data: [(FulfillmentStore, [PartAvailability])], skuData: SKUData, preferredModels: Set) -> String { 40 | guard data.isEmpty == false else { 41 | return "No Inventory Found" 42 | } 43 | 44 | let customSkuData = defaultsVendor.customSkuData 45 | let filterForPreferredModels = defaultsVendor.notifyOnlyForPreferredModels 46 | 47 | var collector: [PartAvailability: Int] = [:] 48 | for (_, parts) in data { 49 | for part in parts { 50 | let collect = { collector[part, default: 0] += 1 } 51 | 52 | if part.partNumber == customSkuData?.sku { 53 | collect() 54 | } else if filterForPreferredModels, preferredModels.contains(part.partNumber) { 55 | collect() 56 | } 57 | } 58 | } 59 | 60 | let combined: [String] = collector.reduce(into: []) { partialResult, next in 61 | 62 | let (key, value) = next 63 | let name = key.partName 64 | partialResult.append("\(name): \(value) found") 65 | } 66 | 67 | return combined.joined(separator: ", ") 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /InventoryWatch/Model/SKUDataLoader.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ModelLoader.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/25/22. 6 | // 7 | 8 | import Foundation 9 | 10 | actor SKUDataLoader { 11 | 12 | private enum iPhoneModel: CaseIterable { 13 | case thirteen, fourteen 14 | } 15 | 16 | var defaultsManager = DefaultsVendor() 17 | 18 | private var cachediPhoneData: [Country: AllPhoneModels] = [:] 19 | private var cachedAppleWatchUltraData: [CountryCode: AppleWatchData] = [:] 20 | 21 | var skuDataForPreferredProduct: SKUData { 22 | get async throws { 23 | return try await skuData(for: defaultsManager.preferredProductType, and: defaultsManager.preferredCountry) 24 | } 25 | } 26 | 27 | func skuData(for productType: ProductType, and country: Country) async throws -> SKUData { 28 | switch productType { 29 | case .MacBookPro: 30 | return MBPDataForCountry(country) 31 | case .M2MacBookPro13: 32 | return M2MBPDataForCountry(country) 33 | case .M2MacBookAir: 34 | return M2MBAirDataForCountry(country) 35 | case .MacStudio: 36 | return MacStudioDataForCountry(country) 37 | 38 | case .StudioDisplay: 39 | return StudioDisplayForCountry(country) 40 | case .AirPodsProGen2: 41 | return AirPodsProGen2DataForCountry(country) 42 | case .ApplePencilUSBCAdapter: 43 | return ApplePencilUSBCAdapterDataForCountry(country) 44 | 45 | case .iPadMiniWifi: 46 | return iPadMiniDataForCountry(country, isWifi: true) 47 | case .iPadMiniCellular: 48 | return iPadMiniDataForCountry(country, isWifi: false) 49 | case .iPad10thGenWifi: 50 | return iPad10thGenDataForCountry(country, isWifi: true) 51 | case .iPad10thGenCellular: 52 | return iPad10thGenDataForCountry(country, isWifi: false) 53 | case .iPadProM2_11in_Wifi: 54 | return iPadProM2_11inDataForCountry(country, isWifi: true) 55 | case .iPadProM2_11in_Cellular: 56 | return iPadProM2_11inDataForCountry(country, isWifi: false) 57 | case .iPadProM2_13in_Wifi: 58 | return iPadProM2_13inDataForCountry(country, isWifi: true) 59 | case .iPadProM2_13in_Cellular: 60 | return iPadProM2_13inDataForCountry(country, isWifi: false) 61 | 62 | case .iPhoneRegular13: 63 | return try phoneModels(for: country).toSkuData(\.regular13) 64 | case .iPhoneMini13: 65 | return try phoneModels(for: country).toSkuData(\.mini13) 66 | case .iPhoneRegular14: 67 | return try phoneModels(for: country).toSkuData(\.regular14) 68 | case .iPhonePlus14: 69 | return try phoneModels(for: country).toSkuData(\.plus14) 70 | case .iPhonePro14: 71 | return try phoneModels(for: country).toSkuData(\.pro14) 72 | case .iPhoneProMax14: 73 | return try phoneModels(for: country).toSkuData(\.proMax14) 74 | 75 | case .AppleWatchUltra: 76 | return try appleWatchUltraModels(for: country) 77 | } 78 | } 79 | 80 | private func generateiPhoneModelsByCountry() throws -> [Country: AllPhoneModels] { 81 | if cachediPhoneData.isEmpty == false { 82 | return cachediPhoneData 83 | } 84 | 85 | var rv = [Country: AllPhoneModels]() 86 | 87 | for phoneModel in iPhoneModel.allCases { 88 | let phoneModelsJson = try loadIPhoneModels(for: phoneModel) 89 | 90 | for (countryCode, phones) in phoneModelsJson { 91 | guard let country = Countries[countryCode.uppercased()] else { 92 | throw AppError.invalidLocalModelStore 93 | } 94 | 95 | let unmappedModelsData: [(String, WritableKeyPath)] 96 | switch phoneModel { 97 | case .thirteen: 98 | unmappedModelsData = [ 99 | ("mini13", \AllPhoneModels.mini13), 100 | ("regular13", \AllPhoneModels.regular13) 101 | ] 102 | case .fourteen: 103 | unmappedModelsData = [ 104 | ("plus14", \AllPhoneModels.plus14), 105 | ("regular14", \AllPhoneModels.regular14), 106 | ("pro14", \AllPhoneModels.pro14), 107 | ("proMax14", \AllPhoneModels.proMax14) 108 | ] 109 | } 110 | 111 | let modelsData = unmappedModelsData.map { first, second in 112 | return (phones[first], second) 113 | } 114 | 115 | var phoneModels: AllPhoneModels 116 | if let existing = rv[country] { 117 | phoneModels = existing 118 | } else { 119 | phoneModels = AllPhoneModels(proMax14: [], pro14: [], regular14: [], plus14: [], mini13: [], regular13: []) 120 | } 121 | 122 | for (models, keyPath) in modelsData { 123 | guard let models = models else { 124 | continue 125 | } 126 | 127 | let parsed: [AllPhoneModels.PhoneModel] = models.map { modelData in 128 | return AllPhoneModels.PhoneModel(sku: modelData.key, productName: modelData.value) 129 | } 130 | 131 | phoneModels[keyPath: keyPath] = parsed 132 | } 133 | 134 | rv[country] = phoneModels 135 | } 136 | } 137 | 138 | cachediPhoneData = rv 139 | return rv 140 | } 141 | 142 | private func phoneModels(for country: Country) throws -> AllPhoneModels { 143 | let iPhoneModels = try generateiPhoneModelsByCountry() 144 | 145 | guard let models = iPhoneModels[country] else { 146 | throw AppError.invalidLocalModelStore 147 | } 148 | 149 | return models 150 | } 151 | 152 | // country: type: model: description 153 | private func loadIPhoneModels(for model: iPhoneModel) throws -> [String: [String: [String: String]]] { 154 | let location: String 155 | switch model { 156 | case .thirteen: 157 | location = "iPhoneModels13-intl" 158 | case .fourteen: 159 | location = "iPhoneModels14-intl" 160 | } 161 | 162 | if let path = Bundle.main.path(forResource: location, ofType: "json") { 163 | let data = try Data(contentsOf: URL(fileURLWithPath: path)) 164 | let decoder = JSONDecoder() 165 | 166 | let iphoneData = try decoder.decode([String: [String: [String: String]]].self, from: data) 167 | return iphoneData 168 | } else { 169 | throw AppError.invalidProjectState 170 | } 171 | } 172 | 173 | private func appleWatchUltraModels(for country: Country) throws -> SKUData { 174 | let rawData = try loadAppleWatchUltraModels() 175 | if rawData.isEmpty { 176 | fatalError() 177 | } 178 | 179 | var compiled: [Country: AppleWatchData] = [:] 180 | for (countryCode, models) in rawData { 181 | guard let foundCountry = Countries[countryCode.uppercased()] else { 182 | throw AppError.invalidLocalModelStore 183 | } 184 | 185 | compiled[foundCountry] = models 186 | } 187 | 188 | guard let countryData = compiled[country] else { 189 | throw AppError.invalidLocalModelStore 190 | } 191 | 192 | return countryData.toSkuData() 193 | } 194 | 195 | private func loadAppleWatchUltraModels() throws -> [CountryCode: AppleWatchData] { 196 | if cachedAppleWatchUltraData.isEmpty == false { 197 | return cachedAppleWatchUltraData 198 | } 199 | 200 | if let path = Bundle.main.path(forResource: "AppleWatchUltra-intl", ofType: "json") { 201 | let data = try Data(contentsOf: URL(fileURLWithPath: path)) 202 | let decoder = JSONDecoder() 203 | 204 | if let appleWatchData = try? decoder.decode([String: [String: [String: String]]].self, from: data) { 205 | let mapped: [CountryCode: AppleWatchData] = appleWatchData.reduce(into: [:]) { partialResult, item in 206 | let data = AppleWatchData(from: item.value) 207 | partialResult[item.key] = data 208 | } 209 | 210 | cachedAppleWatchUltraData = mapped 211 | return mapped 212 | } else { 213 | throw AppError.invalidLocalModelStore 214 | } 215 | } else { 216 | throw AppError.invalidProjectState 217 | } 218 | } 219 | } 220 | 221 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /InventoryWatch/Model/ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewModel.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 10/25/22. 6 | // 7 | 8 | import Foundation 9 | 10 | @MainActor 11 | final class ViewModel: ObservableObject { 12 | 13 | private let fulfillmentModel = FulfillmentModel() 14 | private let githubModel = GithubModel() 15 | private let notificationSender = NotificationSender() 16 | private var defaultsVendor = DefaultsVendor() 17 | 18 | private var updateTimer: Timer? 19 | 20 | @Published var availableParts: [(FulfillmentStore, [PartAvailability])] = [] 21 | @Published var isLoading = false 22 | @Published var hasLatestVersion = true 23 | @Published var errorState: AppError? 24 | @Published var preferredStoreName: String? = nil 25 | 26 | var skuDataForPreferredProduct: SKUData { 27 | get async throws { 28 | return try await fulfillmentModel.skuDataForPreferredProduct 29 | } 30 | } 31 | 32 | var storesForCurrentCountry: [RetailStore] { 33 | get async { 34 | do { 35 | let storesByCountry = try await fulfillmentModel.loadStoresByCountry() 36 | guard let stores = storesByCountry[defaultsVendor.preferredCountry.locale]?.stores else { 37 | throw AppError.invalidProjectState 38 | } 39 | 40 | return stores .sorted(by: { first, second in 41 | if let firstState = first.address.stateName, let secondState = second.address.stateName { 42 | return firstState < secondState 43 | } else { 44 | return first.name < second.name 45 | } 46 | }) 47 | } catch { 48 | updateErrorState(to: error) 49 | return [] 50 | } 51 | } 52 | } 53 | 54 | private var selectedStore: RetailStore? { 55 | get async { 56 | let allStores = await storesForCurrentCountry 57 | let preferredStoreNumber = defaultsVendor.preferredStoreNumber 58 | 59 | return allStores.first(where: { $0.storeNumber == preferredStoreNumber }) 60 | } 61 | } 62 | 63 | init() { 64 | Task { await updateStoreName() } 65 | } 66 | 67 | private var latestTask: Task<(), Never>? = nil 68 | 69 | func fetchLatestInventory() async { 70 | isLoading = true 71 | AnalyticsData.updateAnalyticsData() 72 | 73 | if let task = latestTask { 74 | print("cancelling prior task: \(task)") 75 | task.cancel() 76 | } 77 | 78 | latestTask = Task { 79 | 80 | do { 81 | hasLatestVersion = try await githubModel.hasLatestGithubRelease() 82 | updateErrorState(to: .none, deactivateLoadingState: false) 83 | 84 | availableParts = try await fulfillmentModel.fetchInventory() 85 | try Task.checkCancellation() 86 | updateErrorState(to: .none) 87 | 88 | refreshLastUpdateTime() 89 | 90 | if let skuData = try? await skuDataForPreferredProduct { 91 | await notificationSender.sendNotificationIfNeeded(availableParts: availableParts, skuData: skuData) 92 | } 93 | 94 | print("successful update at \(defaultsVendor.lastUpdateDate ?? "unknown time")") 95 | } catch { 96 | if error is CancellationError { 97 | print("task cancelled - suppressing thrown CancellationError and returning") 98 | return 99 | } else { 100 | updateErrorState(to: error) 101 | } 102 | } 103 | 104 | isLoading = false 105 | latestTask = nil 106 | resetTimer() 107 | } 108 | } 109 | 110 | func clearCurrentAvailableParts() { 111 | availableParts = [] 112 | } 113 | 114 | func fetchLatestGithubRelease() async { 115 | if let latest = try? await githubModel.hasLatestGithubRelease() { 116 | hasLatestVersion = latest 117 | } 118 | } 119 | 120 | func updateErrorState(to error: Error?, deactivateLoadingState: Bool = true) { 121 | if deactivateLoadingState { 122 | self.isLoading = false 123 | } 124 | 125 | guard let error = error else { 126 | self.errorState = nil 127 | return 128 | } 129 | 130 | print(error.localizedDescription) 131 | if let modelError = error as? AppError { 132 | self.errorState = modelError 133 | } else { 134 | self.errorState = AppError.generic(error) 135 | } 136 | } 137 | 138 | func getDefaultStoreForCurrentCountry() async -> RetailStore? { 139 | do { 140 | guard let store = try await fulfillmentModel.getDefaultStoreForCurrentCountry() else { 141 | throw AppError.invalidProjectState 142 | } 143 | 144 | return store 145 | } catch { 146 | updateErrorState(to: error) 147 | return nil 148 | } 149 | } 150 | 151 | func updateStoreName() async { 152 | let storeNumber = defaultsVendor.preferredStoreNumber 153 | let store = await self.storesForCurrentCountry.first(where: { store in 154 | store.storeNumber == storeNumber 155 | }) 156 | 157 | self.preferredStoreName = store?.name 158 | } 159 | 160 | private func refreshLastUpdateTime() { 161 | let formatter = DateFormatter() 162 | formatter.dateFormat = "MMM d, h:mm a" 163 | let dateString = formatter.string(from: Date()) 164 | 165 | defaultsVendor.lastUpdateDate = dateString 166 | } 167 | 168 | private func resetTimer() { 169 | // if the timer settings have changed, kill the current timer 170 | if let existingTimer = updateTimer, existingTimer.timeInterval != Double(defaultsVendor.preferredUpdateInterval * 60) { 171 | existingTimer.invalidate() 172 | updateTimer = nil 173 | } 174 | 175 | // if no timer exists, and the user wants repeated updates, construct a repeating timer 176 | if defaultsVendor.preferredUpdateInterval > 0, updateTimer == nil { 177 | let interval = Double(defaultsVendor.preferredUpdateInterval * 60) 178 | updateTimer = Timer.scheduledTimer(withTimeInterval: interval, repeats: true, block: { _ in 179 | Task { [weak self] in await self?.fetchLatestInventory() } 180 | }) 181 | } 182 | } 183 | 184 | } 185 | -------------------------------------------------------------------------------- /InventoryWatch/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /InventoryWatch/SKUData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SKUData.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/8/21. 6 | // 7 | 8 | import Foundation 9 | 10 | struct SKUData { 11 | private let skuLookup: [String: String] 12 | let orderedSKUs: [String] 13 | 14 | init(orderedSKUs: [String], lookup: [String: String]) { 15 | self.orderedSKUs = orderedSKUs 16 | self.skuLookup = lookup 17 | } 18 | 19 | func productName(forSKU sku: String) -> String? { 20 | return skuLookup[sku] 21 | } 22 | } 23 | 24 | func iPadProM2_11inDataForCountry(_ country: Country, isWifi: Bool) -> SKUData { 25 | let skuCode = country.skuCode(for: isWifi ? .iPadProM2_11in_Wifi : .iPadProM2_11in_Cellular) ?? country.skuCode 26 | 27 | let cellData = [ 28 | "MP563": "M2 iPad Pro 11in 128GB Silver Cellular", 29 | "MP583": "M2 iPad Pro 11in 256GB Silver Cellular", 30 | "MP5D3": "M2 iPad Pro 11in 512GB Silver Cellular", 31 | "MP5F3": "M2 iPad Pro 11in 1TB Silver Cellular", 32 | "MP5H3": "M2 iPad Pro 11in 2TB Silver Cellular", 33 | "MP553": "M2 iPad Pro 11in 128GB Space Gray Cellular", 34 | "MP573": "M2 iPad Pro 11in 256GB Space Gray Cellular", 35 | "MP593": "M2 iPad Pro 11in 512GB Space Gray Cellular", 36 | "MP5E3": "M2 iPad Pro 11in 1TB Space Gray Cellular", 37 | "MP5G3": "M2 iPad Pro 11in 2TB Space Gray Cellular" 38 | ] 39 | 40 | let wifiData = [ 41 | "MNXE3": "M2 iPad Pro 11in 128GB Silver Wifi", 42 | "MNXG3": "M2 iPad Pro 11in 256GB Silver Wifi", 43 | "MNXJ3": "M2 iPad Pro 11in 512GB Silver Wifi", 44 | "MNXL3": "M2 iPad Pro 11in 1TB Silver Wifi", 45 | "MNXN3": "M2 iPad Pro 11in 2TB Silver Wifi", 46 | "MNXD3": "M2 iPad Pro 11in 128GB Space Gray Wifi", 47 | "MNXF3": "M2 iPad Pro 11in 256GB Space Gray Wifi", 48 | "MNXH3": "M2 iPad Pro 11in 512GB Space Gray Wifi", 49 | "MNXK3": "M2 iPad Pro 11in 1TB Space Gray Wifi", 50 | "MNXM3": "M2 iPad Pro 11in 2TB Space Gray Wifi" 51 | ] 52 | 53 | let orderedSkus = isWifi ? 54 | ["MNXE3", "MNXG3", "MNXJ3", "MNXL3", "MNXN3", "MNXD3", "MNXF3", "MNXH3", "MNXK3", "MNXM3"] : 55 | ["MNXE3", "MNXG3", "MNXJ3", "MNXL3", "MNXN3", "MNXD3", "MNXF3", "MNXH3", "MNXK3", "MNXM3"] 56 | 57 | let skusToName: [String: String] = orderedSkus.reduce(into: [String: String]()) { partialResult, next in 58 | let map = isWifi ? wifiData : cellData 59 | guard let name = map[next] else { return } 60 | 61 | let localSku = "\(next)\(skuCode)/A" 62 | partialResult[localSku] = name 63 | } 64 | 65 | let localOrderedSkus = orderedSkus.map { "\($0)\(skuCode)/A" } 66 | 67 | return SKUData(orderedSKUs: localOrderedSkus, lookup: skusToName) 68 | } 69 | 70 | func iPadProM2_13inDataForCountry(_ country: Country, isWifi: Bool) -> SKUData { 71 | let skuCode = country.skuCode(for: isWifi ? .iPadProM2_13in_Wifi : .iPadProM2_13in_Cellular) ?? country.skuCode 72 | 73 | let cellData = [ 74 | "MP5Y3": "M2 iPad Pro 12.9in 128GB Silver Cellular", 75 | "MP613": "M2 iPad Pro 12.9in 256GB Silver Cellular", 76 | "MP633": "M2 iPad Pro 12.9in 512GB Silver Cellular", 77 | "MP653": "M2 iPad Pro 12.9in 1TB Silver Cellular", 78 | "MP673": "M2 iPad Pro 12.9in 2TB Silver Cellular", 79 | "MP5X3": "M2 iPad Pro 12.9in 128GB Space Gray Cellular", 80 | "MP603": "M2 iPad Pro 12.9in 256GB Space Gray Cellular", 81 | "MP623": "M2 iPad Pro 12.9in 512GB Space Gray Cellular", 82 | "MP643": "M2 iPad Pro 12.9in 1TB Space Gray Cellular", 83 | "MP663": "M2 iPad Pro 12.9in 2TB Space Gray Cellular" 84 | ] 85 | 86 | let wifiData = [ 87 | "MNXQ3": "M2 iPad Pro 12.9in 128GB Silver Wifi", 88 | "MNXT3": "M2 iPad Pro 12.9in 256GB Silver Wifi", 89 | "MNXV3": "M2 iPad Pro 12.9in 512GB Silver Wifi", 90 | "MNXX3": "M2 iPad Pro 12.9in 1TB Silver Wifi", 91 | "MNY03": "M2 iPad Pro 12.9in 2TB Silver Wifi", 92 | "MNXP3": "M2 iPad Pro 12.9in 128GB Space Gray Wifi", 93 | "MNXR3": "M2 iPad Pro 12.9in 256GB Space Gray Wifi", 94 | "MNXU3": "M2 iPad Pro 12.9in 512GB Space Gray Wifi", 95 | "MNXW3": "M2 iPad Pro 12.9in 1TB Space Gray Wifi", 96 | "MNXY3": "M2 iPad Pro 12.9in 2TB Space Gray Wifi" 97 | ] 98 | 99 | let orderedSkus = isWifi ? 100 | ["MNXQ3", "MNXT3", "MNXV3", "MNXX3", "MNY03", "MNXP3", "MNXR3", "MNXU3", "MNXW3", "MNXY3"] : 101 | ["MP5Y3", "MP613", "MP633", "MP653", "MP673", "MP5X3", "MP603", "MP623", "MP643", "MP663"] 102 | 103 | let skusToName: [String: String] = orderedSkus.reduce(into: [String: String]()) { partialResult, next in 104 | let map = isWifi ? wifiData : cellData 105 | guard let name = map[next] else { return } 106 | 107 | let localSku = "\(next)\(skuCode)/A" 108 | partialResult[localSku] = name 109 | } 110 | 111 | let localOrderedSkus = orderedSkus.map { "\($0)\(skuCode)/A" } 112 | 113 | return SKUData(orderedSKUs: localOrderedSkus, lookup: skusToName) 114 | } 115 | 116 | func iPad10thGenDataForCountry(_ country: Country, isWifi: Bool) -> SKUData { 117 | let skuCode = country.skuCode(for: isWifi ? .iPad10thGenWifi : .iPad10thGenCellular) ?? country.skuCode 118 | 119 | let wifiData = [ 120 | "MPQ13": "iPad (10th Gen) 64GB Blue Wifi", 121 | "MPQ93": "iPad (10th Gen) 256GB Blue Wifi", 122 | "MPQ33": "iPad (10th Gen) 64GB Pink Wifi", 123 | "MPQC3": "iPad (10th Gen) 256GB Pink Wifi", 124 | "MPQ03": "iPad (10th Gen) 64GB Silver Wifi", 125 | "MPQ83": "iPad (10th Gen) 256GB Silver Wifi", 126 | "MPQ23": "iPad (10th Gen) 64GB Yellow Wifi", 127 | "MPQA3": "iPad (10th Gen) 256GB Yellow Wifi" 128 | ] 129 | 130 | let cellData = [ 131 | "MQ6K3": "iPad (10th Gen) 64GB Blue Cellular", 132 | "MQ6U3": "iPad (10th Gen) 256GB Blue Cellular", 133 | "MQ6M3": "iPad (10th Gen) 64GB Pink Cellular", 134 | "MQ6W3": "iPad (10th Gen) 256GB Pink Cellular", 135 | "MQ6J3": "iPad (10th Gen) 64GB Silver Cellular", 136 | "MQ6T3": "iPad (10th Gen) 256GB Silver Cellular", 137 | "MQ6L3": "iPad (10th Gen) 64GB Yellow Cellular", 138 | "MQ6V3": "iPad (10th Gen) 256GB Yellow Cellular" 139 | ] 140 | 141 | let orderedSkus = isWifi ? 142 | ["MPQ13", "MPQ93", "MPQ33", "MPQC3", "MPQ03", "MPQ83", "MPQ23", "MPQA3"] : 143 | ["MQ6K3", "MQ6U3", "MQ6M3", "MQ6W3", "MQ6J3", "MQ6T3", "MQ6L3", "MQ6V3"] 144 | 145 | let skusToName: [String: String] = orderedSkus.reduce(into: [String: String]()) { partialResult, next in 146 | let map = isWifi ? wifiData : cellData 147 | guard let name = map[next] else { return } 148 | 149 | let localSku = "\(next)\(skuCode)/A" 150 | partialResult[localSku] = name 151 | } 152 | 153 | let localOrderedSkus = orderedSkus.map { "\($0)\(skuCode)/A" } 154 | 155 | return SKUData(orderedSKUs: localOrderedSkus, lookup: skusToName) 156 | } 157 | 158 | func iPadMiniDataForCountry(_ country: Country, isWifi: Bool) -> SKUData { 159 | let skuCode = country.skuCode(for: isWifi ? .iPadMiniWifi : .iPadMiniCellular) ?? country.skuCode 160 | 161 | let wifiData = [ 162 | "MK7R3": "iPad Mini 64GB Purple Wifi", 163 | "MLWL3": "iPad Mini 64GB Pink Wifi", 164 | "MK7P3": "iPad Mini 64GB Starlight Wifi", 165 | "MK7M3": "iPad Mini 64GB Space Gray Wifi", 166 | "MK7X3": "iPad Mini 256GB Purple Wifi", 167 | "MLWR3": "iPad Mini 256GB Pink Wifi", 168 | "MK7V3": "iPad Mini 256GB Starlight Wifi", 169 | "MK7T3": "iPad Mini 256GB Space Gray Wifi" 170 | ] 171 | 172 | let cellData = [ 173 | "MK8E3": "iPad Mini 64GB Purple Cellular", 174 | "MLX43": "iPad Mini 64GB Pink Cellular", 175 | "MK8C3": "iPad Mini 64GB Starlight Cellular", 176 | "MK893": "iPad Mini 64GB Space Gray Cellular", 177 | "MK8K3": "iPad Mini 256GB Purple Cellular", 178 | "MLX93": "iPad Mini 256GB Pink Cellular", 179 | "MK8H3": "iPad Mini 256GB Starlight Cellular", 180 | "MK8F3": "iPad Mini 256GB Space Gray Cellular" 181 | ] 182 | 183 | let orderedSkus = isWifi ? 184 | [ "MK7R3", "MLWL3", "MK7P3", "MK7M3", "MK7X3", "MLWR3", "MK7V3", "MK7T3" ] : 185 | [ "MK8E3", "MLX43", "MK8C3", "MK893", "MK8K3", "MLX93", "MK8H3", "MK8F3" ] 186 | 187 | let skusToName: [String: String] = orderedSkus.reduce(into: [String: String]()) { partialResult, next in 188 | let map = isWifi ? wifiData : cellData 189 | guard let name = map[next] else { return } 190 | 191 | let localSku = "\(next)\(skuCode)/A" 192 | partialResult[localSku] = name 193 | } 194 | 195 | let localOrderedSkus = orderedSkus.map { "\($0)\(skuCode)/A" } 196 | 197 | return SKUData(orderedSKUs: localOrderedSkus, lookup: skusToName) 198 | } 199 | 200 | func StudioDisplayForCountry(_ country: Country) -> SKUData { 201 | let skuCode = country.skuCode(for: .StudioDisplay) ?? country.skuCode 202 | 203 | let orderedSkus = [ 204 | "MK0U3\(skuCode)/A", 205 | "MK0Q3\(skuCode)/A", 206 | "MMYQ3\(skuCode)/A", 207 | "MMYW3\(skuCode)/A", 208 | "MMYV3\(skuCode)/A", 209 | "MMYX3\(skuCode)/A" 210 | ] 211 | 212 | let skusToName = [ 213 | "MK0U3\(skuCode)/A": "Studio Display - Standard glass - Tilt-adjustable stand", 214 | "MK0Q3\(skuCode)/A": "Studio Display - Standard glass - Tilt- and height-adjustable stand", 215 | "MMYQ3\(skuCode)/A": "Studio Display - Standard glass - VESA mount adapter", 216 | "MMYW3\(skuCode)/A": "Studio Display - Nano-texture glass - Tilt-adjustable stand", 217 | "MMYV3\(skuCode)/A": "Studio Display - Nano-texture glass - Tilt- and height-adjustable stand", 218 | "MMYX3\(skuCode)/A": "Studio Display - Nano-texture glass - VESA mount adapter" 219 | ] 220 | 221 | return SKUData(orderedSKUs: orderedSkus, lookup: skusToName) 222 | } 223 | 224 | func MacStudioDataForCountry(_ country: Country) -> SKUData { 225 | let skuCode = country.skuCode(for: .MacStudio) ?? country.skuCode 226 | 227 | let orderedSkus = [ 228 | "MJMW3\(skuCode)/A", 229 | "MJMV3\(skuCode)/A" 230 | ] 231 | 232 | let skusToName = [ 233 | "MJMV3\(skuCode)/A": "M1 Max (10c CPU, 24c GPU), 32GB RAM, 512GB SSD", 234 | "MJMW3\(skuCode)/A": "M1 Ultra (20c CPU, 48c GPU), 64GB RAM, 1TB SSD" 235 | ] 236 | 237 | return SKUData(orderedSKUs: orderedSkus, lookup: skusToName) 238 | } 239 | 240 | func MBPDataForCountry(_ country: Country) -> SKUData { 241 | 242 | let orderedSkus = [ 243 | "MKGR3\(country.skuCode)/A", 244 | "MKGP3\(country.skuCode)/A", 245 | "MKGT3\(country.skuCode)/A", 246 | "MKGQ3\(country.skuCode)/A", 247 | "MMQX3\(country.skuCode)/A", 248 | "MKH53\(country.skuCode)/A", 249 | "MK1E3\(country.skuCode)/A", 250 | "MK183\(country.skuCode)/A", 251 | "MK1F3\(country.skuCode)/A", 252 | "MK193\(country.skuCode)/A", 253 | "MK1H3\(country.skuCode)/A", 254 | "MK1A3\(country.skuCode)/A", 255 | "MK233\(country.skuCode)/A", 256 | "MMQW3\(country.skuCode)/A", 257 | ] 258 | 259 | /** 260 | see here for tweet containing all in-store models: 261 | https://twitter.com/caseyliss/status/1453007425188024324?s=20 262 | */ 263 | let skusToName = [ 264 | "MKGR3\(country.skuCode)/A": "14\" M1 Pro (8c CPU, 14c GPU) 16GB/512GB Silver", 265 | "MKGP3\(country.skuCode)/A": "14\" M1 Pro (8c CPU, 14c GPU) 16GB/512GB Space Grey", 266 | "MKGT3\(country.skuCode)/A": "14\" M1 Pro (10c CPU, 16c GPU) 16GB/1TB Silver", 267 | "MKGQ3\(country.skuCode)/A": "14\" M1 Pro (10c CPU, 16c GPU) 16GB/1TB Space Grey", 268 | "MMQX3\(country.skuCode)/A": "14\" M1 Max (10c CPU, 32c GPU) 64GB/2TB Silver, Ultimate", 269 | "MKH53\(country.skuCode)/A": "14\" M1 Max (10c CPU, 32c GPU) 64GB/2TB Space Grey, Ultimate", 270 | 271 | "MK1E3\(country.skuCode)/A": "16\" M1 Pro (10c CPU, 16c GPU) 16GB/512GB Silver", 272 | "MK183\(country.skuCode)/A": "16\" M1 Pro (10c CPU, 16c GPU) 16GB/512GB Space Grey", 273 | "MK1F3\(country.skuCode)/A": "16\" M1 Pro (10c CPU, 16c GPU) 16GB/1TB Silver", 274 | "MK193\(country.skuCode)/A": "16\" M1 Pro (10c CPU, 16c GPU) 16GB/1TB Space Grey", 275 | 276 | "MK1H3\(country.skuCode)/A": "16\" M1 Max (10c CPU, 32c GPU) 32GB/1TB Silver", 277 | "MK1A3\(country.skuCode)/A": "16\" M1 Max (10c CPU, 32c GPU) 32GB/1TB Space Grey", 278 | "MMQW3\(country.skuCode)/A": "16\" M1 Max (10c CPU, 32c GPU) 64GB/4TB Silver, Ultimate", 279 | "MK233\(country.skuCode)/A": "16\" M1 Max (10c CPU, 32c GPU) 64GB/4TB Space Grey, Ultimate", 280 | ] 281 | 282 | return SKUData(orderedSKUs: orderedSkus, lookup: skusToName) 283 | } 284 | 285 | func M2MBPDataForCountry(_ country: Country) -> SKUData { 286 | 287 | let orderedSkus = [ 288 | "MNEH3\(country.skuCode)/A", // sg low 289 | "MNEJ3\(country.skuCode)/A", // sg high 290 | "MNEP3\(country.skuCode)/A", // sv low 291 | "MNEQ3\(country.skuCode)/A" // sv high 292 | ] 293 | 294 | let skusToName = [ 295 | "MNEH3\(country.skuCode)/A": "13\" M2 8GB/256GB - Space Gray", 296 | "MNEJ3\(country.skuCode)/A": "13\" M2 8GB/512GB - Space Gray", 297 | "MNEP3\(country.skuCode)/A": "13\" M2 8GB/256GB - Silver", 298 | "MNEQ3\(country.skuCode)/A": "13\" M2 8GB/512GB - Silver" 299 | ] 300 | 301 | return SKUData(orderedSKUs: orderedSkus, lookup: skusToName) 302 | } 303 | 304 | func M2MBAirDataForCountry(_ country: Country) -> SKUData { 305 | 306 | let orderedSkus = [ 307 | "MLXY3\(country.skuCode)/A", 308 | "MLY03\(country.skuCode)/A", 309 | "MLY13\(country.skuCode)/A", 310 | "MLY23\(country.skuCode)/A", 311 | "MLY43\(country.skuCode)/A", 312 | "MLY33\(country.skuCode)/A", 313 | "MLXX3\(country.skuCode)/A", 314 | "MLXW3\(country.skuCode)/A", 315 | "MN703\(country.skuCode)/A", 316 | "MNQP3\(country.skuCode)/A", 317 | "MN6Y3\(country.skuCode)/A" 318 | ] 319 | 320 | let skusToName = [ 321 | "MLXY3\(country.skuCode)/A": "M2 (8c CPU, 8c GPU) 8GB/256GB Silver", 322 | "MLY03\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 8GB/512GB Silver", 323 | "MLY13\(country.skuCode)/A": "M2 (8c CPU, 8c GPU) 8GB/256GB Starlight", 324 | "MLY23\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 8GB/512GB Starlight", 325 | "MLY43\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 8GB/512GB Midnight", 326 | "MLY33\(country.skuCode)/A": "M2 (8c CPU, 8c GPU) 8GB/256GB Midnight", 327 | "MLXX3\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 8GB/512GB Space Gray", 328 | "MLXW3\(country.skuCode)/A": "M2 (8c CPU, 8c GPU) 8GB/256GB Space Gray", 329 | 330 | // ultimate builds 331 | "MN703\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 16GB/1TB Midnight", 332 | "MNQP3\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 16GB/1TB Space Gray", 333 | "MN6Y3\(country.skuCode)/A": "M2 (8c CPU, 10c GPU) 16GB/1TB Starlight" 334 | ] 335 | 336 | return SKUData(orderedSKUs: orderedSkus, lookup: skusToName) 337 | } 338 | 339 | func AirPodsProGen2DataForCountry(_ country: Country) -> SKUData { 340 | let skuCode = country.skuCode(for: .AirPodsProGen2) ?? country.skuCode 341 | 342 | return SKUData( 343 | orderedSKUs: ["MQD83\(skuCode)/A"], 344 | lookup: ["MQD83\(skuCode)/A": "AirPods Pro (2nd Generation)"] 345 | ) 346 | } 347 | 348 | func ApplePencilUSBCAdapterDataForCountry(_ country: Country) -> SKUData { 349 | let skuCode = country.skuCode(for: .ApplePencilUSBCAdapter) ?? country.skuCode 350 | 351 | return SKUData( 352 | orderedSKUs: ["MQLU3\(skuCode)/A"], 353 | lookup: ["MQLU3\(skuCode)/A": "USB-C to Apple Pencil Adapter"] 354 | ) 355 | } 356 | -------------------------------------------------------------------------------- /InventoryWatch/SettingsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsView.swift 3 | // InventoryWatch 4 | // 5 | // Created by Worth Baker on 11/9/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SettingsView: View { 11 | 12 | 13 | private struct ProductModel: Identifiable, Equatable { 14 | let sku: String 15 | var name: String 16 | var isFavorite: Bool 17 | 18 | var id: String { sku } 19 | } 20 | 21 | private struct StoreWithSelection: Identifiable, Equatable { 22 | var store: RetailStore 23 | var isSelected: Bool 24 | 25 | var id: String { storeNumber } 26 | var storeNumber: String { store.id } 27 | var storeName: String { store.name } 28 | var city: String { store.address.city } 29 | 30 | var stateName: String? { store.address.stateName } 31 | var stateCode: String? { store.address.stateCode } 32 | } 33 | 34 | @EnvironmentObject var model: ViewModel 35 | @Environment(\.openURL) var openURL 36 | 37 | @AppStorage("preferredCountry") private var preferredCountry = "US" 38 | @AppStorage("preferredStoreNumber") private var preferredStoreNumber = "" 39 | @AppStorage("preferredSKUs") private var preferredSKUs: String = "" 40 | @AppStorage("preferredUpdateInterval") private var preferredUpdateInterval: Int = 1 41 | @AppStorage("preferredProductType") private var preferredProductType: String = "MacBookPro" 42 | @AppStorage("notifyOnlyForPreferredModels") private var notifyOnlyForPreferredModels: Bool = false 43 | @AppStorage("showResultsOnlyForPreferredModels") private var showResultsOnlyForPreferredModels: Bool = false 44 | @AppStorage("customSku") private var customSku = "" 45 | @AppStorage("customSkuNickname") private var customSkuNickname = "" 46 | @AppStorage("useLargeText") private var useLargeText: Bool = false 47 | @AppStorage("shouldIncludeNearbyStores") private var shouldIncludeNearbyStores: Bool = true 48 | 49 | @State private var selectedCountryIndex = 0 50 | @State private var allModels: [ProductModel] = [] 51 | @State private var allStores: [StoreWithSelection] = [] 52 | @State private var storeSearchText: String = "" 53 | @State private var selectedStore: String = "" 54 | 55 | var body: some View { 56 | VStack(alignment: .leading) { 57 | HStack(alignment: .top, spacing: 24) { 58 | VStack(alignment: .leading) { 59 | Picker("Country", selection: $selectedCountryIndex) { 60 | ForEach(0..(preferredSKUs.components(separatedBy: ",")) 266 | guard let skuData = try? await model.skuDataForPreferredProduct else { 267 | return 268 | } 269 | 270 | allModels = skuData.orderedSKUs.map { sku in 271 | let name = skuData.productName(forSKU: sku) ?? sku 272 | return ProductModel(sku: sku, name: name, isFavorite: favoriteSkus.contains(sku)) 273 | } 274 | } 275 | 276 | func loadStores(filterText: String?) async { 277 | if selectedStore.isEmpty { 278 | selectedStore = preferredStoreNumber 279 | } 280 | 281 | let storesJson = await model.storesForCurrentCountry 282 | let stores: [StoreWithSelection] = storesJson.map { store in 283 | StoreWithSelection( 284 | store: store, 285 | isSelected: store.storeNumber == selectedStore 286 | ) 287 | } 288 | if let filter = filterText?.lowercased(), filter.isEmpty == false { 289 | allStores = stores.filter { store in 290 | if store.storeName.lowercased().contains(filter) { 291 | return true 292 | } 293 | 294 | if store.city.lowercased().contains(filter) { 295 | return true 296 | } 297 | 298 | if store.storeNumber.lowercased().contains(filter) { 299 | return true 300 | } 301 | 302 | if (store.stateName?.lowercased() ?? "").contains(filter) { 303 | return true 304 | } 305 | 306 | if (store.stateCode?.lowercased() ?? "").contains(filter) { 307 | return true 308 | } 309 | 310 | return false 311 | } 312 | } else { 313 | allStores = stores 314 | } 315 | } 316 | 317 | func selectDefaultStoreForNewCountry() async { 318 | guard let defaultStore = await model.getDefaultStoreForCurrentCountry() else { 319 | return 320 | } 321 | 322 | preferredStoreNumber = defaultStore.storeNumber 323 | selectedStore = preferredStoreNumber 324 | 325 | for var store in allStores { 326 | store.isSelected = store.storeNumber == preferredStoreNumber 327 | } 328 | } 329 | } 330 | 331 | //struct SettingsView_Previews: PreviewProvider { 332 | // static var previews: some View { 333 | // SettingsView() 334 | // .environmentObject(Model.testData) 335 | // } 336 | //} 337 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # inventory-checker-app 2 | InventoryWatch 2.0 has been released! This repository will remain available for any who are curious, but is no longer actively maintained. Please check out the link below to learn more about our updates and advancements in InventoryWatch 2.0 (including web access!), and to download our new app. 3 | 4 | Read more here: https://worthbak.github.io/inventory-checker-app/ 5 | -------------------------------------------------------------------------------- /docs/InventoryWatch-0.2.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/docs/InventoryWatch-0.2.2.zip -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: InventoryWatch 2 | logo: ./logo.png 3 | description: Your Guide to Apple Store Inventory 4 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /docs/ic-mkt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/docs/ic-mkt.jpg -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # InventoryWatch 2.0 is here! 2 | 3 | ![InventoryWatch-Screenshot](./iw-2.0-mkt.jpg) 4 | 5 | [Download today! ➡️](https://inventorywatch.app) 6 | 7 | ## What's New in 2.0 8 | 9 | InventoryWatch 2.0 is a massive upgrade, adding many of our most-requested features: 10 | 11 | * A completely rewritten and redesigned macOS app, with the ability to add multiple searches 12 | * Support for email and text notifications - no need to stay glued to your Mac! 13 | * A brand-new web app, bringing InventoryWatch to any platform with a browser (including your iPhone) 14 | * Search for Apple's latest products, including the M2 Mac Studio and 15in MacBook Air 15 | * Server-side product updates - no need to update the app whenever new products are launched 16 | 17 | One thing remains the same: **our committment to privacy, and generally not being creepy**. InventoryWatch doesn't track you, has no ads or invasive analytics packages, and will only send you emails that you've asked for. 18 | 19 | ## How To Upgrade 20 | 21 | As always, InventoryWatch for macOS is available to download for free. InventoryWatch 2.0 requires macOS Ventura (13.0), and you can download it now at our new homepage: [InventoryWatch.app](https://inventorywatch.app) 22 | 23 | Support for premium features like email and text notifications, multiple searches, and web access are available via an InventoryWatch subscription, starting at just $2 per month. You can learn more and check out pricing here: [InventoryWatch Pricing](https://inventorywatch.app/plans) 24 | 25 | Got feedback, or found a bug? Open an issue at our new feedback repo: [InventoryWatch Feedback on Github](https://github.com/Rugged-Apps/InventoryWatch-Feedback) 26 | 27 | Finally, if you have questions or just want to send us a message, we're on mastodon.social [@InventoryWatch](https://mastodon.social/@InventoryWatch), and [Twitter](https://twitter.com/InventoryWatch) as well (if you're into that kinda thing). 28 | 29 | We're incredibly excited for you to try InventoryWatch 2.0, and would love to hear what you think! 30 | 31 | Learn more: [InventoryWatch.app](https://inventorywatch.app) 32 | -------------------------------------------------------------------------------- /docs/iw-2.0-mkt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/docs/iw-2.0-mkt.jpg -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/docs/logo.png -------------------------------------------------------------------------------- /product/InventoryWatch.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/worthbak/inventory-checker-app/c5728dab78ea9d02b6cfc69862587bf6ab8565ba/product/InventoryWatch.zip --------------------------------------------------------------------------------