@itznexus/itznexus-cli 1.152.0 → 1.153.0
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.
|
@@ -4,15 +4,12 @@ import { api } from "../../lib/api.js";
|
|
|
4
4
|
import { printList, printDetail, handleError } from "../../lib/format.js";
|
|
5
5
|
const oauthUrlCommand = new Command("oauth-url")
|
|
6
6
|
.description("Generate a Gmail OAuth consent URL")
|
|
7
|
-
.option("--scope <scope>", 'OAuth scope ("user"
|
|
8
|
-
.option("--organization <organizationId>", "Organization a drive reader belongs to (required with --scope drive)")
|
|
7
|
+
.option("--scope <scope>", 'OAuth scope ("user" or "workspace")', "user")
|
|
9
8
|
.option("--json", "Output as JSON")
|
|
10
9
|
.action(async (opts) => {
|
|
11
10
|
try {
|
|
12
11
|
const params = new URLSearchParams();
|
|
13
12
|
params.set("scope", opts.scope);
|
|
14
|
-
if (opts.organization)
|
|
15
|
-
params.set("organizationId", opts.organization);
|
|
16
13
|
const data = await api.get(`/gmail-accounts/oauth-url?${params}`);
|
|
17
14
|
if (opts.json) {
|
|
18
15
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -47,23 +44,20 @@ const oauthCallbackCommand = new Command("oauth-callback")
|
|
|
47
44
|
});
|
|
48
45
|
const listCommand = new Command("list")
|
|
49
46
|
.description("List linked Gmail accounts")
|
|
50
|
-
.option("--scope <scope>", 'Filter by scope ("user"
|
|
51
|
-
.option("--organization <organizationId>", "With --scope drive: only that organization's readers")
|
|
47
|
+
.option("--scope <scope>", 'Filter by scope ("user" or "workspace")')
|
|
52
48
|
.option("--json", "Output as JSON")
|
|
53
49
|
.action(async (opts) => {
|
|
54
50
|
try {
|
|
55
51
|
const params = new URLSearchParams();
|
|
56
52
|
if (opts.scope)
|
|
57
53
|
params.set("scope", opts.scope);
|
|
58
|
-
if (opts.organization)
|
|
59
|
-
params.set("organizationId", opts.organization);
|
|
60
54
|
const qs = params.toString();
|
|
61
55
|
const data = await api.get(`/gmail-accounts${qs ? `?${qs}` : ""}`);
|
|
62
56
|
printList(data, [
|
|
63
57
|
{ key: "email", label: "Email", width: 30 },
|
|
64
58
|
{ key: "scope", label: "Scope", width: 12 },
|
|
65
59
|
{ key: "status", label: "Status", width: 12 },
|
|
66
|
-
{ key: "
|
|
60
|
+
{ key: "syncMail", label: "Mail", width: 6 },
|
|
67
61
|
{ key: "createdAt", label: "Linked", width: 24 },
|
|
68
62
|
], opts);
|
|
69
63
|
}
|
|
@@ -87,7 +81,7 @@ const getCommand = new Command("get")
|
|
|
87
81
|
{ key: "id", label: "ID" },
|
|
88
82
|
{ key: "scope", label: "Scope" },
|
|
89
83
|
{ key: "status", label: "Status" },
|
|
90
|
-
{ key: "
|
|
84
|
+
{ key: "syncMail", label: "Sync mail" },
|
|
91
85
|
{ key: "userId", label: "User" },
|
|
92
86
|
{ key: "createdAt", label: "Linked" },
|
|
93
87
|
{ key: "updatedAt", label: "Updated" },
|
|
@@ -97,6 +91,30 @@ const getCommand = new Command("get")
|
|
|
97
91
|
handleError(err);
|
|
98
92
|
}
|
|
99
93
|
});
|
|
94
|
+
const updateCommand = new Command("update")
|
|
95
|
+
.description("Update a Google account (Drive reading is always on; mail sync is the switch)")
|
|
96
|
+
.argument("<id>", "Gmail account ID")
|
|
97
|
+
.requiredOption("--sync-mail <on|off>", 'Mirror this mailbox ("on" or "off")')
|
|
98
|
+
.option("--json", "Output as JSON")
|
|
99
|
+
.action(async (id, opts) => {
|
|
100
|
+
try {
|
|
101
|
+
if (opts.syncMail !== "on" && opts.syncMail !== "off") {
|
|
102
|
+
throw new Error('--sync-mail must be "on" or "off"');
|
|
103
|
+
}
|
|
104
|
+
const data = await api.post(`/gmail-accounts/${id}`, {
|
|
105
|
+
syncMail: opts.syncMail === "on",
|
|
106
|
+
});
|
|
107
|
+
if (opts.json) {
|
|
108
|
+
console.log(JSON.stringify(data, null, 2));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
console.log(chalk.green("✓"), `${chalk.bold(data.email)}: mail sync ${data.syncMail ? "on" : "off"}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
handleError(err);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
100
118
|
const deleteCommand = new Command("delete")
|
|
101
119
|
.description("Unlink a Gmail account")
|
|
102
120
|
.argument("<id>", "Gmail account ID")
|
|
@@ -116,10 +134,11 @@ const deleteCommand = new Command("delete")
|
|
|
116
134
|
}
|
|
117
135
|
});
|
|
118
136
|
export const gmailAccountCommand = new Command("gmail-account")
|
|
119
|
-
.description("Manage linked
|
|
137
|
+
.description("Manage linked Google accounts (Drive reading, optional mail sync)")
|
|
120
138
|
.addCommand(oauthUrlCommand)
|
|
121
139
|
.addCommand(oauthCallbackCommand)
|
|
122
140
|
.addCommand(listCommand)
|
|
123
141
|
.addCommand(getCommand)
|
|
142
|
+
.addCommand(updateCommand)
|
|
124
143
|
.addCommand(deleteCommand);
|
|
125
144
|
//# sourceMappingURL=gmail-accounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail-accounts.js","sourceRoot":"","sources":["../../../src/commands/api/gmail-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAkB1E,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KAC7C,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,
|
|
1
|
+
{"version":3,"file":"gmail-accounts.js","sourceRoot":"","sources":["../../../src/commands/api/gmail-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,M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AC;IACnB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC;KAC5D,WAAW,CACV,mEAAmE,CACpE;KACA,UAAU,CAAC,eAAe,CAAC;KAC3B,UAAU,CAAC,oBAAoB,CAAC;KAChC,UAAU,CAAC,WAAW,CAAC;KACvB,UAAU,CAAC,UAAU,CAAC;KACtB,UAAU,CAAC,aAAa,CAAC;KACzB,UAAU,CAAC,aAAa,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -120,7 +120,7 @@ YOUTUBE
|
|
|
120
120
|
youtube-video Manage ingested YouTube videos
|
|
121
121
|
|
|
122
122
|
INTEGRATIONS
|
|
123
|
-
gmail-account Manage linked Google accounts (
|
|
123
|
+
gmail-account Manage linked Google accounts (Drive reading, optional mail sync)
|
|
124
124
|
external-document Shared Google documents linked in messages, with their revisions
|
|
125
125
|
github-account Manage linked GitHub accounts
|
|
126
126
|
upwork-job-notification Inspect Upwork job notification ingestion
|