@demind-inc/core 1.6.68 → 1.6.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentReference } from "@google-cloud/firestore";
|
|
2
|
-
export type TodoIntegrationType = "trello" | "todoist" | "ticktick" | "notion" | "github";
|
|
2
|
+
export type TodoIntegrationType = "trello" | "todoist" | "ticktick" | "notion" | "github" | "apple-reminders";
|
|
3
3
|
export interface TodoIntegration {
|
|
4
4
|
todoIntegrationId: string;
|
|
5
5
|
source: TodoIntegrationType;
|
|
@@ -2,6 +2,7 @@ import { DocumentReference } from "@google-cloud/firestore";
|
|
|
2
2
|
import { TodoIntegrationType } from "./TodoIntegrations";
|
|
3
3
|
import { TaskLabel } from "./TaskLabels";
|
|
4
4
|
import { CircadianPhase } from "../types";
|
|
5
|
+
import { AppleRecurrenceRuleFrequency } from "./Calendar";
|
|
5
6
|
export interface TodoTasksBoardAdditionalParamsGithub {
|
|
6
7
|
projectId: string;
|
|
7
8
|
owner: string;
|
|
@@ -126,3 +127,108 @@ export type SuggestedTaskItem = Pick<TaskItem, "taskId" | "name" | "duration" |
|
|
|
126
127
|
suggestedEndTime: string;
|
|
127
128
|
priority?: string;
|
|
128
129
|
};
|
|
130
|
+
export type NativeAppleRemindersSource = 'Local' | 'iCloud';
|
|
131
|
+
export type NativeAppleRemindersList = {
|
|
132
|
+
id: string;
|
|
133
|
+
color: string;
|
|
134
|
+
title: string;
|
|
135
|
+
source: NativeAppleRemindersSource;
|
|
136
|
+
allowsModifications: boolean;
|
|
137
|
+
isDefault: boolean;
|
|
138
|
+
};
|
|
139
|
+
export type NativeAppleRemindersListArray = NativeAppleRemindersList[];
|
|
140
|
+
/**
|
|
141
|
+
* Core reminder type definitions
|
|
142
|
+
* Covers non-recurring, recurring (daily, weekly, monthly, yearly), and note-style reminders.
|
|
143
|
+
*/
|
|
144
|
+
export type ISODateString = string;
|
|
145
|
+
export type TimeZoneId = string;
|
|
146
|
+
export type Weekday = "SU" | "MO" | "TU" | "WE" | "TH" | "FR" | "SA";
|
|
147
|
+
export type Proximity = "enter" | "leave" | "none";
|
|
148
|
+
export type Priority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
149
|
+
/** Calendar container metadata for the reminder. */
|
|
150
|
+
export interface ReminderCalendar {
|
|
151
|
+
title: string;
|
|
152
|
+
color?: string;
|
|
153
|
+
allowsModifications: boolean;
|
|
154
|
+
/** e.g., "Default" | "iCloud" | "Local" — leave as string to be future-proof */
|
|
155
|
+
source?: string;
|
|
156
|
+
id: string;
|
|
157
|
+
}
|
|
158
|
+
/** Geographic coordinates for location-based alarms. */
|
|
159
|
+
export interface Coordinates {
|
|
160
|
+
latitude: number;
|
|
161
|
+
longitude: number;
|
|
162
|
+
}
|
|
163
|
+
/** Location details for geofenced alarms. */
|
|
164
|
+
export interface StructuredLocation {
|
|
165
|
+
coords: Coordinates;
|
|
166
|
+
/** meters; optional because some providers omit it */
|
|
167
|
+
radius?: number;
|
|
168
|
+
title?: string;
|
|
169
|
+
proximity?: Proximity;
|
|
170
|
+
}
|
|
171
|
+
/** Alarm definition — can be time-based, location-based, or both. */
|
|
172
|
+
export interface ReminderAlarm {
|
|
173
|
+
/** Fires at absolute timestamp (UTC ISO). */
|
|
174
|
+
date?: ISODateString;
|
|
175
|
+
/**
|
|
176
|
+
* Offset in seconds relative to dueDate (0 = at due time).
|
|
177
|
+
* May be negative/positive depending on provider.
|
|
178
|
+
*/
|
|
179
|
+
relativeOffset?: number;
|
|
180
|
+
/** Location-triggered alarm. */
|
|
181
|
+
structuredLocation?: StructuredLocation;
|
|
182
|
+
}
|
|
183
|
+
/** Detailed date/time components (localized). */
|
|
184
|
+
export interface DueDateComponents {
|
|
185
|
+
year?: number;
|
|
186
|
+
month?: number;
|
|
187
|
+
day?: number;
|
|
188
|
+
hour?: number;
|
|
189
|
+
minute?: number;
|
|
190
|
+
second?: number;
|
|
191
|
+
timeZone?: TimeZoneId;
|
|
192
|
+
}
|
|
193
|
+
/** Repetition rule for recurring reminders. */
|
|
194
|
+
export interface RecurrenceRule {
|
|
195
|
+
frequency: AppleRecurrenceRuleFrequency;
|
|
196
|
+
interval?: number;
|
|
197
|
+
endDate?: ISODateString;
|
|
198
|
+
occurrenceCount?: number;
|
|
199
|
+
/** Used when frequency = "weekly" */
|
|
200
|
+
daysOfWeek?: Weekday[];
|
|
201
|
+
}
|
|
202
|
+
/** Core reminder fields shared by all reminders. */
|
|
203
|
+
export interface BaseReminder {
|
|
204
|
+
id: string;
|
|
205
|
+
externalIdentifier?: string;
|
|
206
|
+
title: string;
|
|
207
|
+
notes?: string;
|
|
208
|
+
priority?: Priority;
|
|
209
|
+
creationDate: ISODateString;
|
|
210
|
+
lastModifiedDate?: ISODateString;
|
|
211
|
+
calendar: ReminderCalendar;
|
|
212
|
+
hasAlarms: boolean;
|
|
213
|
+
/** Always an array; use [] when none to avoid null checks. */
|
|
214
|
+
alarms: ReminderAlarm[];
|
|
215
|
+
completed: boolean;
|
|
216
|
+
completionDate?: ISODateString;
|
|
217
|
+
/** Optional due fields (note-style reminders may omit these). */
|
|
218
|
+
dueDateComponents?: DueDateComponents;
|
|
219
|
+
dueDate?: ISODateString;
|
|
220
|
+
}
|
|
221
|
+
/** Non-recurring reminders. */
|
|
222
|
+
export interface NonRecurringReminder extends BaseReminder {
|
|
223
|
+
hasRecurrenceRules: false;
|
|
224
|
+
recurrenceRule?: undefined;
|
|
225
|
+
recurrence?: undefined;
|
|
226
|
+
}
|
|
227
|
+
/** Recurring reminders (daily, weekly, etc.). */
|
|
228
|
+
export interface RecurringReminder extends BaseReminder {
|
|
229
|
+
hasRecurrenceRules: true;
|
|
230
|
+
recurrenceRule: RecurrenceRule;
|
|
231
|
+
recurrence?: AppleRecurrenceRuleFrequency;
|
|
232
|
+
}
|
|
233
|
+
/** Union type covering all reminders. */
|
|
234
|
+
export type NativeAppleReminder = NonRecurringReminder | RecurringReminder;
|
package/lib/constants.ts
CHANGED
package/lib/models/TodoTasks.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { DocumentReference } from "@google-cloud/firestore";
|
|
|
2
2
|
import { TodoIntegrationType } from "./TodoIntegrations";
|
|
3
3
|
import { TaskLabel } from "./TaskLabels";
|
|
4
4
|
import { CircadianPhase } from "../types";
|
|
5
|
+
import { AppleRecurrenceRuleFrequency } from "./Calendar";
|
|
5
6
|
|
|
6
7
|
export interface TodoTasksBoardAdditionalParamsGithub {
|
|
7
8
|
projectId: string;
|
|
@@ -142,3 +143,132 @@ export type SuggestedTaskItem = Pick<
|
|
|
142
143
|
suggestedEndTime: string;
|
|
143
144
|
priority?: string;
|
|
144
145
|
};
|
|
146
|
+
|
|
147
|
+
/////////////// Apple Reminders ///////////////
|
|
148
|
+
|
|
149
|
+
export type NativeAppleRemindersSource = 'Local' | 'iCloud';
|
|
150
|
+
|
|
151
|
+
export type NativeAppleRemindersList = {
|
|
152
|
+
id: string;
|
|
153
|
+
color: string;
|
|
154
|
+
title: string;
|
|
155
|
+
source: NativeAppleRemindersSource;
|
|
156
|
+
allowsModifications: boolean;
|
|
157
|
+
isDefault: boolean;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type NativeAppleRemindersListArray = NativeAppleRemindersList[];
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Core reminder type definitions
|
|
166
|
+
* Covers non-recurring, recurring (daily, weekly, monthly, yearly), and note-style reminders.
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
export type ISODateString = string;
|
|
170
|
+
export type TimeZoneId = string;
|
|
171
|
+
export type Weekday = "SU" | "MO" | "TU" | "WE" | "TH" | "FR" | "SA";
|
|
172
|
+
export type Proximity = "enter" | "leave" | "none";
|
|
173
|
+
export type Priority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
174
|
+
|
|
175
|
+
/** Calendar container metadata for the reminder. */
|
|
176
|
+
export interface ReminderCalendar {
|
|
177
|
+
title: string;
|
|
178
|
+
color?: string; // hex
|
|
179
|
+
allowsModifications: boolean;
|
|
180
|
+
/** e.g., "Default" | "iCloud" | "Local" — leave as string to be future-proof */
|
|
181
|
+
source?: string;
|
|
182
|
+
id: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** Geographic coordinates for location-based alarms. */
|
|
186
|
+
export interface Coordinates {
|
|
187
|
+
latitude: number;
|
|
188
|
+
longitude: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Location details for geofenced alarms. */
|
|
192
|
+
export interface StructuredLocation {
|
|
193
|
+
coords: Coordinates;
|
|
194
|
+
/** meters; optional because some providers omit it */
|
|
195
|
+
radius?: number;
|
|
196
|
+
title?: string;
|
|
197
|
+
proximity?: Proximity;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Alarm definition — can be time-based, location-based, or both. */
|
|
201
|
+
export interface ReminderAlarm {
|
|
202
|
+
/** Fires at absolute timestamp (UTC ISO). */
|
|
203
|
+
date?: ISODateString;
|
|
204
|
+
/**
|
|
205
|
+
* Offset in seconds relative to dueDate (0 = at due time).
|
|
206
|
+
* May be negative/positive depending on provider.
|
|
207
|
+
*/
|
|
208
|
+
relativeOffset?: number;
|
|
209
|
+
/** Location-triggered alarm. */
|
|
210
|
+
structuredLocation?: StructuredLocation;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Detailed date/time components (localized). */
|
|
214
|
+
export interface DueDateComponents {
|
|
215
|
+
year?: number;
|
|
216
|
+
month?: number;
|
|
217
|
+
day?: number;
|
|
218
|
+
hour?: number;
|
|
219
|
+
minute?: number;
|
|
220
|
+
second?: number;
|
|
221
|
+
timeZone?: TimeZoneId;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Repetition rule for recurring reminders. */
|
|
225
|
+
export interface RecurrenceRule {
|
|
226
|
+
frequency: AppleRecurrenceRuleFrequency;
|
|
227
|
+
interval?: number; // default 1
|
|
228
|
+
endDate?: ISODateString; // mutually exclusive with occurrenceCount
|
|
229
|
+
occurrenceCount?: number; // mutually exclusive with endDate
|
|
230
|
+
/** Used when frequency = "weekly" */
|
|
231
|
+
daysOfWeek?: Weekday[];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** Core reminder fields shared by all reminders. */
|
|
235
|
+
export interface BaseReminder {
|
|
236
|
+
id: string;
|
|
237
|
+
externalIdentifier?: string;
|
|
238
|
+
title: string;
|
|
239
|
+
notes?: string;
|
|
240
|
+
priority?: Priority;
|
|
241
|
+
|
|
242
|
+
creationDate: ISODateString;
|
|
243
|
+
lastModifiedDate?: ISODateString;
|
|
244
|
+
|
|
245
|
+
calendar: ReminderCalendar;
|
|
246
|
+
|
|
247
|
+
hasAlarms: boolean;
|
|
248
|
+
/** Always an array; use [] when none to avoid null checks. */
|
|
249
|
+
alarms: ReminderAlarm[];
|
|
250
|
+
|
|
251
|
+
completed: boolean;
|
|
252
|
+
completionDate?: ISODateString;
|
|
253
|
+
|
|
254
|
+
/** Optional due fields (note-style reminders may omit these). */
|
|
255
|
+
dueDateComponents?: DueDateComponents;
|
|
256
|
+
dueDate?: ISODateString;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Non-recurring reminders. */
|
|
260
|
+
export interface NonRecurringReminder extends BaseReminder {
|
|
261
|
+
hasRecurrenceRules: false;
|
|
262
|
+
recurrenceRule?: undefined;
|
|
263
|
+
recurrence?: undefined;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** Recurring reminders (daily, weekly, etc.). */
|
|
267
|
+
export interface RecurringReminder extends BaseReminder {
|
|
268
|
+
hasRecurrenceRules: true;
|
|
269
|
+
recurrenceRule: RecurrenceRule;
|
|
270
|
+
recurrence?: AppleRecurrenceRuleFrequency;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Union type covering all reminders. */
|
|
274
|
+
export type NativeAppleReminder = NonRecurringReminder | RecurringReminder;
|