Commit graph

128 commits

Author SHA1 Message Date
Ross Goldberg
6bf5696093
Chop down multiline guard clauses.
Partial #585

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:52:19 -04:00
Ross Goldberg
59a642590a
Rename some uses of *Url as *URL.
Partial #585

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:52:14 -04:00
Ross Goldberg
0b11f3737c
Rename some uses of appName as searchTerm.
Partial #585

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:51:07 -04:00
Ross Goldberg
0e49da7bf1
Rename *bundleId as *bundleID.
Partial #585

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:51:07 -04:00
Ross Goldberg
3a5593c12d
Rename *accountId & username as *appleID.
Partial #585

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:51:07 -04:00
Ross Goldberg
98c85ac6d6
Delete apps via Scripting Bridge to Finder.
Resolve #313

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:39:03 -04:00
Ross Goldberg
53c64b1758
Improve errors.
Partial #313

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:39:03 -04:00
Ross Goldberg
06ee9608be
Improve output.
Improve errors.

Simplify code.

Partial #313

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:39:03 -04:00
Ross Goldberg
b0d2f23465
Add appID parameter to MASError.notInstalled().
Partial #313

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:39:03 -04:00
Ross Goldberg
222646159d
Refactor AppLibrary.installedApp(…) as AppLibrary.installedApps(…)
because multiple installed apps can have the same app ID or app name.

Partial #313

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:39:02 -04:00
Ross Goldberg
4e0a471d81
Remove unnecessary function from AppLibrary.
Partial #313

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-25 22:39:01 -04:00
Ross Goldberg
4d4dd02cd3
Improve lint configurations.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:34 -04:00
Ross Goldberg
2edd21803b
Improve unwrapping.
Cleanup code.

Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:34 -04:00
Ross Goldberg
87aaba555d
Remove unnecessary variable type.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:34 -04:00
Ross Goldberg
ee28af69df
Eliminate magic numbers.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:34 -04:00
Ross Goldberg
fcf8ba29f6
Improve error output.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:34 -04:00
Ross Goldberg
65218eff74
Comment that catch ignores error.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:34 -04:00
Ross Goldberg
3a6d6724c9
Reorder elements.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:33 -04:00
Ross Goldberg
2af2a42a88
Improve parameter names.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:33 -04:00
Ross Goldberg
586de07389
Improve access control.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:33 -04:00
Ross Goldberg
e927466dce
Use Self.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:33 -04:00
Ross Goldberg
06a347c450
Use isEmpty / beEmpty().
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:33 -04:00
Ross Goldberg
d7074db06f
Remove unnecessary else blocks.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:33 -04:00
Ross Goldberg
71fbe2e444
Improve spacing.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:18:28 -04:00
Ross Goldberg
3eaffa5c3e
Improve DocC.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:17:43 -04:00
Ross Goldberg
a100f3acd0
Remove unnecessary generics.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:17:38 -04:00
Ross Goldberg
3d9ea972f9
Cleanup code.
Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-23 06:01:42 -04:00
Ross Goldberg
b0d0f4aacd
appIDValue to encapsulate uint64Value.
Resolve #574

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-15 08:06:14 -04:00
Ross Goldberg
20c08eb855
Update README.md.
Resolve #559

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-15 07:49:15 -04:00
Ross Goldberg
a44655ac31
Refactor StoreSearch.lookup(…) & StoreSearch.search(…) to share implementation, which allows lookup to accept an Entity argument instead of being hardcoded to desktopSoftware.
Resolve #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:46:13 -04:00
Ross Goldberg
280b38dfe8
Add media=software query item to lookup URL to improve results.
Reorder query items for both lookup URLs & search URLs.

Partial #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:29:47 -04:00
Ross Goldberg
6c5a277ad9
Add & use Entity.desktopSoftware instead of macSoftware.
`desktopSoftware` returns info (including version & description) that aligns with what is displayed earlier in the App Store, while `macSoftware` is at least sometimes out of alignment.

Partial #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:24:39 -04:00
Ross Goldberg
6489daa0e3
Update iTunes Search API documentation URL.
Partial #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:12:39 -04:00
Ross Goldberg
265326dede
Add captureStream(…) to observe stdout & stderr in tests.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 05:05:45 -04:00
Ross Goldberg
006273bb81
Standardize names of variables & parameters relating to AppIDs.
Resolve #478

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 04:10:39 -04:00
Ross Goldberg
39f77c01a9
Create typealias AppID = UInt64.
Use `AppID` everywhere appropriate.

Associated appID cleanup.

Partial #478

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 04:10:38 -04:00
Ross Goldberg
0efd73a5ee
Simplify Outdated.run(…).
Resolve #542

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:12 -04:00
Ross Goldberg
cd42176859
Rename apps property of Upgrade as appIds.
Resolve #542

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:12 -04:00
Ross Goldberg
388d963cd1
Do not return Result (or anything else) from command run(…) functions.
Throw when failure. Normal Void return when success.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:12 -04:00
Ross Goldberg
2535e3da42
Use Swift Argument Parser instead of Commandant.
Command structs are nested types of Mas.

Renamed structs.

Limit code visibility as much as possible.

Standardize variable names.

Standardize spacing.

Fix a few tests.

Disable a useless test.

Remove unnecessary test stdout output.

Get swift-format from Brewfile instead of from Package.swift
since swift-format depends on an old version of swift-argument-parser.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:11 -04:00
Ross Goldberg
6793a91e03
Remove unnecessary explicit inits.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:10 -04:00
Ross Goldberg
d413d8cfa1
Move MasKit module to mas.
Move MasKitTests module to masTests.

Rename MasKit enum as Mas.

Upgrade swift-tools-version from 5.3 to 5.6.1.

swift-tools-version 5.5+ is necessary to allow test code to import executable target code,
to allow MasKit library code to be moved into the mas executable.

Upgrade to swift-tools-version to 5.6.1 instead of to 5.5 because they support all the same macOS versions.

Standardize comments.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:03 -04:00
Ross Goldberg
a24bcdd1e9
Merge branch 'main' into 562-apple-id 2024-10-13 22:23:37 -04:00
Ross Goldberg
1bebde9e4a
Merge pull request #550 from rgoldberg/536-output-responses-unparsable-as-json
Output to stderr responses from Apple endpoints that are unparsable as JSON
2024-10-13 22:20:51 -04:00
Ross Goldberg
fe7b688f3b
Merge pull request #549 from rgoldberg/538-fix-typos
Fix typos in comments & in documentation.
2024-10-13 22:18:28 -04:00
Ross Goldberg
7c81b4803c
Merge pull request #551 from rgoldberg/540-outdated-multi-platform-minimum-macos
`outdated` checks if new app version requires newer macOS for all kinds of apps, not just mac-software
2024-10-13 22:17:14 -04:00
Ross Goldberg
fe749fc2eb
Handle CKPurchaseController.shared().perform(…) callback within SSPurchase.perform(adamId:purchase:) to encapsulate CKPurchaseController & its callback.
Chain `Promise`s instead of calling `Promise.wait()`.

Improve comments.

Resolve #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 02:15:07 -04:00
Ross Goldberg
a45308f2f2
Configure SSPurchase in `perform(…) instead of in a convenience init.
Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 02:01:26 -04:00
Ross Goldberg
c01f7c541e
Migrate ISStoreAccount from Grand Central Dispatch to PromiseKit.
Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 02:01:25 -04:00
Ross Goldberg
aceb4c3ddb
Remove unnecessary output when nothing downloaded by download(…).
Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 01:59:18 -04:00