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.
- package/CHANGELOG.md +18 -0
- package/README.md +1 -9
- package/dist/commands/announcements.d.ts +3 -0
- package/dist/commands/announcements.d.ts.map +1 -0
- package/dist/commands/announcements.js +87 -0
- package/dist/commands/announcements.js.map +1 -0
- package/dist/commands/api.d.ts +3 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +8 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/assignments.d.ts +3 -0
- package/dist/commands/assignments.d.ts.map +1 -0
- package/dist/commands/assignments.js +100 -0
- package/dist/commands/assignments.js.map +1 -0
- package/dist/commands/config.d.ts +6 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +202 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/grades.d.ts +3 -0
- package/dist/commands/grades.d.ts.map +1 -0
- package/dist/commands/grades.js +128 -0
- package/dist/commands/grades.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +61 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/profile.d.ts +6 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +30 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/submit.d.ts +8 -0
- package/dist/commands/submit.d.ts.map +1 -0
- package/dist/commands/submit.js +319 -0
- package/dist/commands/submit.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-client.d.ts +2 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +69 -0
- package/dist/lib/api-client.js.map +1 -0
- package/dist/lib/config-validator.d.ts +4 -0
- package/dist/lib/config-validator.d.ts.map +1 -0
- package/dist/lib/config-validator.js +38 -0
- package/dist/lib/config-validator.js.map +1 -0
- package/dist/lib/config.d.ts +10 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +85 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/file-upload.d.ts +3 -0
- package/dist/lib/file-upload.d.ts.map +1 -0
- package/dist/lib/file-upload.js +52 -0
- package/dist/lib/file-upload.js.map +1 -0
- package/dist/lib/interactive.d.ts +16 -0
- package/dist/lib/interactive.d.ts.map +1 -0
- package/dist/lib/interactive.js +756 -0
- package/dist/lib/interactive.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +89 -0
- package/dist/src/index.js.map +1 -0
- package/dist/types/index.d.ts +146 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +76 -71
- package/commands/announcements.js +0 -102
- package/commands/api.js +0 -19
- package/commands/assignments.js +0 -100
- package/commands/config.js +0 -239
- package/commands/grades.js +0 -201
- package/commands/list.js +0 -68
- package/commands/profile.js +0 -35
- package/commands/submit.js +0 -603
- package/lib/api-client.js +0 -75
- package/lib/config-validator.js +0 -60
- package/lib/config.js +0 -103
- package/lib/file-upload.js +0 -74
- package/lib/interactive.js +0 -889
- 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();
|