feat: expose reminder URL metadata
This commit is contained in:
parent
50cc4f56ba
commit
57a73aaae1
@ -1,6 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
## 0.2.0 - 2026-05-04
|
||||
- Add reminder `url` to JSON output when EventKit exposes one
|
||||
- Add `creationDate` to reminder JSON output
|
||||
- Add `open` filter for all incomplete reminders
|
||||
- Accept local ISO 8601 due dates without a timezone suffix
|
||||
|
||||
@ -62,6 +62,8 @@ remindctl authorize # request permissions
|
||||
- `--json` emits JSON arrays/objects.
|
||||
- `--plain` emits tab-separated lines.
|
||||
- `--quiet` emits counts only.
|
||||
- JSON includes EventKit metadata such as `creationDate` and `url` when available.
|
||||
File/image attachments are not exposed by EventKit.
|
||||
|
||||
## Date formats
|
||||
Accepted by `--due` and filters:
|
||||
|
||||
@ -182,6 +182,7 @@ public actor RemindersStore {
|
||||
let id: String
|
||||
let title: String
|
||||
let notes: String?
|
||||
let url: URL?
|
||||
let isCompleted: Bool
|
||||
let completionDate: Date?
|
||||
let creationDate: Date?
|
||||
@ -201,6 +202,7 @@ public actor RemindersStore {
|
||||
id: reminder.calendarItemIdentifier,
|
||||
title: reminder.title ?? "",
|
||||
notes: reminder.notes,
|
||||
url: reminder.url,
|
||||
isCompleted: reminder.isCompleted,
|
||||
completionDate: reminder.completionDate,
|
||||
creationDate: reminder.creationDate,
|
||||
@ -220,6 +222,7 @@ public actor RemindersStore {
|
||||
id: data.id,
|
||||
title: data.title,
|
||||
notes: data.notes,
|
||||
url: data.url,
|
||||
isCompleted: data.isCompleted,
|
||||
completionDate: data.completionDate,
|
||||
creationDate: data.creationDate,
|
||||
@ -269,6 +272,7 @@ public actor RemindersStore {
|
||||
id: reminder.calendarItemIdentifier,
|
||||
title: reminder.title ?? "",
|
||||
notes: reminder.notes,
|
||||
url: reminder.url,
|
||||
isCompleted: reminder.isCompleted,
|
||||
completionDate: reminder.completionDate,
|
||||
creationDate: reminder.creationDate,
|
||||
|
||||
@ -47,6 +47,7 @@ public struct ReminderItem: Identifiable, Codable, Sendable, Equatable {
|
||||
public let id: String
|
||||
public let title: String
|
||||
public let notes: String?
|
||||
public let url: URL?
|
||||
public let isCompleted: Bool
|
||||
public let completionDate: Date?
|
||||
public let creationDate: Date?
|
||||
@ -60,6 +61,7 @@ public struct ReminderItem: Identifiable, Codable, Sendable, Equatable {
|
||||
id: String,
|
||||
title: String,
|
||||
notes: String?,
|
||||
url: URL? = nil,
|
||||
isCompleted: Bool,
|
||||
completionDate: Date?,
|
||||
creationDate: Date? = nil,
|
||||
@ -72,6 +74,7 @@ public struct ReminderItem: Identifiable, Codable, Sendable, Equatable {
|
||||
self.id = id
|
||||
self.title = title
|
||||
self.notes = notes
|
||||
self.url = url
|
||||
self.isCompleted = isCompleted
|
||||
self.completionDate = completionDate
|
||||
self.creationDate = creationDate
|
||||
|
||||
@ -5,12 +5,13 @@ import Testing
|
||||
|
||||
@MainActor
|
||||
struct ReminderItemCodingTests {
|
||||
@Test("JSON includes creation date")
|
||||
func jsonIncludesCreationDate() throws {
|
||||
@Test("JSON includes creation date and URL")
|
||||
func jsonIncludesCreationDateAndURL() throws {
|
||||
let item = ReminderItem(
|
||||
id: "abc",
|
||||
title: "Created",
|
||||
notes: nil,
|
||||
url: URL(string: "https://example.com"),
|
||||
isCompleted: false,
|
||||
completionDate: nil,
|
||||
creationDate: Date(timeIntervalSince1970: 1_700_000_000),
|
||||
@ -25,5 +26,6 @@ struct ReminderItemCodingTests {
|
||||
let data = try encoder.encode(item)
|
||||
let json = try #require(String(data: data, encoding: .utf8))
|
||||
#expect(json.contains(#""creationDate""#))
|
||||
#expect(json.contains(#""url":"https:\/\/example.com""#))
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user