@circleback/cli 0.1.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.
- package/dist/auth/oauth.js +162 -0
- package/dist/auth/server.js +89 -0
- package/dist/auth/tokenStorage.js +51 -0
- package/dist/client/jsonRpc.js +128 -0
- package/dist/commands/auth.js +40 -0
- package/dist/commands/calendar.js +46 -0
- package/dist/commands/domains.js +28 -0
- package/dist/commands/emails.js +38 -0
- package/dist/commands/meetings.js +83 -0
- package/dist/commands/profiles.js +28 -0
- package/dist/commands/registry.js +61 -0
- package/dist/commands/support.js +30 -0
- package/dist/commands/transcripts.js +61 -0
- package/dist/commands/upgrade.js +35 -0
- package/dist/constants.js +39 -0
- package/dist/helpers/date.js +25 -0
- package/dist/helpers/error.js +59 -0
- package/dist/helpers/formatter.js +49 -0
- package/dist/helpers/help.js +42 -0
- package/dist/helpers/parse.js +34 -0
- package/dist/helpers/string.js +9 -0
- package/dist/helpers/style.js +21 -0
- package/dist/helpers/table.js +211 -0
- package/dist/helpers/update.js +105 -0
- package/dist/index.js +35 -0
- package/dist/types.js +34 -0
- package/package.json +45 -0
|
@@ -0,0 +1,211 @@
|
|
|
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.formatEmails = exports.formatSupportArticles = exports.formatDomains = exports.formatProfiles = exports.formatCalendarEvents = exports.formatTranscriptSearchResults = exports.formatTranscripts = exports.formatMeetingDetails = exports.formatMeetingsList = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
9
|
+
const date_1 = require("./date");
|
|
10
|
+
const string_1 = require("./string");
|
|
11
|
+
const style_1 = require("./style");
|
|
12
|
+
const idColumnWidth = (ids) => {
|
|
13
|
+
const maxLength = ids.reduce((max, id) => Math.max(max, String(id).length), 2);
|
|
14
|
+
return maxLength + 2;
|
|
15
|
+
};
|
|
16
|
+
const formatAttendee = (attendee) => attendee.email ? `${attendee.name} (${attendee.email})` : attendee.name;
|
|
17
|
+
const formatSender = (sender) => {
|
|
18
|
+
if (typeof sender === 'string')
|
|
19
|
+
return sender;
|
|
20
|
+
if (sender.name && sender.email)
|
|
21
|
+
return `${sender.name} (${sender.email})`;
|
|
22
|
+
return sender.name ?? sender.email ?? 'Unknown';
|
|
23
|
+
};
|
|
24
|
+
const formatMeetingsList = (meetings) => {
|
|
25
|
+
if (meetings.length === 0)
|
|
26
|
+
return chalk_1.default.yellow('No meetings found.');
|
|
27
|
+
const idWidth = idColumnWidth(meetings.map((meeting) => meeting.id));
|
|
28
|
+
const nameWidth = 40;
|
|
29
|
+
const dateWidth = 14;
|
|
30
|
+
const attendeesWidth = 30;
|
|
31
|
+
const table = new cli_table3_1.default({
|
|
32
|
+
head: [
|
|
33
|
+
style_1.brand.bold('Name'),
|
|
34
|
+
style_1.brand.bold('ID'),
|
|
35
|
+
style_1.brand.bold('Date'),
|
|
36
|
+
style_1.brand.bold('Attendees'),
|
|
37
|
+
],
|
|
38
|
+
colWidths: [nameWidth, idWidth, dateWidth, attendeesWidth],
|
|
39
|
+
wordWrap: true,
|
|
40
|
+
style: style_1.tableStyle,
|
|
41
|
+
});
|
|
42
|
+
meetings.forEach((meeting) => {
|
|
43
|
+
table.push([
|
|
44
|
+
(0, string_1.truncate)(meeting.name, nameWidth - 2),
|
|
45
|
+
meeting.id,
|
|
46
|
+
(0, date_1.formatDate)(meeting.createdAt),
|
|
47
|
+
meeting.attendees.map(formatAttendee).join('\n'),
|
|
48
|
+
]);
|
|
49
|
+
});
|
|
50
|
+
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(meetings.length, 'meeting', 'meetings')} found`)}\n${table.toString()}`;
|
|
51
|
+
};
|
|
52
|
+
exports.formatMeetingsList = formatMeetingsList;
|
|
53
|
+
const formatMeetingDetails = (meetings) => {
|
|
54
|
+
if (meetings.length === 0)
|
|
55
|
+
return chalk_1.default.yellow('No meetings found.');
|
|
56
|
+
return meetings
|
|
57
|
+
.map((meeting) => {
|
|
58
|
+
const header = chalk_1.default.bold.cyan(`\n# ${meeting.name}`);
|
|
59
|
+
const meta = [
|
|
60
|
+
`${chalk_1.default.bold('ID:')} ${meeting.id}`,
|
|
61
|
+
`${chalk_1.default.bold('Date:')} ${(0, date_1.formatDate)(meeting.createdAt)}`,
|
|
62
|
+
meeting.duration
|
|
63
|
+
? `${chalk_1.default.bold('Duration:')} ${Math.round(meeting.duration / 60)} min`
|
|
64
|
+
: null,
|
|
65
|
+
`${chalk_1.default.bold('Attendees:')}\n${meeting.attendees.map((attendee) => ` ${formatAttendee(attendee)}`).join('\n')}`,
|
|
66
|
+
meeting.tags.length > 0
|
|
67
|
+
? `${chalk_1.default.bold('Tags:')} ${meeting.tags.map((tag) => tag.name).join(', ')}`
|
|
68
|
+
: null,
|
|
69
|
+
]
|
|
70
|
+
.filter(Boolean)
|
|
71
|
+
.join('\n');
|
|
72
|
+
const notes = meeting.notes
|
|
73
|
+
? `\n${chalk_1.default.bold('Notes:')}\n${meeting.notes}`
|
|
74
|
+
: '';
|
|
75
|
+
const actionItems = meeting.actionItems && meeting.actionItems.length > 0
|
|
76
|
+
? `\n${chalk_1.default.bold('Action Items:')}\n${meeting.actionItems.map((item) => ` - ${item.text}${item.assignee ? ` (${item.assignee})` : ''}`).join('\n')}`
|
|
77
|
+
: '';
|
|
78
|
+
return `${header}\n${meta}${notes}${actionItems}`;
|
|
79
|
+
})
|
|
80
|
+
.join('\n\n---\n');
|
|
81
|
+
};
|
|
82
|
+
exports.formatMeetingDetails = formatMeetingDetails;
|
|
83
|
+
const formatTranscripts = (transcripts) => {
|
|
84
|
+
if (transcripts.length === 0)
|
|
85
|
+
return chalk_1.default.yellow('No transcripts found.');
|
|
86
|
+
return transcripts
|
|
87
|
+
.map((transcript) => {
|
|
88
|
+
const header = chalk_1.default.bold.cyan(`\n# ${transcript.meetingName} (ID: ${transcript.meetingId})`);
|
|
89
|
+
const content = transcript.transcriptChunks
|
|
90
|
+
.map((chunk) => chunk.content)
|
|
91
|
+
.join('\n');
|
|
92
|
+
return `${header}\n${content}`;
|
|
93
|
+
})
|
|
94
|
+
.join('\n\n---\n');
|
|
95
|
+
};
|
|
96
|
+
exports.formatTranscripts = formatTranscripts;
|
|
97
|
+
const formatTranscriptSearchResults = (results) => {
|
|
98
|
+
if (results.length === 0)
|
|
99
|
+
return chalk_1.default.yellow('No transcript matches found.');
|
|
100
|
+
const idWidth = idColumnWidth(results.map((result) => result.meetingId));
|
|
101
|
+
const meetingWidth = 25;
|
|
102
|
+
const contentWidth = 60;
|
|
103
|
+
const table = new cli_table3_1.default({
|
|
104
|
+
head: [style_1.brand.bold('Meeting'), style_1.brand.bold('ID'), style_1.brand.bold('Content')],
|
|
105
|
+
colWidths: [meetingWidth, idWidth, contentWidth],
|
|
106
|
+
wordWrap: true,
|
|
107
|
+
style: style_1.tableStyle,
|
|
108
|
+
});
|
|
109
|
+
results.forEach((result) => {
|
|
110
|
+
table.push([
|
|
111
|
+
(0, string_1.truncate)(result.meetingName ?? 'Unknown', meetingWidth - 2),
|
|
112
|
+
result.meetingId,
|
|
113
|
+
(0, string_1.truncate)(result.content, contentWidth - 2),
|
|
114
|
+
]);
|
|
115
|
+
});
|
|
116
|
+
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(results.length, 'match', 'matches')} found`)}\n${table.toString()}`;
|
|
117
|
+
};
|
|
118
|
+
exports.formatTranscriptSearchResults = formatTranscriptSearchResults;
|
|
119
|
+
const formatCalendarEvents = (events) => {
|
|
120
|
+
if (events.length === 0)
|
|
121
|
+
return chalk_1.default.yellow('No calendar events found.');
|
|
122
|
+
const table = new cli_table3_1.default({
|
|
123
|
+
head: [
|
|
124
|
+
style_1.brand.bold('Title'),
|
|
125
|
+
style_1.brand.bold('Start'),
|
|
126
|
+
style_1.brand.bold('End'),
|
|
127
|
+
style_1.brand.bold('Platform'),
|
|
128
|
+
style_1.brand.bold('Attendees'),
|
|
129
|
+
],
|
|
130
|
+
colWidths: [30, 20, 20, 12, 35],
|
|
131
|
+
wordWrap: true,
|
|
132
|
+
style: style_1.tableStyle,
|
|
133
|
+
});
|
|
134
|
+
events.forEach((event) => {
|
|
135
|
+
table.push([
|
|
136
|
+
(0, string_1.truncate)(event.title, 28),
|
|
137
|
+
(0, date_1.formatDateTime)(event.startTime),
|
|
138
|
+
(0, date_1.formatDateTime)(event.endTime),
|
|
139
|
+
event.platform ?? '-',
|
|
140
|
+
event.attendees.map(formatAttendee).join('\n'),
|
|
141
|
+
]);
|
|
142
|
+
});
|
|
143
|
+
return `${chalk_1.default.bold((0, string_1.pluralize)(events.length, 'event', 'events'))}\n${table.toString()}`;
|
|
144
|
+
};
|
|
145
|
+
exports.formatCalendarEvents = formatCalendarEvents;
|
|
146
|
+
const formatProfiles = (profiles) => {
|
|
147
|
+
if (profiles.length === 0)
|
|
148
|
+
return chalk_1.default.yellow('No people found.');
|
|
149
|
+
const idWidth = idColumnWidth(profiles.map((profile) => profile.id));
|
|
150
|
+
const nameWidth = 25;
|
|
151
|
+
const emailWidth = 30;
|
|
152
|
+
const titleWidth = 20;
|
|
153
|
+
const companyWidth = 15;
|
|
154
|
+
const table = new cli_table3_1.default({
|
|
155
|
+
head: [
|
|
156
|
+
style_1.brand.bold('Name'),
|
|
157
|
+
style_1.brand.bold('ID'),
|
|
158
|
+
style_1.brand.bold('Email'),
|
|
159
|
+
style_1.brand.bold('Title'),
|
|
160
|
+
style_1.brand.bold('Company'),
|
|
161
|
+
],
|
|
162
|
+
colWidths: [nameWidth, idWidth, emailWidth, titleWidth, companyWidth],
|
|
163
|
+
wordWrap: true,
|
|
164
|
+
style: style_1.tableStyle,
|
|
165
|
+
});
|
|
166
|
+
profiles.forEach((profile) => {
|
|
167
|
+
table.push([
|
|
168
|
+
[profile.firstName, profile.lastName].filter(Boolean).join(' ') || '-',
|
|
169
|
+
profile.id,
|
|
170
|
+
profile.email ?? '-',
|
|
171
|
+
profile.title ?? '-',
|
|
172
|
+
profile.company ?? '-',
|
|
173
|
+
]);
|
|
174
|
+
});
|
|
175
|
+
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(profiles.length, 'person', 'people')} found`)}\n${table.toString()}`;
|
|
176
|
+
};
|
|
177
|
+
exports.formatProfiles = formatProfiles;
|
|
178
|
+
const formatDomains = (domains) => {
|
|
179
|
+
if (domains.length === 0)
|
|
180
|
+
return chalk_1.default.yellow('No companies found.');
|
|
181
|
+
return `${chalk_1.default.bold(`${(0, string_1.pluralize)(domains.length, 'company', 'companies')} found`)}\n${domains.map((domain) => ` ${domain}`).join('\n')}`;
|
|
182
|
+
};
|
|
183
|
+
exports.formatDomains = formatDomains;
|
|
184
|
+
const formatSupportArticles = (articles) => {
|
|
185
|
+
if (articles.length === 0)
|
|
186
|
+
return chalk_1.default.yellow('No articles found.');
|
|
187
|
+
return articles
|
|
188
|
+
.map((article) => `${(0, string_1.link)(chalk_1.default.bold.cyan(article.title), article.url)}\n${(0, string_1.link)(chalk_1.default.dim.underline(article.url), article.url)}\n${article.description}`)
|
|
189
|
+
.join('\n\n');
|
|
190
|
+
};
|
|
191
|
+
exports.formatSupportArticles = formatSupportArticles;
|
|
192
|
+
const formatEmails = (threads) => {
|
|
193
|
+
if (threads.length === 0)
|
|
194
|
+
return chalk_1.default.yellow('No emails found.');
|
|
195
|
+
return threads
|
|
196
|
+
.map((thread) => {
|
|
197
|
+
const latestMessage = thread.messages[0];
|
|
198
|
+
if (!latestMessage)
|
|
199
|
+
return '';
|
|
200
|
+
const header = chalk_1.default.bold.cyan(latestMessage.subject);
|
|
201
|
+
const meta = `${chalk_1.default.bold('From:')} ${formatSender(latestMessage.sender)} ${chalk_1.default.dim((0, date_1.formatDateTime)(latestMessage.receivedOn))}`;
|
|
202
|
+
const messageCount = thread.messages.length > 1
|
|
203
|
+
? chalk_1.default.dim(`(${thread.messages.length} messages in thread)`)
|
|
204
|
+
: '';
|
|
205
|
+
const preview = (0, string_1.truncate)(latestMessage.content.replace(/\s+/g, ' ').trim(), 200);
|
|
206
|
+
return `${header}\n${meta} ${messageCount}\n${preview}`;
|
|
207
|
+
})
|
|
208
|
+
.filter(Boolean)
|
|
209
|
+
.join('\n\n---\n');
|
|
210
|
+
};
|
|
211
|
+
exports.formatEmails = formatEmails;
|
|
@@ -0,0 +1,105 @@
|
|
|
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.printUpdateNotification = exports.checkForUpdate = void 0;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
const CACHE_FILE = node_path_1.default.join(constants_1.CONFIG_DIRECTORY, 'update-check.json');
|
|
12
|
+
const CHECK_INTERVAL_MILLISECONDS = 60 * 60 * 1000; // 1 hour
|
|
13
|
+
const REGISTRY_TIMEOUT_MILLISECONDS = 3_000;
|
|
14
|
+
const fetchLatestVersion = async (packageName) => {
|
|
15
|
+
const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`, {
|
|
16
|
+
headers: { accept: 'application/json' },
|
|
17
|
+
signal: AbortSignal.timeout(REGISTRY_TIMEOUT_MILLISECONDS),
|
|
18
|
+
});
|
|
19
|
+
if (!response.ok) {
|
|
20
|
+
throw new Error(`Registry returned status ${response.status}.`);
|
|
21
|
+
}
|
|
22
|
+
const parsed = await response.json();
|
|
23
|
+
if (typeof parsed !== 'object' ||
|
|
24
|
+
parsed === null ||
|
|
25
|
+
!('version' in parsed) ||
|
|
26
|
+
typeof parsed.version !== 'string') {
|
|
27
|
+
throw new Error('Invalid registry response format.');
|
|
28
|
+
}
|
|
29
|
+
return parsed.version;
|
|
30
|
+
};
|
|
31
|
+
const loadCache = () => {
|
|
32
|
+
try {
|
|
33
|
+
const content = node_fs_1.default.readFileSync(CACHE_FILE, 'utf-8');
|
|
34
|
+
const parsed = JSON.parse(content);
|
|
35
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
36
|
+
return;
|
|
37
|
+
if (!('latestVersion' in parsed) ||
|
|
38
|
+
typeof parsed.latestVersion !== 'string')
|
|
39
|
+
return;
|
|
40
|
+
if (!('checkedAt' in parsed) || typeof parsed.checkedAt !== 'number')
|
|
41
|
+
return;
|
|
42
|
+
return { latestVersion: parsed.latestVersion, checkedAt: parsed.checkedAt };
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const saveCache = (cache) => {
|
|
49
|
+
try {
|
|
50
|
+
node_fs_1.default.mkdirSync(constants_1.CONFIG_DIRECTORY, { recursive: true, mode: 0o700 });
|
|
51
|
+
node_fs_1.default.writeFileSync(CACHE_FILE, JSON.stringify(cache), { mode: 0o600 });
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Silently ignore cache write failures.
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const parseVersion = (version) => version.replace(/^v/, '').split('.').map(Number);
|
|
58
|
+
const isNewerVersion = (latest, current) => {
|
|
59
|
+
const latestParts = parseVersion(latest);
|
|
60
|
+
const currentParts = parseVersion(current);
|
|
61
|
+
const length = Math.max(latestParts.length, currentParts.length);
|
|
62
|
+
const firstDifference = Array.from({ length }, (_, index) => (latestParts[index] ?? 0) - (currentParts[index] ?? 0)).find((difference) => difference !== 0);
|
|
63
|
+
return (firstDifference ?? 0) > 0;
|
|
64
|
+
};
|
|
65
|
+
const checkForUpdate = async (packageName) => {
|
|
66
|
+
const cached = loadCache();
|
|
67
|
+
const now = Date.now();
|
|
68
|
+
if (cached && now - cached.checkedAt < CHECK_INTERVAL_MILLISECONDS) {
|
|
69
|
+
return {
|
|
70
|
+
updateAvailable: isNewerVersion(cached.latestVersion, constants_1.CLIENT_VERSION),
|
|
71
|
+
currentVersion: constants_1.CLIENT_VERSION,
|
|
72
|
+
latestVersion: cached.latestVersion,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
const latestVersion = await fetchLatestVersion(packageName);
|
|
77
|
+
saveCache({ latestVersion, checkedAt: now });
|
|
78
|
+
return {
|
|
79
|
+
updateAvailable: isNewerVersion(latestVersion, constants_1.CLIENT_VERSION),
|
|
80
|
+
currentVersion: constants_1.CLIENT_VERSION,
|
|
81
|
+
latestVersion,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// Network failures should never block CLI usage.
|
|
86
|
+
return {
|
|
87
|
+
updateAvailable: false,
|
|
88
|
+
currentVersion: constants_1.CLIENT_VERSION,
|
|
89
|
+
latestVersion: cached?.latestVersion ?? constants_1.CLIENT_VERSION,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.checkForUpdate = checkForUpdate;
|
|
94
|
+
const printUpdateNotification = (result) => {
|
|
95
|
+
if (!result.updateAvailable)
|
|
96
|
+
return;
|
|
97
|
+
const message = [
|
|
98
|
+
'',
|
|
99
|
+
chalk_1.default.yellow(` Update available: ${chalk_1.default.dim(result.currentVersion)} → ${chalk_1.default.green(result.latestVersion)}`),
|
|
100
|
+
chalk_1.default.yellow(` Run ${chalk_1.default.cyan('circleback update')} or ${chalk_1.default.cyan('cb update')} to update.`),
|
|
101
|
+
'',
|
|
102
|
+
].join('\n');
|
|
103
|
+
console.error(message);
|
|
104
|
+
};
|
|
105
|
+
exports.printUpdateNotification = printUpdateNotification;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const registry_1 = require("./commands/registry");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const help_1 = require("./helpers/help");
|
|
8
|
+
const style_1 = require("./helpers/style");
|
|
9
|
+
const update_1 = require("./helpers/update");
|
|
10
|
+
const program = new commander_1.Command();
|
|
11
|
+
program
|
|
12
|
+
.name('circleback')
|
|
13
|
+
.description('Search and access meetings, emails, calendar events, and more.')
|
|
14
|
+
.version(constants_1.CLIENT_VERSION)
|
|
15
|
+
.option('--json', 'Output raw JSON instead of formatted text')
|
|
16
|
+
.addHelpText('before', style_1.BANNER)
|
|
17
|
+
.configureOutput({
|
|
18
|
+
writeOut: (text) => process.stdout.write((0, help_1.styleHelpOutput)(text)),
|
|
19
|
+
writeErr: (text) => process.stderr.write((0, help_1.styleHelpOutput)(text)),
|
|
20
|
+
});
|
|
21
|
+
(0, registry_1.getAllCommands)().reduce((p, command) => p.addCommand(command), program);
|
|
22
|
+
// Fire the update check in the background immediately so it runs in parallel
|
|
23
|
+
// with command execution. The result is awaited and printed after the command
|
|
24
|
+
// finishes, adding zero latency to the happy path.
|
|
25
|
+
const updateCheckPromise = (0, update_1.checkForUpdate)(constants_1.CLIENT_PACKAGE_NAME);
|
|
26
|
+
program.hook('postAction', async () => {
|
|
27
|
+
try {
|
|
28
|
+
const result = await updateCheckPromise;
|
|
29
|
+
(0, update_1.printUpdateNotification)(result);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Never let the update check interfere with normal CLI operation.
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
program.parse();
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isJsonRpcResponse = exports.isOAuthTokenResponse = exports.isStoredTokens = void 0;
|
|
4
|
+
const isStoredTokens = (value) => typeof value === 'object' &&
|
|
5
|
+
value !== null &&
|
|
6
|
+
'accessToken' in value &&
|
|
7
|
+
typeof value.accessToken === 'string' &&
|
|
8
|
+
'refreshToken' in value &&
|
|
9
|
+
typeof value.refreshToken === 'string' &&
|
|
10
|
+
'expiresAt' in value &&
|
|
11
|
+
typeof value.expiresAt === 'number' &&
|
|
12
|
+
'clientId' in value &&
|
|
13
|
+
typeof value.clientId === 'string' &&
|
|
14
|
+
'scope' in value &&
|
|
15
|
+
typeof value.scope === 'string';
|
|
16
|
+
exports.isStoredTokens = isStoredTokens;
|
|
17
|
+
const isOAuthTokenResponse = (value) => typeof value === 'object' &&
|
|
18
|
+
value !== null &&
|
|
19
|
+
'access_token' in value &&
|
|
20
|
+
typeof value.access_token === 'string' &&
|
|
21
|
+
'refresh_token' in value &&
|
|
22
|
+
typeof value.refresh_token === 'string' &&
|
|
23
|
+
'expires_in' in value &&
|
|
24
|
+
typeof value.expires_in === 'number' &&
|
|
25
|
+
'scope' in value &&
|
|
26
|
+
typeof value.scope === 'string';
|
|
27
|
+
exports.isOAuthTokenResponse = isOAuthTokenResponse;
|
|
28
|
+
const isJsonRpcResponse = (value) => typeof value === 'object' &&
|
|
29
|
+
value !== null &&
|
|
30
|
+
'jsonrpc' in value &&
|
|
31
|
+
value.jsonrpc === '2.0' &&
|
|
32
|
+
'id' in value &&
|
|
33
|
+
typeof value.id === 'number';
|
|
34
|
+
exports.isJsonRpcResponse = isJsonRpcResponse;
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@circleback/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Circleback CLI. Search and access meetings, emails, calendar events, and more.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Circleback <support@circleback.ai> (https://circleback.ai)",
|
|
7
|
+
"homepage": "https://circleback.ai",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"circleback",
|
|
10
|
+
"cli",
|
|
11
|
+
"meetings",
|
|
12
|
+
"transcripts",
|
|
13
|
+
"notes",
|
|
14
|
+
"calendar",
|
|
15
|
+
"ai"
|
|
16
|
+
],
|
|
17
|
+
"bin": {
|
|
18
|
+
"circleback": "./dist/index.js",
|
|
19
|
+
"cb": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"prebuild": "rm -rf dist",
|
|
26
|
+
"build": "tsc && chmod +x dist/index.js",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"chalk": "^4.1.2",
|
|
38
|
+
"cli-table3": "^0.6.5",
|
|
39
|
+
"commander": "^13.1.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^22.0.0",
|
|
43
|
+
"typescript": "5.6.2"
|
|
44
|
+
}
|
|
45
|
+
}
|