@wspc/cli 0.1.5 → 0.1.7
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 +382 -126
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/spec/openapi.json +3295 -1061
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 Command81 } from "commander";
|
|
5
5
|
import { realpathSync } from "fs";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
|
|
@@ -930,6 +930,15 @@ var eventIcsDownload = (options) => (options.client ?? client).get({
|
|
|
930
930
|
url: "/calendar/events/{filename}",
|
|
931
931
|
...options
|
|
932
932
|
});
|
|
933
|
+
var eventRestore = (options) => (options.client ?? client).post({
|
|
934
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
935
|
+
url: "/calendar/events/{id}/restore",
|
|
936
|
+
...options,
|
|
937
|
+
headers: {
|
|
938
|
+
"Content-Type": "application/json",
|
|
939
|
+
...options.headers
|
|
940
|
+
}
|
|
941
|
+
});
|
|
933
942
|
var driveLibraryList = (options) => (options?.client ?? client).get({
|
|
934
943
|
security: [{ scheme: "bearer", type: "http" }],
|
|
935
944
|
url: "/drive/libraries",
|
|
@@ -976,11 +985,30 @@ var driveLibraryUpdate = (options) => (options.client ?? client).patch({
|
|
|
976
985
|
...options.headers
|
|
977
986
|
}
|
|
978
987
|
});
|
|
988
|
+
var driveFileHistory = (options) => (options.client ?? client).get({
|
|
989
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
990
|
+
url: "/drive/libraries/{id}/files/history",
|
|
991
|
+
...options
|
|
992
|
+
});
|
|
979
993
|
var driveManifestGet = (options) => (options.client ?? client).get({
|
|
980
994
|
security: [{ scheme: "bearer", type: "http" }],
|
|
981
995
|
url: "/drive/libraries/{id}/manifest",
|
|
982
996
|
...options
|
|
983
997
|
});
|
|
998
|
+
var driveFileRestore = (options) => (options.client ?? client).post({
|
|
999
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1000
|
+
url: "/drive/libraries/{id}/files/restore",
|
|
1001
|
+
...options,
|
|
1002
|
+
headers: {
|
|
1003
|
+
"Content-Type": "application/json",
|
|
1004
|
+
...options.headers
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
var driveSearch = (options) => (options.client ?? client).get({
|
|
1008
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1009
|
+
url: "/drive/libraries/{id}/search",
|
|
1010
|
+
...options
|
|
1011
|
+
});
|
|
984
1012
|
var emailAliasList = (options) => (options?.client ?? client).get({
|
|
985
1013
|
security: [{ scheme: "bearer", type: "http" }],
|
|
986
1014
|
url: "/email/aliases",
|
|
@@ -1061,6 +1089,20 @@ var emailMarkUnread = (options) => (options.client ?? client).post({
|
|
|
1061
1089
|
...options.headers
|
|
1062
1090
|
}
|
|
1063
1091
|
});
|
|
1092
|
+
var emailAliasRestore = (options) => (options.client ?? client).post({
|
|
1093
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1094
|
+
url: "/email/aliases/{email}/restore",
|
|
1095
|
+
...options
|
|
1096
|
+
});
|
|
1097
|
+
var emailRestore = (options) => (options.client ?? client).post({
|
|
1098
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1099
|
+
url: "/email/messages/restore",
|
|
1100
|
+
...options,
|
|
1101
|
+
headers: {
|
|
1102
|
+
"Content-Type": "application/json",
|
|
1103
|
+
...options.headers
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1064
1106
|
var emailSend = (options) => (options.client ?? client).post({
|
|
1065
1107
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1066
1108
|
url: "/email/messages/send",
|
|
@@ -1220,6 +1262,15 @@ var todoUpdate = (options) => (options.client ?? client).patch({
|
|
|
1220
1262
|
...options.headers
|
|
1221
1263
|
}
|
|
1222
1264
|
});
|
|
1265
|
+
var todoRestore = (options) => (options.client ?? client).post({
|
|
1266
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1267
|
+
url: "/todo/items/{id}/restore",
|
|
1268
|
+
...options,
|
|
1269
|
+
headers: {
|
|
1270
|
+
"Content-Type": "application/json",
|
|
1271
|
+
...options.headers
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1223
1274
|
|
|
1224
1275
|
// src/handwritten/config/index.ts
|
|
1225
1276
|
import { promises as fs } from "fs";
|
|
@@ -1469,9 +1520,9 @@ function createConsistencyFetch(opts) {
|
|
|
1469
1520
|
}
|
|
1470
1521
|
|
|
1471
1522
|
// src/version.ts
|
|
1472
|
-
var VERSION = "0.1.
|
|
1473
|
-
var SPEC_SHA = "
|
|
1474
|
-
var SPEC_FETCHED_AT = "2026-06-
|
|
1523
|
+
var VERSION = "0.1.7";
|
|
1524
|
+
var SPEC_SHA = "bec760cd";
|
|
1525
|
+
var SPEC_FETCHED_AT = "2026-06-30T13:42:06.837Z";
|
|
1475
1526
|
var API_BASE = "https://api.wspc.ai";
|
|
1476
1527
|
|
|
1477
1528
|
// src/index.ts
|
|
@@ -1956,11 +2007,18 @@ function renderList(data, hints) {
|
|
|
1956
2007
|
const columns = pickColumns(first, hints?.columns);
|
|
1957
2008
|
const format = hints?.format ?? {};
|
|
1958
2009
|
const headers = columns.map((c) => c.toUpperCase());
|
|
1959
|
-
const rows = items.map(
|
|
1960
|
-
(item)
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
2010
|
+
const rows = items.map((item) => {
|
|
2011
|
+
const deleted = isRecord(item) && item.deleted_at != null;
|
|
2012
|
+
const cells = columns.map((col, ci) => {
|
|
2013
|
+
const raw = formatCell(
|
|
2014
|
+
isRecord(item) ? item[col] : void 0,
|
|
2015
|
+
format[col],
|
|
2016
|
+
hints?.enumColorMap?.[col]
|
|
2017
|
+
);
|
|
2018
|
+
return ci === 0 && deleted ? `\u2715 ${raw}` : raw;
|
|
2019
|
+
});
|
|
2020
|
+
return deleted ? cells.map((cell) => dim(cell)) : cells;
|
|
2021
|
+
});
|
|
1964
2022
|
process.stdout.write(table(headers, rows));
|
|
1965
2023
|
}
|
|
1966
2024
|
function pickColumns(first, hint) {
|
|
@@ -2607,7 +2665,7 @@ var eventCreateCommand = new Command16("add").description("Schedule a calendar e
|
|
|
2607
2665
|
|
|
2608
2666
|
// src/generated/cli/event/ls.ts
|
|
2609
2667
|
import { Command as Command17 } from "commander";
|
|
2610
|
-
var eventListCommand = new Command17("ls").description("List calendar events").option("--q <value>", "Optional full-text search across title, description, and location (case-insensitive substring).").option("--from <value>", "Inclusive lower bound on the event `start` (ISO datetime with offset, or ISO date-only). When ANY of `start_from`/`start_to`/`end_from`/`end_to` is provided, the implicit past filter is disabled.").option("--to <value>", "Inclusive upper bound on the event `start`.").option("--end-from <value>", "Inclusive lower bound on the event `end`.").option("--end-to <value>", "Inclusive upper bound on the event `end`.").option("--cursor <value>", "Opaque pagination cursor returned in `next_cursor` of a previous response.").option("--limit <value>", "Maximum number of events to return. Clamped to `[1, 200]`. Default is server-defined.").option("--include-deleted
|
|
2668
|
+
var eventListCommand = new Command17("ls").description("List calendar events").option("--q <value>", "Optional full-text search across title, description, and location (case-insensitive substring).").option("--from <value>", "Inclusive lower bound on the event `start` (ISO datetime with offset, or ISO date-only). When ANY of `start_from`/`start_to`/`end_from`/`end_to` is provided, the implicit past filter is disabled.").option("--to <value>", "Inclusive upper bound on the event `start`.").option("--end-from <value>", "Inclusive lower bound on the event `end`.").option("--end-to <value>", "Inclusive upper bound on the event `end`.").option("--cursor <value>", "Opaque pagination cursor returned in `next_cursor` of a previous response.").option("--limit <value>", "Maximum number of events to return. Clamped to `[1, 200]`. Default is server-defined.").option("--include-deleted", "include_deleted").option("--include-past <value>", "When omitted or `false`, events whose `end` is before now are hidden. Pass `true` to include them. Ignored when any of `start_from`/`start_to`/`end_from`/`end_to` is provided \u2014 explicit time bounds always win.").option("--tz <zone>", "IANA timezone for relative time parsing").action(async (opts) => {
|
|
2611
2669
|
const zone = resolveTimezone(opts.tz);
|
|
2612
2670
|
let fromValue;
|
|
2613
2671
|
if (opts.from !== void 0) {
|
|
@@ -2766,9 +2824,33 @@ var eventIcsDownloadCommand = new Command21("ics").description("Download event a
|
|
|
2766
2824
|
render({ kind: "event_ics_download", display: { "shape": "raw" } }, result.data);
|
|
2767
2825
|
});
|
|
2768
2826
|
|
|
2769
|
-
// src/generated/cli/
|
|
2827
|
+
// src/generated/cli/event/restore.ts
|
|
2770
2828
|
import { Command as Command22 } from "commander";
|
|
2771
|
-
var
|
|
2829
|
+
var eventRestoreCommand = new Command22("restore").description("Restore a soft-deleted event").argument("<id>", "id").option("--expected-version <value>", "Optional optimistic lock. Omit to let the server use the current version; pass only to fail with 409 `VERSION_CONFLICT` if someone else has mutated the event since you last read.").action(async (id, opts) => {
|
|
2830
|
+
const client2 = await loadSdkClient();
|
|
2831
|
+
const result = await eventRestore({
|
|
2832
|
+
client: client2._rawClient,
|
|
2833
|
+
path: {
|
|
2834
|
+
id
|
|
2835
|
+
},
|
|
2836
|
+
body: {
|
|
2837
|
+
expected_version: opts.expectedVersion
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
if (result.error || !result.response?.ok) {
|
|
2841
|
+
process.stderr.write(
|
|
2842
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2843
|
+
`
|
|
2844
|
+
);
|
|
2845
|
+
process.exitCode = 1;
|
|
2846
|
+
return;
|
|
2847
|
+
}
|
|
2848
|
+
render({ kind: "event_restore", display: { "shape": "object", "format": { "id": "id-short", "user_id": "id-short", "status": "status-badge", "start": "relative-time", "end": "relative-time", "created_at": "relative-time", "updated_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
2849
|
+
});
|
|
2850
|
+
|
|
2851
|
+
// src/generated/cli/drive/library/add.ts
|
|
2852
|
+
import { Command as Command23 } from "commander";
|
|
2853
|
+
var driveLibraryCreateCommand = new Command23("add").description("Create a drive library").argument("<name>", "name").action(async (name, opts) => {
|
|
2772
2854
|
const client2 = await loadSdkClient();
|
|
2773
2855
|
const result = await driveLibraryCreate({
|
|
2774
2856
|
client: client2._rawClient,
|
|
@@ -2788,8 +2870,8 @@ var driveLibraryCreateCommand = new Command22("add").description("Create a drive
|
|
|
2788
2870
|
});
|
|
2789
2871
|
|
|
2790
2872
|
// src/generated/cli/drive/library/ls.ts
|
|
2791
|
-
import { Command as
|
|
2792
|
-
var driveLibraryListCommand = new
|
|
2873
|
+
import { Command as Command24 } from "commander";
|
|
2874
|
+
var driveLibraryListCommand = new Command24("ls").description("List drive libraries").option("--limit <value>", "limit").option("--cursor <value>", "cursor").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
2793
2875
|
const client2 = await loadSdkClient();
|
|
2794
2876
|
const result = await driveLibraryList({
|
|
2795
2877
|
client: client2._rawClient,
|
|
@@ -2811,8 +2893,8 @@ var driveLibraryListCommand = new Command23("ls").description("List drive librar
|
|
|
2811
2893
|
});
|
|
2812
2894
|
|
|
2813
2895
|
// src/generated/cli/drive/file/rm.ts
|
|
2814
|
-
import { Command as
|
|
2815
|
-
var driveFileDeleteCommand = new
|
|
2896
|
+
import { Command as Command25 } from "commander";
|
|
2897
|
+
var driveFileDeleteCommand = new Command25("rm").description("Delete a drive file").argument("<id>", "id").argument("<path>", "path").option("--expected-entry-version <value>", "expected_entry_version").action(async (id, path, opts) => {
|
|
2816
2898
|
const client2 = await loadSdkClient();
|
|
2817
2899
|
const result = await driveFileDelete({
|
|
2818
2900
|
client: client2._rawClient,
|
|
@@ -2836,8 +2918,8 @@ var driveFileDeleteCommand = new Command24("rm").description("Delete a drive fil
|
|
|
2836
2918
|
});
|
|
2837
2919
|
|
|
2838
2920
|
// src/generated/cli/drive/library/rm.ts
|
|
2839
|
-
import { Command as
|
|
2840
|
-
var driveLibraryDeleteCommand = new
|
|
2921
|
+
import { Command as Command26 } from "commander";
|
|
2922
|
+
var driveLibraryDeleteCommand = new Command26("rm").description("Delete a drive library").argument("<id>", "id").option("--expected-version <value>", "expected_version").action(async (id, opts) => {
|
|
2841
2923
|
const client2 = await loadSdkClient();
|
|
2842
2924
|
const result = await driveLibraryDelete({
|
|
2843
2925
|
client: client2._rawClient,
|
|
@@ -2860,8 +2942,8 @@ var driveLibraryDeleteCommand = new Command25("rm").description("Delete a drive
|
|
|
2860
2942
|
});
|
|
2861
2943
|
|
|
2862
2944
|
// src/generated/cli/drive/library/show.ts
|
|
2863
|
-
import { Command as
|
|
2864
|
-
var driveLibraryGetCommand = new
|
|
2945
|
+
import { Command as Command27 } from "commander";
|
|
2946
|
+
var driveLibraryGetCommand = new Command27("show").description("Get a drive library").argument("<id>", "id").action(async (id, opts) => {
|
|
2865
2947
|
const client2 = await loadSdkClient();
|
|
2866
2948
|
const result = await driveLibraryGet({
|
|
2867
2949
|
client: client2._rawClient,
|
|
@@ -2881,8 +2963,8 @@ var driveLibraryGetCommand = new Command26("show").description("Get a drive libr
|
|
|
2881
2963
|
});
|
|
2882
2964
|
|
|
2883
2965
|
// src/generated/cli/drive/library/update.ts
|
|
2884
|
-
import { Command as
|
|
2885
|
-
var driveLibraryUpdateCommand = new
|
|
2966
|
+
import { Command as Command28 } from "commander";
|
|
2967
|
+
var driveLibraryUpdateCommand = new Command28("update").description("Update a drive library").argument("<id>", "id").option("--name <value>", "name").option("--expected-version <value>", "expected_version").action(async (id, opts) => {
|
|
2886
2968
|
const client2 = await loadSdkClient();
|
|
2887
2969
|
const result = await driveLibraryUpdate({
|
|
2888
2970
|
client: client2._rawClient,
|
|
@@ -2905,9 +2987,33 @@ var driveLibraryUpdateCommand = new Command27("update").description("Update a dr
|
|
|
2905
2987
|
render({ kind: "drive_library_update", display: { "shape": "object", "columns": ["id", "name", "version", "file_count", "storage_bytes", "updated_at"] } }, result.data);
|
|
2906
2988
|
});
|
|
2907
2989
|
|
|
2990
|
+
// src/generated/cli/drive/file/history.ts
|
|
2991
|
+
import { Command as Command29 } from "commander";
|
|
2992
|
+
var driveFileHistoryCommand = new Command29("history").description("Get drive file version history").argument("<id>", "id").option("--path <value>", "path").action(async (id, opts) => {
|
|
2993
|
+
const client2 = await loadSdkClient();
|
|
2994
|
+
const result = await driveFileHistory({
|
|
2995
|
+
client: client2._rawClient,
|
|
2996
|
+
path: {
|
|
2997
|
+
id
|
|
2998
|
+
},
|
|
2999
|
+
query: {
|
|
3000
|
+
path: opts.path
|
|
3001
|
+
}
|
|
3002
|
+
});
|
|
3003
|
+
if (result.error || !result.response?.ok) {
|
|
3004
|
+
process.stderr.write(
|
|
3005
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
3006
|
+
`
|
|
3007
|
+
);
|
|
3008
|
+
process.exitCode = 1;
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3011
|
+
render({ kind: "drive_file_history", display: { "shape": "list", "dataPath": "versions", "columns": ["version_number", "version_id", "size_bytes", "created_at"], "emptyMessage": "no versions" } }, result.data);
|
|
3012
|
+
});
|
|
3013
|
+
|
|
2908
3014
|
// src/generated/cli/drive/manifest/get.ts
|
|
2909
|
-
import { Command as
|
|
2910
|
-
var driveManifestGetCommand = new
|
|
3015
|
+
import { Command as Command30 } from "commander";
|
|
3016
|
+
var driveManifestGetCommand = new Command30("get").description("Get a drive library manifest").argument("<id>", "id").option("--limit <value>", "limit").option("--cursor <value>", "cursor").option("--include-deleted <value>", "include_deleted").option("--path-prefix <value>", "path_prefix").action(async (id, opts) => {
|
|
2911
3017
|
const client2 = await loadSdkClient();
|
|
2912
3018
|
const result = await driveManifestGet({
|
|
2913
3019
|
client: client2._rawClient,
|
|
@@ -2917,7 +3023,8 @@ var driveManifestGetCommand = new Command28("get").description("Get a drive libr
|
|
|
2917
3023
|
query: {
|
|
2918
3024
|
limit: opts.limit,
|
|
2919
3025
|
cursor: opts.cursor,
|
|
2920
|
-
include_deleted: opts.includeDeleted
|
|
3026
|
+
include_deleted: opts.includeDeleted,
|
|
3027
|
+
path_prefix: opts.pathPrefix
|
|
2921
3028
|
}
|
|
2922
3029
|
});
|
|
2923
3030
|
if (result.error || !result.response?.ok) {
|
|
@@ -2931,9 +3038,59 @@ var driveManifestGetCommand = new Command28("get").description("Get a drive libr
|
|
|
2931
3038
|
render({ kind: "drive_manifest_get", display: { "shape": "list", "dataPath": "entries", "columns": ["path", "entry_version", "size_bytes", "updated_at"], "emptyMessage": "no drive files" } }, result.data);
|
|
2932
3039
|
});
|
|
2933
3040
|
|
|
3041
|
+
// src/generated/cli/drive/file/restore.ts
|
|
3042
|
+
import { Command as Command31 } from "commander";
|
|
3043
|
+
var driveFileRestoreCommand = new Command31("restore").description("Restore a drive file version").argument("<id>", "id").option("--path <value>", "path").option("--version-id <value>", "version_id").action(async (id, opts) => {
|
|
3044
|
+
const client2 = await loadSdkClient();
|
|
3045
|
+
const result = await driveFileRestore({
|
|
3046
|
+
client: client2._rawClient,
|
|
3047
|
+
path: {
|
|
3048
|
+
id
|
|
3049
|
+
},
|
|
3050
|
+
body: {
|
|
3051
|
+
path: opts.path,
|
|
3052
|
+
version_id: opts.versionId
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
3055
|
+
if (result.error || !result.response?.ok) {
|
|
3056
|
+
process.stderr.write(
|
|
3057
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
3058
|
+
`
|
|
3059
|
+
);
|
|
3060
|
+
process.exitCode = 1;
|
|
3061
|
+
return;
|
|
3062
|
+
}
|
|
3063
|
+
render({ kind: "drive_file_restore", display: { "shape": "object", "dataPath": "entry", "columns": ["path", "entry_version", "updated_at"] } }, result.data);
|
|
3064
|
+
});
|
|
3065
|
+
|
|
3066
|
+
// src/generated/cli/drive/search.ts
|
|
3067
|
+
import { Command as Command32 } from "commander";
|
|
3068
|
+
var driveSearchCommand = new Command32("search").description("Search drive library text").argument("<id>", "id").option("--query <value>", "query").option("--limit <value>", "limit").action(async (id, opts) => {
|
|
3069
|
+
const client2 = await loadSdkClient();
|
|
3070
|
+
const result = await driveSearch({
|
|
3071
|
+
client: client2._rawClient,
|
|
3072
|
+
path: {
|
|
3073
|
+
id
|
|
3074
|
+
},
|
|
3075
|
+
query: {
|
|
3076
|
+
query: opts.query,
|
|
3077
|
+
limit: opts.limit
|
|
3078
|
+
}
|
|
3079
|
+
});
|
|
3080
|
+
if (result.error || !result.response?.ok) {
|
|
3081
|
+
process.stderr.write(
|
|
3082
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
3083
|
+
`
|
|
3084
|
+
);
|
|
3085
|
+
process.exitCode = 1;
|
|
3086
|
+
return;
|
|
3087
|
+
}
|
|
3088
|
+
render({ kind: "drive_search", display: { "shape": "list", "dataPath": "results", "columns": ["path", "snippet"], "emptyMessage": "no matches" } }, result.data);
|
|
3089
|
+
});
|
|
3090
|
+
|
|
2934
3091
|
// src/generated/cli/alias/add.ts
|
|
2935
|
-
import { Command as
|
|
2936
|
-
var emailAliasCreateCommand = new
|
|
3092
|
+
import { Command as Command33 } from "commander";
|
|
3093
|
+
var emailAliasCreateCommand = new Command33("add").description("Create a receiving alias").argument("<email>", "email").action(async (email, opts) => {
|
|
2937
3094
|
const client2 = await loadSdkClient();
|
|
2938
3095
|
const result = await emailAliasCreate({
|
|
2939
3096
|
client: client2._rawClient,
|
|
@@ -2953,8 +3110,8 @@ var emailAliasCreateCommand = new Command29("add").description("Create a receivi
|
|
|
2953
3110
|
});
|
|
2954
3111
|
|
|
2955
3112
|
// src/generated/cli/alias/ls.ts
|
|
2956
|
-
import { Command as
|
|
2957
|
-
var emailAliasListCommand = new
|
|
3113
|
+
import { Command as Command34 } from "commander";
|
|
3114
|
+
var emailAliasListCommand = new Command34("ls").description("List the caller's aliases").option("--include-deleted", "include_deleted").action(async (opts) => {
|
|
2958
3115
|
const client2 = await loadSdkClient();
|
|
2959
3116
|
const result = await emailAliasList({
|
|
2960
3117
|
client: client2._rawClient,
|
|
@@ -2974,8 +3131,8 @@ var emailAliasListCommand = new Command30("ls").description("List the caller's a
|
|
|
2974
3131
|
});
|
|
2975
3132
|
|
|
2976
3133
|
// src/generated/cli/domain/add.ts
|
|
2977
|
-
import { Command as
|
|
2978
|
-
var emailDomainCreateCommand = new
|
|
3134
|
+
import { Command as Command35 } from "commander";
|
|
3135
|
+
var emailDomainCreateCommand = new Command35("add").description("Register a custom email domain").argument("<domain>", "domain").action(async (domain, opts) => {
|
|
2979
3136
|
const client2 = await loadSdkClient();
|
|
2980
3137
|
const result = await emailDomainCreate({
|
|
2981
3138
|
client: client2._rawClient,
|
|
@@ -2995,8 +3152,8 @@ var emailDomainCreateCommand = new Command31("add").description("Register a cust
|
|
|
2995
3152
|
});
|
|
2996
3153
|
|
|
2997
3154
|
// src/generated/cli/domain/ls.ts
|
|
2998
|
-
import { Command as
|
|
2999
|
-
var emailDomainListCommand = new
|
|
3155
|
+
import { Command as Command36 } from "commander";
|
|
3156
|
+
var emailDomainListCommand = new Command36("ls").description("List cached custom domains").action(async (opts) => {
|
|
3000
3157
|
const client2 = await loadSdkClient();
|
|
3001
3158
|
const result = await emailDomainList({
|
|
3002
3159
|
client: client2._rawClient
|
|
@@ -3013,8 +3170,8 @@ var emailDomainListCommand = new Command32("ls").description("List cached custom
|
|
|
3013
3170
|
});
|
|
3014
3171
|
|
|
3015
3172
|
// src/generated/cli/alias/rm.ts
|
|
3016
|
-
import { Command as
|
|
3017
|
-
var emailAliasDeleteCommand = new
|
|
3173
|
+
import { Command as Command37 } from "commander";
|
|
3174
|
+
var emailAliasDeleteCommand = new Command37("rm").description("Soft-delete an alias").argument("<email>", "email").action(async (email, opts) => {
|
|
3018
3175
|
const client2 = await loadSdkClient();
|
|
3019
3176
|
const result = await emailAliasDelete({
|
|
3020
3177
|
client: client2._rawClient,
|
|
@@ -3034,8 +3191,8 @@ var emailAliasDeleteCommand = new Command33("rm").description("Soft-delete an al
|
|
|
3034
3191
|
});
|
|
3035
3192
|
|
|
3036
3193
|
// src/generated/cli/email/rm.ts
|
|
3037
|
-
import { Command as
|
|
3038
|
-
var emailDeleteCommand = new
|
|
3194
|
+
import { Command as Command38 } from "commander";
|
|
3195
|
+
var emailDeleteCommand = new Command38("rm").description("Soft-delete inbound emails").argument("<id...>", "id").action(async (id, opts) => {
|
|
3039
3196
|
const idRaw = id;
|
|
3040
3197
|
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
3041
3198
|
const client2 = await loadSdkClient();
|
|
@@ -3057,8 +3214,8 @@ var emailDeleteCommand = new Command34("rm").description("Soft-delete inbound em
|
|
|
3057
3214
|
});
|
|
3058
3215
|
|
|
3059
3216
|
// src/generated/cli/domain/rm.ts
|
|
3060
|
-
import { Command as
|
|
3061
|
-
var emailDomainDeleteCommand = new
|
|
3217
|
+
import { Command as Command39 } from "commander";
|
|
3218
|
+
var emailDomainDeleteCommand = new Command39("rm").description("Delete a custom email domain").argument("<domain>", "domain").action(async (domain, opts) => {
|
|
3062
3219
|
const client2 = await loadSdkClient();
|
|
3063
3220
|
const result = await emailDomainDelete({
|
|
3064
3221
|
client: client2._rawClient,
|
|
@@ -3078,8 +3235,8 @@ var emailDomainDeleteCommand = new Command35("rm").description("Delete a custom
|
|
|
3078
3235
|
});
|
|
3079
3236
|
|
|
3080
3237
|
// src/generated/cli/domain/show.ts
|
|
3081
|
-
import { Command as
|
|
3082
|
-
var emailDomainGetCommand = new
|
|
3238
|
+
import { Command as Command40 } from "commander";
|
|
3239
|
+
var emailDomainGetCommand = new Command40("show").description("Get one cached custom domain").argument("<domain>", "domain").action(async (domain, opts) => {
|
|
3083
3240
|
const client2 = await loadSdkClient();
|
|
3084
3241
|
const result = await emailDomainGet({
|
|
3085
3242
|
client: client2._rawClient,
|
|
@@ -3099,8 +3256,8 @@ var emailDomainGetCommand = new Command36("show").description("Get one cached cu
|
|
|
3099
3256
|
});
|
|
3100
3257
|
|
|
3101
3258
|
// src/generated/cli/email/show.ts
|
|
3102
|
-
import { Command as
|
|
3103
|
-
var emailGetCommand = new
|
|
3259
|
+
import { Command as Command41 } from "commander";
|
|
3260
|
+
var emailGetCommand = new Command41("show").description("Get an inbound email by id").argument("<id>", "id").option("--include-html <value>", "When `true`, fetch the HTML body from R2 and include it as `html_body` in the response. Costs an extra R2 read; omit if you only need text.").option("--include-deleted <value>", "When `true`, allow fetching a soft-deleted email. Defaults to `false` (returns 404 for soft-deleted rows).").action(async (id, opts) => {
|
|
3104
3261
|
const client2 = await loadSdkClient();
|
|
3105
3262
|
const result = await emailGet({
|
|
3106
3263
|
client: client2._rawClient,
|
|
@@ -3124,8 +3281,8 @@ var emailGetCommand = new Command37("show").description("Get an inbound email by
|
|
|
3124
3281
|
});
|
|
3125
3282
|
|
|
3126
3283
|
// src/generated/cli/email/ls.ts
|
|
3127
|
-
import { Command as
|
|
3128
|
-
var emailListCommand = new
|
|
3284
|
+
import { Command as Command42 } from "commander";
|
|
3285
|
+
var emailListCommand = new Command42("ls").description("List inbound emails").option("--limit <value>", "Max items to return (clamped to 1-100). Defaults to 20 server-side.").option("--alias-email <value>", "If set, only return emails received on this full alias email address.").option("--unread-only <value>", "When `true`, only return emails with `is_read=false`.").option("--since <value>", "Unix epoch milliseconds \u2014 only return emails with `received_at >= since`. Useful for incremental sync.").option("--cursor <value>", "Opaque pagination cursor returned in `next_cursor` of a previous response.").option("--include-deleted", "include_deleted").action(async (opts) => {
|
|
3129
3286
|
const client2 = await loadSdkClient();
|
|
3130
3287
|
const result = await emailList({
|
|
3131
3288
|
client: client2._rawClient,
|
|
@@ -3150,8 +3307,8 @@ var emailListCommand = new Command38("ls").description("List inbound emails").op
|
|
|
3150
3307
|
});
|
|
3151
3308
|
|
|
3152
3309
|
// src/generated/cli/email/read.ts
|
|
3153
|
-
import { Command as
|
|
3154
|
-
var emailMarkReadCommand = new
|
|
3310
|
+
import { Command as Command43 } from "commander";
|
|
3311
|
+
var emailMarkReadCommand = new Command43("read").description("Mark inbound emails as read").argument("<id...>", "id").action(async (id, opts) => {
|
|
3155
3312
|
const idRaw = id;
|
|
3156
3313
|
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
3157
3314
|
const client2 = await loadSdkClient();
|
|
@@ -3173,8 +3330,8 @@ var emailMarkReadCommand = new Command39("read").description("Mark inbound email
|
|
|
3173
3330
|
});
|
|
3174
3331
|
|
|
3175
3332
|
// src/generated/cli/email/unread.ts
|
|
3176
|
-
import { Command as
|
|
3177
|
-
var emailMarkUnreadCommand = new
|
|
3333
|
+
import { Command as Command44 } from "commander";
|
|
3334
|
+
var emailMarkUnreadCommand = new Command44("unread").description("Mark inbound emails as unread").argument("<id...>", "id").action(async (id, opts) => {
|
|
3178
3335
|
const idRaw = id;
|
|
3179
3336
|
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
3180
3337
|
const client2 = await loadSdkClient();
|
|
@@ -3195,9 +3352,53 @@ var emailMarkUnreadCommand = new Command40("unread").description("Mark inbound e
|
|
|
3195
3352
|
render({ kind: "email_mark_unread", display: { "shape": "object", "format": {} } }, result.data);
|
|
3196
3353
|
});
|
|
3197
3354
|
|
|
3355
|
+
// src/generated/cli/alias/restore.ts
|
|
3356
|
+
import { Command as Command45 } from "commander";
|
|
3357
|
+
var emailAliasRestoreCommand = new Command45("restore").description("Restore a soft-deleted alias").argument("<email>", "email").action(async (email, opts) => {
|
|
3358
|
+
const client2 = await loadSdkClient();
|
|
3359
|
+
const result = await emailAliasRestore({
|
|
3360
|
+
client: client2._rawClient,
|
|
3361
|
+
path: {
|
|
3362
|
+
email
|
|
3363
|
+
}
|
|
3364
|
+
});
|
|
3365
|
+
if (result.error || !result.response?.ok) {
|
|
3366
|
+
process.stderr.write(
|
|
3367
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
3368
|
+
`
|
|
3369
|
+
);
|
|
3370
|
+
process.exitCode = 1;
|
|
3371
|
+
return;
|
|
3372
|
+
}
|
|
3373
|
+
render({ kind: "email_alias_restore", display: { "shape": "object", "format": { "id": "id-short", "user_id": "id-short", "created_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
3374
|
+
});
|
|
3375
|
+
|
|
3376
|
+
// src/generated/cli/email/restore.ts
|
|
3377
|
+
import { Command as Command46 } from "commander";
|
|
3378
|
+
var emailRestoreCommand = new Command46("restore").description("Restore soft-deleted inbound emails").argument("<id...>", "id").action(async (id, opts) => {
|
|
3379
|
+
const idRaw = id;
|
|
3380
|
+
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
3381
|
+
const client2 = await loadSdkClient();
|
|
3382
|
+
const result = await emailRestore({
|
|
3383
|
+
client: client2._rawClient,
|
|
3384
|
+
body: {
|
|
3385
|
+
ids
|
|
3386
|
+
}
|
|
3387
|
+
});
|
|
3388
|
+
if (result.error || !result.response?.ok) {
|
|
3389
|
+
process.stderr.write(
|
|
3390
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
3391
|
+
`
|
|
3392
|
+
);
|
|
3393
|
+
process.exitCode = 1;
|
|
3394
|
+
return;
|
|
3395
|
+
}
|
|
3396
|
+
render({ kind: "email_restore", display: { "shape": "object", "format": {} } }, result.data);
|
|
3397
|
+
});
|
|
3398
|
+
|
|
3198
3399
|
// src/generated/cli/domain/verify.ts
|
|
3199
|
-
import { Command as
|
|
3200
|
-
var emailDomainVerifyCommand = new
|
|
3400
|
+
import { Command as Command47 } from "commander";
|
|
3401
|
+
var emailDomainVerifyCommand = new Command47("verify").description("Verify a custom domain with the provider").argument("<domain>", "domain").action(async (domain, opts) => {
|
|
3201
3402
|
const client2 = await loadSdkClient();
|
|
3202
3403
|
const result = await emailDomainVerify({
|
|
3203
3404
|
client: client2._rawClient,
|
|
@@ -3217,8 +3418,8 @@ var emailDomainVerifyCommand = new Command41("verify").description("Verify a cus
|
|
|
3217
3418
|
});
|
|
3218
3419
|
|
|
3219
3420
|
// src/generated/cli/push/config/rm.ts
|
|
3220
|
-
import { Command as
|
|
3221
|
-
var pushConfigDeleteCommand = new
|
|
3421
|
+
import { Command as Command48 } from "commander";
|
|
3422
|
+
var pushConfigDeleteCommand = new Command48("rm").description("Remove a push transport").argument("<transport>", "transport").action(async (transport, opts) => {
|
|
3222
3423
|
const client2 = await loadSdkClient();
|
|
3223
3424
|
const result = await pushConfigDelete({
|
|
3224
3425
|
client: client2._rawClient,
|
|
@@ -3238,8 +3439,8 @@ var pushConfigDeleteCommand = new Command42("rm").description("Remove a push tra
|
|
|
3238
3439
|
});
|
|
3239
3440
|
|
|
3240
3441
|
// src/generated/cli/push/config/set.ts
|
|
3241
|
-
import { Command as
|
|
3242
|
-
var pushConfigSetCommand = new
|
|
3442
|
+
import { Command as Command49 } from "commander";
|
|
3443
|
+
var pushConfigSetCommand = new Command49("set").description("Register or update a push transport").option("--transport <value>", "Transport discriminator. `telegram` is the only supported value today \u2014 push delivers via a Telegram bot DM. Future transports (web push, iOS/Android, generic webhook) will be added as additional discriminator values.").option("--target-bot-username <value>", "Telegram bot username (with leading `@`, 5\u201332 alphanumeric/underscore characters). This is the bot the user has already started a chat with \u2014 wspc DMs notifications to it via the Telegram Bot API.").action(async (opts) => {
|
|
3243
3444
|
const client2 = await loadSdkClient();
|
|
3244
3445
|
const result = await pushConfigSet({
|
|
3245
3446
|
client: client2._rawClient,
|
|
@@ -3262,8 +3463,8 @@ var pushConfigSetCommand = new Command43("set").description("Register or update
|
|
|
3262
3463
|
});
|
|
3263
3464
|
|
|
3264
3465
|
// src/generated/cli/push/config/show.ts
|
|
3265
|
-
import { Command as
|
|
3266
|
-
var pushConfigGetCommand = new
|
|
3466
|
+
import { Command as Command50 } from "commander";
|
|
3467
|
+
var pushConfigGetCommand = new Command50("show").description("List the caller's push transports").action(async (opts) => {
|
|
3267
3468
|
const client2 = await loadSdkClient();
|
|
3268
3469
|
const result = await pushConfigGet({
|
|
3269
3470
|
client: client2._rawClient
|
|
@@ -3280,8 +3481,8 @@ var pushConfigGetCommand = new Command44("show").description("List the caller's
|
|
|
3280
3481
|
});
|
|
3281
3482
|
|
|
3282
3483
|
// src/generated/cli/push/test.ts
|
|
3283
|
-
import { Command as
|
|
3284
|
-
var pushTestCommand = new
|
|
3484
|
+
import { Command as Command51 } from "commander";
|
|
3485
|
+
var pushTestCommand = new Command51("test").description("Send a test push notification").option("--transport <value>", "Which transport to send the test message through. Must match a transport the caller has already registered via `POST /push/config`; today only `telegram` is supported.").action(async (opts) => {
|
|
3285
3486
|
const client2 = await loadSdkClient();
|
|
3286
3487
|
const result = await pushTest({
|
|
3287
3488
|
client: client2._rawClient,
|
|
@@ -3304,8 +3505,8 @@ var pushTestCommand = new Command45("test").description("Send a test push notifi
|
|
|
3304
3505
|
});
|
|
3305
3506
|
|
|
3306
3507
|
// src/generated/cli/todo/comment/add.ts
|
|
3307
|
-
import { Command as
|
|
3308
|
-
var todoCommentCreateCommand = new
|
|
3508
|
+
import { Command as Command52 } from "commander";
|
|
3509
|
+
var todoCommentCreateCommand = new Command52("add").description("Add a comment to a todo").argument("<id>", "id").argument("<content>", "content").action(async (id, content, opts) => {
|
|
3309
3510
|
const client2 = await loadSdkClient();
|
|
3310
3511
|
const result = await todoCommentCreate({
|
|
3311
3512
|
client: client2._rawClient,
|
|
@@ -3328,8 +3529,8 @@ var todoCommentCreateCommand = new Command46("add").description("Add a comment t
|
|
|
3328
3529
|
});
|
|
3329
3530
|
|
|
3330
3531
|
// src/generated/cli/todo/comment/ls.ts
|
|
3331
|
-
import { Command as
|
|
3332
|
-
var todoCommentListCommand = new
|
|
3532
|
+
import { Command as Command53 } from "commander";
|
|
3533
|
+
var todoCommentListCommand = new Command53("ls").description("List comments on a todo").argument("<id>", "id").option("--order <value>", "order").option("--include-deleted <value>", "include_deleted").option("--limit <value>", "Max comments to return. Clamped to [1, 200]. Default 50 server-side.").option("--cursor <value>", "Opaque pagination cursor returned in `next_cursor` of a previous response.").action(async (id, opts) => {
|
|
3333
3534
|
const client2 = await loadSdkClient();
|
|
3334
3535
|
const result = await todoCommentList({
|
|
3335
3536
|
client: client2._rawClient,
|
|
@@ -3355,8 +3556,8 @@ var todoCommentListCommand = new Command47("ls").description("List comments on a
|
|
|
3355
3556
|
});
|
|
3356
3557
|
|
|
3357
3558
|
// src/generated/cli/todo/project/add.ts
|
|
3358
|
-
import { Command as
|
|
3359
|
-
var projectCreateCommand = new
|
|
3559
|
+
import { Command as Command54 } from "commander";
|
|
3560
|
+
var projectCreateCommand = new Command54("add").description("Create a project").argument("<name>", "name").option("--default-todo-type-id <value>", "default_todo_type_id").action(async (name, opts) => {
|
|
3360
3561
|
const client2 = await loadSdkClient();
|
|
3361
3562
|
const result = await projectCreate({
|
|
3362
3563
|
client: client2._rawClient,
|
|
@@ -3377,8 +3578,8 @@ var projectCreateCommand = new Command48("add").description("Create a project").
|
|
|
3377
3578
|
});
|
|
3378
3579
|
|
|
3379
3580
|
// src/generated/cli/todo/project/ls.ts
|
|
3380
|
-
import { Command as
|
|
3381
|
-
var projectListCommand = new
|
|
3581
|
+
import { Command as Command55 } from "commander";
|
|
3582
|
+
var projectListCommand = new Command55("ls").description("List projects").option("--include-deleted <value>", "Set to `true` to include soft-deleted projects in the response.").action(async (opts) => {
|
|
3382
3583
|
const client2 = await loadSdkClient();
|
|
3383
3584
|
const result = await projectList({
|
|
3384
3585
|
client: client2._rawClient,
|
|
@@ -3398,8 +3599,8 @@ var projectListCommand = new Command49("ls").description("List projects").option
|
|
|
3398
3599
|
});
|
|
3399
3600
|
|
|
3400
3601
|
// src/generated/cli/todo/rule/add.ts
|
|
3401
|
-
import { Command as
|
|
3402
|
-
var recurrenceRuleCreateCommand = new
|
|
3602
|
+
import { Command as Command56 } from "commander";
|
|
3603
|
+
var recurrenceRuleCreateCommand = new Command56("add").description("Create a recurring todo rule").argument("<title>", "title").option("--rrule <value>", "rrule").option("--dtstart <value>", "dtstart").option("--description <value>", "description").option("--parent-id <value>", "parent_id").option("-p, --project <value>", "Project for the recurrence rule, its template todo, and all materialized instances. Must be an active project in the caller's organization.").option("-t, --type <value>", "type_id").action(async (title, opts) => {
|
|
3403
3604
|
const client2 = await loadSdkClient();
|
|
3404
3605
|
const result = await recurrenceRuleCreate({
|
|
3405
3606
|
client: client2._rawClient,
|
|
@@ -3425,8 +3626,8 @@ var recurrenceRuleCreateCommand = new Command50("add").description("Create a rec
|
|
|
3425
3626
|
});
|
|
3426
3627
|
|
|
3427
3628
|
// src/generated/cli/todo/rule/ls.ts
|
|
3428
|
-
import { Command as
|
|
3429
|
-
var recurrenceRuleListCommand = new
|
|
3629
|
+
import { Command as Command57 } from "commander";
|
|
3630
|
+
var recurrenceRuleListCommand = new Command57("ls").description("List recurring todo rules").option("--project-id <value>", "Project id filter. Required. Unknown, cross-organization, or soft-deleted project ids return NOT_FOUND.").option("--user-id <value>", "user_id").action(async (opts) => {
|
|
3430
3631
|
const client2 = await loadSdkClient();
|
|
3431
3632
|
const result = await recurrenceRuleList({
|
|
3432
3633
|
client: client2._rawClient,
|
|
@@ -3447,7 +3648,7 @@ var recurrenceRuleListCommand = new Command51("ls").description("List recurring
|
|
|
3447
3648
|
});
|
|
3448
3649
|
|
|
3449
3650
|
// src/generated/cli/todo/add.ts
|
|
3450
|
-
import { Command as
|
|
3651
|
+
import { Command as Command58 } from "commander";
|
|
3451
3652
|
|
|
3452
3653
|
// src/handwritten/utils/parse-json-field.ts
|
|
3453
3654
|
function parseJsonField(raw, flag) {
|
|
@@ -3462,7 +3663,7 @@ function parseJsonField(raw, flag) {
|
|
|
3462
3663
|
}
|
|
3463
3664
|
|
|
3464
3665
|
// src/generated/cli/todo/add.ts
|
|
3465
|
-
var todoCreateCommand = new
|
|
3666
|
+
var todoCreateCommand = new Command58("add").description("Create a todo").argument("<title>", "title").option("-p, --project <value>", "Project id to assign this todo to. It must be an active project in the caller's organization.").option("--description <value>", "Free-form details about the todo. Fully supports GFM Markdown (tables, strikethrough, task lists). Stored verbatim; client applications are responsible for rendering. Optional. Passing `null` is strictly rejected.").option("--parent-id <value>", "Parent todo ID (`tod_<ULID>`) to attach this todo as a child under another todo. Omit or pass `null` to create a root-level todo. Nesting is limited to one level; attempting to set a child todo as a parent will trigger `PARENT_IS_CHILD`. To make a subtask appear on every occurrence of a recurring rule, set this to that rule's template todo id (the template id returned when the rule is created); the server re-materializes future occurrences so each carries the subtask.").option("--status <value>", "Initial status of the todo. Omit to default to `open`. Allowed values: `open`, `in_progress`, `done`, `cancelled`.").option("--due-at <value>", 'Optional calendar due date in ISO date-only format (`YYYY-MM-DD`). Stored without timezone offsets to represent the same local calendar day globally. Pass `""` or omit the field to skip setting a due date. Passing `null` is strictly rejected.').option("--idempotency-key <value>", "idempotency_key").option("--type-id <value>", "Type id this todo belongs to. Omit to use the project's default type. When project_id is also supplied, the type must belong to the same project. New server-generated type ids use typ_<ULID>; legacy ids remain accepted.").option("--custom-fields <value>", "Custom field values keyed by the field's immutable `key` (not the human `label`). Each value must match the declared field type: string fields require string values, and string_array fields require string arrays. Providing a key that is not declared on the resolved todo type is strictly rejected with `UNDECLARED_FIELD`. Missing required fields that lack a default value are rejected with `FIELD_REQUIRED`. Defaults declared on the type are auto-applied at create time.").action(async (title, opts) => {
|
|
3466
3667
|
const client2 = await loadSdkClient();
|
|
3467
3668
|
const result = await todoCreate({
|
|
3468
3669
|
client: client2._rawClient,
|
|
@@ -3490,8 +3691,8 @@ var todoCreateCommand = new Command52("add").description("Create a todo").argume
|
|
|
3490
3691
|
});
|
|
3491
3692
|
|
|
3492
3693
|
// src/generated/cli/todo/ls.ts
|
|
3493
|
-
import { Command as
|
|
3494
|
-
var todoListCommand = new
|
|
3694
|
+
import { Command as Command59 } from "commander";
|
|
3695
|
+
var todoListCommand = new Command59("ls").description("List todos with filters").option("-p, --project <value>", "Filter by project. Required. Unknown, cross-organization, or soft-deleted project ids return NOT_FOUND.").option("--user-id <value>", "user_id").option("--parent-id <value>", "parent_id").option("-s, --status <value>", "status").option("--include-deleted", "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").option("--limit <value>", "Max todos to return. Clamped to [1, 200]. Default 50 server-side.").option("--cursor <value>", "Opaque pagination cursor returned in `next_cursor` of a previous response.").action(async (opts) => {
|
|
3495
3696
|
const client2 = await loadSdkClient();
|
|
3496
3697
|
const result = await todoList({
|
|
3497
3698
|
client: client2._rawClient,
|
|
@@ -3524,8 +3725,8 @@ var todoListCommand = new Command53("ls").description("List todos with filters")
|
|
|
3524
3725
|
});
|
|
3525
3726
|
|
|
3526
3727
|
// src/generated/cli/todo/type/ls.ts
|
|
3527
|
-
import { Command as
|
|
3528
|
-
var todoTypeListCommand = new
|
|
3728
|
+
import { Command as Command60 } from "commander";
|
|
3729
|
+
var todoTypeListCommand = new Command60("ls").description("List todo types").option("--project-id <value>", "Project id filter. Required. Unknown, cross-organization, or soft-deleted project ids return NOT_FOUND.").option("--user-id <value>", "user_id").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
3529
3730
|
const client2 = await loadSdkClient();
|
|
3530
3731
|
const result = await todoTypeList({
|
|
3531
3732
|
client: client2._rawClient,
|
|
@@ -3547,8 +3748,8 @@ var todoTypeListCommand = new Command54("ls").description("List todo types").opt
|
|
|
3547
3748
|
});
|
|
3548
3749
|
|
|
3549
3750
|
// src/generated/cli/todo/comment/rm.ts
|
|
3550
|
-
import { Command as
|
|
3551
|
-
var todoCommentDeleteCommand = new
|
|
3751
|
+
import { Command as Command61 } from "commander";
|
|
3752
|
+
var todoCommentDeleteCommand = new Command61("rm").description("Soft-delete a comment").argument("<id>", "id").action(async (id, opts) => {
|
|
3552
3753
|
const client2 = await loadSdkClient();
|
|
3553
3754
|
const result = await todoCommentDelete({
|
|
3554
3755
|
client: client2._rawClient,
|
|
@@ -3568,8 +3769,8 @@ var todoCommentDeleteCommand = new Command55("rm").description("Soft-delete a co
|
|
|
3568
3769
|
});
|
|
3569
3770
|
|
|
3570
3771
|
// src/generated/cli/todo/comment/edit.ts
|
|
3571
|
-
import { Command as
|
|
3572
|
-
var todoCommentUpdateCommand = new
|
|
3772
|
+
import { Command as Command62 } from "commander";
|
|
3773
|
+
var todoCommentUpdateCommand = new Command62("edit").description("Edit a comment").argument("<id>", "id").argument("<content>", "content").action(async (id, content, opts) => {
|
|
3573
3774
|
const client2 = await loadSdkClient();
|
|
3574
3775
|
const result = await todoCommentUpdate({
|
|
3575
3776
|
client: client2._rawClient,
|
|
@@ -3592,8 +3793,8 @@ var todoCommentUpdateCommand = new Command56("edit").description("Edit a comment
|
|
|
3592
3793
|
});
|
|
3593
3794
|
|
|
3594
3795
|
// src/generated/cli/todo/project/rm.ts
|
|
3595
|
-
import { Command as
|
|
3596
|
-
var projectDeleteCommand = new
|
|
3796
|
+
import { Command as Command63 } from "commander";
|
|
3797
|
+
var projectDeleteCommand = new Command63("rm").description("Soft-delete a project").argument("<id>", "id").action(async (id, opts) => {
|
|
3597
3798
|
const client2 = await loadSdkClient();
|
|
3598
3799
|
const result = await projectDelete({
|
|
3599
3800
|
client: client2._rawClient,
|
|
@@ -3613,8 +3814,8 @@ var projectDeleteCommand = new Command57("rm").description("Soft-delete a projec
|
|
|
3613
3814
|
});
|
|
3614
3815
|
|
|
3615
3816
|
// src/generated/cli/todo/rule/rm.ts
|
|
3616
|
-
import { Command as
|
|
3617
|
-
var recurrenceRuleDeleteCommand = new
|
|
3817
|
+
import { Command as Command64 } from "commander";
|
|
3818
|
+
var recurrenceRuleDeleteCommand = new Command64("rm").description("Delete a recurring todo rule").argument("<id>", "id").option("--expected-version <value>", "expected_version").action(async (id, opts) => {
|
|
3618
3819
|
const client2 = await loadSdkClient();
|
|
3619
3820
|
const result = await recurrenceRuleDelete({
|
|
3620
3821
|
client: client2._rawClient,
|
|
@@ -3637,8 +3838,8 @@ var recurrenceRuleDeleteCommand = new Command58("rm").description("Delete a recu
|
|
|
3637
3838
|
});
|
|
3638
3839
|
|
|
3639
3840
|
// src/generated/cli/todo/rule/show.ts
|
|
3640
|
-
import { Command as
|
|
3641
|
-
var recurrenceRuleGetCommand = new
|
|
3841
|
+
import { Command as Command65 } from "commander";
|
|
3842
|
+
var recurrenceRuleGetCommand = new Command65("show").description("Get a recurring todo rule").argument("<id>", "id").action(async (id, opts) => {
|
|
3642
3843
|
const client2 = await loadSdkClient();
|
|
3643
3844
|
const result = await recurrenceRuleGet({
|
|
3644
3845
|
client: client2._rawClient,
|
|
@@ -3658,8 +3859,8 @@ var recurrenceRuleGetCommand = new Command59("show").description("Get a recurrin
|
|
|
3658
3859
|
});
|
|
3659
3860
|
|
|
3660
3861
|
// src/generated/cli/todo/rm.ts
|
|
3661
|
-
import { Command as
|
|
3662
|
-
var todoDeleteCommand = new
|
|
3862
|
+
import { Command as Command66 } from "commander";
|
|
3863
|
+
var todoDeleteCommand = new Command66("rm").description("Soft-delete a todo").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--cascade <value>", "cascade").action(async (id, opts) => {
|
|
3663
3864
|
const client2 = await loadSdkClient();
|
|
3664
3865
|
const result = await todoDelete({
|
|
3665
3866
|
client: client2._rawClient,
|
|
@@ -3683,8 +3884,8 @@ var todoDeleteCommand = new Command60("rm").description("Soft-delete a todo").ar
|
|
|
3683
3884
|
});
|
|
3684
3885
|
|
|
3685
3886
|
// src/generated/cli/todo/show.ts
|
|
3686
|
-
import { Command as
|
|
3687
|
-
var todoGetCommand = new
|
|
3887
|
+
import { Command as Command67 } from "commander";
|
|
3888
|
+
var todoGetCommand = new Command67("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) => {
|
|
3688
3889
|
const client2 = await loadSdkClient();
|
|
3689
3890
|
const result = await todoGet({
|
|
3690
3891
|
client: client2._rawClient,
|
|
@@ -3709,8 +3910,8 @@ var todoGetCommand = new Command61("show").description("Get a todo by id").argum
|
|
|
3709
3910
|
});
|
|
3710
3911
|
|
|
3711
3912
|
// src/generated/cli/todo/update.ts
|
|
3712
|
-
import { Command as
|
|
3713
|
-
var todoUpdateCommand = new
|
|
3913
|
+
import { Command as Command68 } from "commander";
|
|
3914
|
+
var todoUpdateCommand = new Command68("update").description("Update a todo").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--title <value>", "New title. Omit to leave the existing title unchanged. Must be non-empty when supplied.").option("--description <value>", 'New description. Markdown formatted (CommonMark + GFM tables, strikethrough, task lists). Pass empty string `""` explicitly to clear an existing description, or omit to leave unchanged. Passing `null` is strictly rejected.').option("--parent-id <value>", "Re-parent the todo. Pass a valid parent ID to attach under another todo, pass `null` to move it back to the root level, or omit to leave unchanged. Nesting is limited to one level; attempting to set a child todo as a parent will trigger `PARENT_IS_CHILD`.").option("--status <value>", "New status of the todo. Allowed transitions: `open` \u2794 `in_progress` \u2794 `done`. `cancelled` represents a terminal state. Transitioning to `done` automatically emits a `captureTodoCompleted` analytics event. Omit to leave the existing status unchanged.").option("--due-at <value>", 'Update calendar due date in ISO date-only format (`YYYY-MM-DD`). Pass `""` explicitly to clear an existing due date, or omit to leave it unchanged. Passing `null` is strictly rejected.').option("--type-id <value>", "Re-assign this todo to a different active type. The new type must belong to the todo's same project; otherwise the request fails with TYPE_PROJECT_MISMATCH. New server-generated type ids use typ_<ULID>; legacy ids remain accepted.").option("--custom-fields <value>", "PATCH semantics: only the keys present in this map change. Pass `null` for a key (e.g. `custom_fields: { priority: null }`) to explicitly delete that custom field value. Array values are replaced wholesale with no element-level diff. Providing a key that is not declared on the effective todo type is rejected with `UNDECLARED_FIELD`.").option("--user-id <value>", "Reassign the owner (assignee) user ID of this todo. Target user must belong to the same organization.").action(async (id, opts) => {
|
|
3714
3915
|
const client2 = await loadSdkClient();
|
|
3715
3916
|
const result = await todoUpdate({
|
|
3716
3917
|
client: client2._rawClient,
|
|
@@ -3740,6 +3941,31 @@ var todoUpdateCommand = new Command62("update").description("Update a todo").arg
|
|
|
3740
3941
|
render({ kind: "todo_update", display: { "shape": "object", "format": { "id": "id-short", "user_id": "id-short", "project_id": "id-short", "parent_id": "id-short", "type_id": "id-short", "status": "status-badge", "due_at": "relative-time", "created_at": "relative-time", "updated_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
3741
3942
|
});
|
|
3742
3943
|
|
|
3944
|
+
// src/generated/cli/todo/restore.ts
|
|
3945
|
+
import { Command as Command69 } from "commander";
|
|
3946
|
+
var todoRestoreCommand = new Command69("restore").description("Restore a soft-deleted todo").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--cascade <value>", "cascade").action(async (id, opts) => {
|
|
3947
|
+
const client2 = await loadSdkClient();
|
|
3948
|
+
const result = await todoRestore({
|
|
3949
|
+
client: client2._rawClient,
|
|
3950
|
+
path: {
|
|
3951
|
+
id
|
|
3952
|
+
},
|
|
3953
|
+
body: {
|
|
3954
|
+
expected_version: opts.expectedVersion,
|
|
3955
|
+
cascade: opts.cascade
|
|
3956
|
+
}
|
|
3957
|
+
});
|
|
3958
|
+
if (result.error || !result.response?.ok) {
|
|
3959
|
+
process.stderr.write(
|
|
3960
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
3961
|
+
`
|
|
3962
|
+
);
|
|
3963
|
+
process.exitCode = 1;
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
render({ kind: "todo_restore", display: { "shape": "object", "format": { "id": "id-short", "user_id": "id-short", "project_id": "id-short", "parent_id": "id-short", "type_id": "id-short", "status": "status-badge", "due_at": "relative-time", "created_at": "relative-time", "updated_at": "relative-time", "deleted_at": "relative-time" } } }, result.data);
|
|
3967
|
+
});
|
|
3968
|
+
|
|
3743
3969
|
// src/generated/cli/index.ts
|
|
3744
3970
|
function registerGeneratedCommands(root) {
|
|
3745
3971
|
const root_invite = root.command("invite").description("invite commands");
|
|
@@ -3769,6 +3995,7 @@ function registerGeneratedCommands(root) {
|
|
|
3769
3995
|
root_event.addCommand(eventGetCommand);
|
|
3770
3996
|
root_event.addCommand(eventUpdateCommand);
|
|
3771
3997
|
root_event.addCommand(eventIcsDownloadCommand);
|
|
3998
|
+
root_event.addCommand(eventRestoreCommand);
|
|
3772
3999
|
const root_drive = root.command("drive").description("drive commands");
|
|
3773
4000
|
const root_drive_library = root_drive.command("library").description("library commands");
|
|
3774
4001
|
root_drive_library.addCommand(driveLibraryCreateCommand);
|
|
@@ -3778,12 +4005,16 @@ function registerGeneratedCommands(root) {
|
|
|
3778
4005
|
root_drive_library.addCommand(driveLibraryUpdateCommand);
|
|
3779
4006
|
const root_drive_file = root_drive.command("file").description("file commands");
|
|
3780
4007
|
root_drive_file.addCommand(driveFileDeleteCommand);
|
|
4008
|
+
root_drive_file.addCommand(driveFileHistoryCommand);
|
|
4009
|
+
root_drive_file.addCommand(driveFileRestoreCommand);
|
|
3781
4010
|
const root_drive_manifest = root_drive.command("manifest").description("manifest commands");
|
|
3782
4011
|
root_drive_manifest.addCommand(driveManifestGetCommand);
|
|
4012
|
+
root_drive.addCommand(driveSearchCommand);
|
|
3783
4013
|
const root_alias = root.command("alias").description("alias commands");
|
|
3784
4014
|
root_alias.addCommand(emailAliasCreateCommand);
|
|
3785
4015
|
root_alias.addCommand(emailAliasListCommand);
|
|
3786
4016
|
root_alias.addCommand(emailAliasDeleteCommand);
|
|
4017
|
+
root_alias.addCommand(emailAliasRestoreCommand);
|
|
3787
4018
|
const root_domain = root.command("domain").description("domain commands");
|
|
3788
4019
|
root_domain.addCommand(emailDomainCreateCommand);
|
|
3789
4020
|
root_domain.addCommand(emailDomainListCommand);
|
|
@@ -3796,6 +4027,7 @@ function registerGeneratedCommands(root) {
|
|
|
3796
4027
|
root_email.addCommand(emailListCommand);
|
|
3797
4028
|
root_email.addCommand(emailMarkReadCommand);
|
|
3798
4029
|
root_email.addCommand(emailMarkUnreadCommand);
|
|
4030
|
+
root_email.addCommand(emailRestoreCommand);
|
|
3799
4031
|
const root_push = root.command("push").description("push commands");
|
|
3800
4032
|
const root_push_config = root_push.command("config").description("config commands");
|
|
3801
4033
|
root_push_config.addCommand(pushConfigDeleteCommand);
|
|
@@ -3824,10 +4056,11 @@ function registerGeneratedCommands(root) {
|
|
|
3824
4056
|
root_todo.addCommand(todoDeleteCommand);
|
|
3825
4057
|
root_todo.addCommand(todoGetCommand);
|
|
3826
4058
|
root_todo.addCommand(todoUpdateCommand);
|
|
4059
|
+
root_todo.addCommand(todoRestoreCommand);
|
|
3827
4060
|
}
|
|
3828
4061
|
|
|
3829
4062
|
// src/handwritten/commands/login.ts
|
|
3830
|
-
import { Command as
|
|
4063
|
+
import { Command as Command70 } from "commander";
|
|
3831
4064
|
|
|
3832
4065
|
// src/handwritten/auth/device-flow.ts
|
|
3833
4066
|
var DEFAULT_SLEEP = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -4069,7 +4302,7 @@ function resolveLoginTarget(opts, env) {
|
|
|
4069
4302
|
function wantsJson(opts, env) {
|
|
4070
4303
|
return opts.json === true || env.WSPC_OUTPUT === "json";
|
|
4071
4304
|
}
|
|
4072
|
-
var loginCommand = new
|
|
4305
|
+
var loginCommand = new Command70("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("--api-base <url>", "Target API base URL (default: production)").option("--env <name>", "Config env name to store credentials under").option("--json", "Emit machine-readable events to stdout").action(async (opts) => {
|
|
4073
4306
|
const store = new ConfigStore();
|
|
4074
4307
|
const { baseUrl, envName } = resolveLoginTarget(opts, process.env);
|
|
4075
4308
|
const output = wantsJson(opts, process.env) ? { write: () => {
|
|
@@ -4088,7 +4321,7 @@ var loginCommand = new Command63("login").description("Log in via OAuth device f
|
|
|
4088
4321
|
});
|
|
4089
4322
|
|
|
4090
4323
|
// src/handwritten/commands/logout.ts
|
|
4091
|
-
import { Command as
|
|
4324
|
+
import { Command as Command71 } from "commander";
|
|
4092
4325
|
|
|
4093
4326
|
// src/handwritten/auth/logout.ts
|
|
4094
4327
|
async function runLogout(opts) {
|
|
@@ -4121,7 +4354,7 @@ async function runLogout(opts) {
|
|
|
4121
4354
|
}
|
|
4122
4355
|
|
|
4123
4356
|
// src/handwritten/commands/logout.ts
|
|
4124
|
-
var logoutCommand = new
|
|
4357
|
+
var logoutCommand = new Command71("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) => {
|
|
4125
4358
|
const res = await runLogout({ store: new ConfigStore(), email, all: opts.all });
|
|
4126
4359
|
if (res.removed.length === 0) {
|
|
4127
4360
|
process.stdout.write("nothing to log out\n");
|
|
@@ -4134,7 +4367,7 @@ var logoutCommand = new Command64("logout").description("Log out an account (def
|
|
|
4134
4367
|
});
|
|
4135
4368
|
|
|
4136
4369
|
// src/handwritten/commands/whoami.ts
|
|
4137
|
-
import { Command as
|
|
4370
|
+
import { Command as Command72 } from "commander";
|
|
4138
4371
|
var ENV_DISPLAY = {
|
|
4139
4372
|
shape: "object",
|
|
4140
4373
|
fields: ["name", "api_base", "account", "actor", "agent_label"]
|
|
@@ -4165,7 +4398,7 @@ async function backfillActiveEmail(store, envName, email, userId) {
|
|
|
4165
4398
|
rekeyLegacyAccount(cfg, envName, email, userId);
|
|
4166
4399
|
});
|
|
4167
4400
|
}
|
|
4168
|
-
var whoamiCommand = new
|
|
4401
|
+
var whoamiCommand = new Command72("whoami").description("Show the active env, signed-in account, and organization").action(async () => {
|
|
4169
4402
|
const store = new ConfigStore();
|
|
4170
4403
|
const config = await store.read();
|
|
4171
4404
|
let resolved;
|
|
@@ -4218,8 +4451,8 @@ function printLoggedOut() {
|
|
|
4218
4451
|
}
|
|
4219
4452
|
|
|
4220
4453
|
// src/handwritten/commands/config.ts
|
|
4221
|
-
import { Command as
|
|
4222
|
-
var configCommand = new
|
|
4454
|
+
import { Command as Command73 } from "commander";
|
|
4455
|
+
var configCommand = new Command73("config").description("Manage wspc local config");
|
|
4223
4456
|
registerRenderer("config_show", (data) => {
|
|
4224
4457
|
const d = data;
|
|
4225
4458
|
if (d.envs.length === 0) {
|
|
@@ -4290,7 +4523,7 @@ configCommand.command("use <env>").description("Switch current_env").action(asyn
|
|
|
4290
4523
|
});
|
|
4291
4524
|
|
|
4292
4525
|
// src/handwritten/commands/account.ts
|
|
4293
|
-
import { Command as
|
|
4526
|
+
import { Command as Command74 } from "commander";
|
|
4294
4527
|
async function listAccounts(store) {
|
|
4295
4528
|
const c = await store.read();
|
|
4296
4529
|
const envName = c.current_env;
|
|
@@ -4331,7 +4564,7 @@ registerRenderer("account_ls", (data) => {
|
|
|
4331
4564
|
]);
|
|
4332
4565
|
process.stdout.write(table(headers, body));
|
|
4333
4566
|
});
|
|
4334
|
-
var accountCommand = new
|
|
4567
|
+
var accountCommand = new Command74("account").description("Manage logged-in accounts");
|
|
4335
4568
|
accountCommand.command("ls").description("List accounts in the current env (active marked with \u2713)").action(async () => {
|
|
4336
4569
|
const accounts = await listAccounts(new ConfigStore());
|
|
4337
4570
|
render({ kind: "account_ls" }, { accounts });
|
|
@@ -4343,7 +4576,7 @@ accountCommand.command("switch <email>").description("Set the active account for
|
|
|
4343
4576
|
});
|
|
4344
4577
|
|
|
4345
4578
|
// src/handwritten/commands/todo-done.ts
|
|
4346
|
-
import { Command as
|
|
4579
|
+
import { Command as Command75 } from "commander";
|
|
4347
4580
|
var TODO_UPDATE_DISPLAY = {
|
|
4348
4581
|
shape: "object",
|
|
4349
4582
|
format: {
|
|
@@ -4361,7 +4594,7 @@ var TODO_UPDATE_DISPLAY = {
|
|
|
4361
4594
|
deleted_at: "relative-time"
|
|
4362
4595
|
}
|
|
4363
4596
|
};
|
|
4364
|
-
var todoDoneCommand = new
|
|
4597
|
+
var todoDoneCommand = new Command75("done").description("Mark a todo done (sugar for `update <id> --status done`)").argument("<id>", "Todo id").action(async (id) => {
|
|
4365
4598
|
const client2 = await loadSdkClient();
|
|
4366
4599
|
const result = await todoUpdate({
|
|
4367
4600
|
client: client2._rawClient,
|
|
@@ -4380,7 +4613,7 @@ var todoDoneCommand = new Command68("done").description("Mark a todo done (sugar
|
|
|
4380
4613
|
});
|
|
4381
4614
|
|
|
4382
4615
|
// src/handwritten/commands/email/send.ts
|
|
4383
|
-
import { Command as
|
|
4616
|
+
import { Command as Command76 } from "commander";
|
|
4384
4617
|
import { randomUUID } from "crypto";
|
|
4385
4618
|
import { readFile, stat } from "fs/promises";
|
|
4386
4619
|
import { basename } from "path";
|
|
@@ -4439,7 +4672,7 @@ async function resolveAttachment(input) {
|
|
|
4439
4672
|
`--attach ${input}: neither a readable file nor a valid <prefix>_<ulid>:<idx> reference.`
|
|
4440
4673
|
);
|
|
4441
4674
|
}
|
|
4442
|
-
var sendCommand = new
|
|
4675
|
+
var sendCommand = new Command76("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)", []).option("--idempotency-key <key>", "idempotency key (auto-generated if omitted)").action(async (opts) => {
|
|
4443
4676
|
const isReply = Boolean(opts.reply);
|
|
4444
4677
|
const to = opts.to;
|
|
4445
4678
|
const attachInputs = opts.attach;
|
|
@@ -4528,7 +4761,7 @@ var sendCommand = new Command69("send").description("Send an outbound email").re
|
|
|
4528
4761
|
});
|
|
4529
4762
|
|
|
4530
4763
|
// src/handwritten/commands/email/attachment.ts
|
|
4531
|
-
import { Command as
|
|
4764
|
+
import { Command as Command77 } from "commander";
|
|
4532
4765
|
import { createWriteStream } from "fs";
|
|
4533
4766
|
import { Readable } from "stream";
|
|
4534
4767
|
import { pipeline } from "stream/promises";
|
|
@@ -4546,7 +4779,7 @@ function parseContentDispositionFilename(header) {
|
|
|
4546
4779
|
}
|
|
4547
4780
|
|
|
4548
4781
|
// src/handwritten/commands/email/attachment.ts
|
|
4549
|
-
var attachmentCommand = new
|
|
4782
|
+
var attachmentCommand = new Command77("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) => {
|
|
4550
4783
|
const idx = Number(idxArg);
|
|
4551
4784
|
if (!Number.isInteger(idx) || idx < 0) {
|
|
4552
4785
|
process.stderr.write(`<idx> must be a non-negative integer (got "${idxArg}")
|
|
@@ -4578,8 +4811,8 @@ var attachmentCommand = new Command70("attachment").description("Download an inb
|
|
|
4578
4811
|
});
|
|
4579
4812
|
|
|
4580
4813
|
// src/handwritten/commands/drive/bind.ts
|
|
4581
|
-
import { Command as
|
|
4582
|
-
import { stat as
|
|
4814
|
+
import { Command as Command78 } from "commander";
|
|
4815
|
+
import { stat as stat3 } from "fs/promises";
|
|
4583
4816
|
import { resolve } from "path";
|
|
4584
4817
|
|
|
4585
4818
|
// src/handwritten/commands/drive/api.ts
|
|
@@ -4667,7 +4900,7 @@ async function createDriveApi(opts = {}) {
|
|
|
4667
4900
|
}
|
|
4668
4901
|
|
|
4669
4902
|
// src/handwritten/commands/drive/state.ts
|
|
4670
|
-
import { mkdir, open, readFile as readFile2, rename, rm, writeFile } from "fs/promises";
|
|
4903
|
+
import { mkdir, open, readFile as readFile2, rename, rm, stat as stat2, writeFile } from "fs/promises";
|
|
4671
4904
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
4672
4905
|
import { join as join2 } from "path";
|
|
4673
4906
|
import { DateTime as DateTime4 } from "luxon";
|
|
@@ -4695,6 +4928,7 @@ function driveConflictTimestamp(clock = systemDriveClock) {
|
|
|
4695
4928
|
// src/handwritten/commands/drive/state.ts
|
|
4696
4929
|
var DRIVE_DIR = ".wspc-drive";
|
|
4697
4930
|
var STATE_FILE = "state.json";
|
|
4931
|
+
var STALE_LOCK_MS = 10 * 60 * 1e3;
|
|
4698
4932
|
function statePath(root) {
|
|
4699
4933
|
return join2(root, DRIVE_DIR, STATE_FILE);
|
|
4700
4934
|
}
|
|
@@ -4720,7 +4954,7 @@ async function writeDriveState(root, state, clock) {
|
|
|
4720
4954
|
const fullPath = statePath(root);
|
|
4721
4955
|
try {
|
|
4722
4956
|
await writeFile(tmp, snapshot, { mode: 384 });
|
|
4723
|
-
const fh = await open(tmp, "r");
|
|
4957
|
+
const fh = await open(tmp, "r+");
|
|
4724
4958
|
try {
|
|
4725
4959
|
await fh.sync();
|
|
4726
4960
|
} finally {
|
|
@@ -4780,11 +5014,22 @@ async function writeDriveRealtimeState(root, realtime) {
|
|
|
4780
5014
|
async function withDriveLock(root, fn) {
|
|
4781
5015
|
await mkdir(join2(root, DRIVE_DIR), { recursive: true });
|
|
4782
5016
|
const lockFile = join2(root, DRIVE_DIR, "sync.lock");
|
|
4783
|
-
const fh = await open(lockFile, "wx").catch((error) => {
|
|
4784
|
-
if (error.code
|
|
5017
|
+
const fh = await open(lockFile, "wx").catch(async (error) => {
|
|
5018
|
+
if (error.code !== "EEXIST") throw error;
|
|
5019
|
+
const lockStat = await stat2(lockFile).catch((statError) => {
|
|
5020
|
+
if (statError.code === "ENOENT") return void 0;
|
|
5021
|
+
throw statError;
|
|
5022
|
+
});
|
|
5023
|
+
if (lockStat && Date.now() - lockStat.mtimeMs <= STALE_LOCK_MS) {
|
|
4785
5024
|
throw new Error("sync lock already exists");
|
|
4786
5025
|
}
|
|
4787
|
-
|
|
5026
|
+
await rm(lockFile, { force: true });
|
|
5027
|
+
return open(lockFile, "wx").catch((retryError) => {
|
|
5028
|
+
if (retryError.code === "EEXIST") {
|
|
5029
|
+
throw new Error("sync lock already exists");
|
|
5030
|
+
}
|
|
5031
|
+
throw retryError;
|
|
5032
|
+
});
|
|
4788
5033
|
});
|
|
4789
5034
|
try {
|
|
4790
5035
|
return await fn();
|
|
@@ -4832,7 +5077,7 @@ function isValidDriveState(value) {
|
|
|
4832
5077
|
async function assertExistingDirectory(path) {
|
|
4833
5078
|
let stats;
|
|
4834
5079
|
try {
|
|
4835
|
-
stats = await
|
|
5080
|
+
stats = await stat3(path);
|
|
4836
5081
|
} catch {
|
|
4837
5082
|
throw new Error(`local folder does not exist: ${path}`);
|
|
4838
5083
|
}
|
|
@@ -4841,7 +5086,7 @@ async function assertExistingDirectory(path) {
|
|
|
4841
5086
|
}
|
|
4842
5087
|
}
|
|
4843
5088
|
function driveBindCommand() {
|
|
4844
|
-
return new
|
|
5089
|
+
return new Command78("bind").description("Bind a local folder to an existing Drive library").requiredOption("--library <id>", "existing Drive library id").argument("[path]", "local folder path", ".").action(async (path, opts) => {
|
|
4845
5090
|
const root = resolve(path);
|
|
4846
5091
|
await assertExistingDirectory(root);
|
|
4847
5092
|
const api = await createDriveApi();
|
|
@@ -4859,7 +5104,7 @@ function driveBindCommand() {
|
|
|
4859
5104
|
}
|
|
4860
5105
|
|
|
4861
5106
|
// src/handwritten/commands/drive/sync.ts
|
|
4862
|
-
import { Command as
|
|
5107
|
+
import { Command as Command79 } from "commander";
|
|
4863
5108
|
import { mkdir as mkdir3, readFile as readFile4, rm as rm3, writeFile as writeFile3 } from "fs/promises";
|
|
4864
5109
|
import { basename as basename3, dirname as dirname2, join as join5, posix as pathPosix2, resolve as resolve3 } from "path";
|
|
4865
5110
|
import { createHash as createHash3, randomUUID as randomUUID4 } from "crypto";
|
|
@@ -5576,7 +5821,7 @@ async function runDriveSyncOnce(root, api, clock = systemDriveClock) {
|
|
|
5576
5821
|
});
|
|
5577
5822
|
}
|
|
5578
5823
|
function driveSyncCommand(api) {
|
|
5579
|
-
const sync = new
|
|
5824
|
+
const sync = new Command79("sync").description("Drive sync commands");
|
|
5580
5825
|
sync.command("once").description("Run one Drive sync pass").argument("[path]", "local folder path", ".").action(async (path) => {
|
|
5581
5826
|
const summary = await runDriveSyncOnce(resolve3(path), api);
|
|
5582
5827
|
render({ kind: "drive_sync_once", display: { shape: "object" } }, summary);
|
|
@@ -6029,7 +6274,7 @@ function containsVersionConflict(value) {
|
|
|
6029
6274
|
}
|
|
6030
6275
|
|
|
6031
6276
|
// src/handwritten/commands/drive/watch.ts
|
|
6032
|
-
import { Command as
|
|
6277
|
+
import { Command as Command80 } from "commander";
|
|
6033
6278
|
import chokidar from "chokidar";
|
|
6034
6279
|
import { relative as relative2, resolve as resolve4 } from "path";
|
|
6035
6280
|
|
|
@@ -6243,9 +6488,20 @@ function redactedRealtimeError(error) {
|
|
|
6243
6488
|
return "auth failed";
|
|
6244
6489
|
}
|
|
6245
6490
|
if (/\bnetwork|fetch|close\b/i.test(text)) {
|
|
6246
|
-
return "network error";
|
|
6491
|
+
return withRealtimeCode("network error", error);
|
|
6492
|
+
}
|
|
6493
|
+
return withRealtimeCode("realtime error", error);
|
|
6494
|
+
}
|
|
6495
|
+
function withRealtimeCode(label, error) {
|
|
6496
|
+
if (typeof error !== "object" || error === null) return label;
|
|
6497
|
+
const code = error.code;
|
|
6498
|
+
if (typeof code === "string" && /^[A-Z][A-Z0-9_]{1,31}$/.test(code)) {
|
|
6499
|
+
return `${label} (${code})`;
|
|
6500
|
+
}
|
|
6501
|
+
if (typeof code === "number" && Number.isInteger(code)) {
|
|
6502
|
+
return `${label} (${code})`;
|
|
6247
6503
|
}
|
|
6248
|
-
return
|
|
6504
|
+
return label;
|
|
6249
6505
|
}
|
|
6250
6506
|
function isRecord3(value) {
|
|
6251
6507
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -6468,7 +6724,7 @@ async function runDriveWatch(root, options = {}) {
|
|
|
6468
6724
|
}
|
|
6469
6725
|
}
|
|
6470
6726
|
function driveWatchCommand(options = {}) {
|
|
6471
|
-
return new
|
|
6727
|
+
return new Command80("watch").description("Watch a bound Drive folder and sync local changes").argument("[path]", "local folder path", ".").action(async (path) => {
|
|
6472
6728
|
await runDriveWatch(resolve4(path), options);
|
|
6473
6729
|
});
|
|
6474
6730
|
}
|
|
@@ -6532,7 +6788,7 @@ function waitForStopSignal(onRegistered) {
|
|
|
6532
6788
|
function mountDriveCommands(program) {
|
|
6533
6789
|
let drive = program.commands.find((c) => c.name() === "drive");
|
|
6534
6790
|
if (!drive) {
|
|
6535
|
-
drive = new
|
|
6791
|
+
drive = new Command81("drive").description("Drive commands");
|
|
6536
6792
|
program.addCommand(drive);
|
|
6537
6793
|
}
|
|
6538
6794
|
if (!drive.commands.some((c) => c.name() === "bind")) {
|
|
@@ -6558,7 +6814,7 @@ function isCliEntrypoint(argv = process.argv, metaUrl = import.meta.url) {
|
|
|
6558
6814
|
}
|
|
6559
6815
|
}
|
|
6560
6816
|
function buildProgram() {
|
|
6561
|
-
const program = new
|
|
6817
|
+
const program = new Command81().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) => {
|
|
6562
6818
|
const globals = actionCommand.optsWithGlobals();
|
|
6563
6819
|
if (globals.json) process.env.WSPC_OUTPUT = "json";
|
|
6564
6820
|
if (globals.account) process.env.WSPC_ACCOUNT = String(globals.account);
|