canvaslms-cli 1.6.3 → 1.6.4-fix

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/CHANGELOG.md CHANGED
@@ -1,210 +1,228 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.6.3] - 2025-12-14
9
-
10
- ### Added (1.6.3)
11
-
12
- - **Live table resize**: Tables re-render automatically when terminal is resized
13
- - **Adaptive truncation**: Text truncation updates dynamically based on terminal width
14
-
15
- ### Fixed (1.6.3)
16
-
17
- - **Submit table truncation**: Reduced excessive truncation in the submit table by compacting columns and shortening date format
18
- - **Table overflow**: Fixed tables overflowing terminal width on small screens
19
- - **Column width calculation**: Corrected border overhead calculation for accurate fitting
20
-
21
- ### Changed (1.6.3)
22
-
23
- - **Submit table columns**: Optimized and tightened column widths for compact display (Assignment Name max width set to 35, Type fixed at 8, Due fixed at 16 with MM/DD/YYYY formatting, Status fixed at 12)
24
-
25
- ## [1.6.2] - 2025-12-14
26
-
27
- - **Table display**: All table now have the same rounded corner format, text size adaptive to the terminal size
28
-
29
- ## [1.6.1] - 2025-12-13
30
-
31
- - **Dry Run Mode**: Submit command now supports `--dry-run` flag to test submission flow without actually uploading files or submitting assignments
32
- - **Assignment URL Display**: After successful submission, the direct link to the assignment is now displayed for easy access
33
-
34
- ## [1.6.0] - 2025-12-06
35
-
36
- ### Added (1.6.0)
37
-
38
- - **Boxed Table Displays**: All commands now display data in modern boxed tables with rounded corners (╭╮╰╯)
39
- - **Adaptive Column Widths**: Tables dynamically adjust column widths based on terminal size for optimal display
40
- - **Color-Coded Grades**: Assignment grades are now color-coded (green: ≥80%, yellow: ≥50%, red: <50%)
41
- - **Announcements Table**: Course selection and announcements list now displayed in formatted tables
42
- - **Profile Table**: User profile information displayed in clean field/value table format
43
-
44
- ### Changed (1.6.0)
45
-
46
- - **Grades Display**: Merged official grades and calculated statistics into a unified table
47
- - **CLI Descriptions**: Shortened command descriptions for cleaner help output
48
- - **Config Output**: Simplified config help by removing redundant command examples
49
- - **Submit Command**: Updated to use rounded corners and adaptive widths
50
- - **Line Endings**: Standardized all files to LF line endings
51
-
52
- ### Technical
53
-
54
- - Consistent use of box-drawing characters across all commands
55
- - Improved terminal width detection for responsive layouts
56
-
57
- ## [1.5.1] - 2025-11-05
58
-
59
- ## [1.4.7] - 2025-11-05
60
-
61
- ### Added (1.4.7)
62
-
63
- - Show allowed file extensions hint in the interactive file browser when an assignment restricts uploads (e.g. `*.pdf`, `*.docx`).
64
- - Add `r` keybinding to the file browser to reload the current directory listing without exiting the browser.
65
-
66
- - **Enhanced File Selection UX**: Implemented continuous file selection until empty input
67
- - Browse current directory with file size display
68
- - Add multiple files one by one
69
- - Remove files from selection
70
- - Show currently selected files
71
- - Smart file filtering (excludes hidden files, package files)
72
- - **Wildcard support**: Use patterns like `*.html`, `*.js`, `*.pdf` to select multiple files
73
- - File type icons for better visual identification
74
-
75
- - **Improved Grade Viewing**:
76
- - Interactive course selection for grade viewing
77
- - Assignment-level grade details with color coding
78
- - Overall course grade summary
79
- - Better grade formatting and status indicators
80
- - Support for letter grades, excused, and missing assignments
81
-
82
- ### Notes (1.4.7)
83
-
84
- - Bumped package version to 1.4.7.
85
- - Assignment-level grade details with color coding
86
- - Overall course grade summary
87
- - Better grade formatting and status indicators
88
- - Support for letter grades, excused, and missing assignments
89
-
90
- - **Enhanced Display Names**:
91
- - Show course names instead of IDs in all commands
92
- - Display assignment names prominently
93
- - Better labeling of IDs vs names throughout interface
94
-
95
- - **Interactive Utilities**:
96
- - Added validation and retry logic for user input
97
- - Confirmation helpers with default values
98
- - List selection utilities with cancel option
99
-
100
- ### Improved (1.4.7)
101
-
102
- - **Submit Command**: Complete redesign with better file selection workflow
103
- - **Grades Command**: Interactive course selection and detailed assignment grades
104
- - **Assignments Command**: Display course names prominently
105
- - **Announcements Command**: Show course names instead of IDs
106
- - **User Experience**: More consistent and intuitive interfaces across all commands
107
-
108
- ### Fixed (1.4.7)
109
-
110
- - Prevent the interactive file browser from permanently removing other stdin listeners: save and restore `process.stdin` 'data' listeners so `readline` and SIGINT (Ctrl+C) continue to work after browser exit.
111
- - Filter file browser listings by `allowed_extensions` when provided by the assignment so disallowed file types cannot be selected (prevents HTTP 400 "filetype not allowed").
112
- - Allow pressing Enter at the final "Proceed with submission? (Y/n)" prompt to accept the default (Yes) to match the shown prompt.
113
- - **Assignment Name Display**: Fixed "Unknown Assignment" issue in submission summary
114
- - **File Selection Flow**: Better error handling and user guidance during file selection
115
- - **Variable Scope**: Proper assignment variable handling throughout submission process
116
-
117
- ### Technical (1.4.7)
118
-
119
- - Enhanced interactive utilities in `lib/interactive.js`
120
- - Better error handling and user guidance
121
- - Improved code organization and modularity
122
-
123
- ## [1.1.1] - 2025-07-03
124
-
125
- ### Fixed (1.1.1)
126
-
127
- - Removed dotenv dependency that was causing module not found errors
128
- - Fixed configuration file path to use `.canvaslms-cli-config.json`
129
- - Resolved package publishing and global installation issues
130
-
131
- ### Added (1.1.1)
132
-
133
- - Dual binary support: both `canvaslms-cli` and `canvas` commands work
134
-
135
- ## [1.1.0] - 2025-07-03
136
-
137
- ### Major Changes (1.1.0)
138
-
139
- - Home directory configuration system (~/.canvaslms-cli-config.json)
140
- - Interactive configuration setup wizard (`canvas config setup`)
141
- - Configuration management subcommands:
142
- - `canvas config show` - Display current configuration
143
- - `canvas config edit` - Edit existing configuration
144
- - `canvas config path` - Show config file location
145
- - `canvas config delete` - Remove configuration file
146
- - Automatic configuration validation for all commands
147
- - Improved error handling and user guidance
148
-
149
- ### Changed (1.1.0)
150
-
151
- - **BREAKING**: Removed environment variable support (.env files)
152
- - Configuration now stored in user's home directory instead of project directory
153
- - Enhanced configuration validation with better error messages
154
- - Improved user onboarding with guided setup process
155
-
156
- ### Removed (1.1.0)
157
-
158
- - dotenv dependency (no longer needed)
159
- - Environment variable fallback support
160
-
161
- ## [1.0.0] - 2025-07-03
162
-
163
- ### Added (1.0.0)
164
-
165
- - Initial release of Canvas CLI Tool
166
- - Modular architecture with separate command handlers
167
- - Interactive assignment submission with file upload
168
- - Course management (list starred/all courses)
169
- - Assignment operations (view, filter by status)
170
- - Grade viewing for all courses or specific course
171
- - Announcements viewing
172
- - User profile management
173
- - Raw API access for all HTTP methods (GET, POST, PUT, DELETE)
174
- - Comprehensive configuration management
175
- - Color-coded output for better readability
176
- - Support for multiple file uploads
177
- - File selection from current directory
178
- - Detailed verbose modes for all commands
179
-
180
- ### Features (1.0.0)
181
-
182
- - 📚 Course listing with favorites support
183
- - 📝 Assignment management with status indicators
184
- - 🚀 Interactive file submission workflow
185
- - 📢 Announcement viewing
186
- - 👤 Profile information display
187
- - 🔧 Direct Canvas API access
188
- - Command aliases for faster usage
189
- - 🎨 Color-coded grade display
190
- - 📁 Smart file selection interface
191
-
192
- ### Technical (1.0.0)
193
-
194
- - Modular command structure in separate files
195
- - Reusable API client library
196
- - Interactive prompt utilities
197
- - File upload handling with progress indicators
198
- - Error handling and user-friendly messages
199
- - Cross-platform compatibility
200
-
201
- ## [Unreleased]
202
-
203
- ### Planned Features (Unreleased)
204
-
205
- - Assignment creation and editing
206
- - Bulk operations
207
- - Plugin system
208
- - Advanced filtering options
209
- - Export functionality
210
- - Offline mode support
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.6.4-fix] - 2025-12-15
9
+
10
+ ### Fix (1.6.4)
11
+
12
+ - **Remove Postinstall Command**: Change to prepare husky
13
+
14
+ ## [1.6.4] - 2025-12-15
15
+
16
+ ### Added (1.6.4)
17
+
18
+ - **Modules Command**: New `modules` command to view course modules and their items with progress tracking
19
+ - **Calendar Command**: New `calendar` command to view upcoming assignments and events with due dates
20
+
21
+ ### Changed (1.6.4)
22
+
23
+ - **Course Arguments**: Replaced course ID arguments with course name arguments across all commands (assignments, grades, announcements) for easier usage
24
+ - **Workflow Name**: Changed CI workflow name from "CI" to "Test & Build" for better clarity
25
+
26
+ ## [1.6.3] - 2025-12-14
27
+
28
+ ### Added (1.6.3)
29
+
30
+ - **Live table resize**: Tables re-render automatically when terminal is resized
31
+ - **Adaptive truncation**: Text truncation updates dynamically based on terminal width
32
+
33
+ ### Fixed (1.6.3)
34
+
35
+ - **Submit table truncation**: Reduced excessive truncation in the submit table by compacting columns and shortening date format
36
+ - **Table overflow**: Fixed tables overflowing terminal width on small screens
37
+ - **Column width calculation**: Corrected border overhead calculation for accurate fitting
38
+
39
+ ### Changed (1.6.3)
40
+
41
+ - **Submit table columns**: Optimized and tightened column widths for compact display (Assignment Name max width set to 35, Type fixed at 8, Due fixed at 16 with MM/DD/YYYY formatting, Status fixed at 12)
42
+
43
+ ## [1.6.2] - 2025-12-14
44
+
45
+ - **Table display**: All table now have the same rounded corner format, text size adaptive to the terminal size
46
+
47
+ ## [1.6.1] - 2025-12-13
48
+
49
+ - **Dry Run Mode**: Submit command now supports `--dry-run` flag to test submission flow without actually uploading files or submitting assignments
50
+ - **Assignment URL Display**: After successful submission, the direct link to the assignment is now displayed for easy access
51
+
52
+ ## [1.6.0] - 2025-12-06
53
+
54
+ ### Added (1.6.0)
55
+
56
+ - **Boxed Table Displays**: All commands now display data in modern boxed tables with rounded corners (╭╮╰╯)
57
+ - **Adaptive Column Widths**: Tables dynamically adjust column widths based on terminal size for optimal display
58
+ - **Color-Coded Grades**: Assignment grades are now color-coded (green: ≥80%, yellow: ≥50%, red: <50%)
59
+ - **Announcements Table**: Course selection and announcements list now displayed in formatted tables
60
+ - **Profile Table**: User profile information displayed in clean field/value table format
61
+
62
+ ### Changed (1.6.0)
63
+
64
+ - **Grades Display**: Merged official grades and calculated statistics into a unified table
65
+ - **CLI Descriptions**: Shortened command descriptions for cleaner help output
66
+ - **Config Output**: Simplified config help by removing redundant command examples
67
+ - **Submit Command**: Updated to use rounded corners and adaptive widths
68
+ - **Line Endings**: Standardized all files to LF line endings
69
+
70
+ ### Technical
71
+
72
+ - Consistent use of box-drawing characters across all commands
73
+ - Improved terminal width detection for responsive layouts
74
+
75
+ ## [1.5.1] - 2025-11-05
76
+
77
+ ## [1.4.7] - 2025-11-05
78
+
79
+ ### Added (1.4.7)
80
+
81
+ - Show allowed file extensions hint in the interactive file browser when an assignment restricts uploads (e.g. `*.pdf`, `*.docx`).
82
+ - Add `r` keybinding to the file browser to reload the current directory listing without exiting the browser.
83
+
84
+ - **Enhanced File Selection UX**: Implemented continuous file selection until empty input
85
+ - Browse current directory with file size display
86
+ - Add multiple files one by one
87
+ - Remove files from selection
88
+ - Show currently selected files
89
+ - Smart file filtering (excludes hidden files, package files)
90
+ - **Wildcard support**: Use patterns like `*.html`, `*.js`, `*.pdf` to select multiple files
91
+ - File type icons for better visual identification
92
+
93
+ - **Improved Grade Viewing**:
94
+ - Interactive course selection for grade viewing
95
+ - Assignment-level grade details with color coding
96
+ - Overall course grade summary
97
+ - Better grade formatting and status indicators
98
+ - Support for letter grades, excused, and missing assignments
99
+
100
+ ### Notes (1.4.7)
101
+
102
+ - Bumped package version to 1.4.7.
103
+ - Assignment-level grade details with color coding
104
+ - Overall course grade summary
105
+ - Better grade formatting and status indicators
106
+ - Support for letter grades, excused, and missing assignments
107
+
108
+ - **Enhanced Display Names**:
109
+ - Show course names instead of IDs in all commands
110
+ - Display assignment names prominently
111
+ - Better labeling of IDs vs names throughout interface
112
+
113
+ - **Interactive Utilities**:
114
+ - Added validation and retry logic for user input
115
+ - Confirmation helpers with default values
116
+ - List selection utilities with cancel option
117
+
118
+ ### Improved (1.4.7)
119
+
120
+ - **Submit Command**: Complete redesign with better file selection workflow
121
+ - **Grades Command**: Interactive course selection and detailed assignment grades
122
+ - **Assignments Command**: Display course names prominently
123
+ - **Announcements Command**: Show course names instead of IDs
124
+ - **User Experience**: More consistent and intuitive interfaces across all commands
125
+
126
+ ### Fixed (1.4.7)
127
+
128
+ - Prevent the interactive file browser from permanently removing other stdin listeners: save and restore `process.stdin` 'data' listeners so `readline` and SIGINT (Ctrl+C) continue to work after browser exit.
129
+ - Filter file browser listings by `allowed_extensions` when provided by the assignment so disallowed file types cannot be selected (prevents HTTP 400 "filetype not allowed").
130
+ - Allow pressing Enter at the final "Proceed with submission? (Y/n)" prompt to accept the default (Yes) to match the shown prompt.
131
+ - **Assignment Name Display**: Fixed "Unknown Assignment" issue in submission summary
132
+ - **File Selection Flow**: Better error handling and user guidance during file selection
133
+ - **Variable Scope**: Proper assignment variable handling throughout submission process
134
+
135
+ ### Technical (1.4.7)
136
+
137
+ - Enhanced interactive utilities in `lib/interactive.js`
138
+ - Better error handling and user guidance
139
+ - Improved code organization and modularity
140
+
141
+ ## [1.1.1] - 2025-07-03
142
+
143
+ ### Fixed (1.1.1)
144
+
145
+ - Removed dotenv dependency that was causing module not found errors
146
+ - Fixed configuration file path to use `.canvaslms-cli-config.json`
147
+ - Resolved package publishing and global installation issues
148
+
149
+ ### Added (1.1.1)
150
+
151
+ - Dual binary support: both `canvaslms-cli` and `canvas` commands work
152
+
153
+ ## [1.1.0] - 2025-07-03
154
+
155
+ ### Major Changes (1.1.0)
156
+
157
+ - Home directory configuration system (~/.canvaslms-cli-config.json)
158
+ - Interactive configuration setup wizard (`canvas config setup`)
159
+ - Configuration management subcommands:
160
+ - `canvas config show` - Display current configuration
161
+ - `canvas config edit` - Edit existing configuration
162
+ - `canvas config path` - Show config file location
163
+ - `canvas config delete` - Remove configuration file
164
+ - Automatic configuration validation for all commands
165
+ - Improved error handling and user guidance
166
+
167
+ ### Changed (1.1.0)
168
+
169
+ - **BREAKING**: Removed environment variable support (.env files)
170
+ - Configuration now stored in user's home directory instead of project directory
171
+ - Enhanced configuration validation with better error messages
172
+ - Improved user onboarding with guided setup process
173
+
174
+ ### Removed (1.1.0)
175
+
176
+ - dotenv dependency (no longer needed)
177
+ - Environment variable fallback support
178
+
179
+ ## [1.0.0] - 2025-07-03
180
+
181
+ ### Added (1.0.0)
182
+
183
+ - Initial release of Canvas CLI Tool
184
+ - Modular architecture with separate command handlers
185
+ - Interactive assignment submission with file upload
186
+ - Course management (list starred/all courses)
187
+ - Assignment operations (view, filter by status)
188
+ - Grade viewing for all courses or specific course
189
+ - Announcements viewing
190
+ - User profile management
191
+ - Raw API access for all HTTP methods (GET, POST, PUT, DELETE)
192
+ - Comprehensive configuration management
193
+ - Color-coded output for better readability
194
+ - Support for multiple file uploads
195
+ - File selection from current directory
196
+ - Detailed verbose modes for all commands
197
+
198
+ ### Features (1.0.0)
199
+
200
+ - 📚 Course listing with favorites support
201
+ - 📝 Assignment management with status indicators
202
+ - 🚀 Interactive file submission workflow
203
+ - 📢 Announcement viewing
204
+ - 👤 Profile information display
205
+ - 🔧 Direct Canvas API access
206
+ - Command aliases for faster usage
207
+ - 🎨 Color-coded grade display
208
+ - 📁 Smart file selection interface
209
+
210
+ ### Technical (1.0.0)
211
+
212
+ - Modular command structure in separate files
213
+ - Reusable API client library
214
+ - Interactive prompt utilities
215
+ - File upload handling with progress indicators
216
+ - Error handling and user-friendly messages
217
+ - Cross-platform compatibility
218
+
219
+ ## [Unreleased]
220
+
221
+ ### Planned Features (Unreleased)
222
+
223
+ - Assignment creation and editing
224
+ - Bulk operations
225
+ - Plugin system
226
+ - Advanced filtering options
227
+ - Export functionality
228
+ - Offline mode support
@@ -0,0 +1,7 @@
1
+ export interface CalendarOptions {
2
+ days?: string;
3
+ all?: boolean;
4
+ past?: boolean;
5
+ }
6
+ export declare function showCalendar(options?: CalendarOptions): Promise<void>;
7
+ //# sourceMappingURL=calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../commands/calendar.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA8CD,wBAAsB,YAAY,CAChC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA+If"}
@@ -0,0 +1,150 @@
1
+ import { makeCanvasRequest } from "../lib/api-client.js";
2
+ import { Table, printInfo, printError, printSuccess } from "../lib/display.js";
3
+ import chalk from "chalk";
4
+ function formatTimeRemaining(dueDate) {
5
+ const now = new Date();
6
+ const diff = dueDate.getTime() - now.getTime();
7
+ const days = Math.floor(diff / (1000 * 60 * 60 * 24));
8
+ const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
9
+ if (diff < 0) {
10
+ const pastDays = Math.abs(days);
11
+ if (pastDays === 0)
12
+ return { text: "Today", color: chalk.red };
13
+ if (pastDays === 1)
14
+ return { text: "1d ago", color: chalk.red };
15
+ return { text: `${pastDays}d ago`, color: chalk.red };
16
+ }
17
+ if (days === 0) {
18
+ if (hours <= 1)
19
+ return { text: "< 1 hour", color: chalk.red };
20
+ return { text: `${hours} hours`, color: chalk.red };
21
+ }
22
+ if (days === 1)
23
+ return { text: "Tomorrow", color: chalk.yellow };
24
+ if (days <= 3)
25
+ return { text: `${days} days`, color: chalk.yellow };
26
+ if (days <= 7)
27
+ return { text: `${days} days`, color: chalk.cyan };
28
+ return { text: `${days} days`, color: chalk.green };
29
+ }
30
+ function formatDueDate(date) {
31
+ const month = (date.getMonth() + 1).toString().padStart(2, "0");
32
+ const day = date.getDate().toString().padStart(2, "0");
33
+ const hours = date.getHours().toString().padStart(2, "0");
34
+ const mins = date.getMinutes().toString().padStart(2, "0");
35
+ return `${month}/${day} ${hours}:${mins}`;
36
+ }
37
+ export async function showCalendar(options = {}) {
38
+ try {
39
+ const days = parseInt(options.days || "14", 10);
40
+ const showPast = options.past || false;
41
+ printInfo("\n" + "-".repeat(60));
42
+ printInfo("Loading upcoming due dates...");
43
+ const queryParams = ["enrollment_state=active", "include[]=favorites"];
44
+ const courses = await makeCanvasRequest("get", "courses", queryParams);
45
+ if (!courses || courses.length === 0) {
46
+ printError("No courses found.");
47
+ return;
48
+ }
49
+ let targetCourses = courses;
50
+ if (!options.all) {
51
+ const starred = courses.filter((c) => c.is_favorite);
52
+ if (starred.length > 0) {
53
+ targetCourses = starred;
54
+ }
55
+ }
56
+ const now = new Date();
57
+ const futureDate = new Date(now.getTime() + days * 24 * 60 * 60 * 1000);
58
+ const pastDate = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
59
+ const assignmentPromises = targetCourses.map(async (course) => {
60
+ try {
61
+ const assignments = await makeCanvasRequest("get", `courses/${course.id}/assignments`, ["include[]=submission", "per_page=100"]);
62
+ return { course, assignments: assignments || [] };
63
+ }
64
+ catch {
65
+ return { course, assignments: [] };
66
+ }
67
+ });
68
+ const results = await Promise.all(assignmentPromises);
69
+ const dueItems = [];
70
+ for (const { course, assignments } of results) {
71
+ for (const assignment of assignments) {
72
+ if (!assignment.due_at)
73
+ continue;
74
+ const dueAt = new Date(assignment.due_at);
75
+ const submission = assignment.submission;
76
+ const isSubmitted = !!(submission && submission.submitted_at);
77
+ if (showPast) {
78
+ if (dueAt < pastDate || dueAt > futureDate)
79
+ continue;
80
+ }
81
+ else {
82
+ if (dueAt < now || dueAt > futureDate)
83
+ continue;
84
+ }
85
+ dueItems.push({
86
+ courseName: course.name,
87
+ courseId: course.id,
88
+ assignmentName: assignment.name,
89
+ assignmentId: assignment.id,
90
+ dueAt,
91
+ submitted: isSubmitted,
92
+ pointsPossible: assignment.points_possible || 0,
93
+ });
94
+ }
95
+ }
96
+ dueItems.sort((a, b) => a.dueAt.getTime() - b.dueAt.getTime());
97
+ if (dueItems.length === 0) {
98
+ console.log(chalk.yellow(`\nNo upcoming assignments due in the next ${days} days.`));
99
+ if (!options.all) {
100
+ console.log(chalk.gray("Tip: Use --all to include all courses."));
101
+ }
102
+ return;
103
+ }
104
+ const courseLabel = options.all ? "all courses" : "starred courses";
105
+ console.log(chalk.cyan.bold(`\nUpcoming Due Dates (${courseLabel}, next ${days} days)`));
106
+ printSuccess(`Found ${dueItems.length} upcoming assignment(s).`);
107
+ const table = new Table([
108
+ { key: "course", header: "Course", flex: 1, minWidth: 10 },
109
+ { key: "assignment", header: "Assignment", flex: 1, minWidth: 15 },
110
+ { key: "due", header: "Due", width: 12 },
111
+ {
112
+ key: "remaining",
113
+ header: "Remaining",
114
+ width: 10,
115
+ color: (value, row) => {
116
+ const colorFn = row._remainingColor;
117
+ return colorFn ? colorFn(value) : chalk.white(value);
118
+ },
119
+ },
120
+ {
121
+ key: "status",
122
+ header: "Status",
123
+ width: 8,
124
+ color: (value, row) => row._submitted ? chalk.green(value) : chalk.yellow(value),
125
+ },
126
+ ], { showRowNumbers: true });
127
+ for (const item of dueItems) {
128
+ const remaining = formatTimeRemaining(item.dueAt);
129
+ table.addRow({
130
+ course: item.courseName,
131
+ assignment: item.assignmentName,
132
+ due: formatDueDate(item.dueAt),
133
+ remaining: remaining.text,
134
+ status: item.submitted ? "Done" : "Pending",
135
+ _submitted: item.submitted,
136
+ _remainingColor: remaining.color,
137
+ });
138
+ }
139
+ table.renderWithResize();
140
+ const pending = dueItems.filter((d) => !d.submitted).length;
141
+ const done = dueItems.filter((d) => d.submitted).length;
142
+ console.log(chalk.gray(`\n ${pending} pending, ${done} submitted`));
143
+ }
144
+ catch (error) {
145
+ const errorMessage = error instanceof Error ? error.message : String(error);
146
+ console.error(chalk.red("Error fetching calendar:"), errorMessage);
147
+ process.exit(1);
148
+ }
149
+ }
150
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../commands/calendar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB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,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;QAC5D,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,OAAO,aAAa,IAAI,YAAY,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAAE,YAAY,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ModulesOptions {
2
+ all?: boolean;
3
+ }
4
+ export declare function showModules(courseName?: string, options?: ModulesOptions): Promise<void>;
5
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../commands/modules.ts"],"names":[],"mappings":"AAoLA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AA+BD,wBAAsB,WAAW,CAC/B,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA4Jf"}