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 @@
1# Sourcehut API Reference 1# Sourcehut API Reference
2 2
3This document provides context and references for working with Sourcehut's APIs. 3This document provides context and references for working with SourceHut's APIs.
4 4
5## Official Documentation 5## Official Documentation
6 6
7The official Sourcehut API documentation can be found at: 7The official SourceHut API documentation can be found at:
8- **https://man.sr.ht** - Contains links to API reference pages for all *.sr.ht services 8- **https://man.sr.ht** - Contains links to API reference pages for all *.sr.ht services
9 9
10## Services and Their APIs 10## Services and Their APIs
@@ -70,7 +70,7 @@ input Filter {
70 70
71### Error Handling 71### Error Handling
72 72
73Sourcehut APIs return GraphQL errors in the following format: 73 SourceHut APIs return GraphQL errors in the following format:
74 74
75```json 75```json
76{ 76{
@@ -107,7 +107,7 @@ Use GraphiQL interfaces available at each service's `/graphql` endpoint to:
107 107
1081. **Filtering**: Some services may not support all filter operations. Check the schema. 1081. **Filtering**: Some services may not support all filter operations. Check the schema.
1092. **Pagination**: Always handle `cursor` properly for pagination. 1092. **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.
111 111
112### Example Query Structure 112### Example Query Structure
113 113
@@ -141,7 +141,6 @@ query {
141 141
142## Additional Resources 142## Additional Resources
143 143
144- Sourcehut API Status: https://status.sr.ht 144- SourceHut API Status: https://status.sr.ht
145- Sourcehut Meta (announcements): https://meta.sr.ht 145- SourceHut Man Pages: https://man.sr.ht
146- Sourcehut GitHub Mirror: https://github.com/sourcehut 146- IRC: #sr.ht on Libera.Chat
147- IRC: #sourcehut on Libera.Chat\ No newline at end of file
Hutch/Networking/SRHTClient.swift +4 −4
@@ -13,7 +13,7 @@ struct MultipartUploadFile: Sendable {
13/// Placeholder type for decoding GraphQL error responses when the data shape is unknown. 13/// Placeholder type for decoding GraphQL error responses when the data shape is unknown.
14private struct EmptyData: Decodable {} 14private struct EmptyData: Decodable {}
15 15
16/// A lightweight GraphQL client for Sourcehut services. 16/// A lightweight GraphQL client for SourceHut services.
17/// All requests require a personal access token set via ``token``. 17/// All requests require a personal access token set via ``token``.
18final class SRHTClient: Sendable { 18final class SRHTClient: Sendable {
19 19
@@ -45,10 +45,10 @@ final class SRHTClient: Sendable {
45 _token.withLock { $0 = token } 45 _token.withLock { $0 = token }
46 } 46 }
47 47
48 /// Execute a GraphQL query or mutation against a Sourcehut service. 48 /// Execute a GraphQL query or mutation against a SourceHut service.
49 /// 49 ///
50 /// - Parameters: 50 /// - Parameters:
51 /// - service: The target Sourcehut service (determines the endpoint URL). 51 /// - service: The target SourceHut service (determines the endpoint URL).
52 /// - query: The GraphQL query or mutation string. 52 /// - query: The GraphQL query or mutation string.
53 /// - variables: Optional dictionary of GraphQL variables. 53 /// - variables: Optional dictionary of GraphQL variables.
54 /// - responseType: The expected `Decodable` type nested under `data`. 54 /// - responseType: The expected `Decodable` type nested under `data`.
@@ -163,7 +163,7 @@ final class SRHTClient: Sendable {
163 /// graphql-multipart-request-spec (multipart/form-data). 163 /// graphql-multipart-request-spec (multipart/form-data).
164 /// 164 ///
165 /// - Parameters: 165 /// - Parameters:
166 /// - service: The target Sourcehut service. 166 /// - service: The target SourceHut service.
167 /// - query: The GraphQL mutation string. 167 /// - query: The GraphQL mutation string.
168 /// - variables: Variables dict; the file variable should be set to `nil`. 168 /// - variables: Variables dict; the file variable should be set to `nil`.
169 /// - fileVariablePath: The dot-separated path to the file variable (e.g. "input.avatar"). 169 /// - fileVariablePath: The dot-separated path to the file variable (e.g. "input.avatar").
Hutch/Networking/SRHTError.swift +1 −1
@@ -1,6 +1,6 @@
1import Foundation 1import Foundation
2 2
3/// Errors produced by the Sourcehut GraphQL client. 3/// Errors produced by the SourceHut GraphQL client.
4enum SRHTError: LocalizedError, Sendable { 4enum SRHTError: LocalizedError, Sendable {
5 /// The server returned one or more GraphQL-level errors. 5 /// The server returned one or more GraphQL-level errors.
6 case graphQLErrors([GraphQLError]) 6 case graphQLErrors([GraphQLError])
Hutch/Networking/SRHTService.swift +1 −1
@@ -1,6 +1,6 @@
1import Foundation 1import Foundation
2 2
3/// Each Sourcehut service exposes its own GraphQL endpoint. 3/// Each SourceHut service exposes its own GraphQL endpoint.
4enum SRHTService: String, Codable, Sendable, CaseIterable { 4enum SRHTService: String, Codable, Sendable, CaseIterable {
5 case meta 5 case meta
6 case hub 6 case hub
Hutch/Views/More/MoreView.swift +1 −1
@@ -36,7 +36,7 @@ struct MoreView: View {
36 } header: { 36 } header: {
37 Text("External Links") 37 Text("External Links")
38 } footer: { 38 } 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.")
40 } 40 }
41 } 41 }
42 .navigationTitle("More") 42 .navigationTitle("More")
Hutch/Views/Repositories/RepositoryListView.swift +1 −1
@@ -217,7 +217,7 @@ private struct CreateRepositorySheet: View {
217 ProgressView() 217 ProgressView()
218 .controlSize(.small) 218 .controlSize(.small)
219 } else { 219 } else {
220 Text("Create Repository") 220 Text("Create")
221 } 221 }
222 } 222 }
223 .disabled(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || viewModel.isCreatingRepository) 223 .disabled(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || viewModel.isCreatingRepository)
Hutch/Views/Settings/SettingsView.swift +2 −2
@@ -713,7 +713,7 @@ private struct AboutView: View {
713 VStack(alignment: .leading, spacing: 6) { 713 VStack(alignment: .leading, spacing: 6) {
714 Text(appName) 714 Text(appName)
715 .font(.title2.weight(.semibold)) 715 .font(.title2.weight(.semibold))
716 Text("A native SourceHut client for iPhone.") 716 Text("A native SourceHut client for iOS.")
717 .font(.subheadline) 717 .font(.subheadline)
718 .foregroundStyle(.secondary) 718 .foregroundStyle(.secondary)
719 } 719 }
@@ -752,7 +752,7 @@ private struct AboutView: View {
752 } 752 }
753 753
754 Section("Acknowledgements") { 754 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.")
756 .font(.subheadline) 756 .font(.subheadline)
757 .foregroundStyle(.secondary) 757 .foregroundStyle(.secondary)
758 } 758 }