@ofocus/sdk 0.1.0

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.
Files changed (200) hide show
  1. package/README.md +80 -0
  2. package/api-report/ofocus-sdk.api.md +564 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/applescript.d.ts +30 -0
  5. package/dist/applescript.d.ts.map +1 -0
  6. package/dist/applescript.js +142 -0
  7. package/dist/applescript.js.map +1 -0
  8. package/dist/commands/batch.d.ts +23 -0
  9. package/dist/commands/batch.d.ts.map +1 -0
  10. package/dist/commands/batch.js +324 -0
  11. package/dist/commands/batch.js.map +1 -0
  12. package/dist/commands/complete.d.ts +14 -0
  13. package/dist/commands/complete.d.ts.map +1 -0
  14. package/dist/commands/complete.js +37 -0
  15. package/dist/commands/complete.js.map +1 -0
  16. package/dist/commands/create-project.d.ts +6 -0
  17. package/dist/commands/create-project.d.ts.map +1 -0
  18. package/dist/commands/create-project.js +124 -0
  19. package/dist/commands/create-project.js.map +1 -0
  20. package/dist/commands/drop.d.ts +26 -0
  21. package/dist/commands/drop.d.ts.map +1 -0
  22. package/dist/commands/drop.js +62 -0
  23. package/dist/commands/drop.js.map +1 -0
  24. package/dist/commands/folders.d.ts +10 -0
  25. package/dist/commands/folders.d.ts.map +1 -0
  26. package/dist/commands/folders.js +150 -0
  27. package/dist/commands/folders.js.map +1 -0
  28. package/dist/commands/inbox.d.ts +6 -0
  29. package/dist/commands/inbox.d.ts.map +1 -0
  30. package/dist/commands/inbox.js +124 -0
  31. package/dist/commands/inbox.js.map +1 -0
  32. package/dist/commands/perspectives.d.ts +20 -0
  33. package/dist/commands/perspectives.d.ts.map +1 -0
  34. package/dist/commands/perspectives.js +166 -0
  35. package/dist/commands/perspectives.js.map +1 -0
  36. package/dist/commands/projects.d.ts +6 -0
  37. package/dist/commands/projects.d.ts.map +1 -0
  38. package/dist/commands/projects.js +113 -0
  39. package/dist/commands/projects.js.map +1 -0
  40. package/dist/commands/repetition.d.ts +17 -0
  41. package/dist/commands/repetition.d.ts.map +1 -0
  42. package/dist/commands/repetition.js +59 -0
  43. package/dist/commands/repetition.js.map +1 -0
  44. package/dist/commands/review.d.ts +10 -0
  45. package/dist/commands/review.d.ts.map +1 -0
  46. package/dist/commands/review.js +132 -0
  47. package/dist/commands/review.js.map +1 -0
  48. package/dist/commands/search.d.ts +6 -0
  49. package/dist/commands/search.d.ts.map +1 -0
  50. package/dist/commands/search.js +150 -0
  51. package/dist/commands/search.js.map +1 -0
  52. package/dist/commands/subtasks.d.ts +14 -0
  53. package/dist/commands/subtasks.d.ts.map +1 -0
  54. package/dist/commands/subtasks.js +370 -0
  55. package/dist/commands/subtasks.js.map +1 -0
  56. package/dist/commands/tags-crud.d.ts +22 -0
  57. package/dist/commands/tags-crud.d.ts.map +1 -0
  58. package/dist/commands/tags-crud.js +187 -0
  59. package/dist/commands/tags-crud.js.map +1 -0
  60. package/dist/commands/tags.d.ts +6 -0
  61. package/dist/commands/tags.d.ts.map +1 -0
  62. package/dist/commands/tags.js +61 -0
  63. package/dist/commands/tags.js.map +1 -0
  64. package/dist/commands/tasks.d.ts +6 -0
  65. package/dist/commands/tasks.d.ts.map +1 -0
  66. package/dist/commands/tasks.js +160 -0
  67. package/dist/commands/tasks.js.map +1 -0
  68. package/dist/commands/update.d.ts +6 -0
  69. package/dist/commands/update.d.ts.map +1 -0
  70. package/dist/commands/update.js +179 -0
  71. package/dist/commands/update.js.map +1 -0
  72. package/dist/errors.d.ts +38 -0
  73. package/dist/errors.d.ts.map +1 -0
  74. package/dist/errors.js +77 -0
  75. package/dist/errors.js.map +1 -0
  76. package/dist/escape.d.ts +6 -0
  77. package/dist/escape.d.ts.map +1 -0
  78. package/dist/escape.js +8 -0
  79. package/dist/escape.js.map +1 -0
  80. package/dist/index.d.ts +30 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +36 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/ofocus-sdk.d.ts +608 -0
  85. package/dist/result.d.ts +15 -0
  86. package/dist/result.d.ts.map +1 -0
  87. package/dist/result.js +29 -0
  88. package/dist/result.js.map +1 -0
  89. package/dist/types.d.ts +228 -0
  90. package/dist/types.d.ts.map +1 -0
  91. package/dist/types.js +2 -0
  92. package/dist/types.js.map +1 -0
  93. package/dist/validation.d.ts +57 -0
  94. package/dist/validation.d.ts.map +1 -0
  95. package/dist/validation.js +172 -0
  96. package/dist/validation.js.map +1 -0
  97. package/docs/index.md +30 -0
  98. package/docs/sdk.addtoinbox.md +68 -0
  99. package/docs/sdk.applescriptresult.data.md +11 -0
  100. package/docs/sdk.applescriptresult.error.md +11 -0
  101. package/docs/sdk.applescriptresult.md +92 -0
  102. package/docs/sdk.applescriptresult.success.md +11 -0
  103. package/docs/sdk.clierror.code.md +11 -0
  104. package/docs/sdk.clierror.details.md +11 -0
  105. package/docs/sdk.clierror.md +92 -0
  106. package/docs/sdk.clierror.message.md +11 -0
  107. package/docs/sdk.clioutput.data.md +11 -0
  108. package/docs/sdk.clioutput.error.md +11 -0
  109. package/docs/sdk.clioutput.md +90 -0
  110. package/docs/sdk.clioutput.success.md +11 -0
  111. package/docs/sdk.commandinfo.description.md +11 -0
  112. package/docs/sdk.commandinfo.md +90 -0
  113. package/docs/sdk.commandinfo.name.md +11 -0
  114. package/docs/sdk.commandinfo.usage.md +11 -0
  115. package/docs/sdk.completeresult.completed.md +11 -0
  116. package/docs/sdk.completeresult.md +90 -0
  117. package/docs/sdk.completeresult.taskid.md +11 -0
  118. package/docs/sdk.completeresult.taskname.md +11 -0
  119. package/docs/sdk.completetask.md +52 -0
  120. package/docs/sdk.createerror.md +82 -0
  121. package/docs/sdk.errorcode.md +24 -0
  122. package/docs/sdk.escapeapplescript.md +52 -0
  123. package/docs/sdk.failure.md +52 -0
  124. package/docs/sdk.failuremessage.md +52 -0
  125. package/docs/sdk.inboxoptions.defer.md +11 -0
  126. package/docs/sdk.inboxoptions.due.md +11 -0
  127. package/docs/sdk.inboxoptions.flag.md +11 -0
  128. package/docs/sdk.inboxoptions.md +134 -0
  129. package/docs/sdk.inboxoptions.note.md +11 -0
  130. package/docs/sdk.inboxoptions.tags.md +11 -0
  131. package/docs/sdk.jsonhelpers.md +13 -0
  132. package/docs/sdk.md +471 -0
  133. package/docs/sdk.ofperspective.id.md +11 -0
  134. package/docs/sdk.ofperspective.md +73 -0
  135. package/docs/sdk.ofperspective.name.md +11 -0
  136. package/docs/sdk.ofproject.folderid.md +11 -0
  137. package/docs/sdk.ofproject.foldername.md +11 -0
  138. package/docs/sdk.ofproject.id.md +11 -0
  139. package/docs/sdk.ofproject.md +192 -0
  140. package/docs/sdk.ofproject.name.md +11 -0
  141. package/docs/sdk.ofproject.note.md +11 -0
  142. package/docs/sdk.ofproject.remainingtaskcount.md +11 -0
  143. package/docs/sdk.ofproject.sequential.md +11 -0
  144. package/docs/sdk.ofproject.status.md +11 -0
  145. package/docs/sdk.ofproject.taskcount.md +11 -0
  146. package/docs/sdk.oftag.availabletaskcount.md +11 -0
  147. package/docs/sdk.oftag.id.md +11 -0
  148. package/docs/sdk.oftag.md +124 -0
  149. package/docs/sdk.oftag.name.md +11 -0
  150. package/docs/sdk.oftag.parentid.md +11 -0
  151. package/docs/sdk.oftag.parentname.md +11 -0
  152. package/docs/sdk.oftask.completed.md +11 -0
  153. package/docs/sdk.oftask.completiondate.md +11 -0
  154. package/docs/sdk.oftask.deferdate.md +11 -0
  155. package/docs/sdk.oftask.duedate.md +11 -0
  156. package/docs/sdk.oftask.flagged.md +11 -0
  157. package/docs/sdk.oftask.id.md +11 -0
  158. package/docs/sdk.oftask.md +226 -0
  159. package/docs/sdk.oftask.name.md +11 -0
  160. package/docs/sdk.oftask.note.md +11 -0
  161. package/docs/sdk.oftask.projectid.md +11 -0
  162. package/docs/sdk.oftask.projectname.md +11 -0
  163. package/docs/sdk.oftask.tags.md +11 -0
  164. package/docs/sdk.omnifocusscript.md +52 -0
  165. package/docs/sdk.omnifocusscriptwithhelpers.md +52 -0
  166. package/docs/sdk.parseapplescripterror.md +52 -0
  167. package/docs/sdk.projectqueryoptions.folder.md +11 -0
  168. package/docs/sdk.projectqueryoptions.md +96 -0
  169. package/docs/sdk.projectqueryoptions.sequential.md +11 -0
  170. package/docs/sdk.projectqueryoptions.status.md +11 -0
  171. package/docs/sdk.queryprojects.md +54 -0
  172. package/docs/sdk.querytags.md +54 -0
  173. package/docs/sdk.querytasks.md +54 -0
  174. package/docs/sdk.runapplescript.md +52 -0
  175. package/docs/sdk.runapplescriptfile.md +68 -0
  176. package/docs/sdk.success.md +52 -0
  177. package/docs/sdk.tagqueryoptions.md +58 -0
  178. package/docs/sdk.tagqueryoptions.parent.md +11 -0
  179. package/docs/sdk.taskqueryoptions.available.md +11 -0
  180. package/docs/sdk.taskqueryoptions.completed.md +11 -0
  181. package/docs/sdk.taskqueryoptions.dueafter.md +11 -0
  182. package/docs/sdk.taskqueryoptions.duebefore.md +11 -0
  183. package/docs/sdk.taskqueryoptions.flagged.md +11 -0
  184. package/docs/sdk.taskqueryoptions.md +172 -0
  185. package/docs/sdk.taskqueryoptions.project.md +11 -0
  186. package/docs/sdk.taskqueryoptions.tag.md +11 -0
  187. package/docs/sdk.taskupdateoptions.defer.md +11 -0
  188. package/docs/sdk.taskupdateoptions.due.md +11 -0
  189. package/docs/sdk.taskupdateoptions.flag.md +11 -0
  190. package/docs/sdk.taskupdateoptions.md +172 -0
  191. package/docs/sdk.taskupdateoptions.note.md +11 -0
  192. package/docs/sdk.taskupdateoptions.project.md +11 -0
  193. package/docs/sdk.taskupdateoptions.tags.md +11 -0
  194. package/docs/sdk.taskupdateoptions.title.md +11 -0
  195. package/docs/sdk.updatetask.md +66 -0
  196. package/docs/sdk.validatedatestring.md +54 -0
  197. package/docs/sdk.validateid.md +66 -0
  198. package/docs/sdk.validateprojectname.md +52 -0
  199. package/docs/sdk.validatetags.md +52 -0
  200. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @ofocus/sdk
