@dypt/cli 0.1.9 → 0.1.10

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 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.9",
12
+ version: "0.1.10",
13
13
  description: "Command-line interface for dypt task management",
14
14
  license: "SEE LICENSE IN LICENSE",
15
15
  homepage: "https://dypt.app",
@@ -893,7 +893,7 @@ async function runNoteSet(input, deps) {
893
893
  async function runTaskCreate(input, deps) {
894
894
  const result = await deps.createTask({
895
895
  title: input.title,
896
- parentId: input.parentId ? Number(input.parentId) : null,
896
+ parentId: input.parentId ?? null,
897
897
  priority: input.priority,
898
898
  deadline: input.deadline,
899
899
  expectedTimeTaken: input.expectedTimeTaken
@@ -2897,7 +2897,7 @@ function buildCli() {
2897
2897
  if (taskNote) {
2898
2898
  addTaskNoteCommands(taskNote);
2899
2899
  }
2900
- task.command("create").argument("<title>").option("--parent <taskId>", "parent task id").addOption(
2900
+ task.command("create").argument("<title>").option("--parent <ref>", 'parent task id, title, or "root"').addOption(
2901
2901
  new Option(
2902
2902
  "--priority <priority>",
2903
2903
  `task priority (${taskPriorityChoices.join("|")})`
@@ -2907,7 +2907,6 @@ function buildCli() {
2907
2907
  await runTaskCreate(
2908
2908
  {
2909
2909
  title,
2910
- parentId: options.parent,
2911
2910
  priority: normalizePriority(options.priority),
2912
2911
  deadline: options.deadline ? parseDateOption(options.deadline, "start") : void 0,
2913
2912
  expectedTimeTaken: parseIntegerOption(
@@ -2917,7 +2916,15 @@ function buildCli() {
2917
2916
  json: Boolean(options.json)
2918
2917
  },
2919
2918
  {
2920
- createTask: (input) => withCliApi((api) => api.createTask(input)),
2919
+ createTask: (input) => withCliApi(
2920
+ async (api) => api.createTask({
2921
+ ...input,
2922
+ parentId: await resolveParentId(
2923
+ options.parent,
2924
+ (ref) => resolveTaskId(api, ref)
2925
+ )
2926
+ })
2927
+ ),
2921
2928
  printJson,
2922
2929
  printTable
2923
2930
  }