@lih-x-x/kmr 1.0.66 → 1.0.68
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/cli.js +34 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,9 +6,9 @@ async function checkUpdate() {
|
|
|
6
6
|
try {
|
|
7
7
|
const res = await fetch(`https://registry.npmjs.org/${"@lih-x-x/kmr"}/latest`, { signal: AbortSignal.timeout(3e3) });
|
|
8
8
|
const data = await res.json();
|
|
9
|
-
if (data.version && data.version !== "1.0.
|
|
9
|
+
if (data.version && data.version !== "1.0.68") {
|
|
10
10
|
console.log(`
|
|
11
|
-
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.
|
|
11
|
+
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.68"} \u2192 ${data.version}`);
|
|
12
12
|
console.log(` \u8FD0\u884C npm install -g ${"@lih-x-x/kmr"} \u66F4\u65B0
|
|
13
13
|
`);
|
|
14
14
|
}
|
|
@@ -56,7 +56,7 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
56
56
|
kmr --help \u663E\u793A\u5E2E\u52A9
|
|
57
57
|
`);
|
|
58
58
|
} else if (command === "--version" || command === "-v") {
|
|
59
|
-
console.log("1.0.
|
|
59
|
+
console.log("1.0.68");
|
|
60
60
|
} else if (command === "list") {
|
|
61
61
|
const { loadConfig } = await import("./config-WIQGW5OC.js");
|
|
62
62
|
const { JsonStore } = await import("./jsonStore-AL73KEUG.js");
|
|
@@ -200,7 +200,14 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
200
200
|
if (!record) {
|
|
201
201
|
console.error(`\u26A0\uFE0F \u672A\u627E\u5230\u4F1A\u8BAE\u8BB0\u5F55 "${meetingId}"\uFF0C\u4EFB\u52A1\u672A\u5173\u8054\u4FDD\u5B58`);
|
|
202
202
|
} else {
|
|
203
|
-
|
|
203
|
+
const todoIdx = record.todos.length;
|
|
204
|
+
record.todos = [...record.todos, {
|
|
205
|
+
content: desc ? `${summary}\uFF1A${desc}` : summary,
|
|
206
|
+
owner: assignee || "",
|
|
207
|
+
deadline: due || "",
|
|
208
|
+
status: "open"
|
|
209
|
+
}];
|
|
210
|
+
record.createdTasks = [...record.createdTasks || [], { ...taskEntry, todoIndex: todoIdx }];
|
|
204
211
|
await store.save(record);
|
|
205
212
|
console.log(` \u5DF2\u5173\u8054\u5230\u4F1A\u8BAE: ${record.summary.title}`);
|
|
206
213
|
}
|
|
@@ -222,7 +229,14 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
222
229
|
rawContent: ""
|
|
223
230
|
};
|
|
224
231
|
}
|
|
225
|
-
|
|
232
|
+
const todoIdx = standalone.todos.length;
|
|
233
|
+
standalone.todos = [...standalone.todos || [], {
|
|
234
|
+
content: desc ? `${summary}\uFF1A${desc}` : summary,
|
|
235
|
+
owner: assignee || "",
|
|
236
|
+
deadline: due || "",
|
|
237
|
+
status: "open"
|
|
238
|
+
}];
|
|
239
|
+
standalone.createdTasks = [...standalone.createdTasks || [], { ...taskEntry, todoIndex: todoIdx }];
|
|
226
240
|
await store.save(standalone);
|
|
227
241
|
console.log(` \u5DF2\u4FDD\u5B58\u5230\u72EC\u7ACB\u4EFB\u52A1\u8BB0\u5F55`);
|
|
228
242
|
}
|
|
@@ -276,18 +290,22 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
276
290
|
}
|
|
277
291
|
await taskCreator.updateTask(taskId, { summary, due, assigneeOpenId });
|
|
278
292
|
console.log(`\u2705 \u4EFB\u52A1\u5DF2\u66F4\u65B0: ${taskId}`);
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
293
|
+
const all = await store.list();
|
|
294
|
+
for (const record of all) {
|
|
295
|
+
if (!record.createdTasks) continue;
|
|
296
|
+
const taskIdx = record.createdTasks.findIndex((t) => t.taskId === taskId);
|
|
297
|
+
if (taskIdx === -1) continue;
|
|
298
|
+
const task = record.createdTasks[taskIdx];
|
|
299
|
+
if (summary) task.summary = summary;
|
|
300
|
+
const todoIdx = task.todoIndex !== void 0 ? task.todoIndex : record.todos.findIndex((t) => t.content.startsWith(task.summary) || task.summary.startsWith(t.content.split("\uFF1A")[0]));
|
|
301
|
+
if (todoIdx >= 0 && record.todos[todoIdx]) {
|
|
302
|
+
if (summary) record.todos[todoIdx].content = summary;
|
|
303
|
+
if (due) record.todos[todoIdx].deadline = due;
|
|
304
|
+
if (assignee) record.todos[todoIdx].owner = assignee;
|
|
290
305
|
}
|
|
306
|
+
await store.save(record);
|
|
307
|
+
console.log(` \u672C\u5730\u8BB0\u5F55\u5DF2\u540C\u6B65\u66F4\u65B0`);
|
|
308
|
+
break;
|
|
291
309
|
}
|
|
292
310
|
} else if (command === "find") {
|
|
293
311
|
const query = argv.slice(3).join(" ");
|