canvaslms-cli 1.4.5 → 1.4.7

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 (81) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -9
  3. package/dist/commands/announcements.d.ts +3 -0
  4. package/dist/commands/announcements.d.ts.map +1 -0
  5. package/dist/commands/announcements.js +87 -0
  6. package/dist/commands/announcements.js.map +1 -0
  7. package/dist/commands/api.d.ts +3 -0
  8. package/dist/commands/api.d.ts.map +1 -0
  9. package/dist/commands/api.js +8 -0
  10. package/dist/commands/api.js.map +1 -0
  11. package/dist/commands/assignments.d.ts +3 -0
  12. package/dist/commands/assignments.d.ts.map +1 -0
  13. package/dist/commands/assignments.js +100 -0
  14. package/dist/commands/assignments.js.map +1 -0
  15. package/dist/commands/config.d.ts +6 -0
  16. package/dist/commands/config.d.ts.map +1 -0
  17. package/dist/commands/config.js +202 -0
  18. package/dist/commands/config.js.map +1 -0
  19. package/dist/commands/grades.d.ts +3 -0
  20. package/dist/commands/grades.d.ts.map +1 -0
  21. package/dist/commands/grades.js +128 -0
  22. package/dist/commands/grades.js.map +1 -0
  23. package/dist/commands/list.d.ts +3 -0
  24. package/dist/commands/list.d.ts.map +1 -0
  25. package/dist/commands/list.js +61 -0
  26. package/dist/commands/list.js.map +1 -0
  27. package/dist/commands/profile.d.ts +6 -0
  28. package/dist/commands/profile.d.ts.map +1 -0
  29. package/dist/commands/profile.js +30 -0
  30. package/dist/commands/profile.js.map +1 -0
  31. package/dist/commands/submit.d.ts +8 -0
  32. package/dist/commands/submit.d.ts.map +1 -0
  33. package/dist/commands/submit.js +319 -0
  34. package/dist/commands/submit.js.map +1 -0
  35. package/dist/index.d.ts +15 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +15 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/lib/api-client.d.ts +2 -0
  40. package/dist/lib/api-client.d.ts.map +1 -0
  41. package/dist/lib/api-client.js +69 -0
  42. package/dist/lib/api-client.js.map +1 -0
  43. package/dist/lib/config-validator.d.ts +4 -0
  44. package/dist/lib/config-validator.d.ts.map +1 -0
  45. package/dist/lib/config-validator.js +38 -0
  46. package/dist/lib/config-validator.js.map +1 -0
  47. package/dist/lib/config.d.ts +10 -0
  48. package/dist/lib/config.d.ts.map +1 -0
  49. package/dist/lib/config.js +85 -0
  50. package/dist/lib/config.js.map +1 -0
  51. package/dist/lib/file-upload.d.ts +3 -0
  52. package/dist/lib/file-upload.d.ts.map +1 -0
  53. package/dist/lib/file-upload.js +52 -0
  54. package/dist/lib/file-upload.js.map +1 -0
  55. package/dist/lib/interactive.d.ts +16 -0
  56. package/dist/lib/interactive.d.ts.map +1 -0
  57. package/dist/lib/interactive.js +756 -0
  58. package/dist/lib/interactive.js.map +1 -0
  59. package/dist/src/index.d.ts +3 -0
  60. package/dist/src/index.d.ts.map +1 -0
  61. package/dist/src/index.js +89 -0
  62. package/dist/src/index.js.map +1 -0
  63. package/dist/types/index.d.ts +146 -0
  64. package/dist/types/index.d.ts.map +1 -0
  65. package/dist/types/index.js +2 -0
  66. package/dist/types/index.js.map +1 -0
  67. package/package.json +76 -71
  68. package/commands/announcements.js +0 -102
  69. package/commands/api.js +0 -19
  70. package/commands/assignments.js +0 -100
  71. package/commands/config.js +0 -239
  72. package/commands/grades.js +0 -201
  73. package/commands/list.js +0 -68
  74. package/commands/profile.js +0 -35
  75. package/commands/submit.js +0 -603
  76. package/lib/api-client.js +0 -75
  77. package/lib/config-validator.js +0 -60
  78. package/lib/config.js +0 -103
  79. package/lib/file-upload.js +0 -74
  80. package/lib/interactive.js +0 -889
  81. package/src/index.js +0 -120
