Commit 9d3e116944

9d3e1169444b47bb1a657b46d4def68ca68fec61

parent: 4a65998b32

Unsigned

cmc <hello@cleberg.net> · 2026-04-02 03:29 UTC

fix copy throughout repo

Layout: unified · split

Hutch/API_REFERENCE.md +7 −8
@@ -1,10 +1,10 @@
11# Sourcehut API Reference
22
3This document provides context and references for working with Sourcehut's APIs.
3This document provides context and references for working with SourceHut's APIs.
44
55## Official Documentation
66
7The official Sourcehut API documentation can be found at:
7The official SourceHut API documentation can be found at:
88- **https://man.sr.ht** - Contains links to API reference pages for all *.sr.ht services
99
1010## Services and Their APIs
@@ -70,7 +70,7 @@ input Filter {
7070
7171### Error Handling
7272
73Sourcehut APIs return GraphQL errors in the following format:
73 SourceHut APIs return GraphQL errors in the following format:
7474
7575```json
7676{
@@ -107,7 +107,7 @@ Use GraphiQL interfaces available at each service's `/graphql` endpoint to:
107107
1081081. **Filtering**: Some services may not support all filter operations. Check the schema.
1091092. **Pagination**: Always handle `cursor` properly for pagination.
1103. **Caching**: Sourcehut APIs may have aggressive caching. Use cache headers appropriately.
1103. **Caching**: SourceHut APIs may have aggressive caching. Use cache headers appropriately.
111111
112112### Example Query Structure
113113
@@ -141,7 +141,6 @@ query {
141141
142142## Additional Resources
143143
144- Sourcehut API Status: https://status.sr.ht
145- Sourcehut Meta (announcements): https://meta.sr.ht
146- Sourcehut GitHub Mirror: https://github.com/sourcehut
147- IRC: #sourcehut on Libera.Chat
\ No newline at end of file
144- SourceHut API Status: https://status.sr.ht
145- SourceHut Man Pages: https://man.sr.ht
146- IRC: #sr.ht on Libera.Chat
Hutch/Networking/SRHTClient.swift +4 −4
@@ -13,7 +13,7 @@ struct MultipartUploadFile: Sendable {
1313/// Placeholder type for decoding GraphQL error responses when the data shape is unknown.
1414private struct EmptyData: Decodable {}
1515
16/// A lightweight GraphQL client for Sourcehut services.
16/// A lightweight GraphQL client for SourceHut services.
1717/// All requests require a personal access token set via ``token``.
1818final class SRHTClient: Sendable {
1919
@@ -45,10 +45,10 @@ final class SRHTClient: Sendable {
4545 _token.withLock { $0 = token }
4646 }
4747
48 /// Execute a GraphQL query or mutation against a Sourcehut service.
48 /// Execute a GraphQL query or mutation against a SourceHut service.
4949 ///
5050 /// - Parameters:
51 /// - service: The target Sourcehut service (determines the endpoint URL).
51 /// - service: The target SourceHut service (determines the endpoint URL).
5252 /// - query: The GraphQL query or mutation string.
5353 /// - variables: Optional dictionary of GraphQL variables.
5454 /// - responseType: The expected `Decodable` type nested under `data`.
@@ -163,7 +163,7 @@ final class SRHTClient: Sendable {
163163 /// graphql-multipart-request-spec (multipart/form-data).
164164 ///
165165 /// - Parameters:
166 /// - service: The target Sourcehut service.
166 /// - service: The target SourceHut service.
167167 /// - query: The GraphQL mutation string.
168168 /// - variables: Variables dict; the file variable should be set to `nil`.
169169 /// - fileVariablePath: The dot-separated path to the file variable (e.g. "input.avatar").
Hutch/Networking/SRHTError.swift +1 −1
@@ -1,6 +1,6 @@
11import Foundation
22
3/// Errors produced by the Sourcehut GraphQL client.
3/// Errors produced by the SourceHut GraphQL client.
44enum SRHTError: LocalizedError, Sendable {
55 /// The server returned one or more GraphQL-level errors.
66 case graphQLErrors([GraphQLError])
Hutch/Networking/SRHTService.swift +1 −1
@@ -1,6 +1,6 @@
11import Foundation
22
3/// Each Sourcehut service exposes its own GraphQL endpoint.
3/// Each SourceHut service exposes its own GraphQL endpoint.
44enum SRHTService: String, Codable, Sendable, CaseIterable {
55 case meta
66 case hub
Hutch/Views/More/MoreView.swift +1 −1
@@ -36,7 +36,7 @@ struct MoreView: View {
3636 } header: {
3737 Text("External Links")
3838 } footer: {
39 Text("These SourceHut services are not supported in-app and open in your browser.")
39 Text("These SourceHut services are not supported in-app, as the SourceHut API does not support them, and will open in your browser.")
4040 }
4141 }
4242 .navigationTitle("More")
Hutch/Views/Repositories/RepositoryListView.swift +1 −1
@@ -217,7 +217,7 @@ private struct CreateRepositorySheet: View {
217217 ProgressView()
218218 .controlSize(.small)
219219 } else {
220 Text("Create Repository")
220 Text("Create")
221221 }
222222 }
223223 .disabled(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || viewModel.isCreatingRepository)
Hutch/Views/Settings/SettingsView.swift +2 −2
@@ -713,7 +713,7 @@ private struct AboutView: View {
713713 VStack(alignment: .leading, spacing: 6) {
714714 Text(appName)
715715 .font(.title2.weight(.semibold))
716 Text("A native SourceHut client for iPhone.")
716 Text("A native SourceHut client for iOS.")
717717 .font(.subheadline)
718718 .foregroundStyle(.secondary)
719719 }
@@ -752,7 +752,7 @@ private struct AboutView: View {
752752 }
753753
754754 Section("Acknowledgements") {
755 Text("Built for SourceHut users who want quick access to repositories, builds, and tickets on iPhone.")
755 Text("Built for SourceHut users who want quick access to repositories, builds, and tickets on iOS.")
756756 .font(.subheadline)
757757 .foregroundStyle(.secondary)
758758 }