@dypt/cli 0.1.6 → 0.1.8
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/dist/index.js +31 -13
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Argument, Command, Option } from "commander";
|
|
|
9
9
|
// package.json
|
|
10
10
|
var package_default = {
|
|
11
11
|
name: "@dypt/cli",
|
|
12
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.8",
|
|
13
13
|
description: "Command-line interface for dypt task management",
|
|
14
14
|
license: "SEE LICENSE IN LICENSE",
|
|
15
15
|
homepage: "https://dypt.app",
|
|
@@ -42,9 +42,9 @@ var package_default = {
|
|
|
42
42
|
typecheck: "tsc --noEmit"
|
|
43
43
|
},
|
|
44
44
|
dependencies: {
|
|
45
|
-
"@trpc/client": "^11.
|
|
46
|
-
commander: "^
|
|
47
|
-
"string-width": "^
|
|
45
|
+
"@trpc/client": "^11.17.0",
|
|
46
|
+
commander: "^14.0.3",
|
|
47
|
+
"string-width": "^8.2.1",
|
|
48
48
|
superjson: "^2.2.6"
|
|
49
49
|
},
|
|
50
50
|
devDependencies: {
|
|
@@ -2392,6 +2392,15 @@ async function resolveTaskId(api, ref) {
|
|
|
2392
2392
|
const matches = result.items ?? [];
|
|
2393
2393
|
return resolveTaskRefFromSearchMatches(ref, matches);
|
|
2394
2394
|
}
|
|
2395
|
+
async function resolveParentId(parentRef, resolveRef) {
|
|
2396
|
+
if (parentRef === void 0) {
|
|
2397
|
+
return void 0;
|
|
2398
|
+
}
|
|
2399
|
+
if (parentRef.toLowerCase() === "root") {
|
|
2400
|
+
return null;
|
|
2401
|
+
}
|
|
2402
|
+
return resolveRef(parentRef);
|
|
2403
|
+
}
|
|
2395
2404
|
function assertExclusiveHierarchyOptions(parent, scope) {
|
|
2396
2405
|
if (parent && scope) {
|
|
2397
2406
|
throw new Error("Use either --parent or --scope, not both");
|
|
@@ -2711,7 +2720,7 @@ function buildCli() {
|
|
|
2711
2720
|
{
|
|
2712
2721
|
ref,
|
|
2713
2722
|
json: Boolean(options.json),
|
|
2714
|
-
depth: options.depth
|
|
2723
|
+
depth: parseIntegerOption(options.depth, "depth", 0),
|
|
2715
2724
|
full: Boolean(options.full)
|
|
2716
2725
|
},
|
|
2717
2726
|
{
|
|
@@ -2960,7 +2969,6 @@ function buildCli() {
|
|
|
2960
2969
|
},
|
|
2961
2970
|
{
|
|
2962
2971
|
updateTask: (input) => withCliApi(async (api) => {
|
|
2963
|
-
const normalizedParentRef = input.parentRef?.toLowerCase() === "root" ? null : input.parentRef;
|
|
2964
2972
|
return api.updateTask({
|
|
2965
2973
|
taskId: await resolveTaskId(api, String(input.ref)),
|
|
2966
2974
|
title: input.title,
|
|
@@ -2970,11 +2978,13 @@ function buildCli() {
|
|
|
2970
2978
|
expectedTimeTaken: input.expectedTimeTaken ? Number(input.expectedTimeTaken) : void 0,
|
|
2971
2979
|
actualTimeTaken: input.actualTimeTaken ? Number(input.actualTimeTaken) : void 0,
|
|
2972
2980
|
archivedAt: input.archivedAt,
|
|
2973
|
-
parentId:
|
|
2981
|
+
parentId: await resolveParentId(
|
|
2982
|
+
input.parentRef,
|
|
2983
|
+
(ref2) => resolveTaskId(api, ref2)
|
|
2984
|
+
)
|
|
2974
2985
|
});
|
|
2975
2986
|
}),
|
|
2976
2987
|
previewTask: (input) => withCliApi(async (api) => {
|
|
2977
|
-
const normalizedParentRef = input.parentRef?.toLowerCase() === "root" ? null : input.parentRef;
|
|
2978
2988
|
return api.previewManyTasks({
|
|
2979
2989
|
taskIds: [await resolveTaskId(api, String(input.ref))],
|
|
2980
2990
|
status: normalizeStatus(input.status),
|
|
@@ -2983,7 +2993,10 @@ function buildCli() {
|
|
|
2983
2993
|
expectedTimeTaken: input.expectedTimeTaken ? Number(input.expectedTimeTaken) : void 0,
|
|
2984
2994
|
actualTimeTaken: input.actualTimeTaken ? Number(input.actualTimeTaken) : void 0,
|
|
2985
2995
|
archivedAt: input.archivedAt,
|
|
2986
|
-
parentId:
|
|
2996
|
+
parentId: await resolveParentId(
|
|
2997
|
+
input.parentRef,
|
|
2998
|
+
(ref2) => resolveTaskId(api, ref2)
|
|
2999
|
+
)
|
|
2987
3000
|
});
|
|
2988
3001
|
}),
|
|
2989
3002
|
printJson,
|
|
@@ -3044,7 +3057,6 @@ function buildCli() {
|
|
|
3044
3057
|
const taskIds = await Promise.all(
|
|
3045
3058
|
input.refs.map((ref) => resolveTaskId(api, ref))
|
|
3046
3059
|
);
|
|
3047
|
-
const normalizedParentRef = input.parentRef?.toLowerCase() === "root" ? null : input.parentRef;
|
|
3048
3060
|
return api.updateManyTasks({
|
|
3049
3061
|
taskIds,
|
|
3050
3062
|
status: normalizeStatus(input.status),
|
|
@@ -3053,14 +3065,16 @@ function buildCli() {
|
|
|
3053
3065
|
expectedTimeTaken: input.expectedTimeTaken ? Number(input.expectedTimeTaken) : void 0,
|
|
3054
3066
|
actualTimeTaken: input.actualTimeTaken ? Number(input.actualTimeTaken) : void 0,
|
|
3055
3067
|
archivedAt: input.archivedAt,
|
|
3056
|
-
parentId:
|
|
3068
|
+
parentId: await resolveParentId(
|
|
3069
|
+
input.parentRef,
|
|
3070
|
+
(ref) => resolveTaskId(api, ref)
|
|
3071
|
+
)
|
|
3057
3072
|
});
|
|
3058
3073
|
}),
|
|
3059
3074
|
previewManyTasks: (input) => withCliApi(async (api) => {
|
|
3060
3075
|
const taskIds = await Promise.all(
|
|
3061
3076
|
input.refs.map((ref) => resolveTaskId(api, ref))
|
|
3062
3077
|
);
|
|
3063
|
-
const normalizedParentRef = input.parentRef?.toLowerCase() === "root" ? null : input.parentRef;
|
|
3064
3078
|
return api.previewManyTasks({
|
|
3065
3079
|
taskIds,
|
|
3066
3080
|
status: normalizeStatus(input.status),
|
|
@@ -3069,7 +3083,10 @@ function buildCli() {
|
|
|
3069
3083
|
expectedTimeTaken: input.expectedTimeTaken ? Number(input.expectedTimeTaken) : void 0,
|
|
3070
3084
|
actualTimeTaken: input.actualTimeTaken ? Number(input.actualTimeTaken) : void 0,
|
|
3071
3085
|
archivedAt: input.archivedAt,
|
|
3072
|
-
parentId:
|
|
3086
|
+
parentId: await resolveParentId(
|
|
3087
|
+
input.parentRef,
|
|
3088
|
+
(ref) => resolveTaskId(api, ref)
|
|
3089
|
+
)
|
|
3073
3090
|
});
|
|
3074
3091
|
}),
|
|
3075
3092
|
printJson,
|
|
@@ -3312,6 +3329,7 @@ if (isCliEntrypoint(process.argv[1], import.meta.url)) {
|
|
|
3312
3329
|
export {
|
|
3313
3330
|
buildCli,
|
|
3314
3331
|
isCliEntrypoint,
|
|
3332
|
+
resolveParentId,
|
|
3315
3333
|
resolveTaskRefFromSearchMatches,
|
|
3316
3334
|
runCli
|
|
3317
3335
|
};
|