package/src/index.js DELETED
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Canvas CLI - A command line tool for interacting with Canvas API
5
- *
6
- * @author Canvas CLI Team
7
- * @version 1.0.0
8
- */
9
-
10
- import { Command } from 'commander';
11
- import { listCourses } from '../commands/list.js';
12
- import { showConfig, setupConfig, editConfig, showConfigPath, deleteConfigFile } from '../commands/config.js';
13
- import { listAssignments } from '../commands/assignments.js';
14
- import { showGrades } from '../commands/grades.js';
15
- import { showAnnouncements } from '../commands/announcements.js';
16
- import { showProfile } from '../commands/profile.js';
17
- import { submitAssignment } from '../commands/submit.js';
18
- import { requireConfig } from '../lib/config-validator.js';
19
-
20
- const program = new Command();
21
-
22
- // Setup CLI program
23
- program
24
- .name('canvas')
25
- .description('Canvas API Command Line Tool')
26
- .version('1.4.5');
27
-
28
- // List command to show enrolled courses
29
- program
30
- .command('list')
31
- .alias('l')
32
- .description('List starred courses (default) or all courses with -a')
33
- .option('-a, --all', 'Show all enrolled courses instead of just starred ones')
34
- .option('-v, --verbose', 'Show detailed course information')
35
- .action((...args) => requireConfig(listCourses)(...args));
36
-
37
- // Config command with subcommands
38
- const configCommand = program
39
- .command('config')
40
- .description('Manage Canvas CLI configuration')
41
- .action((...args) => showConfig(...args)); // Default action when no subcommand is provided
42
-
43
- configCommand
44
- .command('show')
45
- .alias('status')
46
- .description('Show current configuration')
47
- .action((...args) => showConfig(...args));
48
-
49
- configCommand
50
- .command('setup')
51
- .alias('init')
52
- .description('Interactive configuration setup')
53
- .action((...args) => setupConfig(...args));
54
-
55
- configCommand
56
- .command('edit')
57
- .alias('update')
58
- .description('Edit existing configuration')
59
- .action((...args) => editConfig(...args));
60
-
61
- configCommand
62
- .command('path')
63
- .description('Show configuration file path')
64
- .action((...args) => showConfigPath(...args));
65
-
66
- configCommand
67
- .command('delete')
68
- .alias('remove')
69
- .description('Delete configuration file')
70
- .action((...args) => deleteConfigFile(...args));
71
-
72
- // Assignments command to show assignments for a course
73
- program
74
- .command('assignments')
75
- .alias('assign')
76
- .description('List assignments for a specific course')
77
- .argument('<course-id>', 'Course ID to get assignments from')
78
- .option('-v, --verbose', 'Show detailed assignment information')
79
- .option('-s, --submitted', 'Only show submitted assignments')
80
- .option('-p, --pending', 'Only show pending assignments')
81
- .action((...args) => requireConfig(listAssignments)(...args));
82
-
83
- // Grades command to show grades
84
- program
85
- .command('grades')
86
- .alias('grade')
87
- .description('Show grades for all courses or a specific course')
88
- .argument('[course-id]', 'Optional course ID to get grades for specific course')
89
- .option('-v, --verbose', 'Show detailed grade information')
90
- .action((...args) => requireConfig(showGrades)(...args));
91
-
92
- // Announcements command
93
- program
94
- .command('announcements')
95
- .alias('an')
96
- .description('Show recent announcements (interactive if no course-id)')
97
- .argument('[course-id]', 'Optional course ID to get announcements for specific course')
98
- .option('-l, --limit <number>', 'Number of announcements to show', '5')
99
- .action((...args) => requireConfig(showAnnouncements)(...args));
100
-
101
- // Profile command
102
- program
103
- .command('profile')
104
- .alias('me')
105
- .description('Show current user profile information')
106
- .option('-v, --verbose', 'Show detailed profile information')
107
- .action((...args) => requireConfig(showProfile)(...args));
108
-
109
- // Submit command for interactive assignment submission (always list files in current directory)
110
- program
111
- .command('submit')
112
- .alias('sub')
113
- .description('Interactively submit one or multiple files to an assignment')
114
- .option('-c, --course <course-id>', 'Skip course selection and use specific course ID')
115
- .option('-f, --file <file-path>', 'Skip file selection and use specific file path')
116
- .option('-a, --all', 'Show all enrolled courses instead of just starred ones')
117
- .action((...args) => requireConfig(submitAssignment)(...args));
118
-
119
- // Parse command line arguments
120
- program.parse();