Close, reopen, and delete issues on iPhone

This commit is contained in:
Georg Bauer
2026-08-01 15:48:14 +02:00
parent d0ec533da6
commit 5a48456333
11 changed files with 269 additions and 10 deletions

View File

@@ -619,6 +619,8 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
func commits(owner: String, repository: String, branch: String?, path: String, pages: UInt32) async throws -> CommitPage
func deleteIssue(owner: String, repository: String, number: Int64) async throws
func home(page: UInt32, filter: HomeActivityFilter) async throws -> HomePage
func issue(owner: String, repository: String, number: Int64, page: UInt32) async throws -> IssuePage
@@ -653,7 +655,7 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
func repositoryFile(owner: String, repository: String, path: String) async throws -> RepositoryFilePage
func saveIssue(owner: String, repository: String, number: Int64?, title: String, body: String, labelIds: [Int64], milestoneId: Int64?, dueDate: Int64?) async throws -> Int64
func saveIssue(owner: String, repository: String, number: Int64?, title: String, body: String, labelIds: [Int64], milestoneId: Int64?, dueDate: Int64?, closed: Bool) async throws -> Int64
func saveIssueComment(owner: String, repository: String, number: Int64, commentId: Int64?, body: String) async throws
@@ -665,6 +667,8 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
func setAppearance(index: UInt32) throws
func setIssueClosed(owner: String, repository: String, number: Int64, closed: Bool) async throws
func setIssueFilters(owner: String, repository: String, milestone: String, labels: [String], searchText: String) throws
func setIssueStatus(status: String) throws
@@ -841,6 +845,22 @@ open func commits(owner: String, repository: String, branch: String?, path: Stri
)
}
open func deleteIssue(owner: String, repository: String, number: Int64)async throws {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_gotcha_core_fn_method_gotchacore_delete_issue(
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterInt64.lower(number)
)
},
pollFunc: ffi_gotcha_core_rust_future_poll_void,
completeFunc: ffi_gotcha_core_rust_future_complete_void,
freeFunc: ffi_gotcha_core_rust_future_free_void,
liftFunc: { $0 },
errorHandler: FfiConverterTypeGotchaError_lift
)
}
open func home(page: UInt32, filter: HomeActivityFilter)async throws -> HomePage {
return
try await uniffiRustCallAsync(
@@ -1101,12 +1121,12 @@ open func repositoryFile(owner: String, repository: String, path: String)async t
)
}
open func saveIssue(owner: String, repository: String, number: Int64?, title: String, body: String, labelIds: [Int64], milestoneId: Int64?, dueDate: Int64?)async throws -> Int64 {
open func saveIssue(owner: String, repository: String, number: Int64?, title: String, body: String, labelIds: [Int64], milestoneId: Int64?, dueDate: Int64?, closed: Bool)async throws -> Int64 {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_gotcha_core_fn_method_gotchacore_save_issue(
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterOptionInt64.lower(number),FfiConverterString.lower(title),FfiConverterString.lower(body),FfiConverterSequenceInt64.lower(labelIds),FfiConverterOptionInt64.lower(milestoneId),FfiConverterOptionInt64.lower(dueDate)
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterOptionInt64.lower(number),FfiConverterString.lower(title),FfiConverterString.lower(body),FfiConverterSequenceInt64.lower(labelIds),FfiConverterOptionInt64.lower(milestoneId),FfiConverterOptionInt64.lower(dueDate),FfiConverterBool.lower(closed)
)
},
pollFunc: ffi_gotcha_core_rust_future_poll_i64,
@@ -1176,6 +1196,22 @@ open func setAppearance(index: UInt32)throws {try rustCallWithError(FfiConvert
}
}
open func setIssueClosed(owner: String, repository: String, number: Int64, closed: Bool)async throws {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_gotcha_core_fn_method_gotchacore_set_issue_closed(
self.uniffiCloneHandle(),FfiConverterString.lower(owner),FfiConverterString.lower(repository),FfiConverterInt64.lower(number),FfiConverterBool.lower(closed)
)
},
pollFunc: ffi_gotcha_core_rust_future_poll_void,
completeFunc: ffi_gotcha_core_rust_future_complete_void,
freeFunc: ffi_gotcha_core_rust_future_free_void,
liftFunc: { $0 },
errorHandler: FfiConverterTypeGotchaError_lift
)
}
open func setIssueFilters(owner: String, repository: String, milestone: String, labels: [String], searchText: String)throws {try rustCallWithError(FfiConverterTypeGotchaError_lift) {
uniffiCallStatus in
uniffi_gotcha_core_fn_method_gotchacore_set_issue_filters(
@@ -2171,15 +2207,17 @@ public struct IssueEditorPage: Equatable, Hashable {
public var title: String
public var body: String
public var dueDate: Int64?
public var closed: Bool
public var labels: [IssueEditorLabel]
public var milestones: [IssueEditorMilestone]
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(title: String, body: String, dueDate: Int64?, labels: [IssueEditorLabel], milestones: [IssueEditorMilestone]) {
public init(title: String, body: String, dueDate: Int64?, closed: Bool, labels: [IssueEditorLabel], milestones: [IssueEditorMilestone]) {
self.title = title
self.body = body
self.dueDate = dueDate
self.closed = closed
self.labels = labels
self.milestones = milestones
}
@@ -2203,6 +2241,7 @@ public struct FfiConverterTypeIssueEditorPage: FfiConverterRustBuffer {
title: FfiConverterString.read(from: &buf),
body: FfiConverterString.read(from: &buf),
dueDate: FfiConverterOptionInt64.read(from: &buf),
closed: FfiConverterBool.read(from: &buf),
labels: FfiConverterSequenceTypeIssueEditorLabel.read(from: &buf),
milestones: FfiConverterSequenceTypeIssueEditorMilestone.read(from: &buf)
)
@@ -2212,6 +2251,7 @@ public struct FfiConverterTypeIssueEditorPage: FfiConverterRustBuffer {
FfiConverterString.write(value.title, into: &buf)
FfiConverterString.write(value.body, into: &buf)
FfiConverterOptionInt64.write(value.dueDate, into: &buf)
FfiConverterBool.write(value.closed, into: &buf)
FfiConverterSequenceTypeIssueEditorLabel.write(value.labels, into: &buf)
FfiConverterSequenceTypeIssueEditorMilestone.write(value.milestones, into: &buf)
}
@@ -4301,6 +4341,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_gotcha_core_checksum_method_gotchacore_commits() != 60062) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_delete_issue() != 9524) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_home() != 2797) {
return InitializationResult.apiChecksumMismatch
}
@@ -4352,7 +4395,7 @@ private let initializationResult: InitializationResult = {
if (uniffi_gotcha_core_checksum_method_gotchacore_repository_file() != 44948) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_save_issue() != 55053) {
if (uniffi_gotcha_core_checksum_method_gotchacore_save_issue() != 3056) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_save_issue_comment() != 58596) {
@@ -4370,6 +4413,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_gotcha_core_checksum_method_gotchacore_set_appearance() != 61293) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_set_issue_closed() != 38814) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_set_issue_filters() != 24891) {
return InitializationResult.apiChecksumMismatch
}