@wspc/cli 0.0.7 → 0.0.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/cli.js +166 -39
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/spec/openapi.json +2225 -799
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
|
-
import { Command as
|
|
4
|
+
import { Command as Command55 } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/generated/cli/invite/accept.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -1021,6 +1021,20 @@ var pushTest = (options) => (options.client ?? client).post({
|
|
|
1021
1021
|
...options.headers
|
|
1022
1022
|
}
|
|
1023
1023
|
});
|
|
1024
|
+
var todoCommentList = (options) => (options.client ?? client).get({
|
|
1025
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1026
|
+
url: "/todo/items/{id}/comments",
|
|
1027
|
+
...options
|
|
1028
|
+
});
|
|
1029
|
+
var todoCommentCreate = (options) => (options.client ?? client).post({
|
|
1030
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1031
|
+
url: "/todo/items/{id}/comments",
|
|
1032
|
+
...options,
|
|
1033
|
+
headers: {
|
|
1034
|
+
"Content-Type": "application/json",
|
|
1035
|
+
...options.headers
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1024
1038
|
var projectList = (options) => (options?.client ?? client).get({
|
|
1025
1039
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1026
1040
|
url: "/todo/projects",
|
|
@@ -1059,6 +1073,20 @@ var todoTypeList = (options) => (options.client ?? client).get({
|
|
|
1059
1073
|
url: "/todo/types",
|
|
1060
1074
|
...options
|
|
1061
1075
|
});
|
|
1076
|
+
var todoCommentDelete = (options) => (options.client ?? client).delete({
|
|
1077
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1078
|
+
url: "/todo/comments/{id}",
|
|
1079
|
+
...options
|
|
1080
|
+
});
|
|
1081
|
+
var todoCommentUpdate = (options) => (options.client ?? client).patch({
|
|
1082
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1083
|
+
url: "/todo/comments/{id}",
|
|
1084
|
+
...options,
|
|
1085
|
+
headers: {
|
|
1086
|
+
"Content-Type": "application/json",
|
|
1087
|
+
...options.headers
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1062
1090
|
var todoDelete = (options) => (options.client ?? client).delete({
|
|
1063
1091
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1064
1092
|
url: "/todo/items/{id}",
|
|
@@ -1178,9 +1206,9 @@ var ConfigStore = class {
|
|
|
1178
1206
|
};
|
|
1179
1207
|
|
|
1180
1208
|
// src/version.ts
|
|
1181
|
-
var VERSION = "0.0.
|
|
1182
|
-
var SPEC_SHA = "
|
|
1183
|
-
var SPEC_FETCHED_AT = "2026-06-
|
|
1209
|
+
var VERSION = "0.0.8";
|
|
1210
|
+
var SPEC_SHA = "9735a255";
|
|
1211
|
+
var SPEC_FETCHED_AT = "2026-06-08T08:32:23.241Z";
|
|
1184
1212
|
var API_BASE = "https://api.wspc.ai";
|
|
1185
1213
|
|
|
1186
1214
|
// src/index.ts
|
|
@@ -2581,9 +2609,58 @@ var pushTestCommand = new Command33("test").description("Send a test push notifi
|
|
|
2581
2609
|
}
|
|
2582
2610
|
});
|
|
2583
2611
|
|
|
2584
|
-
// src/generated/cli/todo/
|
|
2612
|
+
// src/generated/cli/todo/comment/add.ts
|
|
2585
2613
|
import { Command as Command34 } from "commander";
|
|
2586
|
-
var
|
|
2614
|
+
var todoCommentCreateCommand = new Command34("add").description("Add a comment to a todo").argument("<id>", "id").argument("<content>", "content").action(async (id, content, opts) => {
|
|
2615
|
+
const client2 = await loadSdkClient();
|
|
2616
|
+
const result = await todoCommentCreate({
|
|
2617
|
+
client: client2._rawClient,
|
|
2618
|
+
path: {
|
|
2619
|
+
id
|
|
2620
|
+
},
|
|
2621
|
+
body: {
|
|
2622
|
+
content
|
|
2623
|
+
}
|
|
2624
|
+
});
|
|
2625
|
+
if (result.error || !result.response?.ok) {
|
|
2626
|
+
process.stderr.write(
|
|
2627
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2628
|
+
`
|
|
2629
|
+
);
|
|
2630
|
+
process.exitCode = 1;
|
|
2631
|
+
return;
|
|
2632
|
+
}
|
|
2633
|
+
render({ kind: "todo_comment_create", display: { "shape": "object", "format": { "id": "id-short", "todo_id": "id-short", "user_id": "id-short", "content": "truncate", "created_at": "relative-time", "updated_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
2634
|
+
});
|
|
2635
|
+
|
|
2636
|
+
// src/generated/cli/todo/comment/ls.ts
|
|
2637
|
+
import { Command as Command35 } from "commander";
|
|
2638
|
+
var todoCommentListCommand = new Command35("ls").description("List comments on a todo").argument("<id>", "id").option("--order <value>", "order").option("--include-deleted <value>", "include_deleted").action(async (id, opts) => {
|
|
2639
|
+
const client2 = await loadSdkClient();
|
|
2640
|
+
const result = await todoCommentList({
|
|
2641
|
+
client: client2._rawClient,
|
|
2642
|
+
path: {
|
|
2643
|
+
id
|
|
2644
|
+
},
|
|
2645
|
+
query: {
|
|
2646
|
+
order: opts.order,
|
|
2647
|
+
include_deleted: opts.includeDeleted
|
|
2648
|
+
}
|
|
2649
|
+
});
|
|
2650
|
+
if (result.error || !result.response?.ok) {
|
|
2651
|
+
process.stderr.write(
|
|
2652
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2653
|
+
`
|
|
2654
|
+
);
|
|
2655
|
+
process.exitCode = 1;
|
|
2656
|
+
return;
|
|
2657
|
+
}
|
|
2658
|
+
render({ kind: "todo_comment_list", display: { "shape": "list", "columns": ["id", "content", "created_at"], "format": { "id": "id-short", "content": "truncate", "created_at": "relative-time" }, "emptyMessage": "no comments" } }, result.data);
|
|
2659
|
+
});
|
|
2660
|
+
|
|
2661
|
+
// src/generated/cli/todo/project/add.ts
|
|
2662
|
+
import { Command as Command36 } from "commander";
|
|
2663
|
+
var projectCreateCommand = new Command36("add").description("Create a project").argument("<name>", "name").option("--default-todo-type-id <value>", "default_todo_type_id").action(async (name, opts) => {
|
|
2587
2664
|
const client2 = await loadSdkClient();
|
|
2588
2665
|
const result = await projectCreate({
|
|
2589
2666
|
client: client2._rawClient,
|
|
@@ -2604,8 +2681,8 @@ var projectCreateCommand = new Command34("add").description("Create a project").
|
|
|
2604
2681
|
});
|
|
2605
2682
|
|
|
2606
2683
|
// src/generated/cli/todo/project/ls.ts
|
|
2607
|
-
import { Command as
|
|
2608
|
-
var projectListCommand = new
|
|
2684
|
+
import { Command as Command37 } from "commander";
|
|
2685
|
+
var projectListCommand = new Command37("ls").description("List projects").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
2609
2686
|
const client2 = await loadSdkClient();
|
|
2610
2687
|
const result = await projectList({
|
|
2611
2688
|
client: client2._rawClient,
|
|
@@ -2625,8 +2702,8 @@ var projectListCommand = new Command35("ls").description("List projects").option
|
|
|
2625
2702
|
});
|
|
2626
2703
|
|
|
2627
2704
|
// src/generated/cli/todo/rule/ls.ts
|
|
2628
|
-
import { Command as
|
|
2629
|
-
var recurrenceRuleListCommand = new
|
|
2705
|
+
import { Command as Command38 } from "commander";
|
|
2706
|
+
var recurrenceRuleListCommand = new Command38("ls").description("List recurring todo rules").option("--project-id <value>", "project_id").option("--user-id <value>", "user_id").action(async (opts) => {
|
|
2630
2707
|
const client2 = await loadSdkClient();
|
|
2631
2708
|
const result = await recurrenceRuleList({
|
|
2632
2709
|
client: client2._rawClient,
|
|
@@ -2647,8 +2724,8 @@ var recurrenceRuleListCommand = new Command36("ls").description("List recurring
|
|
|
2647
2724
|
});
|
|
2648
2725
|
|
|
2649
2726
|
// src/generated/cli/todo/add.ts
|
|
2650
|
-
import { Command as
|
|
2651
|
-
var todoCreateCommand = new
|
|
2727
|
+
import { Command as Command39 } from "commander";
|
|
2728
|
+
var todoCreateCommand = new Command39("add").description("Create a todo").argument("<title>", "title").option("-p, --project <value>", "project_id").option("--description <value>", "description").option("--parent-id <value>", "parent_id").option("--status <value>", "status").option("--due-at <value>", "due_at").option("--type-id <value>", "type_id").option("--custom-fields <value>", "custom_fields").action(async (title, opts) => {
|
|
2652
2729
|
const client2 = await loadSdkClient();
|
|
2653
2730
|
const result = await todoCreate({
|
|
2654
2731
|
client: client2._rawClient,
|
|
@@ -2675,8 +2752,8 @@ var todoCreateCommand = new Command37("add").description("Create a todo").argume
|
|
|
2675
2752
|
});
|
|
2676
2753
|
|
|
2677
2754
|
// src/generated/cli/todo/ls.ts
|
|
2678
|
-
import { Command as
|
|
2679
|
-
var todoListCommand = new
|
|
2755
|
+
import { Command as Command40 } from "commander";
|
|
2756
|
+
var todoListCommand = new Command40("ls").description("List todos with filters").option("-p, --project <value>", "project_id").option("--user-id <value>", "user_id").option("--parent-id <value>", "parent_id").option("-s, --status <value>", "status").option("--include-deleted <value>", "include_deleted").option("--include-templates <value>", "include_templates").option("--due-after <value>", "due_after").option("--due-before <value>", "due_before").option("--type-id <value>", "type_id").option("--sort-by <value>", "sort_by").option("--order <value>", "order").option("--include-orphan-fields <value>", "include_orphan_fields").action(async (opts) => {
|
|
2680
2757
|
const client2 = await loadSdkClient();
|
|
2681
2758
|
const result = await todoList({
|
|
2682
2759
|
client: client2._rawClient,
|
|
@@ -2707,8 +2784,8 @@ var todoListCommand = new Command38("ls").description("List todos with filters")
|
|
|
2707
2784
|
});
|
|
2708
2785
|
|
|
2709
2786
|
// src/generated/cli/todo/type/ls.ts
|
|
2710
|
-
import { Command as
|
|
2711
|
-
var todoTypeListCommand = new
|
|
2787
|
+
import { Command as Command41 } from "commander";
|
|
2788
|
+
var todoTypeListCommand = new Command41("ls").description("List todo types").option("--project-id <value>", "project_id").option("--user-id <value>", "user_id").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
2712
2789
|
const client2 = await loadSdkClient();
|
|
2713
2790
|
const result = await todoTypeList({
|
|
2714
2791
|
client: client2._rawClient,
|
|
@@ -2729,9 +2806,54 @@ var todoTypeListCommand = new Command39("ls").description("List todo types").opt
|
|
|
2729
2806
|
render({ kind: "todo_type_list", display: { "shape": "list", "columns": ["id", "label"], "format": { "id": "id-short", "label": "truncate" }, "emptyMessage": "no todo types" } }, result.data);
|
|
2730
2807
|
});
|
|
2731
2808
|
|
|
2809
|
+
// src/generated/cli/todo/comment/rm.ts
|
|
2810
|
+
import { Command as Command42 } from "commander";
|
|
2811
|
+
var todoCommentDeleteCommand = new Command42("rm").description("Soft-delete a comment").argument("<id>", "id").action(async (id, opts) => {
|
|
2812
|
+
const client2 = await loadSdkClient();
|
|
2813
|
+
const result = await todoCommentDelete({
|
|
2814
|
+
client: client2._rawClient,
|
|
2815
|
+
path: {
|
|
2816
|
+
id
|
|
2817
|
+
}
|
|
2818
|
+
});
|
|
2819
|
+
if (result.error || !result.response?.ok) {
|
|
2820
|
+
process.stderr.write(
|
|
2821
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2822
|
+
`
|
|
2823
|
+
);
|
|
2824
|
+
process.exitCode = 1;
|
|
2825
|
+
return;
|
|
2826
|
+
}
|
|
2827
|
+
render({ kind: "todo_comment_delete", display: { "shape": "object", "format": { "id": "id-short", "todo_id": "id-short", "user_id": "id-short", "content": "truncate", "created_at": "relative-time", "updated_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
2828
|
+
});
|
|
2829
|
+
|
|
2830
|
+
// src/generated/cli/todo/comment/edit.ts
|
|
2831
|
+
import { Command as Command43 } from "commander";
|
|
2832
|
+
var todoCommentUpdateCommand = new Command43("edit").description("Edit a comment").argument("<id>", "id").argument("<content>", "content").action(async (id, content, opts) => {
|
|
2833
|
+
const client2 = await loadSdkClient();
|
|
2834
|
+
const result = await todoCommentUpdate({
|
|
2835
|
+
client: client2._rawClient,
|
|
2836
|
+
path: {
|
|
2837
|
+
id
|
|
2838
|
+
},
|
|
2839
|
+
body: {
|
|
2840
|
+
content
|
|
2841
|
+
}
|
|
2842
|
+
});
|
|
2843
|
+
if (result.error || !result.response?.ok) {
|
|
2844
|
+
process.stderr.write(
|
|
2845
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2846
|
+
`
|
|
2847
|
+
);
|
|
2848
|
+
process.exitCode = 1;
|
|
2849
|
+
return;
|
|
2850
|
+
}
|
|
2851
|
+
render({ kind: "todo_comment_update", display: { "shape": "object", "format": { "id": "id-short", "todo_id": "id-short", "user_id": "id-short", "content": "truncate", "created_at": "relative-time", "updated_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
2852
|
+
});
|
|
2853
|
+
|
|
2732
2854
|
// src/generated/cli/todo/rm.ts
|
|
2733
|
-
import { Command as
|
|
2734
|
-
var todoDeleteCommand = new
|
|
2855
|
+
import { Command as Command44 } from "commander";
|
|
2856
|
+
var todoDeleteCommand = new Command44("rm").description("Soft-delete a todo").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--cascade <value>", "cascade").action(async (id, opts) => {
|
|
2735
2857
|
const client2 = await loadSdkClient();
|
|
2736
2858
|
const result = await todoDelete({
|
|
2737
2859
|
client: client2._rawClient,
|
|
@@ -2755,8 +2877,8 @@ var todoDeleteCommand = new Command40("rm").description("Soft-delete a todo").ar
|
|
|
2755
2877
|
});
|
|
2756
2878
|
|
|
2757
2879
|
// src/generated/cli/todo/show.ts
|
|
2758
|
-
import { Command as
|
|
2759
|
-
var todoGetCommand = new
|
|
2880
|
+
import { Command as Command45 } from "commander";
|
|
2881
|
+
var todoGetCommand = new Command45("show").description("Get a todo by id").argument("<id>", "id").option("--include-deleted <value>", "include_deleted").option("--include-orphan-fields <value>", "include_orphan_fields").action(async (id, opts) => {
|
|
2760
2882
|
const client2 = await loadSdkClient();
|
|
2761
2883
|
const result = await todoGet({
|
|
2762
2884
|
client: client2._rawClient,
|
|
@@ -2780,8 +2902,8 @@ var todoGetCommand = new Command41("show").description("Get a todo by id").argum
|
|
|
2780
2902
|
});
|
|
2781
2903
|
|
|
2782
2904
|
// src/generated/cli/todo/update.ts
|
|
2783
|
-
import { Command as
|
|
2784
|
-
var todoUpdateCommand = new
|
|
2905
|
+
import { Command as Command46 } from "commander";
|
|
2906
|
+
var todoUpdateCommand = new Command46("update").description("Update a todo").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--title <value>", "title").option("--description <value>", "description").option("--parent-id <value>", "parent_id").option("--status <value>", "status").option("--due-at <value>", "due_at").option("--type-id <value>", "type_id").option("--custom-fields <value>", "custom_fields").option("--user-id <value>", "user_id").action(async (id, opts) => {
|
|
2785
2907
|
const client2 = await loadSdkClient();
|
|
2786
2908
|
const result = await todoUpdate({
|
|
2787
2909
|
client: client2._rawClient,
|
|
@@ -2857,6 +2979,11 @@ function registerGeneratedCommands(root) {
|
|
|
2857
2979
|
root_push_config.addCommand(pushConfigGetCommand);
|
|
2858
2980
|
root_push.addCommand(pushTestCommand);
|
|
2859
2981
|
const root_todo = root.command("todo").description("todo commands");
|
|
2982
|
+
const root_todo_comment = root_todo.command("comment").description("comment commands");
|
|
2983
|
+
root_todo_comment.addCommand(todoCommentCreateCommand);
|
|
2984
|
+
root_todo_comment.addCommand(todoCommentListCommand);
|
|
2985
|
+
root_todo_comment.addCommand(todoCommentDeleteCommand);
|
|
2986
|
+
root_todo_comment.addCommand(todoCommentUpdateCommand);
|
|
2860
2987
|
const root_todo_project = root_todo.command("project").description("project commands");
|
|
2861
2988
|
root_todo_project.addCommand(projectCreateCommand);
|
|
2862
2989
|
root_todo_project.addCommand(projectListCommand);
|
|
@@ -2872,7 +2999,7 @@ function registerGeneratedCommands(root) {
|
|
|
2872
2999
|
}
|
|
2873
3000
|
|
|
2874
3001
|
// src/handwritten/commands/login.ts
|
|
2875
|
-
import { Command as
|
|
3002
|
+
import { Command as Command47 } from "commander";
|
|
2876
3003
|
|
|
2877
3004
|
// src/handwritten/auth/device-flow.ts
|
|
2878
3005
|
var DEFAULT_SLEEP = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -3051,7 +3178,7 @@ async function runLogin(opts) {
|
|
|
3051
3178
|
}
|
|
3052
3179
|
|
|
3053
3180
|
// src/handwritten/commands/login.ts
|
|
3054
|
-
var loginCommand = new
|
|
3181
|
+
var loginCommand = new Command47("login").description("Log in via OAuth device flow (default) or API key").option("--api-key <key>", "Log in with a wspc API key (escape hatch)").option("--json", "Emit machine-readable events to stdout").action(async (opts) => {
|
|
3055
3182
|
const store = new ConfigStore();
|
|
3056
3183
|
const output = opts.json ? { write: () => {
|
|
3057
3184
|
}, writeJson: (e) => process.stdout.write(JSON.stringify(e) + "\n") } : {
|
|
@@ -3068,7 +3195,7 @@ var loginCommand = new Command43("login").description("Log in via OAuth device f
|
|
|
3068
3195
|
});
|
|
3069
3196
|
|
|
3070
3197
|
// src/handwritten/commands/logout.ts
|
|
3071
|
-
import { Command as
|
|
3198
|
+
import { Command as Command48 } from "commander";
|
|
3072
3199
|
|
|
3073
3200
|
// src/handwritten/auth/logout.ts
|
|
3074
3201
|
async function runLogout(opts) {
|
|
@@ -3096,7 +3223,7 @@ async function runLogout(opts) {
|
|
|
3096
3223
|
}
|
|
3097
3224
|
|
|
3098
3225
|
// src/handwritten/commands/logout.ts
|
|
3099
|
-
var logoutCommand = new
|
|
3226
|
+
var logoutCommand = new Command48("logout").description("Log out an account (default: the active account in the current env)").argument("[email]", "Email of the account to log out").option("--all", "Log out every account in the current env").action(async (email, opts) => {
|
|
3100
3227
|
const res = await runLogout({ store: new ConfigStore(), email, all: opts.all });
|
|
3101
3228
|
if (res.removed.length === 0) {
|
|
3102
3229
|
process.stdout.write("nothing to log out\n");
|
|
@@ -3109,7 +3236,7 @@ var logoutCommand = new Command44("logout").description("Log out an account (def
|
|
|
3109
3236
|
});
|
|
3110
3237
|
|
|
3111
3238
|
// src/handwritten/commands/whoami.ts
|
|
3112
|
-
import { Command as
|
|
3239
|
+
import { Command as Command49 } from "commander";
|
|
3113
3240
|
var ENV_DISPLAY = {
|
|
3114
3241
|
shape: "object",
|
|
3115
3242
|
fields: ["name", "api_base", "account", "actor", "agent_label"]
|
|
@@ -3141,7 +3268,7 @@ async function backfillActiveEmail(store, envName, email, userId) {
|
|
|
3141
3268
|
await store.write(cfg);
|
|
3142
3269
|
}
|
|
3143
3270
|
}
|
|
3144
|
-
var whoamiCommand = new
|
|
3271
|
+
var whoamiCommand = new Command49("whoami").description("Show the active env, signed-in account, and organization").action(async () => {
|
|
3145
3272
|
const store = new ConfigStore();
|
|
3146
3273
|
const config = await store.read();
|
|
3147
3274
|
let resolved;
|
|
@@ -3194,8 +3321,8 @@ function printLoggedOut() {
|
|
|
3194
3321
|
}
|
|
3195
3322
|
|
|
3196
3323
|
// src/handwritten/commands/config.ts
|
|
3197
|
-
import { Command as
|
|
3198
|
-
var configCommand = new
|
|
3324
|
+
import { Command as Command50 } from "commander";
|
|
3325
|
+
var configCommand = new Command50("config").description("Manage wspc local config");
|
|
3199
3326
|
registerRenderer("config_show", (data) => {
|
|
3200
3327
|
const d = data;
|
|
3201
3328
|
if (d.envs.length === 0) {
|
|
@@ -3266,7 +3393,7 @@ configCommand.command("use <env>").description("Switch current_env").action(asyn
|
|
|
3266
3393
|
});
|
|
3267
3394
|
|
|
3268
3395
|
// src/handwritten/commands/account.ts
|
|
3269
|
-
import { Command as
|
|
3396
|
+
import { Command as Command51 } from "commander";
|
|
3270
3397
|
async function listAccounts(store) {
|
|
3271
3398
|
const c = await store.read();
|
|
3272
3399
|
const envName = c.current_env;
|
|
@@ -3307,7 +3434,7 @@ registerRenderer("account_ls", (data) => {
|
|
|
3307
3434
|
]);
|
|
3308
3435
|
process.stdout.write(table(headers, body));
|
|
3309
3436
|
});
|
|
3310
|
-
var accountCommand = new
|
|
3437
|
+
var accountCommand = new Command51("account").description("Manage logged-in accounts");
|
|
3311
3438
|
accountCommand.command("ls").description("List accounts in the current env (active marked with \u2713)").action(async () => {
|
|
3312
3439
|
const accounts = await listAccounts(new ConfigStore());
|
|
3313
3440
|
render({ kind: "account_ls" }, { accounts });
|
|
@@ -3319,7 +3446,7 @@ accountCommand.command("switch <email>").description("Set the active account for
|
|
|
3319
3446
|
});
|
|
3320
3447
|
|
|
3321
3448
|
// src/handwritten/commands/todo-done.ts
|
|
3322
|
-
import { Command as
|
|
3449
|
+
import { Command as Command52 } from "commander";
|
|
3323
3450
|
var TODO_UPDATE_DISPLAY = {
|
|
3324
3451
|
shape: "object",
|
|
3325
3452
|
format: {
|
|
@@ -3337,7 +3464,7 @@ var TODO_UPDATE_DISPLAY = {
|
|
|
3337
3464
|
deleted_at: "relative-time"
|
|
3338
3465
|
}
|
|
3339
3466
|
};
|
|
3340
|
-
var todoDoneCommand = new
|
|
3467
|
+
var todoDoneCommand = new Command52("done").description("Mark a todo done (sugar for `update <id> --status done`)").argument("<id>", "Todo id").action(async (id) => {
|
|
3341
3468
|
const client2 = await loadSdkClient();
|
|
3342
3469
|
const result = await todoUpdate({
|
|
3343
3470
|
client: client2._rawClient,
|
|
@@ -3356,7 +3483,7 @@ var todoDoneCommand = new Command48("done").description("Mark a todo done (sugar
|
|
|
3356
3483
|
});
|
|
3357
3484
|
|
|
3358
3485
|
// src/handwritten/commands/email/send.ts
|
|
3359
|
-
import { Command as
|
|
3486
|
+
import { Command as Command53 } from "commander";
|
|
3360
3487
|
import { readFile, stat } from "fs/promises";
|
|
3361
3488
|
import { basename } from "path";
|
|
3362
3489
|
|
|
@@ -3414,7 +3541,7 @@ async function resolveAttachment(input) {
|
|
|
3414
3541
|
`--attach ${input}: neither a readable file nor a valid <prefix>_<ulid>:<idx> reference.`
|
|
3415
3542
|
);
|
|
3416
3543
|
}
|
|
3417
|
-
var sendCommand = new
|
|
3544
|
+
var sendCommand = new Command53("send").description("Send an outbound email").requiredOption("--from <alias-email>", "alias email to send from").option("--to <addr...>", "recipient address (repeatable)", []).option("--subject <text>", "subject").option("--text <body>", "plain-text body").option("--text-file <path>", "read text body from file").option("--reply <id>", "inbound email id to reply to").option("--attach <path-or-ref...>", "attachment (file path or eml_xxx:idx)", []).requiredOption("--idempotency-key <key>", "idempotency key").action(async (opts) => {
|
|
3418
3545
|
const isReply = Boolean(opts.reply);
|
|
3419
3546
|
const to = opts.to;
|
|
3420
3547
|
const attachInputs = opts.attach;
|
|
@@ -3501,7 +3628,7 @@ var sendCommand = new Command49("send").description("Send an outbound email").re
|
|
|
3501
3628
|
});
|
|
3502
3629
|
|
|
3503
3630
|
// src/handwritten/commands/email/attachment.ts
|
|
3504
|
-
import { Command as
|
|
3631
|
+
import { Command as Command54 } from "commander";
|
|
3505
3632
|
import { createWriteStream } from "fs";
|
|
3506
3633
|
import { Readable } from "stream";
|
|
3507
3634
|
import { pipeline } from "stream/promises";
|
|
@@ -3518,7 +3645,7 @@ function parseContentDispositionFilename(header) {
|
|
|
3518
3645
|
}
|
|
3519
3646
|
|
|
3520
3647
|
// src/handwritten/commands/email/attachment.ts
|
|
3521
|
-
var attachmentCommand = new
|
|
3648
|
+
var attachmentCommand = new Command54("attachment").description("Download an inbound email attachment by index").argument("<email-id>").argument("<idx>").option("--output <path>", "output file path").option("--include-deleted", "allow downloads from soft-deleted parent emails").action(async (emailId, idxArg, opts) => {
|
|
3522
3649
|
const idx = Number(idxArg);
|
|
3523
3650
|
if (!Number.isInteger(idx) || idx < 0) {
|
|
3524
3651
|
process.stderr.write(`<idx> must be a non-negative integer (got "${idxArg}")
|
|
@@ -3551,7 +3678,7 @@ var attachmentCommand = new Command50("attachment").description("Download an inb
|
|
|
3551
3678
|
|
|
3552
3679
|
// src/cli.ts
|
|
3553
3680
|
function buildProgram() {
|
|
3554
|
-
const program = new
|
|
3681
|
+
const program = new Command55().name("wspc").description("Official CLI for wspc.ai").version(`wspc ${VERSION} (spec ${SPEC_SHA}, fetched ${SPEC_FETCHED_AT})`).option("--json", "Output raw JSON (machine-readable)").option("--account <email>", "Run as a specific account (overrides the active account)").hook("preAction", (_thisCommand, actionCommand) => {
|
|
3555
3682
|
const globals = actionCommand.optsWithGlobals();
|
|
3556
3683
|
if (globals.json) process.env.WSPC_OUTPUT = "json";
|
|
3557
3684
|
if (globals.account) process.env.WSPC_ACCOUNT = String(globals.account);
|