canvaslms-cli 1.6.2 → 1.6.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +221 -195
  2. package/README.md +131 -129
  3. package/dist/commands/announcements.d.ts +2 -2
  4. package/dist/commands/announcements.d.ts.map +1 -1
  5. package/dist/commands/announcements.js +29 -20
  6. package/dist/commands/announcements.js.map +1 -1
  7. package/dist/commands/api.d.ts +1 -1
  8. package/dist/commands/api.d.ts.map +1 -1
  9. package/dist/commands/api.js +1 -1
  10. package/dist/commands/api.js.map +1 -1
  11. package/dist/commands/assignments.d.ts +2 -2
  12. package/dist/commands/assignments.d.ts.map +1 -1
  13. package/dist/commands/assignments.js +24 -19
  14. package/dist/commands/assignments.js.map +1 -1
  15. package/dist/commands/config.d.ts.map +1 -1
  16. package/dist/commands/config.js +102 -85
  17. package/dist/commands/config.js.map +1 -1
  18. package/dist/commands/grades.d.ts +2 -2
  19. package/dist/commands/grades.d.ts.map +1 -1
  20. package/dist/commands/grades.js +183 -228
  21. package/dist/commands/grades.js.map +1 -1
  22. package/dist/commands/list.d.ts +1 -1
  23. package/dist/commands/list.d.ts.map +1 -1
  24. package/dist/commands/list.js +22 -20
  25. package/dist/commands/list.js.map +1 -1
  26. package/dist/commands/profile.d.ts.map +1 -1
  27. package/dist/commands/profile.js +57 -32
  28. package/dist/commands/profile.js.map +1 -1
  29. package/dist/commands/submit.d.ts +1 -2
  30. package/dist/commands/submit.d.ts.map +1 -1
  31. package/dist/commands/submit.js +88 -79
  32. package/dist/commands/submit.js.map +1 -1
  33. package/dist/index.d.ts +14 -14
  34. package/dist/index.js +14 -14
  35. package/dist/lib/api-client.d.ts +3 -0
  36. package/dist/lib/api-client.d.ts.map +1 -1
  37. package/dist/lib/api-client.js +31 -16
  38. package/dist/lib/api-client.js.map +1 -1
  39. package/dist/lib/config-validator.d.ts.map +1 -1
  40. package/dist/lib/config-validator.js +12 -12
  41. package/dist/lib/config-validator.js.map +1 -1
  42. package/dist/lib/config.d.ts +1 -1
  43. package/dist/lib/config.d.ts.map +1 -1
  44. package/dist/lib/config.js +16 -14
  45. package/dist/lib/config.js.map +1 -1
  46. package/dist/lib/display.d.ts +11 -5
  47. package/dist/lib/display.d.ts.map +1 -1
  48. package/dist/lib/display.js +261 -169
  49. package/dist/lib/display.js.map +1 -1
  50. package/dist/lib/file-upload.d.ts.map +1 -1
  51. package/dist/lib/file-upload.js +17 -17
  52. package/dist/lib/file-upload.js.map +1 -1
  53. package/dist/lib/interactive.d.ts +1 -1
  54. package/dist/lib/interactive.d.ts.map +1 -1
  55. package/dist/lib/interactive.js +194 -144
  56. package/dist/lib/interactive.js.map +1 -1
  57. package/dist/src/index.d.ts +0 -1
  58. package/dist/src/index.js +62 -63
  59. package/dist/src/index.js.map +1 -1
  60. package/dist/types/index.d.ts +1 -1
  61. package/package.json +10 -3
  62. package/dist/commands/coursenames.d.ts +0 -15
  63. package/dist/commands/coursenames.d.ts.map +0 -1
  64. package/dist/commands/coursenames.js +0 -150
  65. package/dist/commands/coursenames.js.map +0 -1
  66. package/dist/lib/course-utils.d.ts +0 -6
  67. package/dist/lib/course-utils.d.ts.map +0 -1
  68. package/dist/lib/course-utils.js +0 -17
  69. package/dist/lib/course-utils.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,195 +1,221 @@
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.2] - 2025-12-14
9
-
10
- - **Table display**: All table now have the same rounded corner format, text size adaptive to the terminal size
11
-
12
- ## [1.6.1] - 2025-12-13
13
-
14
- - **Dry Run Mode**: Submit command now supports `--dry-run` flag to test submission flow without actually uploading files or submitting assignments
15
- - **Assignment URL Display**: After successful submission, the direct link to the assignment is now displayed for easy access
16
-
17
- ## [1.6.0] - 2025-12-06
18
-
19
- ### Added
20
-
21
- - **Boxed Table Displays**: All commands now display data in modern boxed tables with rounded corners (╭╮╰╯)
22
- - **Adaptive Column Widths**: Tables dynamically adjust column widths based on terminal size for optimal display
23
- - **Color-Coded Grades**: Assignment grades are now color-coded (green: ≥80%, yellow: ≥50%, red: <50%)
24
- - **Announcements Table**: Course selection and announcements list now displayed in formatted tables
25
- - **Profile Table**: User profile information displayed in clean field/value table format
26
-
27
- ### Changed
28
-
29
- - **Grades Display**: Merged official grades and calculated statistics into a unified table
30
- - **CLI Descriptions**: Shortened command descriptions for cleaner help output
31
- - **Config Output**: Simplified config help by removing redundant command examples
32
- - **Submit Command**: Updated to use rounded corners and adaptive widths
33
- - **Line Endings**: Standardized all files to LF line endings
34
-
35
- ### Technical
36
-
37
- - Consistent use of box-drawing characters across all commands
38
- - Improved terminal width detection for responsive layouts
39
-
40
- ## [1.5.1] - 2025-11-05
41
-
42
- ## [1.4.7] - 2025-11-05
43
-
44
- ### Added
45
-
46
- - Show allowed file extensions hint in the interactive file browser when an assignment restricts uploads (e.g. "Allowed: .pdf, .docx").
47
- - Add `r` keybinding to the file browser to reload the current directory listing without exiting the browser.
48
-
49
- ### Fixed
50
-
51
- - 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.
52
- - 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").
53
- - Allow pressing Enter at the final "Proceed with submission? (Y/n)" prompt to accept the default (Yes) to match the shown prompt.
54
-
55
- ### Notes
56
-
57
- - Bumped package version to 1.4.7.
58
-
59
-
60
- ### Added
61
-
62
- - **Enhanced File Selection UX**: Implemented continuous file selection until empty input
63
- - Browse current directory with file size display
64
- - Add multiple files one by one
65
- - Remove files from selection
66
- - Show currently selected files
67
- - Smart file filtering (excludes hidden files, package files)
68
- - **Wildcard support**: Use patterns like *.html, *.js, *.pdf to select multiple files
69
- - File type icons for better visual identification
70
-
71
- - **Improved Grade Viewing**:
72
- - Interactive course selection for grade viewing
73
- - Assignment-level grade details with color coding
74
- - Overall course grade summary
75
- - Better grade formatting and status indicators
76
- - Support for letter grades, excused, and missing assignments
77
-
78
- - **Enhanced Display Names**:
79
- - Show course names instead of IDs in all commands
80
- - Display assignment names prominently
81
- - Better labeling of IDs vs names throughout interface
82
-
83
- - **Interactive Utilities**:
84
- - Added validation and retry logic for user input
85
- - Confirmation helpers with default values
86
- - List selection utilities with cancel option
87
-
88
- ### Improved
89
-
90
- - **Submit Command**: Complete redesign with better file selection workflow
91
- - **Grades Command**: Interactive course selection and detailed assignment grades
92
- - **Assignments Command**: Display course names prominently
93
- - **Announcements Command**: Show course names instead of IDs
94
- - **User Experience**: More consistent and intuitive interfaces across all commands
95
-
96
- ### Fixed
97
-
98
- - **Assignment Name Display**: Fixed "Unknown Assignment" issue in submission summary
99
- - **File Selection Flow**: Better error handling and user guidance during file selection
100
- - **Variable Scope**: Proper assignment variable handling throughout submission process
101
-
102
- ### Technical
103
-
104
- - Enhanced interactive utilities in `lib/interactive.js`
105
- - Better error handling and user guidance
106
- - Improved code organization and modularity
107
-
108
- ## [1.1.1] - 2025-07-03
109
-
110
- ### Fixed
111
-
112
- - Removed dotenv dependency that was causing module not found errors
113
- - Fixed configuration file path to use `.canvaslms-cli-config.json`
114
- - Resolved package publishing and global installation issues
115
-
116
- ### Added
117
-
118
- - Dual binary support: both `canvaslms-cli` and `canvas` commands work
119
-
120
- ## [1.1.0] - 2025-07-03
121
-
122
- ### Major Changes
123
-
124
- - Home directory configuration system (~/.canvaslms-cli-config.json)
125
- - Interactive configuration setup wizard (`canvas config setup`)
126
- - Configuration management subcommands:
127
- - `canvas config show` - Display current configuration
128
- - `canvas config edit` - Edit existing configuration
129
- - `canvas config path` - Show config file location
130
- - `canvas config delete` - Remove configuration file
131
- - Automatic configuration validation for all commands
132
- - Improved error handling and user guidance
133
-
134
- ### Changed
135
-
136
- - **BREAKING**: Removed environment variable support (.env files)
137
- - Configuration now stored in user's home directory instead of project directory
138
- - Enhanced configuration validation with better error messages
139
- - Improved user onboarding with guided setup process
140
-
141
- ### Removed
142
-
143
- - dotenv dependency (no longer needed)
144
- - Environment variable fallback support
145
-
146
- ## [1.0.0] - 2025-07-03
147
-
148
- ### Added
149
-
150
- - Initial release of Canvas CLI Tool
151
- - Modular architecture with separate command handlers
152
- - Interactive assignment submission with file upload
153
- - Course management (list starred/all courses)
154
- - Assignment operations (view, filter by status)
155
- - Grade viewing for all courses or specific course
156
- - Announcements viewing
157
- - User profile management
158
- - Raw API access for all HTTP methods (GET, POST, PUT, DELETE)
159
- - Comprehensive configuration management
160
- - Color-coded output for better readability
161
- - Support for multiple file uploads
162
- - File selection from current directory
163
- - Detailed verbose modes for all commands
164
-
165
- ### Features
166
-
167
- - 📚 Course listing with favorites support
168
- - 📝 Assignment management with status indicators
169
- - 🚀 Interactive file submission workflow
170
- - 📢 Announcement viewing
171
- - 👤 Profile information display
172
- - 🔧 Direct Canvas API access
173
- - ⚡ Command aliases for faster usage
174
- - 🎨 Color-coded grade display
175
- - 📁 Smart file selection interface
176
-
177
- ### Technical
178
-
179
- - Modular command structure in separate files
180
- - Reusable API client library
181
- - Interactive prompt utilities
182
- - File upload handling with progress indicators
183
- - Error handling and user-friendly messages
184
- - Cross-platform compatibility
185
-
186
- ## [Unreleased]
187
-
188
- ### Planned Features
189
-
190
- - Assignment creation and editing
191
- - Bulk operations
192
- - Plugin system
193
- - Advanced filtering options
194
- - Export functionality
195
- - 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] - 2025-12-14
9
+
10
+ ### Changed
11
+
12
+ - **Unified table rendering**: All commands (grades, list, assignments) now use the Table class with live resize support
13
+ - **Grades command refactored**: Replaced 3 custom tables with Table class for consistent styling
14
+
15
+ ### Fixed
16
+
17
+ - **ESLint warnings**: Fixed `no-constant-condition` and `no-control-regex` warnings in interactive.ts
18
+
19
+ ## [1.6.3] - 2025-12-14
20
+
21
+ ### Added (1.6.3)
22
+
23
+ - **Live table resize**: Tables re-render automatically when terminal is resized
24
+ - **Adaptive truncation**: Text truncation updates dynamically based on terminal width
25
+
26
+ ### Fixed (1.6.3)
27
+
28
+ - **Submit table truncation**: Reduced excessive truncation in the submit table by compacting columns and shortening date format
29
+ - **Table overflow**: Fixed tables overflowing terminal width on small screens
30
+ - **Column width calculation**: Corrected border overhead calculation for accurate fitting
31
+
32
+ ### Changed (1.6.3)
33
+
34
+ - **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)
35
+
36
+ ## [1.6.2] - 2025-12-14
37
+
38
+ - **Table display**: All table now have the same rounded corner format, text size adaptive to the terminal size
39
+
40
+ ## [1.6.1] - 2025-12-13
41
+
42
+ - **Dry Run Mode**: Submit command now supports `--dry-run` flag to test submission flow without actually uploading files or submitting assignments
43
+ - **Assignment URL Display**: After successful submission, the direct link to the assignment is now displayed for easy access
44
+
45
+ ## [1.6.0] - 2025-12-06
46
+
47
+ ### Added (1.6.0)
48
+
49
+ - **Boxed Table Displays**: All commands now display data in modern boxed tables with rounded corners (╭╮╰╯)
50
+ - **Adaptive Column Widths**: Tables dynamically adjust column widths based on terminal size for optimal display
51
+ - **Color-Coded Grades**: Assignment grades are now color-coded (green: ≥80%, yellow: ≥50%, red: <50%)
52
+ - **Announcements Table**: Course selection and announcements list now displayed in formatted tables
53
+ - **Profile Table**: User profile information displayed in clean field/value table format
54
+
55
+ ### Changed (1.6.0)
56
+
57
+ - **Grades Display**: Merged official grades and calculated statistics into a unified table
58
+ - **CLI Descriptions**: Shortened command descriptions for cleaner help output
59
+ - **Config Output**: Simplified config help by removing redundant command examples
60
+ - **Submit Command**: Updated to use rounded corners and adaptive widths
61
+ - **Line Endings**: Standardized all files to LF line endings
62
+
63
+ ### Technical
64
+
65
+ - Consistent use of box-drawing characters across all commands
66
+ - Improved terminal width detection for responsive layouts
67
+
68
+ ## [1.5.1] - 2025-11-05
69
+
70
+ ## [1.4.7] - 2025-11-05
71
+
72
+ ### Added (1.4.7)
73
+
74
+ - Show allowed file extensions hint in the interactive file browser when an assignment restricts uploads (e.g. `*.pdf`, `*.docx`).
75
+ - Add `r` keybinding to the file browser to reload the current directory listing without exiting the browser.
76
+
77
+ - **Enhanced File Selection UX**: Implemented continuous file selection until empty input
78
+ - Browse current directory with file size display
79
+ - Add multiple files one by one
80
+ - Remove files from selection
81
+ - Show currently selected files
82
+ - Smart file filtering (excludes hidden files, package files)
83
+ - **Wildcard support**: Use patterns like `*.html`, `*.js`, `*.pdf` to select multiple files
84
+ - File type icons for better visual identification
85
+
86
+ - **Improved Grade Viewing**:
87
+ - Interactive course selection for grade viewing
88
+ - Assignment-level grade details with color coding
89
+ - Overall course grade summary
90
+ - Better grade formatting and status indicators
91
+ - Support for letter grades, excused, and missing assignments
92
+
93
+ ### Notes (1.4.7)
94
+
95
+ - Bumped package version to 1.4.7.
96
+ - Assignment-level grade details with color coding
97
+ - Overall course grade summary
98
+ - Better grade formatting and status indicators
99
+ - Support for letter grades, excused, and missing assignments
100
+
101
+ - **Enhanced Display Names**:
102
+ - Show course names instead of IDs in all commands
103
+ - Display assignment names prominently
104
+ - Better labeling of IDs vs names throughout interface
105
+
106
+ - **Interactive Utilities**:
107
+ - Added validation and retry logic for user input
108
+ - Confirmation helpers with default values
109
+ - List selection utilities with cancel option
110
+
111
+ ### Improved (1.4.7)
112
+
113
+ - **Submit Command**: Complete redesign with better file selection workflow
114
+ - **Grades Command**: Interactive course selection and detailed assignment grades
115
+ - **Assignments Command**: Display course names prominently
116
+ - **Announcements Command**: Show course names instead of IDs
117
+ - **User Experience**: More consistent and intuitive interfaces across all commands
118
+
119
+ ### Fixed (1.4.7)
120
+
121
+ - 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.
122
+ - 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").
123
+ - Allow pressing Enter at the final "Proceed with submission? (Y/n)" prompt to accept the default (Yes) to match the shown prompt.
124
+ - **Assignment Name Display**: Fixed "Unknown Assignment" issue in submission summary
125
+ - **File Selection Flow**: Better error handling and user guidance during file selection
126
+ - **Variable Scope**: Proper assignment variable handling throughout submission process
127
+
128
+ ### Technical (1.4.7)
129
+
130
+ - Enhanced interactive utilities in `lib/interactive.js`
131
+ - Better error handling and user guidance
132
+ - Improved code organization and modularity
133
+
134
+ ## [1.1.1] - 2025-07-03
135
+
136
+ ### Fixed (1.1.1)
137
+
138
+ - Removed dotenv dependency that was causing module not found errors
139
+ - Fixed configuration file path to use `.canvaslms-cli-config.json`
140
+ - Resolved package publishing and global installation issues
141
+
142
+ ### Added (1.1.1)
143
+
144
+ - Dual binary support: both `canvaslms-cli` and `canvas` commands work
145
+
146
+ ## [1.1.0] - 2025-07-03
147
+
148
+ ### Major Changes (1.1.0)
149
+
150
+ - Home directory configuration system (~/.canvaslms-cli-config.json)
151
+ - Interactive configuration setup wizard (`canvas config setup`)
152
+ - Configuration management subcommands:
153
+ - `canvas config show` - Display current configuration
154
+ - `canvas config edit` - Edit existing configuration
155
+ - `canvas config path` - Show config file location
156
+ - `canvas config delete` - Remove configuration file
157
+ - Automatic configuration validation for all commands
158
+ - Improved error handling and user guidance
159
+
160
+ ### Changed (1.1.0)
161
+
162
+ - **BREAKING**: Removed environment variable support (.env files)
163
+ - Configuration now stored in user's home directory instead of project directory
164
+ - Enhanced configuration validation with better error messages
165
+ - Improved user onboarding with guided setup process
166
+
167
+ ### Removed (1.1.0)
168
+
169
+ - dotenv dependency (no longer needed)
170
+ - Environment variable fallback support
171
+
172
+ ## [1.0.0] - 2025-07-03
173
+
174
+ ### Added (1.0.0)
175
+
176
+ - Initial release of Canvas CLI Tool
177
+ - Modular architecture with separate command handlers
178
+ - Interactive assignment submission with file upload
179
+ - Course management (list starred/all courses)
180
+ - Assignment operations (view, filter by status)
181
+ - Grade viewing for all courses or specific course
182
+ - Announcements viewing
183
+ - User profile management
184
+ - Raw API access for all HTTP methods (GET, POST, PUT, DELETE)
185
+ - Comprehensive configuration management
186
+ - Color-coded output for better readability
187
+ - Support for multiple file uploads
188
+ - File selection from current directory
189
+ - Detailed verbose modes for all commands
190
+
191
+ ### Features (1.0.0)
192
+
193
+ - 📚 Course listing with favorites support
194
+ - 📝 Assignment management with status indicators
195
+ - 🚀 Interactive file submission workflow
196
+ - 📢 Announcement viewing
197
+ - 👤 Profile information display
198
+ - 🔧 Direct Canvas API access
199
+ - ⚡ Command aliases for faster usage
200
+ - 🎨 Color-coded grade display
201
+ - 📁 Smart file selection interface
202
+
203
+ ### Technical (1.0.0)
204
+
205
+ - Modular command structure in separate files
206
+ - Reusable API client library
207
+ - Interactive prompt utilities
208
+ - File upload handling with progress indicators
209
+ - Error handling and user-friendly messages
210
+ - Cross-platform compatibility
211
+
212
+ ## [Unreleased]
213
+
214
+ ### Planned Features (Unreleased)
215
+
216
+ - Assignment creation and editing
217
+ - Bulk operations
218
+ - Plugin system
219
+ - Advanced filtering options
220
+ - Export functionality
221
+ - Offline mode support