@krodak/clickup-cli 1.19.2 → 1.19.4
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clickup-cli",
|
|
3
3
|
"description": "ClickUp CLI skills for managing tasks, sprints, comments, checklists, custom fields, tags, and time tracking via the cup command",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Krzysztof Rodak"
|
|
7
7
|
},
|
|
@@ -122,6 +122,36 @@ var ClickUpClient = class {
|
|
|
122
122
|
async requestV3(path, options = {}) {
|
|
123
123
|
return this._fetch(BASE_URL_V3, path, options);
|
|
124
124
|
}
|
|
125
|
+
async requestV3Array(path) {
|
|
126
|
+
const res = await fetch(`${BASE_URL_V3}${path}`, {
|
|
127
|
+
signal: AbortSignal.timeout(3e4),
|
|
128
|
+
headers: { Authorization: this.apiToken }
|
|
129
|
+
});
|
|
130
|
+
if (res.status === 204 || res.headers.get("content-length") === "0") {
|
|
131
|
+
if (!res.ok) {
|
|
132
|
+
throw new Error(`ClickUp API error ${res.status}: ${res.statusText}`);
|
|
133
|
+
}
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
136
|
+
let parsed;
|
|
137
|
+
try {
|
|
138
|
+
parsed = await res.json();
|
|
139
|
+
} catch {
|
|
140
|
+
throw new Error(`ClickUp API error ${res.status}: response was not valid JSON`);
|
|
141
|
+
}
|
|
142
|
+
if (!res.ok) {
|
|
143
|
+
let errMsg = res.statusText;
|
|
144
|
+
if (isRecord(parsed)) {
|
|
145
|
+
const raw = parsed.err ?? parsed.error ?? parsed.ECODE;
|
|
146
|
+
if (typeof raw === "string") errMsg = raw;
|
|
147
|
+
}
|
|
148
|
+
throw new Error(`ClickUp API error ${res.status}: ${errMsg}`);
|
|
149
|
+
}
|
|
150
|
+
if (!Array.isArray(parsed)) {
|
|
151
|
+
throw new Error("Unexpected API response: expected JSON array");
|
|
152
|
+
}
|
|
153
|
+
return parsed;
|
|
154
|
+
}
|
|
125
155
|
async getMe() {
|
|
126
156
|
if (this.meCache) return this.meCache;
|
|
127
157
|
const data = await this.request(
|
|
@@ -674,20 +704,12 @@ var ClickUpClient = class {
|
|
|
674
704
|
return this.requestV3(`/workspaces/${workspaceId}/docs/${docId}`);
|
|
675
705
|
}
|
|
676
706
|
async getDocPageListing(workspaceId, docId) {
|
|
677
|
-
|
|
678
|
-
`/workspaces/${workspaceId}/docs/${docId}/pages`
|
|
679
|
-
);
|
|
680
|
-
return readCollectionField(
|
|
681
|
-
data,
|
|
682
|
-
"pages",
|
|
683
|
-
"doc page listing"
|
|
684
|
-
);
|
|
707
|
+
return this.requestV3Array(`/workspaces/${workspaceId}/docs/${docId}/pages`);
|
|
685
708
|
}
|
|
686
709
|
async getDocPages(workspaceId, docId) {
|
|
687
|
-
|
|
710
|
+
return this.requestV3Array(
|
|
688
711
|
`/workspaces/${workspaceId}/docs/${docId}/pages?content_format=text/md`
|
|
689
712
|
);
|
|
690
|
-
return readCollectionField(data, "pages", "doc pages");
|
|
691
713
|
}
|
|
692
714
|
async getGoals(teamId) {
|
|
693
715
|
const data = await this.request(`/team/${teamId}/goal`);
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
showDetailsAndOpen,
|
|
50
50
|
summarize,
|
|
51
51
|
writeConfig
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-HCGKTH6V.js";
|
|
53
53
|
|
|
54
54
|
// src/index.ts
|
|
55
55
|
import { realpathSync as realpathSync2 } from "fs";
|
|
@@ -4569,7 +4569,13 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4569
4569
|
}
|
|
4570
4570
|
})
|
|
4571
4571
|
);
|
|
4572
|
-
program.command("update <taskId>").description("Update a task").option("-n, --name <text>", "New task name").option("-d, --description <text>", "New description (markdown supported)").option(
|
|
4572
|
+
program.command("update <taskId>").description("Update a task").option("-n, --name <text>", "New task name").option("-d, --description <text>", "New description (markdown supported)").option(
|
|
4573
|
+
"-s, --status <status>",
|
|
4574
|
+
'New status (fuzzy matched, e.g. "prog" matches "in progress")'
|
|
4575
|
+
).option("--priority <level>", "Priority: urgent, high, normal, low (or 1-4)").option("--due-date <date>", 'Due date (YYYY-MM-DD, or "none"/"clear" to remove)').option("--start-date <date>", "Start date (YYYY-MM-DD)").option(
|
|
4576
|
+
"--time-estimate <duration>",
|
|
4577
|
+
'Time estimate (e.g. "2h", "30m", "1h30m", "0" or "none" to clear)'
|
|
4578
|
+
).option("--assignee <userId>", 'Add assignee by user ID or "me"').option("--remove-assignee <userId>", 'Remove assignee by user ID or "me"').option("--parent <taskId>", "Set parent task (makes this a subtask)").option("--detach", "Remove parent task (promote subtask to top-level)").option("--archive", "Archive the task").option("--unarchive", "Unarchive the task").option("--field <nameAndValue...>", 'Set custom field: --field "Name" value').option("--json", "Force JSON output even in terminal").action(
|
|
4573
4579
|
wrapAction(
|
|
4574
4580
|
async (taskId, opts) => {
|
|
4575
4581
|
const config = loadConfig(getProfileName());
|
|
@@ -4615,11 +4621,11 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4615
4621
|
}
|
|
4616
4622
|
)
|
|
4617
4623
|
);
|
|
4618
|
-
program.command("create").description("Create a new task").option("-l, --list <listId>",
|
|
4624
|
+
program.command("create").description("Create a new task").option("-l, --list <listId>", 'Target list ID or "sprint:current" for active sprint').requiredOption("-n, --name <name>", "Task name").option("-d, --description <text>", "Task description (markdown supported)").option("-p, --parent <taskId>", "Parent task ID (list auto-detected from parent)").option("-s, --status <status>", "Initial status").option("--priority <level>", "Priority: urgent, high, normal, low (or 1-4)").option("--due-date <date>", "Due date (YYYY-MM-DD)").option("--start-date <date>", "Start date (YYYY-MM-DD)").option("--assignee <userId>", 'Assignee user ID or "me"').option("--tags <tags>", "Comma-separated tag names").option("--custom-item-id <id>", "Custom task type ID (use to create initiatives)").option("--time-estimate <duration>", 'Time estimate (e.g. "2h", "30m", "1h30m")').option("--template <id>", "Create from a task template (find IDs with cup templates)").option("--json", "Force JSON output even in terminal").action(
|
|
4619
4625
|
wrapAction(async (opts) => {
|
|
4620
4626
|
const config = loadConfig(getProfileName());
|
|
4621
4627
|
if (opts.list === "sprint:current") {
|
|
4622
|
-
const { resolveActiveSprintListId } = await import("./sprint-
|
|
4628
|
+
const { resolveActiveSprintListId } = await import("./sprint-NLMMC4RB.js");
|
|
4623
4629
|
opts.list = await resolveActiveSprintListId(config);
|
|
4624
4630
|
}
|
|
4625
4631
|
if (opts.assignee === "me") {
|
|
@@ -4936,11 +4942,11 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4936
4942
|
}
|
|
4937
4943
|
})
|
|
4938
4944
|
);
|
|
4939
|
-
program.command("move <taskId>").description("Add or remove a task from a list").option("--to <listId>",
|
|
4945
|
+
program.command("move <taskId>").description("Add or remove a task from a list").option("--to <listId>", 'Add task to this list (or "sprint:current" for active sprint)').option("--remove <listId>", "Remove task from this list").option("--json", "Force JSON output even in terminal").action(
|
|
4940
4946
|
wrapAction(async (taskId, opts) => {
|
|
4941
4947
|
const config = loadConfig(getProfileName());
|
|
4942
4948
|
if (opts.to === "sprint:current") {
|
|
4943
|
-
const { resolveActiveSprintListId } = await import("./sprint-
|
|
4949
|
+
const { resolveActiveSprintListId } = await import("./sprint-NLMMC4RB.js");
|
|
4944
4950
|
opts.to = await resolveActiveSprintListId(config);
|
|
4945
4951
|
}
|
|
4946
4952
|
const message = await moveTask(config, taskId, opts);
|