@krodak/clickup-cli 1.19.1 → 1.19.3
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.3",
|
|
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}/pagelisting`
|
|
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";
|
|
@@ -1062,7 +1062,8 @@ async function fetchTimeInStatus(config, taskId) {
|
|
|
1062
1062
|
} catch (err) {
|
|
1063
1063
|
if (err instanceof Error && /No data for TIS/i.test(err.message)) {
|
|
1064
1064
|
throw new Error(
|
|
1065
|
-
'The "Time in Status" ClickApp is not enabled for this workspace.\nEnable it in ClickUp: Space Settings \u2192 ClickApps \u2192 Time in Status'
|
|
1065
|
+
'The "Time in Status" ClickApp is not enabled for this workspace.\nEnable it in ClickUp: Space Settings \u2192 ClickApps \u2192 Time in Status',
|
|
1066
|
+
{ cause: err }
|
|
1066
1067
|
);
|
|
1067
1068
|
}
|
|
1068
1069
|
throw err;
|
|
@@ -3049,7 +3050,6 @@ async function installSkillInteractive() {
|
|
|
3049
3050
|
const installed = [];
|
|
3050
3051
|
if (isTTY()) {
|
|
3051
3052
|
const { checkbox } = await import("@inquirer/prompts");
|
|
3052
|
-
const preselected = targets.filter((t) => t.detected).map((t) => t.name);
|
|
3053
3053
|
const selected = await checkbox({
|
|
3054
3054
|
message: "Install skill for which agents?",
|
|
3055
3055
|
choices: targets.map((t) => ({
|
|
@@ -4619,7 +4619,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4619
4619
|
wrapAction(async (opts) => {
|
|
4620
4620
|
const config = loadConfig(getProfileName());
|
|
4621
4621
|
if (opts.list === "sprint:current") {
|
|
4622
|
-
const { resolveActiveSprintListId } = await import("./sprint-
|
|
4622
|
+
const { resolveActiveSprintListId } = await import("./sprint-NLMMC4RB.js");
|
|
4623
4623
|
opts.list = await resolveActiveSprintListId(config);
|
|
4624
4624
|
}
|
|
4625
4625
|
if (opts.assignee === "me") {
|
|
@@ -4940,7 +4940,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4940
4940
|
wrapAction(async (taskId, opts) => {
|
|
4941
4941
|
const config = loadConfig(getProfileName());
|
|
4942
4942
|
if (opts.to === "sprint:current") {
|
|
4943
|
-
const { resolveActiveSprintListId } = await import("./sprint-
|
|
4943
|
+
const { resolveActiveSprintListId } = await import("./sprint-NLMMC4RB.js");
|
|
4944
4944
|
opts.to = await resolveActiveSprintListId(config);
|
|
4945
4945
|
}
|
|
4946
4946
|
const message = await moveTask(config, taskId, opts);
|