tuturuuu 0.10.1 → 0.12.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 +40 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands.d.ts +4 -0
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +399 -3
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +135 -3
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/render.d.ts +2 -0
- package/dist/cli/render.d.ts.map +1 -1
- package/dist/cli/render.js +33 -9
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/task-description.d.ts +23 -0
- package/dist/cli/task-description.d.ts.map +1 -0
- package/dist/cli/task-description.js +280 -0
- package/dist/cli/task-description.js.map +1 -0
- package/dist/cli/task-templates.d.ts +12 -0
- package/dist/cli/task-templates.d.ts.map +1 -0
- package/dist/cli/task-templates.js +172 -0
- package/dist/cli/task-templates.js.map +1 -0
- package/dist/cli/tiptap.d.ts +9 -0
- package/dist/cli/tiptap.d.ts.map +1 -0
- package/dist/cli/tiptap.js +120 -0
- package/dist/cli/tiptap.js.map +1 -0
- package/dist/epm.d.ts +3 -1
- package/dist/epm.d.ts.map +1 -1
- package/dist/epm.js +87 -4
- package/dist/epm.js.map +1 -1
- package/dist/external-projects.d.ts +2 -2
- package/dist/external-projects.d.ts.map +1 -1
- package/dist/external-projects.js +2 -1
- package/dist/external-projects.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/platform-calendar.d.ts +9 -0
- package/dist/platform-calendar.d.ts.map +1 -1
- package/dist/platform.d.ts +17 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +100 -0
- package/dist/platform.js.map +1 -1
- package/dist/task-templates.d.ts +103 -0
- package/dist/task-templates.d.ts.map +1 -0
- package/dist/task-templates.js +85 -0
- package/dist/task-templates.js.map +1 -0
- package/dist/types.d.ts +39 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -74,8 +74,14 @@ ttr lists use
|
|
|
74
74
|
ttr tasks use
|
|
75
75
|
ttr tasks --board <board-id>
|
|
76
76
|
ttr tasks --compact
|
|
77
|
+
ttr tasks search "deadline review"
|
|
78
|
+
ttr tasks search "deadline review" --mode text
|
|
79
|
+
ttr tasks search "deadline review" --mode semantic
|
|
77
80
|
ttr tasks create "Add Tuturuuu CLI"
|
|
78
81
|
ttr tasks create --list <list-id> --name "Write release notes"
|
|
82
|
+
ttr task-templates create "Bug report" --key bug-report --title "Investigate bug"
|
|
83
|
+
ttr task-templates use bug-report --list <list-id>
|
|
84
|
+
ttr tasks create --template bug-report --list <list-id> --name "Investigate checkout bug"
|
|
79
85
|
ttr tasks done <task-id>
|
|
80
86
|
ttr tasks close <task-id>
|
|
81
87
|
ttr tasks update <task-id> --json-payload '{"completed":true}'
|
|
@@ -145,7 +151,11 @@ ttr calendar events --help
|
|
|
145
151
|
ttr finance --help
|
|
146
152
|
ttr finance transactions --help
|
|
147
153
|
ttr tasks --help
|
|
154
|
+
ttr tasks search --help
|
|
148
155
|
ttr tasks create --help
|
|
156
|
+
ttr task-templates --help
|
|
157
|
+
ttr task-templates import --help
|
|
158
|
+
ttr task-templates export --help
|
|
149
159
|
ttr tasks done --help
|
|
150
160
|
ttr tasks close --help
|
|
151
161
|
ttr tasks update --help
|
|
@@ -182,8 +192,18 @@ count and current page/max page. Add `--compact` to task lists when an agent
|
|
|
182
192
|
only needs the task title, task list name, and per-task workspace name. Task
|
|
183
193
|
lists are ordered by priority and due date, with prettier due dates and
|
|
184
194
|
configured task-list colors in table output. Use `--json` on read commands when
|
|
185
|
-
another agent or script needs machine-readable output.
|
|
186
|
-
|
|
195
|
+
another agent or script needs machine-readable output.
|
|
196
|
+
|
|
197
|
+
Use `ttr tasks search <query>` for ranked task search. Search defaults to
|
|
198
|
+
`--mode hybrid`, accepts `--mode text` for PostgreSQL full-text search only and
|
|
199
|
+
`--mode semantic` for embedding similarity only, and supports
|
|
200
|
+
`--query`/`--q`, `--limit`/`--match-count`, `--threshold`/`--match-threshold`,
|
|
201
|
+
`--workspace`/`--ws`, `--compact`, and `--json`. Search output preserves API
|
|
202
|
+
relevance order and shows the score when available. Existing list filtering
|
|
203
|
+
with `ttr tasks --q <query>` is unchanged and remains the lightweight list text
|
|
204
|
+
filter.
|
|
205
|
+
|
|
206
|
+
`tasks create`, `boards create`, and `lists create` accept a quoted positional name as
|
|
187
207
|
a shorthand for `--name`. Task CRUD accepts either the task UUID or the board
|
|
188
208
|
identifier shown in the UI, such as `VHP-12`; prefixed identifiers resolve
|
|
189
209
|
within the selected workspace even when another list is selected. Marking a task
|
|
@@ -194,6 +214,16 @@ completed stamps `completed_at` so Tuturuuu moves it to the first
|
|
|
194
214
|
`closed_at`; pass `--list <closed-list-id>` to choose a specific closed
|
|
195
215
|
destination.
|
|
196
216
|
|
|
217
|
+
Task templates are single-task starters, separate from board templates. Workspace
|
|
218
|
+
templates are managed with `ttr task-templates list/show/create/update/delete/use`
|
|
219
|
+
and can be imported from or exported to local markdown files. Local templates
|
|
220
|
+
live under `.tuturuuu/task-templates/*.md`, use YAML frontmatter for fields such
|
|
221
|
+
as `key`, `name`, `task_name`, `priority`, `label_ids`, `assignee_ids`, and
|
|
222
|
+
`project_ids`, and use the markdown body as the task description. `ttr tasks
|
|
223
|
+
create --template <key-or-path>` resolves workspace keys or local markdown
|
|
224
|
+
paths; explicit flags such as `--name`, `--list`, `--priority`, `--labels`, and
|
|
225
|
+
`--projects` override template defaults.
|
|
226
|
+
|
|
197
227
|
Finance commands cover workspace wallets, transactions, categories, budgets,
|
|
198
228
|
and recurring transactions through the same authenticated internal APIs as the
|
|
199
229
|
web app. Use `--workspace` or `--ws` to target a specific workspace, and
|
|
@@ -256,8 +286,16 @@ Common task examples:
|
|
|
256
286
|
ttr tasks
|
|
257
287
|
ttr tasks --compact
|
|
258
288
|
ttr tasks --json --no-update-check
|
|
289
|
+
ttr tasks search "deadline review"
|
|
290
|
+
ttr tasks search "deadline review" --mode hybrid --limit 20 --threshold 0.25
|
|
291
|
+
ttr tasks search --query "deadline review" --mode text --json --no-update-check
|
|
259
292
|
ttr tasks create "Add Tuturuuu CLI"
|
|
260
293
|
ttr tasks create --list <list-id> --name "Write release notes"
|
|
294
|
+
ttr task-templates list
|
|
295
|
+
ttr task-templates create "Bug report" --key bug-report --title "Investigate bug" --priority high
|
|
296
|
+
ttr task-templates export bug-report --file .tuturuuu/task-templates/bug-report.md
|
|
297
|
+
ttr task-templates import .tuturuuu/task-templates/bug-report.md
|
|
298
|
+
ttr tasks create --template bug-report --list <list-id> --name "Investigate checkout bug"
|
|
261
299
|
ttr tasks done VHP-12
|
|
262
300
|
ttr tasks done <task-id> --list <done-list-id>
|
|
263
301
|
ttr tasks close VHP-12
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA+BpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,sBAGpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA+BpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,sBAGpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,sBAc9C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;;eAOnD,MAAM;;;;YAQT,MAAM;;;;EASnB;AAED,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,YAOtC"}
|
package/dist/cli/args.js
CHANGED
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":";;;;;;;AAOA,mBAA0B,IAAc;IACtC,MAAM,KAAK,GAA8B,EAAE,CAAC;IAC5C,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,GA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CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QACpD,OAAO;YACL,SAAS,EAAE,MAAe;YAC1B,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;SAC9D,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,MAAe;SACxB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EACP,KAAK,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,SAAmB;QACnE,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,SAAmB;KAC5E,CAAC;AACJ,CAAC;AAED,kBAAyB,KAAc;IACrC,OAAO,KAAK;QACV,CAAC,CAAC,KAAK;aACF,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;aAC5B,MAAM,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,EAAE,CAAC;AACT,CAAC"}
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export declare function listTasksForCli(client: TuturuuuUserClient, _config: Cli
|
|
|
18
18
|
response: CliWorkspaceTasksResponse;
|
|
19
19
|
workspaceName?: string;
|
|
20
20
|
}>;
|
|
21
|
+
export declare function searchTasksForCli(client: TuturuuuUserClient, _config: CliConfig, workspaceId: string, flags: Record<string, FlagValue>, positionals: string[]): Promise<{
|
|
22
|
+
response: Awaited<ReturnType<TuturuuuUserClient['tasks']['search']>>;
|
|
23
|
+
workspaceName?: string;
|
|
24
|
+
}>;
|
|
21
25
|
export declare function getTaskUpdatePayload(flags: Record<string, FlagValue>): Record<string, unknown>;
|
|
22
26
|
export declare function getTaskDonePayload(flags: Record<string, FlagValue>, listId?: string): Record<string, unknown>;
|
|
23
27
|
export declare function getTaskClosePayload(flags: Record<string, FlagValue>, listId?: string): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,QAAQ,CAAC;AAQhB,OAAO,EACL,KAAK,SAAS,EAQf,MAAM,UAAU,CAAC;AAmFlB,UAAU,qBAAqB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAOD,KAAK,yBAAyB,GAAG,sBAAsB,GAAG;IACxD,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAoYF,wBAAsB,eAAe,CACnC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAC/B,OAAO,CAAC;IAAE,QAAQ,EAAE,yBAAyB,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAyG1E;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAwBD;AAsMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,2BAiBpE;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,2BAiBhB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,2BAqBhB;AAgPD,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,UAQjD;AAED,wBAAsB,MAAM,CAAC,IAAI,WAAwB,iBAo/BxD"}
|
package/dist/cli/commands.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.listTasksForCli = listTasksForCli;
|
|
7
|
+
exports.searchTasksForCli = searchTasksForCli;
|
|
7
8
|
exports.getTaskUpdatePayload = getTaskUpdatePayload;
|
|
8
9
|
exports.getTaskDonePayload = getTaskDonePayload;
|
|
9
10
|
exports.getTaskClosePayload = getTaskClosePayload;
|
|
@@ -21,15 +22,21 @@ const finance_1 = require("./finance");
|
|
|
21
22
|
const help_1 = require("./help");
|
|
22
23
|
const render_1 = require("./render");
|
|
23
24
|
const selection_1 = require("./selection");
|
|
25
|
+
const task_description_1 = require("./task-description");
|
|
26
|
+
const task_templates_1 = require("./task-templates");
|
|
27
|
+
const tiptap_1 = require("./tiptap");
|
|
24
28
|
const update_1 = require("./update");
|
|
25
29
|
const doneActions = new Set(['complete', 'completed', 'done', 'mark-done']);
|
|
26
30
|
const closeActions = new Set(['archive', 'close', 'closed', 'mark-closed']);
|
|
27
31
|
const DEFAULT_TASK_PAGE_SIZE = 50;
|
|
28
32
|
const ACTIVE_TASK_LIST_STATUSES = ['not_started', 'active'];
|
|
29
33
|
const DOCUMENT_TASK_LIST_STATUSES = ['documents'];
|
|
34
|
+
const TASK_TEMPLATE_PRIORITIES = ['critical', 'high', 'normal', 'low'];
|
|
35
|
+
const TASK_TEMPLATE_VISIBILITIES = ['private', 'workspace'];
|
|
30
36
|
const REVIEW_TASK_LIST_STATUSES = ['review'];
|
|
31
37
|
const DONE_TASK_LIST_STATUSES = ['review', 'done'];
|
|
32
38
|
const CLOSED_TASK_LIST_STATUSES = ['closed'];
|
|
39
|
+
const TASK_SEARCH_MODES = ['text', 'semantic', 'hybrid'];
|
|
33
40
|
const LABEL_COLOR_ALIASES = {
|
|
34
41
|
amber: '#D97706',
|
|
35
42
|
blue: '#2563EB',
|
|
@@ -110,6 +117,46 @@ function parseNonNegativeInteger(value) {
|
|
|
110
117
|
const parsed = Number.parseInt(value, 10);
|
|
111
118
|
return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;
|
|
112
119
|
}
|
|
120
|
+
function parseTaskSearchMode(flags) {
|
|
121
|
+
const mode = (0, args_1.getFlag)(flags, 'mode') || 'hybrid';
|
|
122
|
+
if (TASK_SEARCH_MODES.includes(mode)) {
|
|
123
|
+
return mode;
|
|
124
|
+
}
|
|
125
|
+
throw new Error('Invalid task search mode. Use text, semantic, or hybrid.');
|
|
126
|
+
}
|
|
127
|
+
function parseTaskSearchPositiveInteger(value, flagName) {
|
|
128
|
+
if (!value)
|
|
129
|
+
return undefined;
|
|
130
|
+
const parsed = Number(value);
|
|
131
|
+
if (Number.isInteger(parsed) && parsed > 0)
|
|
132
|
+
return parsed;
|
|
133
|
+
throw new Error(`${flagName} must be a positive integer.`);
|
|
134
|
+
}
|
|
135
|
+
function parseTaskSearchThreshold(value) {
|
|
136
|
+
if (!value)
|
|
137
|
+
return undefined;
|
|
138
|
+
const parsed = Number(value);
|
|
139
|
+
if (Number.isFinite(parsed) && parsed >= 0 && parsed <= 1) {
|
|
140
|
+
return parsed;
|
|
141
|
+
}
|
|
142
|
+
throw new Error('--threshold must be a number between 0 and 1.');
|
|
143
|
+
}
|
|
144
|
+
function parseTaskTemplatePriority(value) {
|
|
145
|
+
if (!value)
|
|
146
|
+
return undefined;
|
|
147
|
+
if (TASK_TEMPLATE_PRIORITIES.includes(value)) {
|
|
148
|
+
return value;
|
|
149
|
+
}
|
|
150
|
+
throw new Error('Invalid task template priority. Use critical, high, normal, or low.');
|
|
151
|
+
}
|
|
152
|
+
function parseTaskTemplateVisibility(value) {
|
|
153
|
+
if (!value)
|
|
154
|
+
return undefined;
|
|
155
|
+
if (TASK_TEMPLATE_VISIBILITIES.includes(value)) {
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
throw new Error('Invalid task template visibility. Use private or workspace.');
|
|
159
|
+
}
|
|
113
160
|
function getTaskPagination(flags) {
|
|
114
161
|
const limit = parsePositiveInteger((0, args_1.getFlag)(flags, 'limit')) ??
|
|
115
162
|
parsePositiveInteger((0, args_1.getFlag)(flags, 'page-size')) ??
|
|
@@ -210,6 +257,23 @@ function getCliTaskListOptions(flags) {
|
|
|
210
257
|
q: (0, args_1.getFlag)(flags, 'q'),
|
|
211
258
|
};
|
|
212
259
|
}
|
|
260
|
+
function getCliTaskSearchPayload(flags, positionals) {
|
|
261
|
+
const query = (0, args_1.getFlag)(flags, 'query') ||
|
|
262
|
+
(0, args_1.getFlag)(flags, 'q') ||
|
|
263
|
+
positionals.slice(2).join(' ');
|
|
264
|
+
const trimmedQuery = query.trim();
|
|
265
|
+
if (!trimmedQuery) {
|
|
266
|
+
throw new Error('Missing search query. Use `ttr tasks search <query>` or --query.');
|
|
267
|
+
}
|
|
268
|
+
const matchCount = parseTaskSearchPositiveInteger((0, args_1.getFlag)(flags, 'match-count') || (0, args_1.getFlag)(flags, 'limit'), '--match-count');
|
|
269
|
+
const matchThreshold = parseTaskSearchThreshold((0, args_1.getFlag)(flags, 'match-threshold') || (0, args_1.getFlag)(flags, 'threshold'));
|
|
270
|
+
return {
|
|
271
|
+
...(matchCount !== undefined ? { matchCount } : {}),
|
|
272
|
+
...(matchThreshold !== undefined ? { matchThreshold } : {}),
|
|
273
|
+
mode: parseTaskSearchMode(flags),
|
|
274
|
+
query: trimmedQuery,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
213
277
|
function getTaskListStatus(task) {
|
|
214
278
|
const taskWithRelations = task;
|
|
215
279
|
return (task.source_list_status ?? taskWithRelations.task_lists?.status ?? null);
|
|
@@ -326,6 +390,29 @@ async function listTasksForCli(client, _config, workspaceId, flags) {
|
|
|
326
390
|
workspaceName,
|
|
327
391
|
};
|
|
328
392
|
}
|
|
393
|
+
async function searchTasksForCli(client, _config, workspaceId, flags, positionals) {
|
|
394
|
+
const payload = getCliTaskSearchPayload(flags, positionals);
|
|
395
|
+
const workspaces = await client.workspaces.list();
|
|
396
|
+
const requestedWorkspace = resolveWorkspace(workspaceId, workspaces);
|
|
397
|
+
const personalWorkspace = workspaces.find((workspace) => workspace.personal);
|
|
398
|
+
const currentWorkspace = shouldUseDefaultPersonalTaskScope(flags) && personalWorkspace
|
|
399
|
+
? personalWorkspace
|
|
400
|
+
: requestedWorkspace;
|
|
401
|
+
const effectiveWorkspaceId = currentWorkspace?.id ?? workspaceId;
|
|
402
|
+
const workspaceName = currentWorkspace?.name || workspaceId;
|
|
403
|
+
const response = await client.tasks.search(effectiveWorkspaceId, payload);
|
|
404
|
+
return {
|
|
405
|
+
response: {
|
|
406
|
+
...response,
|
|
407
|
+
tasks: response.tasks.map((task) => ({
|
|
408
|
+
...task,
|
|
409
|
+
workspace_id: effectiveWorkspaceId,
|
|
410
|
+
workspace_name: workspaceName,
|
|
411
|
+
})),
|
|
412
|
+
},
|
|
413
|
+
workspaceName,
|
|
414
|
+
};
|
|
415
|
+
}
|
|
329
416
|
function getClient(config) {
|
|
330
417
|
if (!config.session?.accessToken || !config.session.refreshToken) {
|
|
331
418
|
throw new Error('Not logged in. Run `ttr login` first.');
|
|
@@ -510,6 +597,108 @@ function getTaskClosePayload(flags, listId) {
|
|
|
510
597
|
}
|
|
511
598
|
return payload;
|
|
512
599
|
}
|
|
600
|
+
function getTaskTemplatePayloadFromFlags(flags, fallbackName) {
|
|
601
|
+
const payload = getPayload(flags);
|
|
602
|
+
const priority = parseTaskTemplatePriority((0, args_1.getFlag)(flags, 'priority'));
|
|
603
|
+
const visibility = parseTaskTemplateVisibility((0, args_1.getFlag)(flags, 'visibility'));
|
|
604
|
+
const name = (0, args_1.getFlag)(flags, 'name') || (0, args_1.getFlag)(flags, 'template-name') || fallbackName;
|
|
605
|
+
const taskName = (0, args_1.getFlag)(flags, 'title') || (0, args_1.getFlag)(flags, 'task-name') || fallbackName;
|
|
606
|
+
return {
|
|
607
|
+
...payload,
|
|
608
|
+
...((0, args_1.getFlag)(flags, 'assignees')
|
|
609
|
+
? { assignee_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'assignees')) }
|
|
610
|
+
: {}),
|
|
611
|
+
...((0, args_1.getFlag)(flags, 'board') || (0, args_1.getFlag)(flags, 'board-id')
|
|
612
|
+
? {
|
|
613
|
+
default_board_id: (0, args_1.getFlag)(flags, 'board') || (0, args_1.getFlag)(flags, 'board-id'),
|
|
614
|
+
}
|
|
615
|
+
: {}),
|
|
616
|
+
...((0, args_1.getFlag)(flags, 'description')
|
|
617
|
+
? { description: (0, args_1.getFlag)(flags, 'description') }
|
|
618
|
+
: {}),
|
|
619
|
+
...((0, args_1.getFlag)(flags, 'end-date')
|
|
620
|
+
? { end_date: (0, args_1.getFlag)(flags, 'end-date') }
|
|
621
|
+
: {}),
|
|
622
|
+
...((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')
|
|
623
|
+
? {
|
|
624
|
+
estimation_points: Number((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')),
|
|
625
|
+
}
|
|
626
|
+
: {}),
|
|
627
|
+
...((0, args_1.getFlag)(flags, 'key') || (0, args_1.getFlag)(flags, 'slug')
|
|
628
|
+
? { key: (0, args_1.getFlag)(flags, 'key') || (0, args_1.getFlag)(flags, 'slug') }
|
|
629
|
+
: {}),
|
|
630
|
+
...((0, args_1.getFlag)(flags, 'labels')
|
|
631
|
+
? { label_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'labels')) }
|
|
632
|
+
: {}),
|
|
633
|
+
...((0, args_1.getFlag)(flags, 'list') || (0, args_1.getFlag)(flags, 'list-id')
|
|
634
|
+
? { default_list_id: (0, args_1.getFlag)(flags, 'list') || (0, args_1.getFlag)(flags, 'list-id') }
|
|
635
|
+
: {}),
|
|
636
|
+
...(name ? { name } : {}),
|
|
637
|
+
...(priority ? { priority } : {}),
|
|
638
|
+
...((0, args_1.getFlag)(flags, 'projects')
|
|
639
|
+
? { project_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'projects')) }
|
|
640
|
+
: {}),
|
|
641
|
+
...((0, args_1.getFlag)(flags, 'start-date')
|
|
642
|
+
? { start_date: (0, args_1.getFlag)(flags, 'start-date') }
|
|
643
|
+
: {}),
|
|
644
|
+
...(taskName ? { task_name: taskName } : {}),
|
|
645
|
+
...(visibility ? { visibility } : {}),
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function getTaskTemplateCreateOverrides(flags, listId, fallbackName) {
|
|
649
|
+
const payload = getPayload(flags);
|
|
650
|
+
const priority = parseTaskTemplatePriority((0, args_1.getFlag)(flags, 'priority'));
|
|
651
|
+
return {
|
|
652
|
+
...payload,
|
|
653
|
+
...((0, args_1.getFlag)(flags, 'assignees')
|
|
654
|
+
? { assignee_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'assignees')) }
|
|
655
|
+
: {}),
|
|
656
|
+
...((0, args_1.getFlag)(flags, 'end-date')
|
|
657
|
+
? { end_date: (0, args_1.getFlag)(flags, 'end-date') }
|
|
658
|
+
: {}),
|
|
659
|
+
...((0, args_1.getFlag)(flags, 'description')
|
|
660
|
+
? { description: (0, args_1.getFlag)(flags, 'description') }
|
|
661
|
+
: {}),
|
|
662
|
+
...((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')
|
|
663
|
+
? {
|
|
664
|
+
estimation_points: Number((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')),
|
|
665
|
+
}
|
|
666
|
+
: {}),
|
|
667
|
+
...((0, args_1.getFlag)(flags, 'labels')
|
|
668
|
+
? { label_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'labels')) }
|
|
669
|
+
: {}),
|
|
670
|
+
listId,
|
|
671
|
+
...((0, args_1.getFlag)(flags, 'name') || fallbackName
|
|
672
|
+
? { name: (0, args_1.getFlag)(flags, 'name') || fallbackName }
|
|
673
|
+
: {}),
|
|
674
|
+
...(priority ? { priority } : {}),
|
|
675
|
+
...((0, args_1.getFlag)(flags, 'projects')
|
|
676
|
+
? { project_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'projects')) }
|
|
677
|
+
: {}),
|
|
678
|
+
...((0, args_1.getFlag)(flags, 'start-date')
|
|
679
|
+
? { start_date: (0, args_1.getFlag)(flags, 'start-date') }
|
|
680
|
+
: {}),
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
async function createTaskFromLocalTemplate({ client, flags, listId, reference, workspaceId, }) {
|
|
684
|
+
const localTemplate = (0, task_templates_1.parseLocalTaskTemplateFile)((0, task_templates_1.resolveLocalTaskTemplatePath)(reference));
|
|
685
|
+
const overrides = getTaskTemplateCreateOverrides(flags, listId);
|
|
686
|
+
return client.tasks.create(workspaceId, {
|
|
687
|
+
assignee_ids: localTemplate.payload.assignee_ids ?? [],
|
|
688
|
+
description: localTemplate.payload.description ?? null,
|
|
689
|
+
end_date: localTemplate.payload.end_date ?? null,
|
|
690
|
+
estimation_points: localTemplate.payload.estimation_points ?? null,
|
|
691
|
+
label_ids: localTemplate.payload.label_ids ?? [],
|
|
692
|
+
name: typeof overrides.name === 'string'
|
|
693
|
+
? overrides.name
|
|
694
|
+
: (localTemplate.payload.task_name ?? localTemplate.payload.name),
|
|
695
|
+
priority: localTemplate.payload.priority ?? null,
|
|
696
|
+
project_ids: localTemplate.payload.project_ids ?? [],
|
|
697
|
+
start_date: localTemplate.payload.start_date ?? null,
|
|
698
|
+
...overrides,
|
|
699
|
+
listId,
|
|
700
|
+
});
|
|
701
|
+
}
|
|
513
702
|
async function getDefaultStatusListId({ client, config, flags, json, status, taskId, workspaceId, }) {
|
|
514
703
|
const explicitListId = (0, args_1.getFlag)(flags, 'list') || (0, args_1.getFlag)(flags, 'list-id');
|
|
515
704
|
if (explicitListId) {
|
|
@@ -610,6 +799,10 @@ async function runCli(argv = process.argv.slice(2)) {
|
|
|
610
799
|
await upgradeCli();
|
|
611
800
|
return;
|
|
612
801
|
}
|
|
802
|
+
if (group === 'tiptap') {
|
|
803
|
+
await (0, tiptap_1.runTiptapCommand)({ action: rawAction, flags, json });
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
613
806
|
let config = await (0, config_1.readCliConfig)();
|
|
614
807
|
if (flags['no-update-check'] !== true && !(0, update_1.isCliUpdateCheckDisabled)()) {
|
|
615
808
|
const nextConfig = await (0, update_1.checkForCliUpdate)({
|
|
@@ -849,7 +1042,136 @@ async function runCli(argv = process.argv.slice(2)) {
|
|
|
849
1042
|
return;
|
|
850
1043
|
}
|
|
851
1044
|
}
|
|
1045
|
+
if (group === 'task-templates') {
|
|
1046
|
+
if (action === 'list') {
|
|
1047
|
+
if (flags.local === true) {
|
|
1048
|
+
const localTemplates = (0, task_templates_1.listLocalTaskTemplates)().map((template) => ({
|
|
1049
|
+
path: template.path,
|
|
1050
|
+
...template.payload,
|
|
1051
|
+
}));
|
|
1052
|
+
(0, render_1.render)(localTemplates, { group, json });
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
const payload = await client.tasks.listTemplates(workspaceId, {
|
|
1056
|
+
includeArchived: flags.all === true || flags.archived === true,
|
|
1057
|
+
q: (0, args_1.getFlag)(flags, 'q'),
|
|
1058
|
+
visibility: (0, args_1.getFlag)(flags, 'visibility'),
|
|
1059
|
+
});
|
|
1060
|
+
(0, render_1.render)(json ? payload : payload.templates, { group, json });
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
if (action === 'show' || action === 'get') {
|
|
1064
|
+
if (!firstId)
|
|
1065
|
+
throw new Error('Missing task template key.');
|
|
1066
|
+
if (flags.local === true || (0, task_templates_1.isLocalTaskTemplateReference)(firstId)) {
|
|
1067
|
+
(0, render_1.render)((0, task_templates_1.parseLocalTaskTemplateFile)((0, task_templates_1.resolveLocalTaskTemplatePath)(firstId)), {
|
|
1068
|
+
group,
|
|
1069
|
+
json,
|
|
1070
|
+
});
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
(0, render_1.render)(await client.tasks.getTemplate(workspaceId, firstId), {
|
|
1074
|
+
group,
|
|
1075
|
+
json,
|
|
1076
|
+
});
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
if (action === 'create') {
|
|
1080
|
+
const payload = getTaskTemplatePayloadFromFlags(flags, positionalValue || 'Untitled Template');
|
|
1081
|
+
if (flags.local === true || (0, args_1.getFlag)(flags, 'file')) {
|
|
1082
|
+
const file = (0, args_1.getFlag)(flags, 'file') ||
|
|
1083
|
+
(0, task_templates_1.resolveLocalTaskTemplatePath)(String((0, args_1.getFlag)(flags, 'key') || (0, args_1.getFlag)(flags, 'slug') || payload.name));
|
|
1084
|
+
const path = (0, task_templates_1.writeLocalTaskTemplate)(file, payload);
|
|
1085
|
+
(0, render_1.render)({ path, template: payload }, { group, json });
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
(0, render_1.render)(await client.tasks.createTemplate(workspaceId, payload), {
|
|
1089
|
+
group,
|
|
1090
|
+
json,
|
|
1091
|
+
});
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
if (action === 'update') {
|
|
1095
|
+
if (!firstId)
|
|
1096
|
+
throw new Error('Missing task template key.');
|
|
1097
|
+
(0, render_1.render)(await client.tasks.updateTemplate(workspaceId, firstId, getTaskTemplatePayloadFromFlags(flags)), { group, json });
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
if (action === 'delete' || action === 'archive') {
|
|
1101
|
+
if (!firstId)
|
|
1102
|
+
throw new Error('Missing task template key.');
|
|
1103
|
+
(0, render_1.render)(await client.tasks.deleteTemplate(workspaceId, firstId, {
|
|
1104
|
+
permanent: flags.permanent === true,
|
|
1105
|
+
}), { group, json });
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
if (action === 'use') {
|
|
1109
|
+
if (!firstId)
|
|
1110
|
+
throw new Error('Missing task template key or file.');
|
|
1111
|
+
const listSelection = await (0, selection_1.selectListId)(client, config, workspaceId, flags, json);
|
|
1112
|
+
config = listSelection.config;
|
|
1113
|
+
if (flags.local === true || (0, task_templates_1.isLocalTaskTemplateReference)(firstId)) {
|
|
1114
|
+
(0, render_1.render)(await createTaskFromLocalTemplate({
|
|
1115
|
+
client,
|
|
1116
|
+
flags,
|
|
1117
|
+
listId: listSelection.listId,
|
|
1118
|
+
reference: firstId,
|
|
1119
|
+
workspaceId,
|
|
1120
|
+
}), { group: 'tasks', json });
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
(0, render_1.render)(await client.tasks.useTemplate(workspaceId, firstId, getTaskTemplateCreateOverrides(flags, listSelection.listId, (0, args_1.getFlag)(flags, 'name'))), { group: 'tasks', json });
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
if (action === 'import') {
|
|
1127
|
+
if (!firstId)
|
|
1128
|
+
throw new Error('Missing local task template file.');
|
|
1129
|
+
const localTemplate = (0, task_templates_1.parseLocalTaskTemplateFile)((0, task_templates_1.resolveLocalTaskTemplatePath)(firstId));
|
|
1130
|
+
(0, render_1.render)(await client.tasks.createTemplate(workspaceId, {
|
|
1131
|
+
...localTemplate.payload,
|
|
1132
|
+
...getTaskTemplatePayloadFromFlags(flags),
|
|
1133
|
+
}), { group, json });
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
if (action === 'export') {
|
|
1137
|
+
if (!firstId)
|
|
1138
|
+
throw new Error('Missing task template key.');
|
|
1139
|
+
const { template } = await client.tasks.getTemplate(workspaceId, firstId);
|
|
1140
|
+
const file = (0, args_1.getFlag)(flags, 'file');
|
|
1141
|
+
if (file) {
|
|
1142
|
+
const path = (0, task_templates_1.writeLocalTaskTemplate)(file, template);
|
|
1143
|
+
(0, render_1.render)({ path, template }, { group, json });
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
process.stdout.write((0, task_templates_1.taskTemplateToMarkdown)(template));
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
if (action === 'save-from-task') {
|
|
1150
|
+
const taskId = firstId || (0, args_1.getFlag)(flags, 'task') || (0, args_1.getFlag)(flags, 'task-id');
|
|
1151
|
+
if (!taskId)
|
|
1152
|
+
throw new Error('Missing task id.');
|
|
1153
|
+
(0, render_1.render)(await client.tasks.saveTemplateFromTask(workspaceId, {
|
|
1154
|
+
name: (0, args_1.getFlag)(flags, 'name') || (0, args_1.getFlag)(flags, 'template-name'),
|
|
1155
|
+
taskId,
|
|
1156
|
+
visibility: (0, args_1.getFlag)(flags, 'visibility') || 'private',
|
|
1157
|
+
}), { group, json });
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
852
1161
|
if (group === 'tasks') {
|
|
1162
|
+
if (action === 'description' ||
|
|
1163
|
+
action === 'descriptions' ||
|
|
1164
|
+
action === 'desc') {
|
|
1165
|
+
config = await (0, task_description_1.runTaskDescriptionCommand)({
|
|
1166
|
+
client,
|
|
1167
|
+
config,
|
|
1168
|
+
flags,
|
|
1169
|
+
json,
|
|
1170
|
+
positionals,
|
|
1171
|
+
workspaceId,
|
|
1172
|
+
});
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
853
1175
|
if (action === 'list') {
|
|
854
1176
|
const { response: taskResponse, workspaceName } = await listTasksForCli(client, config, workspaceId, flags);
|
|
855
1177
|
(0, render_1.render)((0, render_1.sortTaskResponseForCli)(taskResponse), {
|
|
@@ -861,6 +1183,19 @@ async function runCli(argv = process.argv.slice(2)) {
|
|
|
861
1183
|
});
|
|
862
1184
|
return;
|
|
863
1185
|
}
|
|
1186
|
+
if (action === 'search') {
|
|
1187
|
+
const { response: taskResponse, workspaceName } = await searchTasksForCli(client, config, workspaceId, flags, positionals);
|
|
1188
|
+
(0, render_1.render)(taskResponse, {
|
|
1189
|
+
compact: flags.compact === true,
|
|
1190
|
+
currentWorkspaceId: workspaceId,
|
|
1191
|
+
group,
|
|
1192
|
+
json,
|
|
1193
|
+
preserveTaskOrder: true,
|
|
1194
|
+
showTaskScore: true,
|
|
1195
|
+
workspaceName,
|
|
1196
|
+
});
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
864
1199
|
if (action === 'use' || action === 'select') {
|
|
865
1200
|
const selection = await (0, selection_1.selectTaskId)(client, config, workspaceId, flags, json, firstId);
|
|
866
1201
|
config = selection.config;
|
|
@@ -879,7 +1214,41 @@ async function runCli(argv = process.argv.slice(2)) {
|
|
|
879
1214
|
if (action === 'create') {
|
|
880
1215
|
const listSelection = await (0, selection_1.selectListId)(client, config, workspaceId, flags, json);
|
|
881
1216
|
config = listSelection.config;
|
|
882
|
-
(0,
|
|
1217
|
+
const templateReference = (0, args_1.getFlag)(flags, 'template');
|
|
1218
|
+
const descriptionPayload = await (0, task_description_1.getTaskDescriptionPayloadFromFlags)(flags);
|
|
1219
|
+
const chunkDescriptionAfterCreate = (0, task_description_1.shouldUseChunkedTaskDescriptionUpdate)(descriptionPayload);
|
|
1220
|
+
if (templateReference) {
|
|
1221
|
+
const createOverrides = {
|
|
1222
|
+
...getTaskTemplateCreateOverrides(flags, listSelection.listId, positionalValue),
|
|
1223
|
+
...(descriptionPayload && !chunkDescriptionAfterCreate
|
|
1224
|
+
? descriptionPayload
|
|
1225
|
+
: {}),
|
|
1226
|
+
};
|
|
1227
|
+
const response = flags.local === true ||
|
|
1228
|
+
(0, task_templates_1.isLocalTaskTemplateReference)(templateReference)
|
|
1229
|
+
? await createTaskFromLocalTemplate({
|
|
1230
|
+
client,
|
|
1231
|
+
flags,
|
|
1232
|
+
listId: listSelection.listId,
|
|
1233
|
+
reference: templateReference,
|
|
1234
|
+
workspaceId,
|
|
1235
|
+
})
|
|
1236
|
+
: await client.tasks.useTemplate(workspaceId, templateReference, createOverrides);
|
|
1237
|
+
if (descriptionPayload &&
|
|
1238
|
+
(chunkDescriptionAfterCreate ||
|
|
1239
|
+
flags.local === true ||
|
|
1240
|
+
(0, task_templates_1.isLocalTaskTemplateReference)(templateReference))) {
|
|
1241
|
+
await (0, task_description_1.updateTaskDescriptionWithBestTransport)({
|
|
1242
|
+
client,
|
|
1243
|
+
payload: descriptionPayload,
|
|
1244
|
+
taskId: response.task.id,
|
|
1245
|
+
workspaceId,
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
(0, render_1.render)(response, { group, json });
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
const createPayload = {
|
|
883
1252
|
assignee_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'assignees')),
|
|
884
1253
|
end_date: (0, args_1.getFlag)(flags, 'end-date') || null,
|
|
885
1254
|
label_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'labels')),
|
|
@@ -888,13 +1257,40 @@ async function runCli(argv = process.argv.slice(2)) {
|
|
|
888
1257
|
priority: (0, args_1.getFlag)(flags, 'priority') || null,
|
|
889
1258
|
project_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'projects')),
|
|
890
1259
|
start_date: (0, args_1.getFlag)(flags, 'start-date') || null,
|
|
891
|
-
|
|
1260
|
+
...(descriptionPayload && !chunkDescriptionAfterCreate
|
|
1261
|
+
? descriptionPayload
|
|
1262
|
+
: {}),
|
|
1263
|
+
};
|
|
1264
|
+
const response = await client.tasks.create(workspaceId, createPayload);
|
|
1265
|
+
if (descriptionPayload && chunkDescriptionAfterCreate) {
|
|
1266
|
+
await (0, task_description_1.updateTaskDescriptionWithBestTransport)({
|
|
1267
|
+
client,
|
|
1268
|
+
payload: descriptionPayload,
|
|
1269
|
+
taskId: response.task.id,
|
|
1270
|
+
workspaceId,
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
(0, render_1.render)(response, { group, json });
|
|
892
1274
|
return;
|
|
893
1275
|
}
|
|
894
1276
|
if (action === 'update') {
|
|
895
1277
|
const selection = await (0, selection_1.selectTaskId)(client, config, workspaceId, flags, json, firstId);
|
|
896
1278
|
config = selection.config;
|
|
897
|
-
const
|
|
1279
|
+
const descriptionPayload = await (0, task_description_1.getTaskDescriptionPayloadFromFlags)(flags);
|
|
1280
|
+
const taskUpdatePayload = getTaskUpdatePayload(flags);
|
|
1281
|
+
const hasTaskUpdatePayload = Object.keys(taskUpdatePayload).length > 0;
|
|
1282
|
+
let response;
|
|
1283
|
+
if (hasTaskUpdatePayload || !descriptionPayload) {
|
|
1284
|
+
response = await client.tasks.update(workspaceId, selection.taskId, taskUpdatePayload);
|
|
1285
|
+
}
|
|
1286
|
+
if (descriptionPayload) {
|
|
1287
|
+
response = await (0, task_description_1.updateTaskDescriptionWithBestTransport)({
|
|
1288
|
+
client,
|
|
1289
|
+
payload: descriptionPayload,
|
|
1290
|
+
taskId: selection.taskId,
|
|
1291
|
+
workspaceId,
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
898
1294
|
await renderTaskMutationResult({
|
|
899
1295
|
client,
|
|
900
1296
|
displayKey: getIdentifierDisplayKey(firstId),
|