@circleback/cli 0.1.3 → 0.1.4
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/commands/actionItems.js +65 -0
- package/dist/commands/calendar.js +9 -8
- package/dist/commands/emails.js +5 -4
- package/dist/commands/meetings.js +22 -21
- package/dist/commands/registry.js +6 -0
- package/dist/commands/support.js +3 -3
- package/dist/commands/transcripts.js +10 -9
- package/dist/constants.js +12 -1
- package/dist/helpers/formatter.js +2 -0
- package/dist/helpers/table.js +67 -34
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.searchActionItemsCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const jsonRpc_1 = require("../client/jsonRpc");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
const date_1 = require("../helpers/date");
|
|
12
|
+
const error_1 = require("../helpers/error");
|
|
13
|
+
const formatter_1 = require("../helpers/formatter");
|
|
14
|
+
const parse_1 = require("../helpers/parse");
|
|
15
|
+
const DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS = 30;
|
|
16
|
+
exports.searchActionItemsCommand = new commander_1.Command('search')
|
|
17
|
+
.description('Search action items.')
|
|
18
|
+
.argument('[search]', 'Search term')
|
|
19
|
+
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
|
|
20
|
+
.option('--status <status>', 'Filter by status (PENDING or DONE)')
|
|
21
|
+
.option('--last <days>', 'Show action items from the last N days')
|
|
22
|
+
.option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
|
|
23
|
+
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
|
|
24
|
+
.option('--tags <ids>', constants_1.TAGS_OPTION_DESCRIPTION)
|
|
25
|
+
.option('--assignee <id>', 'Filter by assignee profile ID')
|
|
26
|
+
.action(async (query, options) => {
|
|
27
|
+
try {
|
|
28
|
+
if (options.last && options.from) {
|
|
29
|
+
console.error(chalk_1.default.red(constants_1.LAST_AND_FROM_CONFLICT_ERROR));
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const jsonMode = exports.searchActionItemsCommand.parent?.parent?.opts().json ?? false;
|
|
33
|
+
const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
|
|
34
|
+
const args = {
|
|
35
|
+
intent: query ?? 'Listing recent action items.',
|
|
36
|
+
pageIndex,
|
|
37
|
+
};
|
|
38
|
+
if (query)
|
|
39
|
+
args['searchTerms'] = [query];
|
|
40
|
+
if (options.status)
|
|
41
|
+
args['status'] = options.status;
|
|
42
|
+
if (options.last) {
|
|
43
|
+
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
|
|
44
|
+
}
|
|
45
|
+
else if (options.from) {
|
|
46
|
+
args['startDate'] = options.from;
|
|
47
|
+
}
|
|
48
|
+
else if (!query) {
|
|
49
|
+
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS);
|
|
50
|
+
}
|
|
51
|
+
if (options.to)
|
|
52
|
+
args['endDate'] = options.to;
|
|
53
|
+
if (options.tags)
|
|
54
|
+
args['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
|
|
55
|
+
if (options.assignee)
|
|
56
|
+
args['assigneeProfileId'] = (0, parse_1.parseIntOption)(options.assignee, '--assignee');
|
|
57
|
+
const result = await (0, jsonRpc_1.callTool)('SearchActionItems', args);
|
|
58
|
+
(0, formatter_1.formatOutput)('SearchActionItems', result, jsonMode);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const message = error instanceof Error ? error.message : constants_1.SEARCH_FAILED_ERROR;
|
|
62
|
+
console.error(chalk_1.default.red((0, error_1.formatMcpError)(message) ?? message));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
@@ -7,6 +7,7 @@ exports.searchCalendarCommand = void 0;
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const jsonRpc_1 = require("../client/jsonRpc");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
const date_1 = require("../helpers/date");
|
|
11
12
|
const error_1 = require("../helpers/error");
|
|
12
13
|
const formatter_1 = require("../helpers/formatter");
|
|
@@ -14,28 +15,28 @@ const parse_1 = require("../helpers/parse");
|
|
|
14
15
|
exports.searchCalendarCommand = new commander_1.Command('search')
|
|
15
16
|
.description('Search calendar events.')
|
|
16
17
|
.option('--last <days>', 'Show events from the last N days')
|
|
17
|
-
.option('--from <date>',
|
|
18
|
-
.option('--to <date>',
|
|
18
|
+
.option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
|
|
19
|
+
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
|
|
19
20
|
.action(async (options) => {
|
|
20
21
|
try {
|
|
21
22
|
if (options.last && options.from) {
|
|
22
|
-
console.error(chalk_1.default.red(
|
|
23
|
+
console.error(chalk_1.default.red(constants_1.LAST_AND_FROM_CONFLICT_ERROR));
|
|
23
24
|
process.exit(1);
|
|
24
25
|
}
|
|
25
26
|
const jsonMode = exports.searchCalendarCommand.parent?.parent?.opts().json ?? false;
|
|
26
|
-
const
|
|
27
|
+
const args = {
|
|
27
28
|
intent: 'Listing calendar events.',
|
|
28
29
|
pageIndex: 0,
|
|
29
30
|
};
|
|
30
31
|
if (options.last) {
|
|
31
|
-
|
|
32
|
+
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
|
|
32
33
|
}
|
|
33
34
|
else if (options.from) {
|
|
34
|
-
|
|
35
|
+
args['startDate'] = options.from;
|
|
35
36
|
}
|
|
36
37
|
if (options.to)
|
|
37
|
-
|
|
38
|
-
const result = await (0, jsonRpc_1.callTool)('SearchCalendarEvents',
|
|
38
|
+
args['endDate'] = options.to;
|
|
39
|
+
const result = await (0, jsonRpc_1.callTool)('SearchCalendarEvents', args);
|
|
39
40
|
(0, formatter_1.formatOutput)('SearchCalendarEvents', result, jsonMode);
|
|
40
41
|
}
|
|
41
42
|
catch (error) {
|
package/dist/commands/emails.js
CHANGED
|
@@ -7,13 +7,14 @@ exports.searchEmailsCommand = void 0;
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const jsonRpc_1 = require("../client/jsonRpc");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
const error_1 = require("../helpers/error");
|
|
11
12
|
const formatter_1 = require("../helpers/formatter");
|
|
12
13
|
const parse_1 = require("../helpers/parse");
|
|
13
14
|
exports.searchEmailsCommand = new commander_1.Command('search')
|
|
14
15
|
.description('Search connected email accounts. Supports filters: from:email, to:email, participant:email, before:YYYY-MM-DD, after:YYYY-MM-DD.')
|
|
15
16
|
.argument('[search]', 'Search term')
|
|
16
|
-
.option('-p, --page <index>',
|
|
17
|
+
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
|
|
17
18
|
.action(async (query, options) => {
|
|
18
19
|
try {
|
|
19
20
|
if (query !== undefined && query.trim() === '') {
|
|
@@ -22,12 +23,12 @@ exports.searchEmailsCommand = new commander_1.Command('search')
|
|
|
22
23
|
}
|
|
23
24
|
const jsonMode = exports.searchEmailsCommand.parent?.parent?.opts().json ?? false;
|
|
24
25
|
const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
|
|
25
|
-
const
|
|
26
|
+
const args = {
|
|
26
27
|
intent: query ?? 'Listing recent emails.',
|
|
27
28
|
pageIndex,
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
const result = await (0, jsonRpc_1.callTool)('SearchEmails',
|
|
30
|
+
args['searchTerm'] = query ?? '';
|
|
31
|
+
const result = await (0, jsonRpc_1.callTool)('SearchEmails', args);
|
|
31
32
|
(0, formatter_1.formatOutput)('SearchEmails', result, jsonMode);
|
|
32
33
|
}
|
|
33
34
|
catch (error) {
|
|
@@ -7,63 +7,64 @@ exports.readMeetingsCommand = exports.searchMeetingsCommand = void 0;
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const jsonRpc_1 = require("../client/jsonRpc");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
const date_1 = require("../helpers/date");
|
|
11
12
|
const error_1 = require("../helpers/error");
|
|
12
13
|
const formatter_1 = require("../helpers/formatter");
|
|
13
14
|
const parse_1 = require("../helpers/parse");
|
|
14
15
|
const DEFAULT_MEETINGS_SEARCH_LAST_DAYS = 7;
|
|
15
16
|
exports.searchMeetingsCommand = new commander_1.Command('search')
|
|
16
|
-
.description('Search
|
|
17
|
+
.description('Search meetings.')
|
|
17
18
|
.argument('[search]', 'Search term')
|
|
18
|
-
.option('-p, --page <index>',
|
|
19
|
+
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
|
|
19
20
|
.option('--last <days>', 'Show meetings from the last N days')
|
|
20
|
-
.option('--from <date>',
|
|
21
|
-
.option('--to <date>',
|
|
22
|
-
.option('--tags <ids>',
|
|
23
|
-
.option('--profiles <ids>',
|
|
24
|
-
.option('--domains <domains>',
|
|
21
|
+
.option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
|
|
22
|
+
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
|
|
23
|
+
.option('--tags <ids>', constants_1.TAGS_OPTION_DESCRIPTION)
|
|
24
|
+
.option('--profiles <ids>', constants_1.PROFILES_OPTION_DESCRIPTION)
|
|
25
|
+
.option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION)
|
|
25
26
|
.action(async (query, options) => {
|
|
26
27
|
try {
|
|
27
28
|
if (options.last && options.from) {
|
|
28
|
-
console.error(chalk_1.default.red(
|
|
29
|
+
console.error(chalk_1.default.red(constants_1.LAST_AND_FROM_CONFLICT_ERROR));
|
|
29
30
|
process.exit(1);
|
|
30
31
|
}
|
|
31
32
|
const jsonMode = exports.searchMeetingsCommand.parent?.parent?.opts().json ?? false;
|
|
32
33
|
const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
|
|
33
|
-
const
|
|
34
|
+
const args = {
|
|
34
35
|
intent: query ?? 'Listing recent meetings.',
|
|
35
36
|
pageIndex,
|
|
36
37
|
};
|
|
37
38
|
if (query)
|
|
38
|
-
|
|
39
|
+
args['searchTerm'] = query;
|
|
39
40
|
if (options.last) {
|
|
40
|
-
|
|
41
|
+
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
|
|
41
42
|
}
|
|
42
43
|
else if (options.from) {
|
|
43
|
-
|
|
44
|
+
args['startDate'] = options.from;
|
|
44
45
|
}
|
|
45
46
|
else if (!query) {
|
|
46
|
-
|
|
47
|
+
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_MEETINGS_SEARCH_LAST_DAYS);
|
|
47
48
|
}
|
|
48
49
|
if (options.to)
|
|
49
|
-
|
|
50
|
+
args['endDate'] = options.to;
|
|
50
51
|
if (options.tags)
|
|
51
|
-
|
|
52
|
+
args['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
|
|
52
53
|
if (options.profiles)
|
|
53
|
-
|
|
54
|
+
args['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
|
|
54
55
|
if (options.domains)
|
|
55
|
-
|
|
56
|
-
const result = await (0, jsonRpc_1.callTool)('SearchMeetings',
|
|
56
|
+
args['domains'] = options.domains.split(',');
|
|
57
|
+
const result = await (0, jsonRpc_1.callTool)('SearchMeetings', args);
|
|
57
58
|
(0, formatter_1.formatOutput)('SearchMeetings', result, jsonMode);
|
|
58
59
|
}
|
|
59
60
|
catch (error) {
|
|
60
|
-
const message = error instanceof Error ? error.message :
|
|
61
|
+
const message = error instanceof Error ? error.message : constants_1.SEARCH_FAILED_ERROR;
|
|
61
62
|
console.error(chalk_1.default.red((0, error_1.formatMcpError)(message) ?? message));
|
|
62
63
|
process.exit(1);
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
exports.readMeetingsCommand = new commander_1.Command('read')
|
|
66
|
-
.description('Get detailed information
|
|
67
|
+
.description('Get detailed meeting information.')
|
|
67
68
|
.argument('<ids...>', 'Meeting IDs')
|
|
68
69
|
.action(async (ids) => {
|
|
69
70
|
try {
|
|
@@ -76,7 +77,7 @@ exports.readMeetingsCommand = new commander_1.Command('read')
|
|
|
76
77
|
(0, formatter_1.formatOutput)('ReadMeetings', result, jsonMode);
|
|
77
78
|
}
|
|
78
79
|
catch (error) {
|
|
79
|
-
const message = error instanceof Error ? error.message :
|
|
80
|
+
const message = error instanceof Error ? error.message : constants_1.READ_FAILED_ERROR;
|
|
80
81
|
console.error(chalk_1.default.red((0, error_1.formatMcpError)(message) ?? message));
|
|
81
82
|
process.exit(1);
|
|
82
83
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAllCommands = exports.commandGroups = exports.standaloneCommands = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
+
const actionItems_1 = require("./actionItems");
|
|
5
6
|
const auth_1 = require("./auth");
|
|
6
7
|
const calendar_1 = require("./calendar");
|
|
7
8
|
const domains_1 = require("./domains");
|
|
@@ -52,6 +53,11 @@ exports.commandGroups = [
|
|
|
52
53
|
description: 'Search emails.',
|
|
53
54
|
subcommands: [emails_1.searchEmailsCommand],
|
|
54
55
|
},
|
|
56
|
+
{
|
|
57
|
+
name: 'action-items',
|
|
58
|
+
description: 'Search action items.',
|
|
59
|
+
subcommands: [actionItems_1.searchActionItemsCommand],
|
|
60
|
+
},
|
|
55
61
|
];
|
|
56
62
|
const buildCommandGroup = (definition) => definition.subcommands.reduce((group, command, index) => group.addCommand(command, index === 0 ? { isDefault: true } : undefined), new commander_1.Command(definition.name).description(definition.description));
|
|
57
63
|
const getAllCommands = () => [
|
package/dist/commands/support.js
CHANGED
|
@@ -15,11 +15,11 @@ exports.searchSupportCommand = new commander_1.Command('search')
|
|
|
15
15
|
.action(async (query) => {
|
|
16
16
|
try {
|
|
17
17
|
const jsonMode = exports.searchSupportCommand.parent?.parent?.opts().json ?? false;
|
|
18
|
-
const
|
|
18
|
+
const args = {
|
|
19
19
|
intent: query ?? 'Listing support articles.',
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
const result = await (0, jsonRpc_1.callTool)('SearchSupportArticles',
|
|
21
|
+
args['searchTerm'] = query ?? '';
|
|
22
|
+
const result = await (0, jsonRpc_1.callTool)('SearchSupportArticles', args);
|
|
23
23
|
(0, formatter_1.formatOutput)('SearchSupportArticles', result, jsonMode);
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
@@ -7,30 +7,31 @@ exports.getTranscriptsCommand = exports.searchTranscriptsCommand = void 0;
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const jsonRpc_1 = require("../client/jsonRpc");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
const error_1 = require("../helpers/error");
|
|
11
12
|
const formatter_1 = require("../helpers/formatter");
|
|
12
13
|
const parse_1 = require("../helpers/parse");
|
|
13
14
|
exports.searchTranscriptsCommand = new commander_1.Command('search')
|
|
14
15
|
.description('Search meeting transcripts.')
|
|
15
16
|
.argument('<search>', 'Search term')
|
|
16
|
-
.option('--tags <ids>',
|
|
17
|
-
.option('--profiles <ids>',
|
|
18
|
-
.option('--domains <domains>',
|
|
17
|
+
.option('--tags <ids>', constants_1.TAGS_OPTION_DESCRIPTION)
|
|
18
|
+
.option('--profiles <ids>', constants_1.PROFILES_OPTION_DESCRIPTION)
|
|
19
|
+
.option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION)
|
|
19
20
|
.showHelpAfterError(true)
|
|
20
21
|
.action(async (query, options) => {
|
|
21
22
|
try {
|
|
22
23
|
const jsonMode = exports.searchTranscriptsCommand.parent?.parent?.opts().json ?? false;
|
|
23
|
-
const
|
|
24
|
+
const args = {
|
|
24
25
|
intent: query,
|
|
25
26
|
searchTerm: query,
|
|
26
27
|
};
|
|
27
28
|
if (options.tags)
|
|
28
|
-
|
|
29
|
+
args['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
|
|
29
30
|
if (options.profiles)
|
|
30
|
-
|
|
31
|
+
args['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
|
|
31
32
|
if (options.domains)
|
|
32
|
-
|
|
33
|
-
const result = await (0, jsonRpc_1.callTool)('SearchTranscripts',
|
|
33
|
+
args['domains'] = options.domains.split(',');
|
|
34
|
+
const result = await (0, jsonRpc_1.callTool)('SearchTranscripts', args);
|
|
34
35
|
(0, formatter_1.formatOutput)('SearchTranscripts', result, jsonMode);
|
|
35
36
|
}
|
|
36
37
|
catch (error) {
|
|
@@ -40,7 +41,7 @@ exports.searchTranscriptsCommand = new commander_1.Command('search')
|
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
exports.getTranscriptsCommand = new commander_1.Command('read')
|
|
43
|
-
.description('Get full transcripts
|
|
44
|
+
.description('Get full meeting transcripts.')
|
|
44
45
|
.argument('<meetingId...>', 'Meeting IDs (max 50)')
|
|
45
46
|
.showHelpAfterError(true)
|
|
46
47
|
.action(async (ids) => {
|
package/dist/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CALLBACK_TIMEOUT_MILLISECONDS = exports.OAUTH_SCOPE = exports.TOKENS_FILE = exports.CONFIG_DIRECTORY = exports.ASCII_LOGO = exports.SECONDARY_COLOR = exports.BRAND_COLOR = exports.CLIENT_VERSION = exports.CLIENT_PACKAGE_NAME = exports.CLIENT_NAME = exports.BASE_URL = void 0;
|
|
6
|
+
exports.READ_FAILED_ERROR = exports.SEARCH_FAILED_ERROR = exports.LAST_AND_FROM_CONFLICT_ERROR = exports.DOMAINS_OPTION_DESCRIPTION = exports.PROFILES_OPTION_DESCRIPTION = exports.TAGS_OPTION_DESCRIPTION = exports.END_DATE_OPTION_DESCRIPTION = exports.START_DATE_OPTION_DESCRIPTION = exports.PAGE_OPTION_DESCRIPTION = exports.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL = exports.DEFAULT_MEETING_NAME = exports.CALLBACK_TIMEOUT_MILLISECONDS = exports.OAUTH_SCOPE = exports.TOKENS_FILE = exports.CONFIG_DIRECTORY = exports.ASCII_LOGO = exports.SECONDARY_COLOR = exports.BRAND_COLOR = exports.CLIENT_VERSION = exports.CLIENT_PACKAGE_NAME = exports.CLIENT_NAME = exports.BASE_URL = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const node_os_1 = __importDefault(require("node:os"));
|
|
@@ -37,3 +37,14 @@ exports.CONFIG_DIRECTORY = node_path_1.default.join(node_os_1.default.homedir(),
|
|
|
37
37
|
exports.TOKENS_FILE = node_path_1.default.join(exports.CONFIG_DIRECTORY, 'tokens.json');
|
|
38
38
|
exports.OAUTH_SCOPE = 'user';
|
|
39
39
|
exports.CALLBACK_TIMEOUT_MILLISECONDS = 120_000;
|
|
40
|
+
exports.DEFAULT_MEETING_NAME = 'New meeting';
|
|
41
|
+
exports.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL = 'Unassigned';
|
|
42
|
+
exports.PAGE_OPTION_DESCRIPTION = 'Page index (starts at 0)';
|
|
43
|
+
exports.START_DATE_OPTION_DESCRIPTION = 'Start date (YYYY-MM-DD)';
|
|
44
|
+
exports.END_DATE_OPTION_DESCRIPTION = 'End date (YYYY-MM-DD)';
|
|
45
|
+
exports.TAGS_OPTION_DESCRIPTION = 'Comma-separated tag IDs';
|
|
46
|
+
exports.PROFILES_OPTION_DESCRIPTION = 'Comma-separated profile IDs';
|
|
47
|
+
exports.DOMAINS_OPTION_DESCRIPTION = 'Comma-separated domains';
|
|
48
|
+
exports.LAST_AND_FROM_CONFLICT_ERROR = 'Cannot use --last and --from together.';
|
|
49
|
+
exports.SEARCH_FAILED_ERROR = 'Search failed.';
|
|
50
|
+
exports.READ_FAILED_ERROR = 'Read failed.';
|
|
@@ -33,6 +33,8 @@ const formatForTool = (toolName, data) => {
|
|
|
33
33
|
return (0, table_1.formatSupportArticles)(data);
|
|
34
34
|
case 'SearchEmails':
|
|
35
35
|
return (0, table_1.formatEmails)(data);
|
|
36
|
+
case 'SearchActionItems':
|
|
37
|
+
return (0, table_1.formatActionItems)(data);
|
|
36
38
|
default:
|
|
37
39
|
return;
|
|
38
40
|
}
|
package/dist/helpers/table.js
CHANGED
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.formatEmails = exports.formatSupportArticles = exports.formatDomains = exports.formatProfiles = exports.formatCalendarEvents = exports.formatTranscriptReadResults = exports.formatTranscriptSearchResults = exports.formatMeetingDetails = exports.formatMeetingsList = void 0;
|
|
6
|
+
exports.formatEmails = exports.formatActionItems = exports.formatSupportArticles = exports.formatDomains = exports.formatProfiles = exports.formatCalendarEvents = exports.formatTranscriptReadResults = exports.formatTranscriptSearchResults = exports.formatMeetingDetails = exports.formatMeetingsList = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
9
9
|
const date_1 = require("./date");
|
|
10
10
|
const string_1 = require("./string");
|
|
11
11
|
const style_1 = require("./style");
|
|
12
12
|
const lodash_1 = require("lodash");
|
|
13
|
+
const constants_1 = require("../constants");
|
|
13
14
|
const idColumnWidth = (ids) => {
|
|
14
15
|
const maxLength = ids.reduce((max, id) => Math.max(max, String(id).length), 2);
|
|
15
16
|
return maxLength + 2;
|
|
@@ -53,14 +54,12 @@ const formatMeetingsList = (meetings) => {
|
|
|
53
54
|
wordWrap: true,
|
|
54
55
|
style: style_1.tableStyle,
|
|
55
56
|
});
|
|
56
|
-
meetings.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
]);
|
|
63
|
-
});
|
|
57
|
+
table.push(...meetings.map((meeting) => [
|
|
58
|
+
(0, string_1.truncate)(meeting.name, nameWidth - 2),
|
|
59
|
+
meeting.id,
|
|
60
|
+
(0, date_1.formatDate)(meeting.createdAt),
|
|
61
|
+
meeting.attendees.map(formatAttendee).join('\n'),
|
|
62
|
+
]));
|
|
64
63
|
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(meetings.length, 'meeting', 'meetings')} found`)}\n${table.toString()}`;
|
|
65
64
|
};
|
|
66
65
|
exports.formatMeetingsList = formatMeetingsList;
|
|
@@ -106,13 +105,11 @@ const formatTranscriptSearchResults = (results) => {
|
|
|
106
105
|
wordWrap: true,
|
|
107
106
|
style: style_1.tableStyle,
|
|
108
107
|
});
|
|
109
|
-
results.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
]);
|
|
115
|
-
});
|
|
108
|
+
table.push(...results.map((result) => [
|
|
109
|
+
(0, string_1.truncate)(result.meetingName || constants_1.DEFAULT_MEETING_NAME, meetingWidth - 2),
|
|
110
|
+
result.meetingId,
|
|
111
|
+
(0, string_1.truncate)(result.text, contentWidth - 2),
|
|
112
|
+
]));
|
|
116
113
|
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(results.length, 'match', 'matches')} found`)}\n${table.toString()}`;
|
|
117
114
|
};
|
|
118
115
|
exports.formatTranscriptSearchResults = formatTranscriptSearchResults;
|
|
@@ -149,15 +146,13 @@ const formatCalendarEvents = (events) => {
|
|
|
149
146
|
wordWrap: true,
|
|
150
147
|
style: style_1.tableStyle,
|
|
151
148
|
});
|
|
152
|
-
events.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
]);
|
|
160
|
-
});
|
|
149
|
+
table.push(...events.map((event) => [
|
|
150
|
+
(0, string_1.truncate)(event.title, 28),
|
|
151
|
+
(0, date_1.formatDateTime)(event.startTime),
|
|
152
|
+
(0, date_1.formatDateTime)(event.endTime),
|
|
153
|
+
event.platform ?? '-',
|
|
154
|
+
event.attendees?.map(formatAttendee).join('\n') ?? '-',
|
|
155
|
+
]));
|
|
161
156
|
return `${chalk_1.default.bold((0, string_1.pluralize)(events.length, 'event', 'events'))}\n${table.toString()}`;
|
|
162
157
|
};
|
|
163
158
|
exports.formatCalendarEvents = formatCalendarEvents;
|
|
@@ -181,15 +176,13 @@ const formatProfiles = (profiles) => {
|
|
|
181
176
|
wordWrap: true,
|
|
182
177
|
style: style_1.tableStyle,
|
|
183
178
|
});
|
|
184
|
-
profiles.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
]);
|
|
192
|
-
});
|
|
179
|
+
table.push(...profiles.map((profile) => [
|
|
180
|
+
[profile.firstName, profile.lastName].filter(Boolean).join(' ') || '-',
|
|
181
|
+
profile.id,
|
|
182
|
+
profile.email ?? '-',
|
|
183
|
+
profile.title ?? '-',
|
|
184
|
+
profile.company ?? '-',
|
|
185
|
+
]));
|
|
193
186
|
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(profiles.length, 'person', 'people')} found`)}\n${table.toString()}`;
|
|
194
187
|
};
|
|
195
188
|
exports.formatProfiles = formatProfiles;
|
|
@@ -207,6 +200,46 @@ const formatSupportArticles = (articles) => {
|
|
|
207
200
|
.join('\n\n');
|
|
208
201
|
};
|
|
209
202
|
exports.formatSupportArticles = formatSupportArticles;
|
|
203
|
+
const formatActionItems = (actionItems) => {
|
|
204
|
+
if (actionItems.length === 0)
|
|
205
|
+
return chalk_1.default.yellow('No action items found.');
|
|
206
|
+
const idWidth = idColumnWidth(actionItems.map((item) => item.id));
|
|
207
|
+
const titleWidth = 35;
|
|
208
|
+
const statusWidth = 10;
|
|
209
|
+
const assigneeWidth = 20;
|
|
210
|
+
const meetingWidth = 25;
|
|
211
|
+
const dateWidth = 14;
|
|
212
|
+
const table = new cli_table3_1.default({
|
|
213
|
+
head: [
|
|
214
|
+
style_1.brand.bold('Title'),
|
|
215
|
+
style_1.brand.bold('ID'),
|
|
216
|
+
style_1.brand.bold('Status'),
|
|
217
|
+
style_1.brand.bold('Assignee'),
|
|
218
|
+
style_1.brand.bold('Meeting'),
|
|
219
|
+
style_1.brand.bold('Date'),
|
|
220
|
+
],
|
|
221
|
+
colWidths: [
|
|
222
|
+
titleWidth,
|
|
223
|
+
idWidth,
|
|
224
|
+
statusWidth,
|
|
225
|
+
assigneeWidth,
|
|
226
|
+
meetingWidth,
|
|
227
|
+
dateWidth,
|
|
228
|
+
],
|
|
229
|
+
wordWrap: true,
|
|
230
|
+
style: style_1.tableStyle,
|
|
231
|
+
});
|
|
232
|
+
table.push(...actionItems.map((item) => [
|
|
233
|
+
(0, string_1.truncate)(item.title, titleWidth - 2),
|
|
234
|
+
item.id,
|
|
235
|
+
item.status,
|
|
236
|
+
item.assignee?.name ?? constants_1.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL,
|
|
237
|
+
(0, string_1.truncate)(item.meeting.name || constants_1.DEFAULT_MEETING_NAME, meetingWidth - 2),
|
|
238
|
+
(0, date_1.formatDate)(item.createdAt),
|
|
239
|
+
]));
|
|
240
|
+
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(actionItems.length, 'action item', 'action items')} found`)}\n${table.toString()}`;
|
|
241
|
+
};
|
|
242
|
+
exports.formatActionItems = formatActionItems;
|
|
210
243
|
const formatMessage = (message) => {
|
|
211
244
|
const header = chalk_1.default.bold.cyan(message.subject ?? 'No subject');
|
|
212
245
|
const meta = `${chalk_1.default.bold('From:')} ${formatSender(message.sender)} ${chalk_1.default.dim((0, date_1.formatDateTime)(message.receivedOn))}`;
|
package/package.json
CHANGED