@wspc/cli 0.0.4 → 0.0.6
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 +415 -75
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -27
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/spec/openapi.json +1704 -1450
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
|
-
import { Command as
|
|
4
|
+
import { Command as Command43 } from "commander";
|
|
5
5
|
|
|
6
|
-
// src/generated/cli/
|
|
6
|
+
// src/generated/cli/keys/create.ts
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
|
|
9
9
|
// src/generated/sdk/core/bodySerializer.gen.ts
|
|
@@ -792,19 +792,61 @@ var createClient = (config = {}) => {
|
|
|
792
792
|
};
|
|
793
793
|
|
|
794
794
|
// src/generated/sdk/client.gen.ts
|
|
795
|
-
var client = createClient(createConfig());
|
|
795
|
+
var client = createClient(createConfig({ baseUrl: "https://api.wspc.ai" }));
|
|
796
796
|
|
|
797
797
|
// src/generated/sdk/sdk.gen.ts
|
|
798
|
+
var keyList = (options) => (options?.client ?? client).get({
|
|
799
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
800
|
+
url: "/auth/keys",
|
|
801
|
+
...options
|
|
802
|
+
});
|
|
803
|
+
var keyCreate = (options) => (options.client ?? client).post({
|
|
804
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
805
|
+
url: "/auth/keys",
|
|
806
|
+
...options,
|
|
807
|
+
headers: {
|
|
808
|
+
"Content-Type": "application/json",
|
|
809
|
+
...options.headers
|
|
810
|
+
}
|
|
811
|
+
});
|
|
798
812
|
var orgGet = (options) => (options?.client ?? client).get({
|
|
799
813
|
security: [{ scheme: "bearer", type: "http" }],
|
|
800
814
|
url: "/auth/me/org",
|
|
801
815
|
...options
|
|
802
816
|
});
|
|
817
|
+
var orgUpdate = (options) => (options?.client ?? client).patch({
|
|
818
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
819
|
+
url: "/auth/me/org",
|
|
820
|
+
...options,
|
|
821
|
+
headers: {
|
|
822
|
+
"Content-Type": "application/json",
|
|
823
|
+
...options?.headers
|
|
824
|
+
}
|
|
825
|
+
});
|
|
803
826
|
var authMe = (options) => (options?.client ?? client).get({
|
|
804
827
|
security: [{ scheme: "bearer", type: "http" }],
|
|
805
828
|
url: "/auth/me",
|
|
806
829
|
...options
|
|
807
830
|
});
|
|
831
|
+
var orgMembersList = (options) => (options?.client ?? client).get({
|
|
832
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
833
|
+
url: "/auth/me/org/members",
|
|
834
|
+
...options
|
|
835
|
+
});
|
|
836
|
+
var keyRevoke = (options) => (options.client ?? client).delete({
|
|
837
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
838
|
+
url: "/auth/keys/{id}",
|
|
839
|
+
...options
|
|
840
|
+
});
|
|
841
|
+
var keyUpdate = (options) => (options.client ?? client).patch({
|
|
842
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
843
|
+
url: "/auth/keys/{id}",
|
|
844
|
+
...options,
|
|
845
|
+
headers: {
|
|
846
|
+
"Content-Type": "application/json",
|
|
847
|
+
...options.headers
|
|
848
|
+
}
|
|
849
|
+
});
|
|
808
850
|
var eventList = (options) => (options?.client ?? client).get({
|
|
809
851
|
security: [{ scheme: "bearer", type: "http" }],
|
|
810
852
|
url: "/calendar/events",
|
|
@@ -912,6 +954,34 @@ var emailSend = (options) => (options.client ?? client).post({
|
|
|
912
954
|
...options.headers
|
|
913
955
|
}
|
|
914
956
|
});
|
|
957
|
+
var pushConfigDelete = (options) => (options.client ?? client).delete({
|
|
958
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
959
|
+
url: "/push/config/{transport}",
|
|
960
|
+
...options
|
|
961
|
+
});
|
|
962
|
+
var pushConfigGet = (options) => (options?.client ?? client).get({
|
|
963
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
964
|
+
url: "/push/config",
|
|
965
|
+
...options
|
|
966
|
+
});
|
|
967
|
+
var pushConfigSet = (options) => (options.client ?? client).post({
|
|
968
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
969
|
+
url: "/push/config",
|
|
970
|
+
...options,
|
|
971
|
+
headers: {
|
|
972
|
+
"Content-Type": "application/json",
|
|
973
|
+
...options.headers
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
var pushTest = (options) => (options.client ?? client).post({
|
|
977
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
978
|
+
url: "/push/test",
|
|
979
|
+
...options,
|
|
980
|
+
headers: {
|
|
981
|
+
"Content-Type": "application/json",
|
|
982
|
+
...options.headers
|
|
983
|
+
}
|
|
984
|
+
});
|
|
915
985
|
var projectList = (options) => (options?.client ?? client).get({
|
|
916
986
|
security: [{ scheme: "bearer", type: "http" }],
|
|
917
987
|
url: "/todo/projects",
|
|
@@ -1018,9 +1088,9 @@ var ConfigStore = class {
|
|
|
1018
1088
|
};
|
|
1019
1089
|
|
|
1020
1090
|
// src/version.ts
|
|
1021
|
-
var VERSION = "0.0.
|
|
1022
|
-
var SPEC_SHA = "
|
|
1023
|
-
var SPEC_FETCHED_AT = "2026-
|
|
1091
|
+
var VERSION = "0.0.6";
|
|
1092
|
+
var SPEC_SHA = "7418fe42";
|
|
1093
|
+
var SPEC_FETCHED_AT = "2026-06-02T09:58:13.195Z";
|
|
1024
1094
|
var API_BASE = "https://api.wspc.ai";
|
|
1025
1095
|
|
|
1026
1096
|
// src/index.ts
|
|
@@ -1182,6 +1252,27 @@ var green = (s) => wrap("32", s);
|
|
|
1182
1252
|
var yellow = (s) => wrap("33", s);
|
|
1183
1253
|
var red = (s) => wrap("31", s);
|
|
1184
1254
|
var gray = (s) => wrap("90", s);
|
|
1255
|
+
var cyan = (s) => wrap("36", s);
|
|
1256
|
+
function colorise(s, color) {
|
|
1257
|
+
switch (color) {
|
|
1258
|
+
case "green":
|
|
1259
|
+
return green(s);
|
|
1260
|
+
case "yellow":
|
|
1261
|
+
return yellow(s);
|
|
1262
|
+
case "red":
|
|
1263
|
+
return red(s);
|
|
1264
|
+
case "gray":
|
|
1265
|
+
return gray(s);
|
|
1266
|
+
case "cyan":
|
|
1267
|
+
return cyan(s);
|
|
1268
|
+
case "dim":
|
|
1269
|
+
return dim(s);
|
|
1270
|
+
case "bold":
|
|
1271
|
+
return bold(s);
|
|
1272
|
+
default:
|
|
1273
|
+
return s;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1185
1276
|
var ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
1186
1277
|
function visibleWidth(s) {
|
|
1187
1278
|
const stripped = s.replace(ANSI_RE, "");
|
|
@@ -1384,7 +1475,7 @@ function renderList(data, hints) {
|
|
|
1384
1475
|
const headers = columns.map((c) => c.toUpperCase());
|
|
1385
1476
|
const rows = items.map(
|
|
1386
1477
|
(item) => columns.map(
|
|
1387
|
-
(col) => formatCell(item[col], format[col])
|
|
1478
|
+
(col) => formatCell(item[col], format[col], hints?.enumColorMap?.[col])
|
|
1388
1479
|
)
|
|
1389
1480
|
);
|
|
1390
1481
|
process.stdout.write(table(headers, rows));
|
|
@@ -1429,13 +1520,24 @@ function renderObject(data, hints) {
|
|
|
1429
1520
|
...arrayFields.map((f) => f.length)
|
|
1430
1521
|
);
|
|
1431
1522
|
for (const f of fields) {
|
|
1432
|
-
const value = formatCell(obj[f], format[f]);
|
|
1523
|
+
const value = formatCell(obj[f], format[f], hints?.enumColorMap?.[f]);
|
|
1433
1524
|
process.stdout.write(` ${dim(f.padEnd(labelWidth))} ${value}
|
|
1434
1525
|
`);
|
|
1435
1526
|
}
|
|
1436
1527
|
for (const f of arrayFields) {
|
|
1437
1528
|
renderArrayField(f, obj[f], labelWidth);
|
|
1438
1529
|
}
|
|
1530
|
+
if (hints?.secretField) {
|
|
1531
|
+
const value = obj[hints.secretField];
|
|
1532
|
+
if (value !== void 0) {
|
|
1533
|
+
process.stdout.write("\n");
|
|
1534
|
+
process.stdout.write(colorise("\u26A0 This is the only time you'll see this key. Save it now.", "yellow") + "\n");
|
|
1535
|
+
process.stdout.write("\n");
|
|
1536
|
+
process.stdout.write(" To use it as the active env credential:\n");
|
|
1537
|
+
process.stdout.write(` wspc env add <name> --api-key ${value}
|
|
1538
|
+
`);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1439
1541
|
}
|
|
1440
1542
|
var ARRAY_FIELD_MAX_ITEMS = 10;
|
|
1441
1543
|
function renderArrayField(name, items, labelWidth) {
|
|
@@ -1486,8 +1588,8 @@ function renderScalar(data) {
|
|
|
1486
1588
|
function isScalar(v) {
|
|
1487
1589
|
return v === null || typeof v !== "object" && typeof v !== "function";
|
|
1488
1590
|
}
|
|
1489
|
-
function formatCell(value, fmt) {
|
|
1490
|
-
if (value === void 0 || value === null) return dim("\u2014");
|
|
1591
|
+
function formatCell(value, fmt, colorMap) {
|
|
1592
|
+
if (fmt !== "enum-badge" && (value === void 0 || value === null)) return dim("\u2014");
|
|
1491
1593
|
switch (fmt) {
|
|
1492
1594
|
case "id-short":
|
|
1493
1595
|
return idShort(String(value));
|
|
@@ -1499,14 +1601,63 @@ function formatCell(value, fmt) {
|
|
|
1499
1601
|
return truncate(String(value), 50);
|
|
1500
1602
|
case "bool-badge":
|
|
1501
1603
|
return boolBadge(value);
|
|
1604
|
+
case "enum-badge": {
|
|
1605
|
+
const map = colorMap ?? {};
|
|
1606
|
+
const key = value === null || value === void 0 ? "null" : String(value);
|
|
1607
|
+
const entry = map[key] ?? map["*"];
|
|
1608
|
+
if (!entry) {
|
|
1609
|
+
return value === void 0 || value === null ? dim("\u2014") : String(value);
|
|
1610
|
+
}
|
|
1611
|
+
const label = entry.label.replace("<value>", String(value));
|
|
1612
|
+
return colorise(label, entry.color);
|
|
1613
|
+
}
|
|
1502
1614
|
default:
|
|
1503
1615
|
if (typeof value === "object") return JSON.stringify(value);
|
|
1504
1616
|
return String(value);
|
|
1505
1617
|
}
|
|
1506
1618
|
}
|
|
1507
1619
|
|
|
1620
|
+
// src/generated/cli/keys/create.ts
|
|
1621
|
+
var keyCreateCommand = new Command("create").description("Create a new API key (full value returned once)").option("--label <value>", "label").action(async (opts) => {
|
|
1622
|
+
const client2 = await loadSdkClient();
|
|
1623
|
+
const result = await keyCreate({
|
|
1624
|
+
client: client2._rawClient,
|
|
1625
|
+
body: {
|
|
1626
|
+
label: opts.label
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
if (result.error || !result.response?.ok) {
|
|
1630
|
+
process.stderr.write(
|
|
1631
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
1632
|
+
`
|
|
1633
|
+
);
|
|
1634
|
+
process.exitCode = 1;
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
render({ kind: "key_create", display: { "shape": "object", "fields": ["id", "label", "api_key", "created_at"], "format": { "id": "id-short", "created_at": "relative-time" }, "secretField": "api_key" } }, result.data);
|
|
1638
|
+
});
|
|
1639
|
+
|
|
1640
|
+
// src/generated/cli/keys/ls.ts
|
|
1641
|
+
import { Command as Command2 } from "commander";
|
|
1642
|
+
var keyListCommand = new Command2("ls").description("List active API keys").action(async (opts) => {
|
|
1643
|
+
const client2 = await loadSdkClient();
|
|
1644
|
+
const result = await keyList({
|
|
1645
|
+
client: client2._rawClient
|
|
1646
|
+
});
|
|
1647
|
+
if (result.error || !result.response?.ok) {
|
|
1648
|
+
process.stderr.write(
|
|
1649
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
1650
|
+
`
|
|
1651
|
+
);
|
|
1652
|
+
process.exitCode = 1;
|
|
1653
|
+
return;
|
|
1654
|
+
}
|
|
1655
|
+
render({ kind: "key_list", display: { "shape": "list", "dataPath": "keys", "columns": ["id", "label", "last_4", "created_at", "last_used_at"], "format": { "id": "id-short", "created_at": "relative-time", "last_used_at": "relative-time" }, "emptyMessage": "(no API keys)" } }, result.data);
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1508
1658
|
// src/generated/cli/org/show.ts
|
|
1509
|
-
|
|
1659
|
+
import { Command as Command3 } from "commander";
|
|
1660
|
+
var orgGetCommand = new Command3("show").description("Get the authenticated user's organization").action(async (opts) => {
|
|
1510
1661
|
const client2 = await loadSdkClient();
|
|
1511
1662
|
const result = await orgGet({
|
|
1512
1663
|
client: client2._rawClient
|
|
@@ -1522,9 +1673,30 @@ var orgGetCommand = new Command("show").description("Get the authenticated user'
|
|
|
1522
1673
|
render({ kind: "org_get", display: { "shape": "object", "fields": ["id", "name", "created_at", "updated_at"], "format": { "id": "id-short", "name": "truncate", "created_at": "relative-time", "updated_at": "relative-time" } } }, result.data);
|
|
1523
1674
|
});
|
|
1524
1675
|
|
|
1676
|
+
// src/generated/cli/org/rename.ts
|
|
1677
|
+
import { Command as Command4 } from "commander";
|
|
1678
|
+
var orgUpdateCommand = new Command4("rename").description("Update the authenticated user's organization").option("--name <value>", "name").action(async (opts) => {
|
|
1679
|
+
const client2 = await loadSdkClient();
|
|
1680
|
+
const result = await orgUpdate({
|
|
1681
|
+
client: client2._rawClient,
|
|
1682
|
+
body: {
|
|
1683
|
+
name: opts.name
|
|
1684
|
+
}
|
|
1685
|
+
});
|
|
1686
|
+
if (result.error || !result.response?.ok) {
|
|
1687
|
+
process.stderr.write(
|
|
1688
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
1689
|
+
`
|
|
1690
|
+
);
|
|
1691
|
+
process.exitCode = 1;
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
render({ kind: "org_update", display: { "shape": "object", "fields": ["id", "name", "created_at", "updated_at"], "format": { "id": "id-short", "name": "truncate", "created_at": "relative-time", "updated_at": "relative-time" } } }, result.data);
|
|
1695
|
+
});
|
|
1696
|
+
|
|
1525
1697
|
// src/generated/cli/auth/me.ts
|
|
1526
|
-
import { Command as
|
|
1527
|
-
var authMeCommand = new
|
|
1698
|
+
import { Command as Command5 } from "commander";
|
|
1699
|
+
var authMeCommand = new Command5("me").description("Fetch the user identified by the bearer token").action(async (opts) => {
|
|
1528
1700
|
const client2 = await loadSdkClient();
|
|
1529
1701
|
const result = await authMe({
|
|
1530
1702
|
client: client2._rawClient
|
|
@@ -1540,8 +1712,75 @@ var authMeCommand = new Command2("me").description("Fetch the user identified by
|
|
|
1540
1712
|
render({ kind: "auth_me", display: { "shape": "object", "fields": ["user_id", "email", "display_name", "api_key_id"], "format": { "user_id": "id-short", "api_key_id": "id-short" } } }, result.data);
|
|
1541
1713
|
});
|
|
1542
1714
|
|
|
1715
|
+
// src/generated/cli/org/members.ts
|
|
1716
|
+
import { Command as Command6 } from "commander";
|
|
1717
|
+
var orgMembersListCommand = new Command6("members").description("List members of the authenticated user's organization").option("--cursor <value>", "cursor").option("--limit <value>", "limit").action(async (opts) => {
|
|
1718
|
+
const client2 = await loadSdkClient();
|
|
1719
|
+
const result = await orgMembersList({
|
|
1720
|
+
client: client2._rawClient,
|
|
1721
|
+
query: {
|
|
1722
|
+
cursor: opts.cursor,
|
|
1723
|
+
limit: opts.limit
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
if (result.error || !result.response?.ok) {
|
|
1727
|
+
process.stderr.write(
|
|
1728
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
1729
|
+
`
|
|
1730
|
+
);
|
|
1731
|
+
process.exitCode = 1;
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
render({ kind: "org_members_list", display: { "shape": "list", "dataPath": "members", "columns": ["user_id", "email", "display_name", "joined_at"], "format": { "user_id": "id-short", "joined_at": "relative-time" } } }, result.data);
|
|
1735
|
+
});
|
|
1736
|
+
|
|
1737
|
+
// src/generated/cli/keys/rm.ts
|
|
1738
|
+
import { Command as Command7 } from "commander";
|
|
1739
|
+
var keyRevokeCommand = new Command7("rm").description("Soft-revoke an API key").argument("<id>", "id").action(async (id, opts) => {
|
|
1740
|
+
const client2 = await loadSdkClient();
|
|
1741
|
+
const result = await keyRevoke({
|
|
1742
|
+
client: client2._rawClient,
|
|
1743
|
+
path: {
|
|
1744
|
+
id
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
if (result.error || !result.response?.ok) {
|
|
1748
|
+
process.stderr.write(
|
|
1749
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
1750
|
+
`
|
|
1751
|
+
);
|
|
1752
|
+
process.exitCode = 1;
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
render({ kind: "key_revoke", display: void 0 }, result.data);
|
|
1756
|
+
});
|
|
1757
|
+
|
|
1758
|
+
// src/generated/cli/keys/edit.ts
|
|
1759
|
+
import { Command as Command8 } from "commander";
|
|
1760
|
+
var keyUpdateCommand = new Command8("edit").description("Update an active API key's label").argument("<id>", "id").option("--label <value>", "label").action(async (id, opts) => {
|
|
1761
|
+
const client2 = await loadSdkClient();
|
|
1762
|
+
const result = await keyUpdate({
|
|
1763
|
+
client: client2._rawClient,
|
|
1764
|
+
path: {
|
|
1765
|
+
id
|
|
1766
|
+
},
|
|
1767
|
+
body: {
|
|
1768
|
+
label: opts.label
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
if (result.error || !result.response?.ok) {
|
|
1772
|
+
process.stderr.write(
|
|
1773
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
1774
|
+
`
|
|
1775
|
+
);
|
|
1776
|
+
process.exitCode = 1;
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
render({ kind: "key_update", display: void 0 }, result.data);
|
|
1780
|
+
});
|
|
1781
|
+
|
|
1543
1782
|
// src/generated/cli/event/add.ts
|
|
1544
|
-
import { Command as
|
|
1783
|
+
import { Command as Command9 } from "commander";
|
|
1545
1784
|
|
|
1546
1785
|
// src/handwritten/utils/parse-time.ts
|
|
1547
1786
|
import * as chrono from "chrono-node";
|
|
@@ -1627,7 +1866,7 @@ function parseAttendee(input) {
|
|
|
1627
1866
|
}
|
|
1628
1867
|
|
|
1629
1868
|
// src/generated/cli/event/add.ts
|
|
1630
|
-
var eventCreateCommand = new
|
|
1869
|
+
var eventCreateCommand = new Command9("add").description("Schedule a calendar event").argument("<title>", "title").option("--description <value>", "description").option("--start <value>", "start").option("--end <value>", "end").option("-l, --location <value>", "location").option("-u, --url <value>", "url").option("--status <value>", "status").option("--attendee <value>", "attendee", (val, memo) => {
|
|
1631
1870
|
memo.push(val);
|
|
1632
1871
|
return memo;
|
|
1633
1872
|
}, []).option("--all-day", "all_day").option("--tz <zone>", "IANA timezone for relative time parsing").action(async (title, opts) => {
|
|
@@ -1676,8 +1915,8 @@ var eventCreateCommand = new Command3("add").description("Schedule a calendar ev
|
|
|
1676
1915
|
});
|
|
1677
1916
|
|
|
1678
1917
|
// src/generated/cli/event/ls.ts
|
|
1679
|
-
import { Command as
|
|
1680
|
-
var eventListCommand = new
|
|
1918
|
+
import { Command as Command10 } from "commander";
|
|
1919
|
+
var eventListCommand = new Command10("ls").description("List calendar events").option("--q <value>", "q").option("--from <value>", "from").option("--to <value>", "to").option("--end-from <value>", "end_from").option("--end-to <value>", "end_to").option("--cursor <value>", "cursor").option("--limit <value>", "limit").option("--include-deleted <value>", "include_deleted").option("--include-past <value>", "include_past").option("--tz <zone>", "IANA timezone for relative time parsing").action(async (opts) => {
|
|
1681
1920
|
const zone = resolveTimezone(opts.tz);
|
|
1682
1921
|
let fromValue;
|
|
1683
1922
|
if (opts.from !== void 0) {
|
|
@@ -1714,8 +1953,8 @@ var eventListCommand = new Command4("ls").description("List calendar events").op
|
|
|
1714
1953
|
});
|
|
1715
1954
|
|
|
1716
1955
|
// src/generated/cli/event/rm.ts
|
|
1717
|
-
import { Command as
|
|
1718
|
-
var eventDeleteCommand = new
|
|
1956
|
+
import { Command as Command11 } from "commander";
|
|
1957
|
+
var eventDeleteCommand = new Command11("rm").description("Soft-delete a calendar event").argument("<id>", "id").option("--expected-version <value>", "expected_version").action(async (id, opts) => {
|
|
1719
1958
|
const client2 = await loadSdkClient();
|
|
1720
1959
|
const result = await eventDelete({
|
|
1721
1960
|
client: client2._rawClient,
|
|
@@ -1738,8 +1977,8 @@ var eventDeleteCommand = new Command5("rm").description("Soft-delete a calendar
|
|
|
1738
1977
|
});
|
|
1739
1978
|
|
|
1740
1979
|
// src/generated/cli/event/show.ts
|
|
1741
|
-
import { Command as
|
|
1742
|
-
var eventGetCommand = new
|
|
1980
|
+
import { Command as Command12 } from "commander";
|
|
1981
|
+
var eventGetCommand = new Command12("show").description("Get a calendar event by id").argument("<id>", "id").option("--include-deleted <value>", "include_deleted").action(async (id, opts) => {
|
|
1743
1982
|
const client2 = await loadSdkClient();
|
|
1744
1983
|
const result = await eventGet({
|
|
1745
1984
|
client: client2._rawClient,
|
|
@@ -1762,8 +2001,8 @@ var eventGetCommand = new Command6("show").description("Get a calendar event by
|
|
|
1762
2001
|
});
|
|
1763
2002
|
|
|
1764
2003
|
// src/generated/cli/event/set.ts
|
|
1765
|
-
import { Command as
|
|
1766
|
-
var eventUpdateCommand = new
|
|
2004
|
+
import { Command as Command13 } from "commander";
|
|
2005
|
+
var eventUpdateCommand = new Command13("set").description("Update a calendar event").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--title <value>", "title").option("--description <value>", "description").option("--start <value>", "start").option("--end <value>", "end").option("-l, --location <value>", "location").option("-u, --url <value>", "url").option("--status <value>", "status").option("--attendee <value>", "attendee", (val, memo) => {
|
|
1767
2006
|
memo.push(val);
|
|
1768
2007
|
return memo;
|
|
1769
2008
|
}, []).option("--all-day", "all_day").option("--tz <zone>", "IANA timezone for relative time parsing").action(async (id, opts) => {
|
|
@@ -1816,8 +2055,8 @@ var eventUpdateCommand = new Command7("set").description("Update a calendar even
|
|
|
1816
2055
|
});
|
|
1817
2056
|
|
|
1818
2057
|
// src/generated/cli/event/ics.ts
|
|
1819
|
-
import { Command as
|
|
1820
|
-
var eventIcsDownloadCommand = new
|
|
2058
|
+
import { Command as Command14 } from "commander";
|
|
2059
|
+
var eventIcsDownloadCommand = new Command14("ics").description("Download event as `.ics`").argument("<id>", "id").action(async (id, opts) => {
|
|
1821
2060
|
const client2 = await loadSdkClient();
|
|
1822
2061
|
const result = await eventIcsDownload({
|
|
1823
2062
|
client: client2._rawClient,
|
|
@@ -1837,8 +2076,8 @@ var eventIcsDownloadCommand = new Command8("ics").description("Download event as
|
|
|
1837
2076
|
});
|
|
1838
2077
|
|
|
1839
2078
|
// src/generated/cli/alias/add.ts
|
|
1840
|
-
import { Command as
|
|
1841
|
-
var emailAliasCreateCommand = new
|
|
2079
|
+
import { Command as Command15 } from "commander";
|
|
2080
|
+
var emailAliasCreateCommand = new Command15("add").description("Create a receiving alias").argument("<email>", "email").action(async (email, opts) => {
|
|
1842
2081
|
const client2 = await loadSdkClient();
|
|
1843
2082
|
const result = await emailAliasCreate({
|
|
1844
2083
|
client: client2._rawClient,
|
|
@@ -1858,8 +2097,8 @@ var emailAliasCreateCommand = new Command9("add").description("Create a receivin
|
|
|
1858
2097
|
});
|
|
1859
2098
|
|
|
1860
2099
|
// src/generated/cli/alias/ls.ts
|
|
1861
|
-
import { Command as
|
|
1862
|
-
var emailAliasListCommand = new
|
|
2100
|
+
import { Command as Command16 } from "commander";
|
|
2101
|
+
var emailAliasListCommand = new Command16("ls").description("List the caller's aliases").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
1863
2102
|
const client2 = await loadSdkClient();
|
|
1864
2103
|
const result = await emailAliasList({
|
|
1865
2104
|
client: client2._rawClient,
|
|
@@ -1879,8 +2118,8 @@ var emailAliasListCommand = new Command10("ls").description("List the caller's a
|
|
|
1879
2118
|
});
|
|
1880
2119
|
|
|
1881
2120
|
// src/generated/cli/alias/rm.ts
|
|
1882
|
-
import { Command as
|
|
1883
|
-
var emailAliasDeleteCommand = new
|
|
2121
|
+
import { Command as Command17 } from "commander";
|
|
2122
|
+
var emailAliasDeleteCommand = new Command17("rm").description("Soft-delete an alias").argument("<email>", "email").action(async (email, opts) => {
|
|
1884
2123
|
const client2 = await loadSdkClient();
|
|
1885
2124
|
const result = await emailAliasDelete({
|
|
1886
2125
|
client: client2._rawClient,
|
|
@@ -1900,8 +2139,8 @@ var emailAliasDeleteCommand = new Command11("rm").description("Soft-delete an al
|
|
|
1900
2139
|
});
|
|
1901
2140
|
|
|
1902
2141
|
// src/generated/cli/email/rm.ts
|
|
1903
|
-
import { Command as
|
|
1904
|
-
var emailDeleteCommand = new
|
|
2142
|
+
import { Command as Command18 } from "commander";
|
|
2143
|
+
var emailDeleteCommand = new Command18("rm").description("Soft-delete inbound emails").argument("<id...>", "id").action(async (id, opts) => {
|
|
1905
2144
|
const idRaw = id;
|
|
1906
2145
|
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
1907
2146
|
const client2 = await loadSdkClient();
|
|
@@ -1923,8 +2162,8 @@ var emailDeleteCommand = new Command12("rm").description("Soft-delete inbound em
|
|
|
1923
2162
|
});
|
|
1924
2163
|
|
|
1925
2164
|
// src/generated/cli/email/show.ts
|
|
1926
|
-
import { Command as
|
|
1927
|
-
var emailGetCommand = new
|
|
2165
|
+
import { Command as Command19 } from "commander";
|
|
2166
|
+
var emailGetCommand = new Command19("show").description("Get an inbound email by id").argument("<id>", "id").option("--include-html <value>", "include_html").option("--include-deleted <value>", "include_deleted").action(async (id, opts) => {
|
|
1928
2167
|
const client2 = await loadSdkClient();
|
|
1929
2168
|
const result = await emailGet({
|
|
1930
2169
|
client: client2._rawClient,
|
|
@@ -1948,8 +2187,8 @@ var emailGetCommand = new Command13("show").description("Get an inbound email by
|
|
|
1948
2187
|
});
|
|
1949
2188
|
|
|
1950
2189
|
// src/generated/cli/email/ls.ts
|
|
1951
|
-
import { Command as
|
|
1952
|
-
var emailListCommand = new
|
|
2190
|
+
import { Command as Command20 } from "commander";
|
|
2191
|
+
var emailListCommand = new Command20("ls").description("List inbound emails").option("--limit <value>", "limit").option("--alias-email <value>", "alias_email").option("--unread-only <value>", "unread_only").option("--since <value>", "since").option("--cursor <value>", "cursor").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
1953
2192
|
const client2 = await loadSdkClient();
|
|
1954
2193
|
const result = await emailList({
|
|
1955
2194
|
client: client2._rawClient,
|
|
@@ -1974,8 +2213,8 @@ var emailListCommand = new Command14("ls").description("List inbound emails").op
|
|
|
1974
2213
|
});
|
|
1975
2214
|
|
|
1976
2215
|
// src/generated/cli/email/read.ts
|
|
1977
|
-
import { Command as
|
|
1978
|
-
var emailMarkReadCommand = new
|
|
2216
|
+
import { Command as Command21 } from "commander";
|
|
2217
|
+
var emailMarkReadCommand = new Command21("read").description("Mark inbound emails as read").argument("<id...>", "id").action(async (id, opts) => {
|
|
1979
2218
|
const idRaw = id;
|
|
1980
2219
|
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
1981
2220
|
const client2 = await loadSdkClient();
|
|
@@ -1997,8 +2236,8 @@ var emailMarkReadCommand = new Command15("read").description("Mark inbound email
|
|
|
1997
2236
|
});
|
|
1998
2237
|
|
|
1999
2238
|
// src/generated/cli/email/unread.ts
|
|
2000
|
-
import { Command as
|
|
2001
|
-
var emailMarkUnreadCommand = new
|
|
2239
|
+
import { Command as Command22 } from "commander";
|
|
2240
|
+
var emailMarkUnreadCommand = new Command22("unread").description("Mark inbound emails as unread").argument("<id...>", "id").action(async (id, opts) => {
|
|
2002
2241
|
const idRaw = id;
|
|
2003
2242
|
const ids = idRaw.length > 0 ? idRaw : void 0;
|
|
2004
2243
|
const client2 = await loadSdkClient();
|
|
@@ -2019,9 +2258,96 @@ var emailMarkUnreadCommand = new Command16("unread").description("Mark inbound e
|
|
|
2019
2258
|
render({ kind: "email_mark_unread", display: { "shape": "object", "format": {} } }, result.data);
|
|
2020
2259
|
});
|
|
2021
2260
|
|
|
2261
|
+
// src/generated/cli/push/config/rm.ts
|
|
2262
|
+
import { Command as Command23 } from "commander";
|
|
2263
|
+
var pushConfigDeleteCommand = new Command23("rm").description("Remove a push transport").argument("<transport>", "transport").action(async (transport, opts) => {
|
|
2264
|
+
const client2 = await loadSdkClient();
|
|
2265
|
+
const result = await pushConfigDelete({
|
|
2266
|
+
client: client2._rawClient,
|
|
2267
|
+
path: {
|
|
2268
|
+
transport
|
|
2269
|
+
}
|
|
2270
|
+
});
|
|
2271
|
+
if (result.error || !result.response?.ok) {
|
|
2272
|
+
process.stderr.write(
|
|
2273
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2274
|
+
`
|
|
2275
|
+
);
|
|
2276
|
+
process.exitCode = 1;
|
|
2277
|
+
return;
|
|
2278
|
+
}
|
|
2279
|
+
render({ kind: "push_config_delete", display: void 0 }, result.data);
|
|
2280
|
+
});
|
|
2281
|
+
|
|
2282
|
+
// src/generated/cli/push/config/set.ts
|
|
2283
|
+
import { Command as Command24 } from "commander";
|
|
2284
|
+
var pushConfigSetCommand = new Command24("set").description("Register or update a push transport").option("--transport <value>", "transport").option("--target-bot-username <value>", "target_bot_username").action(async (opts) => {
|
|
2285
|
+
const client2 = await loadSdkClient();
|
|
2286
|
+
const result = await pushConfigSet({
|
|
2287
|
+
client: client2._rawClient,
|
|
2288
|
+
body: {
|
|
2289
|
+
config: {
|
|
2290
|
+
transport: opts.transport,
|
|
2291
|
+
target_bot_username: opts.targetBotUsername
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
});
|
|
2295
|
+
if (result.error || !result.response?.ok) {
|
|
2296
|
+
process.stderr.write(
|
|
2297
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2298
|
+
`
|
|
2299
|
+
);
|
|
2300
|
+
process.exitCode = 1;
|
|
2301
|
+
return;
|
|
2302
|
+
}
|
|
2303
|
+
render({ kind: "push_config_set", display: { "shape": "object", "fields": ["transport", "target_bot_username"], "format": { "transport": "truncate" } } }, result.data);
|
|
2304
|
+
});
|
|
2305
|
+
|
|
2306
|
+
// src/generated/cli/push/config/show.ts
|
|
2307
|
+
import { Command as Command25 } from "commander";
|
|
2308
|
+
var pushConfigGetCommand = new Command25("show").description("List the caller's push transports").action(async (opts) => {
|
|
2309
|
+
const client2 = await loadSdkClient();
|
|
2310
|
+
const result = await pushConfigGet({
|
|
2311
|
+
client: client2._rawClient
|
|
2312
|
+
});
|
|
2313
|
+
if (result.error || !result.response?.ok) {
|
|
2314
|
+
process.stderr.write(
|
|
2315
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2316
|
+
`
|
|
2317
|
+
);
|
|
2318
|
+
process.exitCode = 1;
|
|
2319
|
+
return;
|
|
2320
|
+
}
|
|
2321
|
+
render({ kind: "push_config_get", display: { "shape": "list", "dataPath": "configs", "columns": ["transport", "target_bot_username", "last_test_at", "last_test_status"], "format": { "transport": "truncate", "last_test_at": "relative-time", "last_test_status": "enum-badge" }, "enumColorMap": { "last_test_status": { "ok": { "label": "\u2713 ok", "color": "green" }, "*": { "label": "\u2715 <value>", "color": "red" }, "null": { "label": "\u2014", "color": "dim" } } }, "emptyMessage": "(no push transports registered)" } }, result.data);
|
|
2322
|
+
});
|
|
2323
|
+
|
|
2324
|
+
// src/generated/cli/push/test.ts
|
|
2325
|
+
import { Command as Command26 } from "commander";
|
|
2326
|
+
var pushTestCommand = new Command26("test").description("Send a test push notification").option("--transport <value>", "transport").action(async (opts) => {
|
|
2327
|
+
const client2 = await loadSdkClient();
|
|
2328
|
+
const result = await pushTest({
|
|
2329
|
+
client: client2._rawClient,
|
|
2330
|
+
body: {
|
|
2331
|
+
transport: opts.transport
|
|
2332
|
+
}
|
|
2333
|
+
});
|
|
2334
|
+
if (result.error || !result.response?.ok) {
|
|
2335
|
+
process.stderr.write(
|
|
2336
|
+
`HTTP ${result.response?.status ?? "?"}: ${JSON.stringify(result.error ?? "unknown error", null, 2)}
|
|
2337
|
+
`
|
|
2338
|
+
);
|
|
2339
|
+
process.exitCode = 1;
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
render({ kind: "push_test", display: { "shape": "object", "fields": ["ok", "status", "detail", "durationMs"], "format": { "ok": "bool-badge" } } }, result.data);
|
|
2343
|
+
if (result.data?.ok === false) {
|
|
2344
|
+
process.exit(1);
|
|
2345
|
+
}
|
|
2346
|
+
});
|
|
2347
|
+
|
|
2022
2348
|
// src/generated/cli/todo/project/add.ts
|
|
2023
|
-
import { Command as
|
|
2024
|
-
var projectCreateCommand = new
|
|
2349
|
+
import { Command as Command27 } from "commander";
|
|
2350
|
+
var projectCreateCommand = new Command27("add").description("Create a project").argument("<name>", "name").option("--default-todo-type-id <value>", "default_todo_type_id").action(async (name, opts) => {
|
|
2025
2351
|
const client2 = await loadSdkClient();
|
|
2026
2352
|
const result = await projectCreate({
|
|
2027
2353
|
client: client2._rawClient,
|
|
@@ -2042,8 +2368,8 @@ var projectCreateCommand = new Command17("add").description("Create a project").
|
|
|
2042
2368
|
});
|
|
2043
2369
|
|
|
2044
2370
|
// src/generated/cli/todo/project/ls.ts
|
|
2045
|
-
import { Command as
|
|
2046
|
-
var projectListCommand = new
|
|
2371
|
+
import { Command as Command28 } from "commander";
|
|
2372
|
+
var projectListCommand = new Command28("ls").description("List projects").option("--include-deleted <value>", "include_deleted").action(async (opts) => {
|
|
2047
2373
|
const client2 = await loadSdkClient();
|
|
2048
2374
|
const result = await projectList({
|
|
2049
2375
|
client: client2._rawClient,
|
|
@@ -2063,8 +2389,8 @@ var projectListCommand = new Command18("ls").description("List projects").option
|
|
|
2063
2389
|
});
|
|
2064
2390
|
|
|
2065
2391
|
// src/generated/cli/todo/rule/ls.ts
|
|
2066
|
-
import { Command as
|
|
2067
|
-
var recurrenceRuleListCommand = new
|
|
2392
|
+
import { Command as Command29 } from "commander";
|
|
2393
|
+
var recurrenceRuleListCommand = new Command29("ls").description("List recurring todo rules").option("--project-id <value>", "project_id").option("--user-id <value>", "user_id").action(async (opts) => {
|
|
2068
2394
|
const client2 = await loadSdkClient();
|
|
2069
2395
|
const result = await recurrenceRuleList({
|
|
2070
2396
|
client: client2._rawClient,
|
|
@@ -2085,8 +2411,8 @@ var recurrenceRuleListCommand = new Command19("ls").description("List recurring
|
|
|
2085
2411
|
});
|
|
2086
2412
|
|
|
2087
2413
|
// src/generated/cli/todo/add.ts
|
|
2088
|
-
import { Command as
|
|
2089
|
-
var todoCreateCommand = new
|
|
2414
|
+
import { Command as Command30 } from "commander";
|
|
2415
|
+
var todoCreateCommand = new Command30("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) => {
|
|
2090
2416
|
const client2 = await loadSdkClient();
|
|
2091
2417
|
const result = await todoCreate({
|
|
2092
2418
|
client: client2._rawClient,
|
|
@@ -2113,8 +2439,8 @@ var todoCreateCommand = new Command20("add").description("Create a todo").argume
|
|
|
2113
2439
|
});
|
|
2114
2440
|
|
|
2115
2441
|
// src/generated/cli/todo/ls.ts
|
|
2116
|
-
import { Command as
|
|
2117
|
-
var todoListCommand = new
|
|
2442
|
+
import { Command as Command31 } from "commander";
|
|
2443
|
+
var todoListCommand = new Command31("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) => {
|
|
2118
2444
|
const client2 = await loadSdkClient();
|
|
2119
2445
|
const result = await todoList({
|
|
2120
2446
|
client: client2._rawClient,
|
|
@@ -2145,8 +2471,8 @@ var todoListCommand = new Command21("ls").description("List todos with filters")
|
|
|
2145
2471
|
});
|
|
2146
2472
|
|
|
2147
2473
|
// src/generated/cli/todo/type/ls.ts
|
|
2148
|
-
import { Command as
|
|
2149
|
-
var todoTypeListCommand = new
|
|
2474
|
+
import { Command as Command32 } from "commander";
|
|
2475
|
+
var todoTypeListCommand = new Command32("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) => {
|
|
2150
2476
|
const client2 = await loadSdkClient();
|
|
2151
2477
|
const result = await todoTypeList({
|
|
2152
2478
|
client: client2._rawClient,
|
|
@@ -2168,8 +2494,8 @@ var todoTypeListCommand = new Command22("ls").description("List todo types").opt
|
|
|
2168
2494
|
});
|
|
2169
2495
|
|
|
2170
2496
|
// src/generated/cli/todo/rm.ts
|
|
2171
|
-
import { Command as
|
|
2172
|
-
var todoDeleteCommand = new
|
|
2497
|
+
import { Command as Command33 } from "commander";
|
|
2498
|
+
var todoDeleteCommand = new Command33("rm").description("Soft-delete a todo").argument("<id>", "id").option("--expected-version <value>", "expected_version").option("--cascade <value>", "cascade").action(async (id, opts) => {
|
|
2173
2499
|
const client2 = await loadSdkClient();
|
|
2174
2500
|
const result = await todoDelete({
|
|
2175
2501
|
client: client2._rawClient,
|
|
@@ -2193,8 +2519,8 @@ var todoDeleteCommand = new Command23("rm").description("Soft-delete a todo").ar
|
|
|
2193
2519
|
});
|
|
2194
2520
|
|
|
2195
2521
|
// src/generated/cli/todo/show.ts
|
|
2196
|
-
import { Command as
|
|
2197
|
-
var todoGetCommand = new
|
|
2522
|
+
import { Command as Command34 } from "commander";
|
|
2523
|
+
var todoGetCommand = new Command34("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) => {
|
|
2198
2524
|
const client2 = await loadSdkClient();
|
|
2199
2525
|
const result = await todoGet({
|
|
2200
2526
|
client: client2._rawClient,
|
|
@@ -2202,7 +2528,8 @@ var todoGetCommand = new Command24("show").description("Get a todo by id").argum
|
|
|
2202
2528
|
id
|
|
2203
2529
|
},
|
|
2204
2530
|
query: {
|
|
2205
|
-
include_deleted: opts.includeDeleted
|
|
2531
|
+
include_deleted: opts.includeDeleted,
|
|
2532
|
+
include_orphan_fields: opts.includeOrphanFields
|
|
2206
2533
|
}
|
|
2207
2534
|
});
|
|
2208
2535
|
if (result.error || !result.response?.ok) {
|
|
@@ -2217,8 +2544,8 @@ var todoGetCommand = new Command24("show").description("Get a todo by id").argum
|
|
|
2217
2544
|
});
|
|
2218
2545
|
|
|
2219
2546
|
// src/generated/cli/todo/update.ts
|
|
2220
|
-
import { Command as
|
|
2221
|
-
var todoUpdateCommand = new
|
|
2547
|
+
import { Command as Command35 } from "commander";
|
|
2548
|
+
var todoUpdateCommand = new Command35("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) => {
|
|
2222
2549
|
const client2 = await loadSdkClient();
|
|
2223
2550
|
const result = await todoUpdate({
|
|
2224
2551
|
client: client2._rawClient,
|
|
@@ -2250,8 +2577,15 @@ var todoUpdateCommand = new Command25("update").description("Update a todo").arg
|
|
|
2250
2577
|
|
|
2251
2578
|
// src/generated/cli/index.ts
|
|
2252
2579
|
function registerGeneratedCommands(root) {
|
|
2580
|
+
const root_keys = root.command("keys").description("keys commands");
|
|
2581
|
+
root_keys.addCommand(keyCreateCommand);
|
|
2582
|
+
root_keys.addCommand(keyListCommand);
|
|
2583
|
+
root_keys.addCommand(keyRevokeCommand);
|
|
2584
|
+
root_keys.addCommand(keyUpdateCommand);
|
|
2253
2585
|
const root_org = root.command("org").description("org commands");
|
|
2254
2586
|
root_org.addCommand(orgGetCommand);
|
|
2587
|
+
root_org.addCommand(orgUpdateCommand);
|
|
2588
|
+
root_org.addCommand(orgMembersListCommand);
|
|
2255
2589
|
const root_auth = root.command("auth").description("auth commands");
|
|
2256
2590
|
root_auth.addCommand(authMeCommand);
|
|
2257
2591
|
const root_event = root.command("event").description("event commands");
|
|
@@ -2271,6 +2605,12 @@ function registerGeneratedCommands(root) {
|
|
|
2271
2605
|
root_email.addCommand(emailListCommand);
|
|
2272
2606
|
root_email.addCommand(emailMarkReadCommand);
|
|
2273
2607
|
root_email.addCommand(emailMarkUnreadCommand);
|
|
2608
|
+
const root_push = root.command("push").description("push commands");
|
|
2609
|
+
const root_push_config = root_push.command("config").description("config commands");
|
|
2610
|
+
root_push_config.addCommand(pushConfigDeleteCommand);
|
|
2611
|
+
root_push_config.addCommand(pushConfigSetCommand);
|
|
2612
|
+
root_push_config.addCommand(pushConfigGetCommand);
|
|
2613
|
+
root_push.addCommand(pushTestCommand);
|
|
2274
2614
|
const root_todo = root.command("todo").description("todo commands");
|
|
2275
2615
|
const root_todo_project = root_todo.command("project").description("project commands");
|
|
2276
2616
|
root_todo_project.addCommand(projectCreateCommand);
|
|
@@ -2287,7 +2627,7 @@ function registerGeneratedCommands(root) {
|
|
|
2287
2627
|
}
|
|
2288
2628
|
|
|
2289
2629
|
// src/handwritten/commands/login.ts
|
|
2290
|
-
import { Command as
|
|
2630
|
+
import { Command as Command36 } from "commander";
|
|
2291
2631
|
|
|
2292
2632
|
// src/handwritten/auth/device-flow.ts
|
|
2293
2633
|
var DEFAULT_SLEEP = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -2422,7 +2762,7 @@ async function runLogin(opts) {
|
|
|
2422
2762
|
}
|
|
2423
2763
|
|
|
2424
2764
|
// src/handwritten/commands/login.ts
|
|
2425
|
-
var loginCommand = new
|
|
2765
|
+
var loginCommand = new Command36("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) => {
|
|
2426
2766
|
const store = new ConfigStore();
|
|
2427
2767
|
const output = opts.json ? { write: () => {
|
|
2428
2768
|
}, writeJson: (e) => process.stdout.write(JSON.stringify(e) + "\n") } : {
|
|
@@ -2439,7 +2779,7 @@ var loginCommand = new Command26("login").description("Log in via OAuth device f
|
|
|
2439
2779
|
});
|
|
2440
2780
|
|
|
2441
2781
|
// src/handwritten/commands/logout.ts
|
|
2442
|
-
import { Command as
|
|
2782
|
+
import { Command as Command37 } from "commander";
|
|
2443
2783
|
|
|
2444
2784
|
// src/handwritten/auth/logout.ts
|
|
2445
2785
|
async function runLogout(opts) {
|
|
@@ -2456,13 +2796,13 @@ async function runLogout(opts) {
|
|
|
2456
2796
|
}
|
|
2457
2797
|
|
|
2458
2798
|
// src/handwritten/commands/logout.ts
|
|
2459
|
-
var logoutCommand = new
|
|
2799
|
+
var logoutCommand = new Command37("logout").description("Clear stored credentials for the current environment").action(async () => {
|
|
2460
2800
|
await runLogout({ store: new ConfigStore() });
|
|
2461
2801
|
process.stdout.write("\u2713 logged out\n");
|
|
2462
2802
|
});
|
|
2463
2803
|
|
|
2464
2804
|
// src/handwritten/commands/whoami.ts
|
|
2465
|
-
import { Command as
|
|
2805
|
+
import { Command as Command38 } from "commander";
|
|
2466
2806
|
var ENV_DISPLAY = {
|
|
2467
2807
|
shape: "object",
|
|
2468
2808
|
fields: ["name", "api_base", "actor", "agent_label"]
|
|
@@ -2496,7 +2836,7 @@ registerRenderer("whoami", (data) => {
|
|
|
2496
2836
|
renderObject(d.org, ORG_DISPLAY);
|
|
2497
2837
|
}
|
|
2498
2838
|
});
|
|
2499
|
-
var whoamiCommand = new
|
|
2839
|
+
var whoamiCommand = new Command38("whoami").description("Show the active env, signed-in user, and organization").action(async () => {
|
|
2500
2840
|
const store = new ConfigStore();
|
|
2501
2841
|
const current = await store.currentEnv();
|
|
2502
2842
|
if (!current) {
|
|
@@ -2550,8 +2890,8 @@ function printLoggedOut() {
|
|
|
2550
2890
|
}
|
|
2551
2891
|
|
|
2552
2892
|
// src/handwritten/commands/config.ts
|
|
2553
|
-
import { Command as
|
|
2554
|
-
var configCommand = new
|
|
2893
|
+
import { Command as Command39 } from "commander";
|
|
2894
|
+
var configCommand = new Command39("config").description("Manage wspc local config");
|
|
2555
2895
|
registerRenderer("config_show", (data) => {
|
|
2556
2896
|
const d = data;
|
|
2557
2897
|
if (d.envs.length === 0) {
|
|
@@ -2616,7 +2956,7 @@ configCommand.command("use <env>").description("Switch current_env").action(asyn
|
|
|
2616
2956
|
});
|
|
2617
2957
|
|
|
2618
2958
|
// src/handwritten/commands/todo-done.ts
|
|
2619
|
-
import { Command as
|
|
2959
|
+
import { Command as Command40 } from "commander";
|
|
2620
2960
|
var TODO_UPDATE_DISPLAY = {
|
|
2621
2961
|
shape: "object",
|
|
2622
2962
|
format: {
|
|
@@ -2634,7 +2974,7 @@ var TODO_UPDATE_DISPLAY = {
|
|
|
2634
2974
|
deleted_at: "relative-time"
|
|
2635
2975
|
}
|
|
2636
2976
|
};
|
|
2637
|
-
var todoDoneCommand = new
|
|
2977
|
+
var todoDoneCommand = new Command40("done").description("Mark a todo done (sugar for `update <id> --status done`)").argument("<id>", "Todo id").action(async (id) => {
|
|
2638
2978
|
const client2 = await loadSdkClient();
|
|
2639
2979
|
const result = await todoUpdate({
|
|
2640
2980
|
client: client2._rawClient,
|
|
@@ -2653,7 +2993,7 @@ var todoDoneCommand = new Command30("done").description("Mark a todo done (sugar
|
|
|
2653
2993
|
});
|
|
2654
2994
|
|
|
2655
2995
|
// src/handwritten/commands/email/send.ts
|
|
2656
|
-
import { Command as
|
|
2996
|
+
import { Command as Command41 } from "commander";
|
|
2657
2997
|
import { readFile, stat } from "fs/promises";
|
|
2658
2998
|
import { basename } from "path";
|
|
2659
2999
|
|
|
@@ -2711,7 +3051,7 @@ async function resolveAttachment(input) {
|
|
|
2711
3051
|
`--attach ${input}: neither a readable file nor a valid <prefix>_<ulid>:<idx> reference.`
|
|
2712
3052
|
);
|
|
2713
3053
|
}
|
|
2714
|
-
var sendCommand = new
|
|
3054
|
+
var sendCommand = new Command41("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) => {
|
|
2715
3055
|
const isReply = Boolean(opts.reply);
|
|
2716
3056
|
const to = opts.to;
|
|
2717
3057
|
const attachInputs = opts.attach;
|
|
@@ -2798,7 +3138,7 @@ var sendCommand = new Command31("send").description("Send an outbound email").re
|
|
|
2798
3138
|
});
|
|
2799
3139
|
|
|
2800
3140
|
// src/handwritten/commands/email/attachment.ts
|
|
2801
|
-
import { Command as
|
|
3141
|
+
import { Command as Command42 } from "commander";
|
|
2802
3142
|
import { createWriteStream } from "fs";
|
|
2803
3143
|
import { Readable } from "stream";
|
|
2804
3144
|
import { pipeline } from "stream/promises";
|
|
@@ -2815,7 +3155,7 @@ function parseContentDispositionFilename(header) {
|
|
|
2815
3155
|
}
|
|
2816
3156
|
|
|
2817
3157
|
// src/handwritten/commands/email/attachment.ts
|
|
2818
|
-
var attachmentCommand = new
|
|
3158
|
+
var attachmentCommand = new Command42("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) => {
|
|
2819
3159
|
const idx = Number(idxArg);
|
|
2820
3160
|
if (!Number.isInteger(idx) || idx < 0) {
|
|
2821
3161
|
process.stderr.write(`<idx> must be a non-negative integer (got "${idxArg}")
|
|
@@ -2848,7 +3188,7 @@ var attachmentCommand = new Command32("attachment").description("Download an inb
|
|
|
2848
3188
|
|
|
2849
3189
|
// src/cli.ts
|
|
2850
3190
|
function buildProgram() {
|
|
2851
|
-
const program = new
|
|
3191
|
+
const program = new Command43().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)").hook("preAction", (thisCommand) => {
|
|
2852
3192
|
if (thisCommand.opts().json) process.env.WSPC_OUTPUT = "json";
|
|
2853
3193
|
});
|
|
2854
3194
|
program.addCommand(loginCommand);
|