2
+
3
+ Core SDK for interacting with OmniFocus via AppleScript.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @ofocus/sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import {
15
+ addToInbox,
16
+ queryTasks,
17
+ queryProjects,
18
+ completeTask,
19
+ success,
20
+ failure,
21
+ } from "@ofocus/sdk";
22
+
23
+ // Add a task to the inbox
24
+ const result = await addToInbox("Buy groceries", {
25
+ note: "Milk, eggs, bread",
26
+ due: "tomorrow 5pm",
27
+ flag: true,
28
+ tags: ["errands"],
29
+ });
30
+
31
+ if (result.success) {
32
+ console.log("Created task:", result.data.id);
33
+ } else {
34
+ console.error("Error:", result.error.message);
35
+ }
36
+
37
+ // Query tasks
38
+ const tasks = await queryTasks({
39
+ flagged: true,
40
+ available: true,
41
+ });
42
+
43
+ // Complete a task
44
+ await completeTask("task-id-here");
45
+ ```
46
+
47
+ ## API
48
+
49
+ ### Commands
50
+
51
+ - `addToInbox(title, options?)` - Add a task to the OmniFocus inbox
52
+ - `queryTasks(options?)` - Query tasks with optional filters
53
+ - `queryProjects(options?)` - Query projects with optional filters
54
+ - `queryTags(options?)` - Query tags with optional filters
55
+ - `completeTask(taskId)` - Mark a task as complete
56
+ - `updateTask(taskId, options)` - Update task properties
57
+
58
+ ### Result Helpers
59
+
60
+ - `success(data)` - Create a successful result
61
+ - `failure(error)` - Create a failed result
62
+ - `failureMessage(message)` - Create a failed result with a string message
63
+
64
+ ### Error Handling
65
+
66
+ - `ErrorCode` - Enum of error codes for semantic error handling
67
+ - `createError(code, message, details?)` - Create a structured error
68
+ - `parseAppleScriptError(rawError)` - Parse AppleScript errors
69
+
70
+ ### Utilities
71
+
72
+ - `escapeAppleScript(str)` - Escape strings for AppleScript
73
+ - `validateId(id, type)` - Validate OmniFocus IDs
74
+ - `validateDateString(dateStr)` - Validate date strings
75
+ - `validateTags(tags)` - Validate tag names
76
+ - `validateProjectName(name)` - Validate project names
77
+
78
+ ## License
79
+
80
+ MIT
@@ -0,0 +1,564 @@
1
+ ## API Report File for "@ofocus/sdk"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // @public
8
+ export function addToInbox(title: string, options?: InboxOptions): Promise<CliOutput<OFTask>>;
9
+
10
+ // @public (undocumented)
11
+ export interface AppleScriptResult<T> {
12
+ // (undocumented)
13
+ data?: T;
14
+ // (undocumented)
15
+ error?: CliError;
16
+ // (undocumented)
17
+ success: boolean;
18
+ }
19
+
20
+ // @public
21
+ export interface BatchCompleteItem {
22
+ // (undocumented)
23
+ taskId: string;
24
+ // (undocumented)
25
+ taskName: string;
26
+ }
27
+
28
+ // @public
29
+ export interface BatchDeleteItem {
30
+ // (undocumented)
31
+ taskId: string;
32
+ }
33
+
34
+ // @public
35
+ export interface BatchResult<T> {
36
+ // (undocumented)
37
+ failed: {
38
+ id: string;
39
+ error: string;
40
+ }[];
41
+ // (undocumented)
42
+ succeeded: T[];
43
+ // (undocumented)
44
+ totalFailed: number;
45
+ // (undocumented)
46
+ totalSucceeded: number;
47
+ }
48
+
49
+ // @public
50
+ export function buildRepetitionRuleScript(taskVar: string, rule: RepetitionRule): string;
51
+
52
+ // @public
53
+ export function buildRRule(rule: RepetitionRule): string;
54
+
55
+ // @public
56
+ export interface CliError {
57
+ // (undocumented)
58
+ code: ErrorCode;
59
+ // (undocumented)
60
+ details?: string;
61
+ // (undocumented)
62
+ message: string;
63
+ }
64
+
65
+ // @public
66
+ export interface CliOutput<T> {
67
+ // (undocumented)
68
+ data: T | null;
69
+ // (undocumented)
70
+ error: CliError | null;
71
+ // (undocumented)
72
+ success: boolean;
73
+ }
74
+
75
+ // @public
76
+ export interface CommandInfo {
77
+ // (undocumented)
78
+ description: string;
79
+ // (undocumented)
80
+ name: string;
81
+ // (undocumented)
82
+ usage: string;
83
+ }
84
+
85
+ // @public
86
+ export interface CompleteResult {
87
+ // (undocumented)
88
+ completed: boolean;
89
+ // (undocumented)
90
+ taskId: string;
91
+ // (undocumented)
92
+ taskName: string;
93
+ }
94
+
95
+ // @public
96
+ export function completeTask(taskId: string): Promise<CliOutput<CompleteResult>>;
97
+
98
+ // @public
99
+ export function completeTasks(taskIds: string[]): Promise<CliOutput<BatchResult<BatchCompleteItem>>>;
100
+
101
+ // @public
102
+ export function createError(code: ErrorCode, message: string, details?: string): CliError;
103
+
104
+ // @public
105
+ export function createFolder(name: string, options?: CreateFolderOptions): Promise<CliOutput<OFFolder>>;
106
+
107
+ // @public
108
+ export interface CreateFolderOptions {
109
+ // (undocumented)
110
+ parentFolderId?: string | undefined;
111
+ // (undocumented)
112
+ parentFolderName?: string | undefined;
113
+ }
114
+
115
+ // @public
116
+ export function createProject(name: string, options?: CreateProjectOptions): Promise<CliOutput<OFProject>>;
117
+
118
+ // @public
119
+ export interface CreateProjectOptions {
120
+ // (undocumented)
121
+ deferDate?: string | undefined;
122
+ // (undocumented)
123
+ dueDate?: string | undefined;
124
+ // (undocumented)
125
+ folderId?: string | undefined;
126
+ // (undocumented)
127
+ folderName?: string | undefined;
128
+ // (undocumented)
129
+ note?: string | undefined;
130
+ // (undocumented)
131
+ sequential?: boolean | undefined;
132
+ // (undocumented)
133
+ status?: "active" | "on-hold" | undefined;
134
+ }
135
+
136
+ // @public
137
+ export function createSubtask(title: string, parentTaskId: string, options?: InboxOptions): Promise<CliOutput<OFTaskWithChildren>>;
138
+
139
+ // @public
140
+ export function createTag(name: string, options?: CreateTagOptions): Promise<CliOutput<OFTag>>;
141
+
142
+ // @public
143
+ export interface CreateTagOptions {
144
+ // (undocumented)
145
+ parentTagId?: string | undefined;
146
+ // (undocumented)
147
+ parentTagName?: string | undefined;
148
+ }
149
+
150
+ // @public
151
+ export interface DeleteResult {
152
+ // (undocumented)
153
+ deleted: true;
154
+ // (undocumented)
155
+ taskId: string;
156
+ }
157
+
158
+ // @public
159
+ export function deleteTag(tagId: string): Promise<CliOutput<DeleteTagResult>>;
160
+
161
+ // @public
162
+ export interface DeleteTagResult {
163
+ // (undocumented)
164
+ deleted: true;
165
+ // (undocumented)
166
+ tagId: string;
167
+ }
168
+
169
+ // @public
170
+ export function deleteTask(taskId: string): Promise<CliOutput<DeleteResult>>;
171
+
172
+ // @public
173
+ export function deleteTasks(taskIds: string[]): Promise<CliOutput<BatchResult<BatchDeleteItem>>>;
174
+
175
+ // @public
176
+ export interface DropResult {
177
+ // (undocumented)
178
+ dropped: boolean;
179
+ // (undocumented)
180
+ taskId: string;
181
+ // (undocumented)
182
+ taskName: string;
183
+ }
184
+
185
+ // @public
186
+ export function dropTask(taskId: string): Promise<CliOutput<DropResult>>;
187
+
188
+ // @public
189
+ const ErrorCode: {
190
+ readonly TASK_NOT_FOUND: "TASK_NOT_FOUND";
191
+ readonly PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND";
192
+ readonly TAG_NOT_FOUND: "TAG_NOT_FOUND";
193
+ readonly FOLDER_NOT_FOUND: "FOLDER_NOT_FOUND";
194
+ readonly PERSPECTIVE_NOT_FOUND: "PERSPECTIVE_NOT_FOUND";
195
+ readonly DUPLICATE_NAME: "DUPLICATE_NAME";
196
+ readonly OMNIFOCUS_NOT_RUNNING: "OMNIFOCUS_NOT_RUNNING";
197
+ readonly INVALID_DATE_FORMAT: "INVALID_DATE_FORMAT";
198
+ readonly INVALID_ID_FORMAT: "INVALID_ID_FORMAT";
199
+ readonly INVALID_REPETITION_RULE: "INVALID_REPETITION_RULE";
200
+ readonly APPLESCRIPT_ERROR: "APPLESCRIPT_ERROR";
201
+ readonly JSON_PARSE_ERROR: "JSON_PARSE_ERROR";
202
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
203
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
204
+ };
205
+
206
+ // @public (undocumented)
207
+ type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
208
+ export { ErrorCode }
209
+ export { ErrorCode as ErrorCodeType }
210
+
211
+ // @public
212
+ export function escapeAppleScript(str: string): string;
213
+
214
+ // @public
215
+ export function failure<T = null>(error: CliError): CliOutput<T>;
216
+
217
+ // @public
218
+ export function failureMessage<T = null>(message: string): CliOutput<T>;
219
+
220
+ // @public
221
+ export interface FolderQueryOptions {
222
+ // (undocumented)
223
+ parent?: string | undefined;
224
+ }
225
+
226
+ // @public
227
+ export interface InboxOptions {
228
+ // (undocumented)
229
+ defer?: string | undefined;
230
+ // (undocumented)
231
+ due?: string | undefined;
232
+ // (undocumented)
233
+ estimatedMinutes?: number | undefined;
234
+ // (undocumented)
235
+ flag?: boolean | undefined;
236
+ // (undocumented)
237
+ note?: string | undefined;
238
+ // (undocumented)
239
+ repeat?: RepetitionRule | undefined;
240
+ // (undocumented)
241
+ tags?: string[] | undefined;
242
+ }
243
+
244
+ // @public
245
+ export const jsonHelpers = "\non jsonString(val)\n if val is \"\" or val is missing value or val is \"missing value\" then\n return \"null\"\n else\n return \"\\\"\" & my escapeJson(val) & \"\\\"\"\n end if\nend jsonString\n\non jsonArray(theList)\n if (count of theList) is 0 then\n return \"[]\"\n end if\n set output to \"[\"\n repeat with i from 1 to count of theList\n if i > 1 then set output to output & \",\"\n set output to output & \"\\\"\" & (my escapeJson(item i of theList)) & \"\\\"\"\n end repeat\n return output & \"]\"\nend jsonArray\n\non escapeJson(str)\n set output to \"\"\n repeat with c in characters of (str as string)\n if c is \"\\\"\" then\n set output to output & \"\\\\\\\"\"\n else if c is \"\\\\\" then\n set output to output & \"\\\\\\\\\"\n else if c is return then\n set output to output & \"\\\\n\"\n else if c is linefeed then\n set output to output & \"\\\\n\"\n else\n set output to output & c\n end if\n end repeat\n return output\nend escapeJson\n";
246
+
247
+ // @public
248
+ export function listPerspectives(): Promise<CliOutput<OFPerspective[]>>;
249
+
250
+ // @public
251
+ export function moveTaskToParent(taskId: string, parentTaskId: string): Promise<CliOutput<OFTaskWithChildren>>;
252
+
253
+ // @public
254
+ export interface OFFolder {
255
+ // (undocumented)
256
+ folderCount: number;
257
+ // (undocumented)
258
+ id: string;
259
+ // (undocumented)
260
+ name: string;
261
+ // (undocumented)
262
+ parentId: string | null;
263
+ // (undocumented)
264
+ parentName: string | null;
265
+ // (undocumented)
266
+ projectCount: number;
267
+ }
268
+
269
+ // @public
270
+ export interface OFPerspective {
271
+ // (undocumented)
272
+ custom: boolean;
273
+ // (undocumented)
274
+ id: string;
275
+ // (undocumented)
276
+ name: string;
277
+ }
278
+
279
+ // @public
280
+ export interface OFProject {
281
+ // (undocumented)
282
+ folderId: string | null;
283
+ // (undocumented)
284
+ folderName: string | null;
285
+ // (undocumented)
286
+ id: string;
287
+ // (undocumented)
288
+ name: string;
289
+ // (undocumented)
290
+ note: string | null;
291
+ // (undocumented)
292
+ remainingTaskCount: number;
293
+ // (undocumented)
294
+ sequential: boolean;
295
+ // (undocumented)
296
+ status: "active" | "on-hold" | "completed" | "dropped";
297
+ // (undocumented)
298
+ taskCount: number;
299
+ }
300
+
301
+ // @public
302
+ export interface OFTag {
303
+ // (undocumented)
304
+ availableTaskCount: number;
305
+ // (undocumented)
306
+ id: string;
307
+ // (undocumented)
308
+ name: string;
309
+ // (undocumented)
310
+ parentId: string | null;
311
+ // (undocumented)
312
+ parentName: string | null;
313
+ }
314
+
315
+ // @public
316
+ export interface OFTask {
317
+ // (undocumented)
318
+ completed: boolean;
319
+ // (undocumented)
320
+ completionDate: string | null;
321
+ // (undocumented)
322
+ deferDate: string | null;
323
+ // (undocumented)
324
+ dueDate: string | null;
325
+ // (undocumented)
326
+ estimatedMinutes: number | null;
327
+ // (undocumented)
328
+ flagged: boolean;
329
+ // (undocumented)
330
+ id: string;
331
+ // (undocumented)
332
+ name: string;
333
+ // (undocumented)
334
+ note: string | null;
335
+ // (undocumented)
336
+ projectId: string | null;
337
+ // (undocumented)
338
+ projectName: string | null;
339
+ // (undocumented)
340
+ tags: string[];
341
+ }
342
+
343
+ // @public
344
+ export interface OFTaskWithChildren extends OFTask {
345
+ // (undocumented)
346
+ childTaskCount: number;
347
+ // (undocumented)
348
+ isActionGroup: boolean;
349
+ // (undocumented)
350
+ parentTaskId: string | null;
351
+ // (undocumented)
352
+ parentTaskName: string | null;
353
+ }
354
+
355
+ // @public
356
+ export function omniFocusScript(body: string): string;
357
+
358
+ // @public
359
+ export function omniFocusScriptWithHelpers(body: string): string;
360
+
361
+ // @public
362
+ export function parseAppleScriptError(rawError: string): CliError;
363
+
364
+ // @public
365
+ export interface PerspectiveQueryOptions {
366
+ // (undocumented)
367
+ limit?: number | undefined;
368
+ }
369
+
370
+ // @public
371
+ export interface ProjectQueryOptions {
372
+ // (undocumented)
373
+ folder?: string | undefined;
374
+ // (undocumented)
375
+ sequential?: boolean | undefined;
376
+ // (undocumented)
377
+ status?: "active" | "on-hold" | "completed" | "dropped" | undefined;
378
+ }
379
+
380
+ // @public
381
+ export function queryFolders(options?: FolderQueryOptions): Promise<CliOutput<OFFolder[]>>;
382
+
383
+ // @public
384
+ export function queryPerspective(name: string, options?: PerspectiveQueryOptions): Promise<CliOutput<OFTask[]>>;
385
+
386
+ // @public
387
+ export function queryProjects(options?: ProjectQueryOptions): Promise<CliOutput<OFProject[]>>;
388
+
389
+ // @public
390
+ export function queryProjectsForReview(): Promise<CliOutput<OFProject[]>>;
391
+
392
+ // @public
393
+ export function querySubtasks(parentTaskId: string, options?: SubtaskQueryOptions): Promise<CliOutput<OFTaskWithChildren[]>>;
394
+
395
+ // @public
396
+ export function queryTags(options?: TagQueryOptions): Promise<CliOutput<OFTag[]>>;
397
+
398
+ // @public
399
+ export function queryTasks(options?: TaskQueryOptions): Promise<CliOutput<OFTask[]>>;
400
+
401
+ // @public
402
+ export interface RepetitionRule {
403
+ // (undocumented)
404
+ dayOfMonth?: number | undefined;
405
+ // (undocumented)
406
+ daysOfWeek?: number[] | undefined;
407
+ // (undocumented)
408
+ frequency: "daily" | "weekly" | "monthly" | "yearly";
409
+ // (undocumented)
410
+ interval: number;
411
+ // (undocumented)
412
+ repeatMethod: "due-again" | "defer-another";
413
+ }
414
+
415
+ // @public
416
+ export function reviewProject(projectId: string): Promise<CliOutput<ReviewResult>>;
417
+
418
+ // @public
419
+ export interface ReviewResult {
420
+ // (undocumented)
421
+ lastReviewed: string;
422
+ // (undocumented)
423
+ nextReviewDate: string | null;
424
+ // (undocumented)
425
+ projectId: string;
426
+ // (undocumented)
427
+ projectName: string;
428
+ }
429
+
430
+ // @public
431
+ export function runAppleScript<T>(script: string): Promise<AppleScriptResult<T>>;
432
+
433
+ // @public
434
+ export function runAppleScriptFile<T>(filePath: string, args?: string[]): Promise<AppleScriptResult<T>>;
435
+
436
+ // @public
437
+ export interface SearchOptions {
438
+ // (undocumented)
439
+ includeCompleted?: boolean | undefined;
440
+ // (undocumented)
441
+ limit?: number | undefined;
442
+ // (undocumented)
443
+ scope?: "name" | "note" | "both" | undefined;
444
+ }
445
+
446
+ // @public
447
+ export function searchTasks(query: string, options?: SearchOptions): Promise<CliOutput<OFTask[]>>;
448
+
449
+ // @public
450
+ export interface SubtaskQueryOptions {
451
+ // (undocumented)
452
+ completed?: boolean | undefined;
453
+ // (undocumented)
454
+ flagged?: boolean | undefined;
455
+ }
456
+
457
+ // @public
458
+ export function success<T>(data: T): CliOutput<T>;
459
+
460
+ // @public
461
+ export interface TagQueryOptions {
462
+ // (undocumented)
463
+ parent?: string | undefined;
464
+ }
465
+
466
+ // @public
467
+ export interface TaskQueryOptions {
468
+ // (undocumented)
469
+ available?: boolean | undefined;
470
+ // (undocumented)
471
+ completed?: boolean | undefined;
472
+ // (undocumented)
473
+ dueAfter?: string | undefined;
474
+ // (undocumented)
475
+ dueBefore?: string | undefined;
476
+ // (undocumented)
477
+ flagged?: boolean | undefined;
478
+ // (undocumented)
479
+ project?: string | undefined;
480
+ // (undocumented)
481
+ tag?: string | undefined;
482
+ }
483
+
484
+ // @public
485
+ export interface TaskUpdateOptions {
486
+ // (undocumented)
487
+ clearEstimate?: boolean | undefined;
488
+ // (undocumented)
489
+ clearRepeat?: boolean | undefined;
490
+ // (undocumented)
491
+ defer?: string | undefined;
492
+ // (undocumented)
493
+ due?: string | undefined;
494
+ // (undocumented)
495
+ estimatedMinutes?: number | undefined;
496
+ // (undocumented)
497
+ flag?: boolean | undefined;
498
+ // (undocumented)
499
+ note?: string | undefined;
500
+ // (undocumented)
501
+ project?: string | undefined;
502
+ // (undocumented)
503
+ repeat?: RepetitionRule | undefined;
504
+ // (undocumented)
505
+ tags?: string[] | undefined;
506
+ // (undocumented)
507
+ title?: string | undefined;
508
+ }
509
+
510
+ // @public
511
+ export function updateTag(tagId: string, options: UpdateTagOptions): Promise<CliOutput<OFTag>>;
512
+
513
+ // @public
514
+ export interface UpdateTagOptions {
515
+ // (undocumented)
516
+ name?: string | undefined;
517
+ // (undocumented)
518
+ parentTagId?: string | undefined;
519
+ // (undocumented)
520
+ parentTagName?: string | undefined;
521
+ }
522
+
523
+ // @public
524
+ export function updateTask(taskId: string, options: TaskUpdateOptions): Promise<CliOutput<OFTask>>;
525
+
526
+ // @public
527
+ export function updateTasks(taskIds: string[], options: TaskUpdateOptions): Promise<CliOutput<BatchResult<BatchCompleteItem>>>;
528
+
529
+ // @public
530
+ export function validateDateString(dateStr: string): CliError | null;
531
+
532
+ // @public
533
+ export function validateEstimatedMinutes(minutes: number | undefined): CliError | null;
534
+
535
+ // @public
536
+ export function validateFolderName(name: string | undefined): CliError | null;
537
+
538
+ // @public
539
+ export function validateId(id: string, type: "task" | "project" | "tag"): CliError | null;
540
+
541
+ // @public
542
+ export function validateProjectName(name: string | undefined): CliError | null;
543
+
544
+ // @public
545
+ export function validateRepetitionRule(rule: {
546
+ frequency: string;
547
+ interval: number;
548
+ repeatMethod: string;
549
+ daysOfWeek?: number[] | undefined;
550
+ dayOfMonth?: number | undefined;
551
+ } | undefined): CliError | null;
552
+
553
+ // @public
554
+ export function validateSearchQuery(query: string): CliError | null;
555
+
556
+ // @public
557
+ export function validateTagName(name: string): CliError | null;
558
+
559
+ // @public
560
+ export function validateTags(tags: string[] | undefined): CliError | null;
561
+
562
+ // (No @packageDocumentation comment for this package)
563
+
564
+ ```