@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.
- package/README.md +80 -0
- package/api-report/ofocus-sdk.api.md +564 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/applescript.d.ts +30 -0
- package/dist/applescript.d.ts.map +1 -0
- package/dist/applescript.js +142 -0
- package/dist/applescript.js.map +1 -0
- package/dist/commands/batch.d.ts +23 -0
- package/dist/commands/batch.d.ts.map +1 -0
- package/dist/commands/batch.js +324 -0
- package/dist/commands/batch.js.map +1 -0
- package/dist/commands/complete.d.ts +14 -0
- package/dist/commands/complete.d.ts.map +1 -0
- package/dist/commands/complete.js +37 -0
- package/dist/commands/complete.js.map +1 -0
- package/dist/commands/create-project.d.ts +6 -0
- package/dist/commands/create-project.d.ts.map +1 -0
- package/dist/commands/create-project.js +124 -0
- package/dist/commands/create-project.js.map +1 -0
- package/dist/commands/drop.d.ts +26 -0
- package/dist/commands/drop.d.ts.map +1 -0
- package/dist/commands/drop.js +62 -0
- package/dist/commands/drop.js.map +1 -0
- package/dist/commands/folders.d.ts +10 -0
- package/dist/commands/folders.d.ts.map +1 -0
- package/dist/commands/folders.js +150 -0
- package/dist/commands/folders.js.map +1 -0
- package/dist/commands/inbox.d.ts +6 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +124 -0
- package/dist/commands/inbox.js.map +1 -0
- package/dist/commands/perspectives.d.ts +20 -0
- package/dist/commands/perspectives.d.ts.map +1 -0
- package/dist/commands/perspectives.js +166 -0
- package/dist/commands/perspectives.js.map +1 -0
- package/dist/commands/projects.d.ts +6 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +113 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/repetition.d.ts +17 -0
- package/dist/commands/repetition.d.ts.map +1 -0
- package/dist/commands/repetition.js +59 -0
- package/dist/commands/repetition.js.map +1 -0
- package/dist/commands/review.d.ts +10 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +132 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/search.d.ts +6 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +150 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/subtasks.d.ts +14 -0
- package/dist/commands/subtasks.d.ts.map +1 -0
- package/dist/commands/subtasks.js +370 -0
- package/dist/commands/subtasks.js.map +1 -0
- package/dist/commands/tags-crud.d.ts +22 -0
- package/dist/commands/tags-crud.d.ts.map +1 -0
- package/dist/commands/tags-crud.js +187 -0
- package/dist/commands/tags-crud.js.map +1 -0
- package/dist/commands/tags.d.ts +6 -0
- package/dist/commands/tags.d.ts.map +1 -0
- package/dist/commands/tags.js +61 -0
- package/dist/commands/tags.js.map +1 -0
- package/dist/commands/tasks.d.ts +6 -0
- package/dist/commands/tasks.d.ts.map +1 -0
- package/dist/commands/tasks.js +160 -0
- package/dist/commands/tasks.js.map +1 -0
- package/dist/commands/update.d.ts +6 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +179 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/errors.d.ts +38 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +77 -0
- package/dist/errors.js.map +1 -0
- package/dist/escape.d.ts +6 -0
- package/dist/escape.d.ts.map +1 -0
- package/dist/escape.js +8 -0
- package/dist/escape.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/ofocus-sdk.d.ts +608 -0
- package/dist/result.d.ts +15 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +29 -0
- package/dist/result.js.map +1 -0
- package/dist/types.d.ts +228 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +57 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +172 -0
- package/dist/validation.js.map +1 -0
- package/docs/index.md +30 -0
- package/docs/sdk.addtoinbox.md +68 -0
- package/docs/sdk.applescriptresult.data.md +11 -0
- package/docs/sdk.applescriptresult.error.md +11 -0
- package/docs/sdk.applescriptresult.md +92 -0
- package/docs/sdk.applescriptresult.success.md +11 -0
- package/docs/sdk.clierror.code.md +11 -0
- package/docs/sdk.clierror.details.md +11 -0
- package/docs/sdk.clierror.md +92 -0
- package/docs/sdk.clierror.message.md +11 -0
- package/docs/sdk.clioutput.data.md +11 -0
- package/docs/sdk.clioutput.error.md +11 -0
- package/docs/sdk.clioutput.md +90 -0
- package/docs/sdk.clioutput.success.md +11 -0
- package/docs/sdk.commandinfo.description.md +11 -0
- package/docs/sdk.commandinfo.md +90 -0
- package/docs/sdk.commandinfo.name.md +11 -0
- package/docs/sdk.commandinfo.usage.md +11 -0
- package/docs/sdk.completeresult.completed.md +11 -0
- package/docs/sdk.completeresult.md +90 -0
- package/docs/sdk.completeresult.taskid.md +11 -0
- package/docs/sdk.completeresult.taskname.md +11 -0
- package/docs/sdk.completetask.md +52 -0
- package/docs/sdk.createerror.md +82 -0
- package/docs/sdk.errorcode.md +24 -0
- package/docs/sdk.escapeapplescript.md +52 -0
- package/docs/sdk.failure.md +52 -0
- package/docs/sdk.failuremessage.md +52 -0
- package/docs/sdk.inboxoptions.defer.md +11 -0
- package/docs/sdk.inboxoptions.due.md +11 -0
- package/docs/sdk.inboxoptions.flag.md +11 -0
- package/docs/sdk.inboxoptions.md +134 -0
- package/docs/sdk.inboxoptions.note.md +11 -0
- package/docs/sdk.inboxoptions.tags.md +11 -0
- package/docs/sdk.jsonhelpers.md +13 -0
- package/docs/sdk.md +471 -0
- package/docs/sdk.ofperspective.id.md +11 -0
- package/docs/sdk.ofperspective.md +73 -0
- package/docs/sdk.ofperspective.name.md +11 -0
- package/docs/sdk.ofproject.folderid.md +11 -0
- package/docs/sdk.ofproject.foldername.md +11 -0
- package/docs/sdk.ofproject.id.md +11 -0
- package/docs/sdk.ofproject.md +192 -0
- package/docs/sdk.ofproject.name.md +11 -0
- package/docs/sdk.ofproject.note.md +11 -0
- package/docs/sdk.ofproject.remainingtaskcount.md +11 -0
- package/docs/sdk.ofproject.sequential.md +11 -0
- package/docs/sdk.ofproject.status.md +11 -0
- package/docs/sdk.ofproject.taskcount.md +11 -0
- package/docs/sdk.oftag.availabletaskcount.md +11 -0
- package/docs/sdk.oftag.id.md +11 -0
- package/docs/sdk.oftag.md +124 -0
- package/docs/sdk.oftag.name.md +11 -0
- package/docs/sdk.oftag.parentid.md +11 -0
- package/docs/sdk.oftag.parentname.md +11 -0
- package/docs/sdk.oftask.completed.md +11 -0
- package/docs/sdk.oftask.completiondate.md +11 -0
- package/docs/sdk.oftask.deferdate.md +11 -0
- package/docs/sdk.oftask.duedate.md +11 -0
- package/docs/sdk.oftask.flagged.md +11 -0
- package/docs/sdk.oftask.id.md +11 -0
- package/docs/sdk.oftask.md +226 -0
- package/docs/sdk.oftask.name.md +11 -0
- package/docs/sdk.oftask.note.md +11 -0
- package/docs/sdk.oftask.projectid.md +11 -0
- package/docs/sdk.oftask.projectname.md +11 -0
- package/docs/sdk.oftask.tags.md +11 -0
- package/docs/sdk.omnifocusscript.md +52 -0
- package/docs/sdk.omnifocusscriptwithhelpers.md +52 -0
- package/docs/sdk.parseapplescripterror.md +52 -0
- package/docs/sdk.projectqueryoptions.folder.md +11 -0
- package/docs/sdk.projectqueryoptions.md +96 -0
- package/docs/sdk.projectqueryoptions.sequential.md +11 -0
- package/docs/sdk.projectqueryoptions.status.md +11 -0
- package/docs/sdk.queryprojects.md +54 -0
- package/docs/sdk.querytags.md +54 -0
- package/docs/sdk.querytasks.md +54 -0
- package/docs/sdk.runapplescript.md +52 -0
- package/docs/sdk.runapplescriptfile.md +68 -0
- package/docs/sdk.success.md +52 -0
- package/docs/sdk.tagqueryoptions.md +58 -0
- package/docs/sdk.tagqueryoptions.parent.md +11 -0
- package/docs/sdk.taskqueryoptions.available.md +11 -0
- package/docs/sdk.taskqueryoptions.completed.md +11 -0
- package/docs/sdk.taskqueryoptions.dueafter.md +11 -0
- package/docs/sdk.taskqueryoptions.duebefore.md +11 -0
- package/docs/sdk.taskqueryoptions.flagged.md +11 -0
- package/docs/sdk.taskqueryoptions.md +172 -0
- package/docs/sdk.taskqueryoptions.project.md +11 -0
- package/docs/sdk.taskqueryoptions.tag.md +11 -0
- package/docs/sdk.taskupdateoptions.defer.md +11 -0
- package/docs/sdk.taskupdateoptions.due.md +11 -0
- package/docs/sdk.taskupdateoptions.flag.md +11 -0
- package/docs/sdk.taskupdateoptions.md +172 -0
- package/docs/sdk.taskupdateoptions.note.md +11 -0
- package/docs/sdk.taskupdateoptions.project.md +11 -0
- package/docs/sdk.taskupdateoptions.tags.md +11 -0
- package/docs/sdk.taskupdateoptions.title.md +11 -0
- package/docs/sdk.updatetask.md +66 -0
- package/docs/sdk.validatedatestring.md +54 -0
- package/docs/sdk.validateid.md +66 -0
- package/docs/sdk.validateprojectname.md +52 -0
- package/docs/sdk.validatetags.md +52 -0
- 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
|
+
```
|