@circleback/cli 0.3.2 → 0.3.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/meetings.js +2 -1
- package/dist/constants.js +2 -1
- package/dist/helpers/parse.js +9 -1
- package/dist/helpers/table.js +3 -1
- package/package.json +2 -1
|
@@ -64,11 +64,12 @@ exports.searchMeetingsCommand = new commander_1.Command('search')
|
|
|
64
64
|
});
|
|
65
65
|
exports.readMeetingsCommand = new commander_1.Command('read')
|
|
66
66
|
.description('Get detailed meeting information.')
|
|
67
|
-
.argument('<ids...>',
|
|
67
|
+
.argument('<ids...>', `Meeting IDs (max ${constants_1.MAX_READ_MEETING_IDENTIFIERS})`)
|
|
68
68
|
.action(async (ids) => {
|
|
69
69
|
try {
|
|
70
70
|
const jsonMode = exports.readMeetingsCommand.parent?.parent?.opts().json ?? false;
|
|
71
71
|
const meetingIds = (0, parse_1.validateMeetingIdentifiers)(ids);
|
|
72
|
+
(0, parse_1.validateReadMeetingIdentifierLimit)(meetingIds);
|
|
72
73
|
const result = await (0, jsonRpc_1.callTool)('ReadMeetings', {
|
|
73
74
|
intent: `Reading meeting details for IDs: ${meetingIds.join(', ')}.`,
|
|
74
75
|
meetingIds,
|
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.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.API_KEY_SETTINGS_URL = exports.API_KEY_ENVIRONMENT_VARIABLE = exports.API_KEY_PREFIX = exports.CLIENT_VERSION_HEADER = 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.MAX_READ_MEETING_IDENTIFIERS = exports.CALLBACK_TIMEOUT_MILLISECONDS = exports.OAUTH_SCOPE = exports.TOKENS_FILE = exports.CONFIG_DIRECTORY = exports.ASCII_LOGO = exports.SECONDARY_COLOR = exports.BRAND_COLOR = exports.API_KEY_SETTINGS_URL = exports.API_KEY_ENVIRONMENT_VARIABLE = exports.API_KEY_PREFIX = exports.CLIENT_VERSION_HEADER = 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"));
|
|
@@ -45,6 +45,7 @@ exports.CONFIG_DIRECTORY = node_path_1.default.join(node_os_1.default.homedir(),
|
|
|
45
45
|
exports.TOKENS_FILE = node_path_1.default.join(exports.CONFIG_DIRECTORY, 'tokens.json');
|
|
46
46
|
exports.OAUTH_SCOPE = 'user';
|
|
47
47
|
exports.CALLBACK_TIMEOUT_MILLISECONDS = 120_000;
|
|
48
|
+
exports.MAX_READ_MEETING_IDENTIFIERS = 50;
|
|
48
49
|
exports.DEFAULT_MEETING_NAME = 'New meeting';
|
|
49
50
|
exports.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL = 'Unassigned';
|
|
50
51
|
exports.PAGE_OPTION_DESCRIPTION = 'Page index (starts at 0)';
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateMeetingIdentifiers = exports.parseNumericIds = exports.parseIntOption = exports.extractAndValidateObjectFromString = void 0;
|
|
3
|
+
exports.validateReadMeetingIdentifierLimit = exports.validateMeetingIdentifiers = exports.parseNumericIds = exports.parseIntOption = exports.extractAndValidateObjectFromString = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
5
6
|
const output_1 = require("./output");
|
|
6
7
|
const extractAndValidateObjectFromString = (rawText, schema) => {
|
|
7
8
|
try {
|
|
@@ -48,3 +49,10 @@ const validateMeetingIdentifiers = (values) => {
|
|
|
48
49
|
return cleanedValues;
|
|
49
50
|
};
|
|
50
51
|
exports.validateMeetingIdentifiers = validateMeetingIdentifiers;
|
|
52
|
+
const validateReadMeetingIdentifierLimit = (ids) => {
|
|
53
|
+
if (ids.length > constants_1.MAX_READ_MEETING_IDENTIFIERS) {
|
|
54
|
+
(0, output_1.printText)(`Too many meeting identifiers. Expected at most ${constants_1.MAX_READ_MEETING_IDENTIFIERS}.`, output_1.TextType.Error);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.validateReadMeetingIdentifierLimit = validateReadMeetingIdentifierLimit;
|
package/dist/helpers/table.js
CHANGED
|
@@ -242,7 +242,9 @@ const formatActionItems = (actionItems) => {
|
|
|
242
242
|
item.id,
|
|
243
243
|
item.status,
|
|
244
244
|
item.assignee?.name ?? constants_1.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL,
|
|
245
|
-
|
|
245
|
+
item.meetings
|
|
246
|
+
.map((meeting) => (0, string_1.truncate)(meeting.name || constants_1.DEFAULT_MEETING_NAME, meetingWidth - 2))
|
|
247
|
+
.join('\n') || '-',
|
|
246
248
|
(0, date_1.formatDate)(item.createdAt),
|
|
247
249
|
]));
|
|
248
250
|
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(actionItems.length, 'action item', 'action items')} found`)}\n${table.toString()}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@circleback/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Circleback CLI. Search and access meetings, emails, calendar events, and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Circleback <support@circleback.ai> (https://circleback.ai)",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"prebuild": "rm -rf dist",
|
|
26
26
|
"build": "tsc && chmod +x dist/index.js",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test:unit": "jest --runInBand",
|
|
28
29
|
"postinstall": "echo '\n Welcome to the Circleback CLI. Run `circleback` or `cb` to get started.\n'",
|
|
29
30
|
"prepublishOnly": "npm run build"
|
|
30
31
|
},
|