canvas-lms-mcp 2.8.4 → 2.9.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/README.md +80 -12
- package/bin/canvas-lms-mcp.js +9 -0
- package/dist/canvas/accounts.d.ts +9 -3
- package/dist/canvas/accounts.d.ts.map +1 -1
- package/dist/canvas/assignments.d.ts +17 -1
- package/dist/canvas/assignments.d.ts.map +1 -1
- package/dist/canvas/courses.d.ts +28 -1
- package/dist/canvas/courses.d.ts.map +1 -1
- package/dist/canvas/dashboard.d.ts +5 -1
- package/dist/canvas/dashboard.d.ts.map +1 -1
- package/dist/canvas/enrollments.d.ts +24 -1
- package/dist/canvas/enrollments.d.ts.map +1 -1
- package/dist/canvas/groups.d.ts +14 -0
- package/dist/canvas/groups.d.ts.map +1 -1
- package/dist/canvas/index.cjs +3 -3
- package/dist/canvas/index.js +2 -2
- package/dist/canvas/modules.d.ts +38 -4
- package/dist/canvas/modules.d.ts.map +1 -1
- package/dist/canvas/types.d.ts +299 -5
- package/dist/canvas/types.d.ts.map +1 -1
- package/dist/{chunk-PQWAKAIH.cjs → chunk-6WVJZGIN.cjs} +54 -3
- package/dist/chunk-6WVJZGIN.cjs.map +1 -0
- package/dist/{chunk-SYO65DQF.js → chunk-6XNWSJQF.js} +2 -2
- package/dist/{chunk-SYO65DQF.js.map → chunk-6XNWSJQF.js.map} +1 -1
- package/dist/{chunk-4YHJF3CC.js → chunk-CAGP6GC5.js} +53 -2
- package/dist/chunk-CAGP6GC5.js.map +1 -0
- package/dist/{chunk-HMC476LT.cjs → chunk-KHLEGNHP.cjs} +2098 -650
- package/dist/chunk-KHLEGNHP.cjs.map +1 -0
- package/dist/{chunk-4TAI5SSR.cjs → chunk-LMKNKL5C.cjs} +178 -60
- package/dist/chunk-LMKNKL5C.cjs.map +1 -0
- package/dist/{chunk-XDAWAHU7.cjs → chunk-QWLAP6MW.cjs} +2 -2
- package/dist/{chunk-XDAWAHU7.cjs.map → chunk-QWLAP6MW.cjs.map} +1 -1
- package/dist/{chunk-HF7IV5SM.js → chunk-W624KMYI.js} +134 -16
- package/dist/chunk-W624KMYI.js.map +1 -0
- package/dist/{chunk-R5BMHZIZ.js → chunk-YHOUWXSD.js} +2098 -650
- package/dist/chunk-YHOUWXSD.js.map +1 -0
- package/dist/cli.cjs +2 -2
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/discovery/manifests.d.ts +14 -2
- package/dist/discovery/manifests.d.ts.map +1 -1
- package/dist/http.cjs +27 -10
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.ts +9 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +24 -7
- package/dist/http.js.map +1 -1
- package/dist/init.cjs +3 -3
- package/dist/init.js +1 -1
- package/dist/prompts/catalog.d.ts +20 -11
- package/dist/prompts/catalog.d.ts.map +1 -1
- package/dist/prompts/generate.d.ts +14 -0
- package/dist/prompts/generate.d.ts.map +1 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/skills.generated.d.ts.map +1 -1
- package/dist/prompts/types.d.ts +11 -0
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/provenance/fields.d.ts.map +1 -1
- package/dist/pseudonym/coverage.d.ts.map +1 -1
- package/dist/pseudonym/pseudonymizer.d.ts +63 -1
- package/dist/pseudonym/pseudonymizer.d.ts.map +1 -1
- package/dist/server.cjs +4 -4
- package/dist/server.d.ts +23 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +3 -3
- package/dist/stdio.cjs +8 -6
- package/dist/stdio.cjs.map +1 -1
- package/dist/stdio.js +6 -4
- package/dist/stdio.js.map +1 -1
- package/dist/tools/accounts.d.ts.map +1 -1
- package/dist/tools/appointment-groups.d.ts.map +1 -1
- package/dist/tools/assignments.d.ts.map +1 -1
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/catalog.d.ts +11 -0
- package/dist/tools/catalog.d.ts.map +1 -1
- package/dist/tools/conversations.d.ts.map +1 -1
- package/dist/tools/courses.d.ts +2 -1
- package/dist/tools/courses.d.ts.map +1 -1
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/enrollments.d.ts.map +1 -1
- package/dist/tools/files.d.ts.map +1 -1
- package/dist/tools/index.d.ts +6 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/new-quizzes.d.ts.map +1 -1
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/peer-reviews.d.ts.map +1 -1
- package/dist/tools/quizzes.d.ts.map +1 -1
- package/dist/tools/requirement-engine.d.ts +341 -0
- package/dist/tools/requirement-engine.d.ts.map +1 -0
- package/dist/tools/requirement-graph.d.ts +66 -0
- package/dist/tools/requirement-graph.d.ts.map +1 -0
- package/dist/tools/rubrics.d.ts +2 -1
- package/dist/tools/rubrics.d.ts.map +1 -1
- package/dist/tools/student.d.ts.map +1 -1
- package/dist/tools/submissions.d.ts.map +1 -1
- package/dist/tools/toolsets.d.ts +56 -0
- package/dist/tools/toolsets.d.ts.map +1 -0
- package/dist/tools/types.d.ts +14 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/users.d.ts +2 -0
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/write-policy.d.ts +32 -0
- package/dist/tools/write-policy.d.ts.map +1 -0
- package/package.json +2 -2
- package/skills/canvas-course-requirements/SKILL.md +117 -0
- package/dist/chunk-4TAI5SSR.cjs.map +0 -1
- package/dist/chunk-4YHJF3CC.js.map +0 -1
- package/dist/chunk-HF7IV5SM.js.map +0 -1
- package/dist/chunk-HMC476LT.cjs.map +0 -1
- package/dist/chunk-PQWAKAIH.cjs.map +0 -1
- package/dist/chunk-R5BMHZIZ.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
MCP server for [Canvas LMS](https://www.instructure.com/canvas). Read courses, assignments, submissions, rubrics, quizzes; grade, comment, manage course content, and handle Canvas admin workflows from any AI agent.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
187 tools across Canvas courses, assignments, submissions, gradebook history, rubrics, quizzes, New Quizzes (LTI), files, users, groups, enrollments, discussions, modules, pages, calendar, conversations, peer reviews, accounts, analytics, outcomes, grading standards, grade projection, link audit, accessibility audit, content exports, content migrations, quiz accommodations, appointment groups, student workflows, student search, dashboard, instructor attention workflows, and health checks. Three deployment modes: stdio, HTTP, and library import.
|
|
15
15
|
|
|
16
16
|
## One-click install (Claude Desktop)
|
|
17
17
|
|
|
@@ -38,14 +38,14 @@ Click a badge to open Cursor or VS Code with canvas-lms-mcp pre-configured (plac
|
|
|
38
38
|
/plugin install canvas-lms-mcp
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Installs the MCP server (via `npx canvas-lms-mcp`) and all
|
|
41
|
+
Installs the MCP server (via `npx canvas-lms-mcp`) and all 17 [Agent Skills](#agent-skills) in a single step, versioned and updatable through Claude Code's plugin manager. On enable, Claude Code prompts for your Canvas API token and base URL (and the optional FERPA pseudonymization settings). See the [Claude Code plugins reference](https://code.claude.com/docs/en/plugins-reference) for how marketplaces and plugin manifests work.
|
|
42
42
|
|
|
43
43
|
## Comparison
|
|
44
44
|
|
|
45
45
|
| | canvas-lms-mcp | [vishalsachdev/canvas-mcp](https://github.com/vishalsachdev/canvas-mcp) | [DMontgomery40/mcp-canvas-lms](https://github.com/DMontgomery40/mcp-canvas-lms) |
|
|
46
46
|
|---|---|---|---|
|
|
47
47
|
| Language | TypeScript | Python | TypeScript |
|
|
48
|
-
| Tools |
|
|
48
|
+
| Tools | 187 | 80+ | 54 |
|
|
49
49
|
| License | [](https://github.com/bruchris/canvas-lms-mcp/blob/main/LICENSE) | [](https://github.com/vishalsachdev/canvas-mcp/blob/main/LICENSE) | [](https://github.com/DMontgomery40/mcp-canvas-lms/blob/main/LICENSE) |
|
|
50
50
|
| Last commit | [](https://github.com/bruchris/canvas-lms-mcp) | [](https://github.com/vishalsachdev/canvas-mcp) | [](https://github.com/DMontgomery40/mcp-canvas-lms) |
|
|
51
51
|
|
|
@@ -89,7 +89,7 @@ npx skills add bruchris/canvas-lms-mcp
|
|
|
89
89
|
|
|
90
90
|
Skills are markdown workflow files (no extra dependencies). They work with the MCP server you already have installed. See the [`skills/` directory](./skills/) for the full list.
|
|
91
91
|
|
|
92
|
-
The same
|
|
92
|
+
The same 17 workflows are also served over MCP as [prompts](https://modelcontextprotocol.io/docs/concepts/prompts), so a host without a skill-file loader — Claude Desktop, ChatGPT, or an application embedding this server in-process — can list them with `prompts/list` and fetch one with `prompts/get`. Each prompt advertises optional `course_id`-style arguments a host can prefill, and marks the workflows that reach write tools. Prompts are inert templates the user chooses: selecting one grants the model no tool authority it did not already have.
|
|
93
93
|
|
|
94
94
|
## Example Prompts
|
|
95
95
|
|
|
@@ -106,13 +106,13 @@ Once configured, try these prompts with your AI client:
|
|
|
106
106
|
|
|
107
107
|
## Tool Inventory
|
|
108
108
|
|
|
109
|
-
### All Registered Tools (
|
|
109
|
+
### All Registered Tools (187)
|
|
110
110
|
|
|
111
111
|
| Category | Tools |
|
|
112
112
|
|----------|-------|
|
|
113
113
|
| Health | `health_check` |
|
|
114
|
-
| Courses | `list_courses`, `get_course`, `get_syllabus`, `create_course`, `update_course` |
|
|
115
|
-
| Assignments | `list_assignments`, `get_assignment`, `list_assignment_groups`, `create_assignment`, `update_assignment`, `delete_assignment` |
|
|
114
|
+
| Courses | `list_courses`, `get_course`, `get_syllabus`, `list_sections`, `create_course`, `update_course` |
|
|
115
|
+
| Assignments | `list_assignments`, `get_assignment`, `list_assignment_groups`, `create_assignment_group`, `update_assignment_group`, `create_assignment`, `update_assignment`, `delete_assignment` |
|
|
116
116
|
| Assignment Overrides | `list_assignment_overrides`, `create_assignment_override`, `set_student_assignment_dates` |
|
|
117
117
|
| Submissions | `list_submissions`, `get_submission`, `grade_submission`, `comment_on_submission` |
|
|
118
118
|
| Submissions Awaiting Grading | `list_submissions_awaiting_grading` |
|
|
@@ -152,7 +152,7 @@ Once configured, try these prompts with your AI client:
|
|
|
152
152
|
| Attention | `list_submission_comments_needing_attention`, `list_students_needing_attention` |
|
|
153
153
|
| FERPA (conditional) | `resolve_pseudonym` — stdio only, registered when `CANVAS_PSEUDONYMIZE_STUDENTS=true` and `CANVAS_PSEUDONYMIZE_REVERSE_LOOKUP=true` |
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
125 tools are read-only and 62 tools perform Canvas write operations. When FERPA mode is enabled **on the stdio transport**, `resolve_pseudonym` is registered as the 188th tool overall (126th read tool). The HTTP transport never registers it — see [FERPA mode](#ferpa-mode-student-pseudonymization).
|
|
156
156
|
|
|
157
157
|
All write tools require appropriate Canvas permissions. Canvas enforces its own permission model -- the MCP server does not bypass it.
|
|
158
158
|
|
|
@@ -317,6 +317,8 @@ const courses = await canvas.courses.list()
|
|
|
317
317
|
| `--issuer` | `CANVAS_MCP_ISSUER` | (required in `oauth_brokered`) | Public URL of this server; OAuth issuer and resource prefix |
|
|
318
318
|
| `doctor` | -- | -- | Print an identity-safe setup report (also `auth status`); exit 1 when something is missing |
|
|
319
319
|
| `--role` | `CANVAS_ROLE` | (all tools) | Filter tools by Canvas role: `student`, `teacher`, or `admin` (see [Role-based tool filtering](#role-based-tool-filtering)) |
|
|
320
|
+
| `--toolsets <list>` | `CANVAS_TOOLSETS` | (all tools) | Comma-separated Canvas areas to expose: `core`, `grading`, `quizzes`, `people`, `communication`, `outcomes`, `course_ops`, `account`, `student` (see [Toolset filtering](#toolset-filtering)) |
|
|
321
|
+
| `--read-only` | `CANVAS_READ_ONLY` | `false` | Register only `readOnlyHint` tools (see [Read-only mode](#read-only-mode)) |
|
|
320
322
|
| `--destructive-tools=<mode>` | `CANVAS_DESTRUCTIVE_TOOLS` | `allow` | `allow` or `block`. `block` unregisters the twelve irreversible delete tools (see [Destructive tool policy](#destructive-tool-policy)) |
|
|
321
323
|
|
|
322
324
|
## Environment Variables
|
|
@@ -344,6 +346,8 @@ const courses = await canvas.courses.list()
|
|
|
344
346
|
| `CANVAS_PSEUDONYM_DIR` | No | Absolute path that overrides the default pseudonym map directory |
|
|
345
347
|
| `CANVAS_PSEUDONYM_AUDIT_LOG` | No | Path to an append-only file that mirrors `resolve_pseudonym` audit lines (stderr is always written) |
|
|
346
348
|
| `CANVAS_PROVENANCE_FENCING` | No | **On by default.** Set to exactly `false` to disable [provenance fencing](#provenance-fencing-untrusted-canvas-content) |
|
|
349
|
+
| `CANVAS_TOOLSETS` | No | Comma-separated Canvas areas to expose; unset or `all` exposes every tool (see [Toolset filtering](#toolset-filtering)) |
|
|
350
|
+
| `CANVAS_READ_ONLY` | No | Set truthy to register only `readOnlyHint` tools (see [Read-only mode](#read-only-mode)) |
|
|
347
351
|
| `CANVAS_DESTRUCTIVE_TOOLS` | No | `allow` (default) or `block`. Set to exactly `block` to unregister the twelve irreversible delete tools (see [Destructive tool policy](#destructive-tool-policy)) |
|
|
348
352
|
| `CANVAS_STRING_IDS` | No | **Off by default.** Set to exactly `true` to request Canvas identifiers as JSON strings instead of numbers (see [64-bit Canvas identifiers](#64-bit-canvas-identifiers-opt-in-string-ids)) |
|
|
349
353
|
|
|
@@ -569,10 +573,10 @@ Three roles, plus the default of "unset = every tool":
|
|
|
569
573
|
|
|
570
574
|
| `CANVAS_ROLE` | Tools exposed | Typical use |
|
|
571
575
|
|---------------|---------------|-------------|
|
|
572
|
-
| _(unset)_ | all (~
|
|
573
|
-
| `student` | ~
|
|
574
|
-
| `teacher` | ~
|
|
575
|
-
| `admin` | ~
|
|
576
|
+
| _(unset)_ | all (~187) | default; backwards-compatible |
|
|
577
|
+
| `student` | ~67 | a student's own courses, grades, submissions, and read-only course content |
|
|
578
|
+
| `teacher` | ~165 | grading, roster, content authoring, analytics |
|
|
579
|
+
| `admin` | ~175 | everything `teacher` sees plus account-level tools (`enroll_user`, `list_account_users`, …) |
|
|
576
580
|
|
|
577
581
|
Notes:
|
|
578
582
|
|
|
@@ -585,6 +589,70 @@ Notes:
|
|
|
585
589
|
|
|
586
590
|
Design rationale in [BRU-1530](https://github.com/bruchris/canvas-lms-mcp) (role taxonomy, why three roles, auto-detect deferred to v2).
|
|
587
591
|
|
|
592
|
+
## Toolset filtering
|
|
593
|
+
|
|
594
|
+
Where a role answers *who is calling*, a toolset answers *what they are here to do*. Selecting one or more narrows the tool list to whole Canvas areas, which is the cheaper lever when a client's context budget is the constraint. Like roles this is a **client-side UX / context-reduction filter only** — asking for a toolset grants nothing, and Canvas still enforces permissions server-side.
|
|
595
|
+
|
|
596
|
+
```bash
|
|
597
|
+
# stdio: env var or --toolsets flag (flag wins)
|
|
598
|
+
CANVAS_TOOLSETS=grading canvas-lms-mcp --base-url https://school.instructure.com
|
|
599
|
+
canvas-lms-mcp --base-url https://school.instructure.com --toolsets core,grading
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
Nine toolsets, plus the default of "unset = every tool". Every tool domain belongs to exactly **one** of them, so a selection is a partition rather than a set of overlapping tags:
|
|
603
|
+
|
|
604
|
+
| `CANVAS_TOOLSETS` | Covers |
|
|
605
|
+
|-------------------|--------|
|
|
606
|
+
| _(unset, or `all`)_ | every tool — the default, backwards-compatible surface |
|
|
607
|
+
| `core` | courses, assignments, modules, pages, files, health check |
|
|
608
|
+
| `grading` | submissions, rubrics, peer reviews, gradebook history, grade explanation and projection, analytics |
|
|
609
|
+
| `quizzes` | Classic and New Quizzes, quiz responses, quiz accommodations |
|
|
610
|
+
| `people` | users, groups, enrollments, cross-course student search |
|
|
611
|
+
| `communication` | discussions, announcements, conversations |
|
|
612
|
+
| `outcomes` | outcomes, outcome groups, rollups, mastery |
|
|
613
|
+
| `course_ops` | course setup, content exports and migrations, calendar, appointment groups, link and accessibility audits |
|
|
614
|
+
| `account` | account and sub-account administration |
|
|
615
|
+
| `student` | the caller-is-a-student surface: my courses, grades, submissions, planner, dashboard |
|
|
616
|
+
|
|
617
|
+
Notes:
|
|
618
|
+
|
|
619
|
+
- **Counts are derived, not documented.** `docs/generated/tool-manifest.json` carries a `toolset` field on every entry (schema 1.2), so the exact surface for any selection is computable from the generated artifact instead of a number in this file that can go stale.
|
|
620
|
+
- Values are **case-insensitive**, comma-separated, and union together: `--toolsets core,grading` exposes both.
|
|
621
|
+
- `all` is an explicit "no filter", accepted anywhere in the list.
|
|
622
|
+
- **An unrecognised name discards the whole selection**, logs a warning to stderr, and registers all tools. A typo therefore fails towards *more* tools, never towards a narrower surface than you asked for — the one outcome a misconfigured client cannot detect from the result. (Same rule as `CANVAS_ROLE`.)
|
|
623
|
+
- **Prompts are filtered to match.** A workflow that names a tool this server did not register is not advertised, so no prompt points the model at a tool it cannot call. Most workflows span two to four toolsets, so a single narrow selection can leave **no** prompts at all — the server then declares no `prompts` capability, rather than advertising an empty list. Select the toolsets a workflow needs (for example `core,grading` for `canvas-grading-pass`) to keep it.
|
|
624
|
+
- **HTTP transport:** read per request from the `X-Canvas-Toolsets` header, falling back to `CANVAS_TOOLSETS` from the server config. A valid header (or `all`) overrides the configured default; an invalid header is ignored with a warning and the configured selection is kept.
|
|
625
|
+
|
|
626
|
+
## Read-only mode
|
|
627
|
+
|
|
628
|
+
`CANVAS_READ_ONLY=true` (or `--read-only`) registers only tools annotated `readOnlyHint: true`. Nothing that writes to Canvas is registered at all, so there is no write handler for a model to reach.
|
|
629
|
+
|
|
630
|
+
```bash
|
|
631
|
+
CANVAS_READ_ONLY=true canvas-lms-mcp --base-url https://school.instructure.com
|
|
632
|
+
canvas-lms-mcp --base-url https://school.instructure.com --read-only
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
- This is not a new mechanism: it exposes the write-tool policy the OAuth profile already applies to a token without the `canvas:write` scope.
|
|
636
|
+
- **It is a floor.** On the OAuth HTTP profile it is applied on top of the caller's scopes, so a token that carries `canvas:write` cannot widen a server the operator started read-only. A scope-blocked token still blocks exactly as before.
|
|
637
|
+
- Server configuration only — there is deliberately **no** request header, for the same reason `CANVAS_DESTRUCTIVE_TOOLS` has none: a client that could pick the value could switch the restriction off.
|
|
638
|
+
- `false`, `0`, `off`, `no` and unset all preserve the default write surface. The flag is one-way; there is no `--no-read-only`.
|
|
639
|
+
- Write workflows are hidden from `prompts/list` too, since their tools are absent.
|
|
640
|
+
|
|
641
|
+
## How the four tool-surface filters compose
|
|
642
|
+
|
|
643
|
+
All four are **opt-in**. With none of them set, the registered surface is every tool and every prompt — the default this package has always shipped.
|
|
644
|
+
|
|
645
|
+
| Control | Selects by | Narrows to | Client-overridable (HTTP)? | Real boundary? |
|
|
646
|
+
|---------|-----------|-----------|---------------------------|----------------|
|
|
647
|
+
| `CANVAS_ROLE` | who is calling | audiences that role can see | yes, `X-Canvas-Role` | no — UX filter |
|
|
648
|
+
| `CANVAS_TOOLSETS` | what they are doing | domains in the selected toolsets | yes, `X-Canvas-Toolsets` | no — UX filter |
|
|
649
|
+
| `CANVAS_READ_ONLY` | operator policy | `readOnlyHint: true` tools | no | yes — handler never registered |
|
|
650
|
+
| `CANVAS_DESTRUCTIVE_TOOLS=block` | operator policy | drops the twelve irreversible deletes | no | yes — handler never registered |
|
|
651
|
+
|
|
652
|
+
They **intersect**, in that order of concern: a tool is registered only if every active control admits it. So no control can add back a tool another removed, and the surface can only ever shrink as you add controls. The two client-overridable filters narrow what a caller sees; the two operator policies bound what any caller can do, which is why neither has a header.
|
|
653
|
+
|
|
654
|
+
Prompts follow the result rather than being filtered separately: a workflow is advertised only when every tool it names survives all four.
|
|
655
|
+
|
|
588
656
|
## Development
|
|
589
657
|
|
|
590
658
|
```bash
|
package/bin/canvas-lms-mcp.js
CHANGED
|
@@ -20,6 +20,15 @@ directories can read its tool list, but then every tool call fails):
|
|
|
20
20
|
--token <t> Canvas API token (or CANVAS_API_TOKEN)
|
|
21
21
|
--base-url <u> Canvas base URL, origin only (or CANVAS_BASE_URL)
|
|
22
22
|
|
|
23
|
+
Tool surface (all opt-in; with none set, every tool and prompt is registered):
|
|
24
|
+
--toolsets <list> Comma-separated Canvas areas (or CANVAS_TOOLSETS):
|
|
25
|
+
core, grading, quizzes, people, communication,
|
|
26
|
+
outcomes, course_ops, account, student. "all" = no filter
|
|
27
|
+
--read-only Register only read-only tools (or CANVAS_READ_ONLY)
|
|
28
|
+
--role <r> student | teacher | admin (or CANVAS_ROLE)
|
|
29
|
+
--destructive-tools=<mode>
|
|
30
|
+
allow (default) or block (or CANVAS_DESTRUCTIVE_TOOLS)
|
|
31
|
+
|
|
23
32
|
Options:
|
|
24
33
|
-h, --help Show this help and exit
|
|
25
34
|
`
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { CanvasHttpClient } from './client';
|
|
2
2
|
import type { CanvasAccount, CanvasAccountNotification, CanvasAccountReport, CanvasCourse, CanvasUser } from './types';
|
|
3
3
|
import type { CanvasId } from './id';
|
|
4
|
+
import type { SearchUserInclude, UserSort } from './users';
|
|
5
|
+
export type AccountUserSort = UserSort | 'id';
|
|
6
|
+
export interface ListAccountUsersOptions {
|
|
7
|
+
search_term?: string;
|
|
8
|
+
sort?: AccountUserSort;
|
|
9
|
+
order?: 'asc' | 'desc';
|
|
10
|
+
include?: ReadonlyArray<SearchUserInclude>;
|
|
11
|
+
}
|
|
4
12
|
export declare class AccountsModule {
|
|
5
13
|
private client;
|
|
6
14
|
constructor(client: CanvasHttpClient);
|
|
@@ -10,9 +18,7 @@ export declare class AccountsModule {
|
|
|
10
18
|
listCourses(accountId: CanvasId, params?: {
|
|
11
19
|
search_term?: string;
|
|
12
20
|
}): Promise<CanvasCourse[]>;
|
|
13
|
-
listUsers(accountId: CanvasId, params?:
|
|
14
|
-
search_term?: string;
|
|
15
|
-
}): Promise<CanvasUser[]>;
|
|
21
|
+
listUsers(accountId: CanvasId, params?: ListAccountUsersOptions): Promise<CanvasUser[]>;
|
|
16
22
|
getReports(accountId: CanvasId): Promise<CanvasAccountReport[]>;
|
|
17
23
|
listNotifications(accountId: string): Promise<CanvasAccountNotification[]>;
|
|
18
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/canvas/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/canvas/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,EACV,aAAa,EACb,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACX,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAO1D,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,IAAI,CAAA;AAE7C,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;CAC3C;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAEtC,GAAG,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;IAIhD,IAAI,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAIhC,eAAe,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAI9D,WAAW,CACf,SAAS,EAAE,QAAQ,EACnB,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAChC,OAAO,CAAC,YAAY,EAAE,CAAC;IASpB,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAYvF,UAAU,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAI/D,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAKjF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CanvasHttpClient } from './client';
|
|
2
|
-
import type { CanvasAssignment, CanvasAssignmentGroup, CanvasAssignmentOverride, CreateAssignmentOverrideParams, CreateAssignmentParams, UpdateAssignmentParams } from './types';
|
|
2
|
+
import type { CanvasAssignment, CanvasAssignmentGroup, CanvasAssignmentOverride, CreateAssignmentGroupParams, CreateAssignmentOverrideParams, CreateAssignmentParams, UpdateAssignmentGroupParams, UpdateAssignmentParams } from './types';
|
|
3
3
|
import type { CanvasId } from './id';
|
|
4
4
|
export type AssignmentListInclude = 'submission' | 'assignment_visibility' | 'all_dates' | 'overrides' | 'observed_users' | 'can_edit' | 'score_statistics';
|
|
5
5
|
export type AssignmentGetInclude = 'submission' | 'assignment_visibility' | 'overrides' | 'observed_users' | 'can_edit' | 'score_statistics' | 'all_dates';
|
|
@@ -36,6 +36,22 @@ export declare class AssignmentsModule {
|
|
|
36
36
|
list(courseId: CanvasId, opts?: ListAssignmentsOptions): Promise<CanvasAssignment[]>;
|
|
37
37
|
get(courseId: CanvasId, assignmentId: CanvasId, opts?: GetAssignmentOptions): Promise<CanvasAssignment>;
|
|
38
38
|
listGroups(courseId: CanvasId, opts?: ListAssignmentGroupsOptions): Promise<CanvasAssignmentGroup[]>;
|
|
39
|
+
/**
|
|
40
|
+
* `POST /api/v1/courses/:course_id/assignment_groups`.
|
|
41
|
+
*
|
|
42
|
+
* Top-level params, not an `assignment_group[...]` envelope — see
|
|
43
|
+
* {@link CreateAssignmentGroupParams}. Returns the created group.
|
|
44
|
+
*/
|
|
45
|
+
createGroup(courseId: CanvasId, params: CreateAssignmentGroupParams): Promise<CanvasAssignmentGroup>;
|
|
46
|
+
/**
|
|
47
|
+
* `PUT /api/v1/courses/:course_id/assignment_groups/:assignment_group_id`.
|
|
48
|
+
*
|
|
49
|
+
* A partial update: Canvas assigns only the attributes present in the request
|
|
50
|
+
* (`update_assignment_group` -> `assignment_group.attributes = ...`), so
|
|
51
|
+
* omitted fields keep their current value and repeating the same call leaves
|
|
52
|
+
* the same state.
|
|
53
|
+
*/
|
|
54
|
+
updateGroup(courseId: CanvasId, assignmentGroupId: CanvasId, params: UpdateAssignmentGroupParams): Promise<CanvasAssignmentGroup>;
|
|
39
55
|
create(courseId: CanvasId, params: CreateAssignmentParams): Promise<CanvasAssignment>;
|
|
40
56
|
update(courseId: CanvasId, assignmentId: CanvasId, params: UpdateAssignmentParams): Promise<CanvasAssignment>;
|
|
41
57
|
delete(courseId: CanvasId, assignmentId: CanvasId): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignments.d.ts","sourceRoot":"","sources":["../../src/canvas/assignments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,MAAM,qBAAqB,GAC7B,YAAY,GACZ,uBAAuB,GACvB,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,kBAAkB,CAAA;AAEtB,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,uBAAuB,GACvB,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,kBAAkB,GAClB,WAAW,CAAA;AAEf,MAAM,MAAM,gBAAgB,GAC1B,MAAM,GAAG,SAAS,GAAG,SAA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,OAAO,CAAC,gBAAgB,CAAC;IAOtB,UAAU,CACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,GAAE,2BAAgC,GACrC,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAOnC;;;;;OAKG;IACG,WAAW,CACf,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAUjC;;;;;;;OAOG;IACG,WAAW,CACf,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,QAAQ,EAC3B,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAU3B,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOrF,MAAM,CACV,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,QAAQ,EACtB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,gBAAgB,CAAC;IAUtB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjE,aAAa,CACjB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,QAAQ,GACrB,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAMhC,cAAc,CAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,QAAQ,EACtB,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,wBAAwB,CAAC;CASrC"}
|
package/dist/canvas/courses.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CanvasHttpClient } from './client';
|
|
2
|
-
import type { CanvasCourse, CreateCourseParams, UpdateCourseParams } from './types';
|
|
2
|
+
import type { CanvasCourse, CanvasCourseSection, CreateCourseParams, UpdateCourseParams } from './types';
|
|
3
3
|
import type { CanvasId } from './id';
|
|
4
4
|
export type CourseEnrollmentState = 'active' | 'invited_or_pending' | 'completed';
|
|
5
5
|
export type CourseWorkflowState = 'unpublished' | 'available' | 'completed' | 'deleted';
|
|
@@ -16,11 +16,38 @@ export interface GetCourseOptions {
|
|
|
16
16
|
include?: ReadonlyArray<CourseGetInclude>;
|
|
17
17
|
teacher_limit?: number;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* `include[]` values `SectionsController#index` documents.
|
|
21
|
+
*
|
|
22
|
+
* `students`, `enrollments` and `avatar_url` are deliberately absent: the first
|
|
23
|
+
* makes Canvas embed a capped list of `User` objects in every section (student
|
|
24
|
+
* names, and avatar URLs when `avatar_url` rides along), and this server has a
|
|
25
|
+
* dedicated, pseudonymized roster surface already (`list_course_users` /
|
|
26
|
+
* `list_students`). `passback_status` is omitted as SIS grade-passback plumbing
|
|
27
|
+
* unrelated to the section-identification job this tool exists for.
|
|
28
|
+
*/
|
|
29
|
+
export type CourseSectionInclude = 'total_students' | 'permissions';
|
|
30
|
+
export interface ListCourseSectionsOptions {
|
|
31
|
+
include?: ReadonlyArray<CourseSectionInclude>;
|
|
32
|
+
/** Canvas requires at least 2 characters; shorter terms are ignored, not an error. */
|
|
33
|
+
search_term?: string;
|
|
34
|
+
}
|
|
19
35
|
export declare class CoursesModule {
|
|
20
36
|
private client;
|
|
21
37
|
constructor(client: CanvasHttpClient);
|
|
22
38
|
list(opts?: ListCoursesOptions): Promise<CanvasCourse[]>;
|
|
23
39
|
get(courseId: CanvasId, opts?: GetCourseOptions): Promise<CanvasCourse>;
|
|
40
|
+
/**
|
|
41
|
+
* `GET /api/v1/courses/:course_id/sections` — a paginated, flat array of
|
|
42
|
+
* `Section` objects (no root envelope).
|
|
43
|
+
*
|
|
44
|
+
* `SectionsController#index` nulls `params[:include]` entirely unless the
|
|
45
|
+
* caller holds one of `:read_roster`, `:view_all_grades` or `:manage_grades`
|
|
46
|
+
* on the course, so a caller with only `:read` gets the base section fields
|
|
47
|
+
* whatever is requested here — the call succeeds, the extras are silently
|
|
48
|
+
* dropped.
|
|
49
|
+
*/
|
|
50
|
+
listSections(courseId: CanvasId, opts?: ListCourseSectionsOptions): Promise<CanvasCourseSection[]>;
|
|
24
51
|
getSyllabus(courseId: CanvasId): Promise<string | null>;
|
|
25
52
|
create(params: CreateCourseParams): Promise<CanvasCourse>;
|
|
26
53
|
update(courseId: CanvasId, params: UpdateCourseParams): Promise<CanvasCourse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../src/canvas/courses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../src/canvas/courses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,oBAAoB,GAAG,WAAW,CAAA;AAEjF,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAA;AAEvF,MAAM,MAAM,iBAAiB,GACzB,qBAAqB,GACrB,eAAe,GACf,oBAAoB,GACpB,cAAc,GACd,+BAA+B,GAC/B,iBAAiB,GACjB,MAAM,GACN,SAAS,GACT,iBAAiB,GACjB,UAAU,GACV,uBAAuB,GACvB,gBAAgB,GAChB,iBAAiB,GACjB,WAAW,GACX,UAAU,GACV,gBAAgB,GAChB,MAAM,GACN,cAAc,GACd,cAAc,GACd,WAAW,GACX,gBAAgB,GAChB,eAAe,CAAA;AAEnB,MAAM,MAAM,gBAAgB,GAC1B,iBAAiB,GAAG,aAAa,GAAG,aAAa,GAAG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YAAY,CAAC;CAMpF"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { CanvasHttpClient } from './client';
|
|
2
|
+
import type { CalendarEventType } from './calendar';
|
|
2
3
|
import type { CanvasDashboardCard, CanvasTodoItem, CanvasUpcomingEvent, CanvasMissingSubmission } from './types';
|
|
4
|
+
export interface GetUpcomingEventsOptions {
|
|
5
|
+
type?: CalendarEventType;
|
|
6
|
+
}
|
|
3
7
|
export declare class DashboardModule {
|
|
4
8
|
private client;
|
|
5
9
|
constructor(client: CanvasHttpClient);
|
|
6
10
|
getDashboardCards(): Promise<CanvasDashboardCard[]>;
|
|
7
11
|
getTodoItems(): Promise<CanvasTodoItem[]>;
|
|
8
|
-
getUpcomingEvents(): Promise<CanvasUpcomingEvent[]>;
|
|
12
|
+
getUpcomingEvents(opts?: GetUpcomingEventsOptions): Promise<CanvasUpcomingEvent[]>;
|
|
9
13
|
getMissingSubmissions(): Promise<CanvasMissingSubmission[]>;
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/canvas/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,qBAAa,eAAe;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAEtC,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAInD,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/canvas/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,iBAAiB,CAAA;CACzB;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAEtC,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAInD,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAWzC,iBAAiB,CAAC,IAAI,GAAE,wBAA6B,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQtF,qBAAqB,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;CAGlE"}
|
|
@@ -26,12 +26,35 @@ export interface ListUserEnrollmentsOptions {
|
|
|
26
26
|
grading_period_id?: CanvasId;
|
|
27
27
|
enrollment_term_id?: CanvasId;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The two optional `enrollment[...]` fields `enroll` forwards beyond
|
|
31
|
+
* role and state.
|
|
32
|
+
*
|
|
33
|
+
* `course_section_id` is the section to enroll into; Canvas ignores it on the
|
|
34
|
+
* section-scoped URL variant, which this client does not use.
|
|
35
|
+
* `limit_privileges_to_course_section` confines the user to that section — for
|
|
36
|
+
* teachers and TAs that includes grading privileges, and a section-limited
|
|
37
|
+
* student sees no user (teachers included) outside their own sections. Canvas
|
|
38
|
+
* documents it as taking effect relative to `course_section_id`, so passing it
|
|
39
|
+
* without a section restricts the user to whichever section Canvas picks.
|
|
40
|
+
*/
|
|
41
|
+
export interface EnrollUserOptions {
|
|
42
|
+
course_section_id?: CanvasId;
|
|
43
|
+
limit_privileges_to_course_section?: boolean;
|
|
44
|
+
}
|
|
29
45
|
export declare class EnrollmentsModule {
|
|
30
46
|
private client;
|
|
31
47
|
constructor(client: CanvasHttpClient);
|
|
32
48
|
list(opts?: ListUserEnrollmentsOptions): Promise<CanvasEnrollment[]>;
|
|
33
49
|
listForCourse(courseId: CanvasId, opts?: ListCourseEnrollmentsOptions): Promise<CanvasEnrollment[]>;
|
|
34
|
-
|
|
50
|
+
/**
|
|
51
|
+
* `POST /api/v1/courses/:course_id/enrollments`, under the `enrollment[...]`
|
|
52
|
+
* envelope Canvas documents.
|
|
53
|
+
*
|
|
54
|
+
* `opts` keys are spread last and only when present, so a call that omits
|
|
55
|
+
* them produces the same request body as before they existed.
|
|
56
|
+
*/
|
|
57
|
+
enroll(courseId: CanvasId, userId: CanvasId, type: string, enrollmentState?: string, opts?: EnrollUserOptions): Promise<CanvasEnrollment>;
|
|
35
58
|
remove(courseId: CanvasId, enrollmentId: CanvasId, task: string): Promise<CanvasEnrollment>;
|
|
36
59
|
listMyGrades(courseId?: CanvasId): Promise<CanvasEnrollment[]>;
|
|
37
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollments.d.ts","sourceRoot":"","sources":["../../src/canvas/enrollments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,oBAAoB,GACpB,oBAAoB,CAAA;AAExB,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,SAAS,GACT,kBAAkB,GAClB,SAAS,GACT,UAAU,GACV,WAAW,GACX,UAAU,GACV,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,CAAA;AAE3B,MAAM,MAAM,iBAAiB,GACzB,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,MAAM,GACN,g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E"}
|
package/dist/canvas/groups.d.ts
CHANGED
|
@@ -12,6 +12,20 @@ export interface CreateGroupParams {
|
|
|
12
12
|
export declare class GroupsModule {
|
|
13
13
|
private client;
|
|
14
14
|
constructor(client: CanvasHttpClient);
|
|
15
|
+
/**
|
|
16
|
+
* The groups the CALLING user is a member of, optionally narrowed to course
|
|
17
|
+
* contexts. This is deliberately not `list(courseId)`: `/courses/:id/groups`
|
|
18
|
+
* is gated on `:read_roster` and returns every group in the course, so a
|
|
19
|
+
* student with roster access reads back groups they are not in. Attributing a
|
|
20
|
+
* per-group discussion's child topic to one of those would report another
|
|
21
|
+
* group's state as the caller's own.
|
|
22
|
+
*
|
|
23
|
+
* `course_id` is on each group (`context_type: 'Course'`), so the caller
|
|
24
|
+
* filters locally rather than per-course fan-out.
|
|
25
|
+
*/
|
|
26
|
+
listMine(opts?: {
|
|
27
|
+
contextType?: 'Course' | 'Account';
|
|
28
|
+
}): Promise<CanvasGroup[]>;
|
|
15
29
|
list(courseId: CanvasId): Promise<CanvasGroup[]>;
|
|
16
30
|
listMembers(groupId: CanvasId): Promise<CanvasUser[]>;
|
|
17
31
|
listCategories(courseId: CanvasId): Promise<CanvasGroupCategory[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../src/canvas/groups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAClG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE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AAE,QAAQ,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAOxF,yFAAyF;IACnF,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;IAIrD,oGAAoG;IAC9F,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAOpF,iEAAiE;IAC3D,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,CAAC;CAKlF"}
|
package/dist/canvas/index.cjs
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLMKNKL5Ccjs = require('../chunk-LMKNKL5C.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkQWLAP6MWcjs = require('../chunk-QWLAP6MW.cjs');
|
|
16
16
|
require('../chunk-AMZAZNZZ.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
@@ -26,5 +26,5 @@ require('../chunk-AMZAZNZZ.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.CANVAS_MAX_ID =
|
|
29
|
+
exports.CANVAS_MAX_ID = _chunkLMKNKL5Ccjs.CANVAS_MAX_ID; exports.CanvasApiError = _chunkQWLAP6MWcjs.CanvasApiError; exports.CanvasClient = _chunkLMKNKL5Ccjs.CanvasClient; exports.CanvasHttpClient = _chunkQWLAP6MWcjs.CanvasHttpClient; exports.MAX_SAFE_CANVAS_NUMBER_ID = _chunkLMKNKL5Ccjs.MAX_SAFE_CANVAS_NUMBER_ID; exports.appendCanvasQuery = _chunkQWLAP6MWcjs.appendCanvasQuery; exports.canvasIdInput = _chunkLMKNKL5Ccjs.canvasIdInput; exports.canvasIdList = _chunkLMKNKL5Ccjs.canvasIdList; exports.compareCanvasIds = _chunkLMKNKL5Ccjs.compareCanvasIds; exports.normalizeCanvasIdInput = _chunkLMKNKL5Ccjs.normalizeCanvasIdInput; exports.toCanvasQuery = _chunkQWLAP6MWcjs.toCanvasQuery;
|
|
30
30
|
//# sourceMappingURL=index.cjs.map
|
package/dist/canvas/index.js
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
canvasIdList,
|
|
7
7
|
compareCanvasIds,
|
|
8
8
|
normalizeCanvasIdInput
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-W624KMYI.js";
|
|
10
10
|
import {
|
|
11
11
|
CanvasApiError,
|
|
12
12
|
CanvasHttpClient,
|
|
13
13
|
appendCanvasQuery,
|
|
14
14
|
toCanvasQuery
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-6XNWSJQF.js";
|
|
16
16
|
import "../chunk-XLORAICV.js";
|
|
17
17
|
export {
|
|
18
18
|
CANVAS_MAX_ID,
|
package/dist/canvas/modules.d.ts
CHANGED
|
@@ -29,14 +29,48 @@ export declare class ModulesModule {
|
|
|
29
29
|
/**
|
|
30
30
|
* List a course's modules with each module's items inlined via `include[]=items`.
|
|
31
31
|
* Unlike `getCourseStructure`, this returns the raw Canvas shapes (including the
|
|
32
|
-
* `published` state on every module and item,
|
|
33
|
-
*
|
|
32
|
+
* `published` state on every module and item, and each item's
|
|
33
|
+
* `completion_requirement`, all of which `getCourseStructure` projects away), which
|
|
34
|
+
* the course-setup health check needs to detect unpublished content.
|
|
35
|
+
*
|
|
36
|
+
* **`items` can be absent, and absent is not empty.** `module_json` inlines items
|
|
37
|
+
* only when `includes.include?("items") && count <= Api::MAX_PER_PAGE`, with
|
|
38
|
+
* `Api::MAX_PER_PAGE = 100` (`lib/api.rb`). A module with 101 or more items comes back
|
|
39
|
+
* with **no `items` key at all** — not a truncated array, not an error. Compare
|
|
40
|
+
* `items.length` against `items_count` and fall back to `listItems` for that module;
|
|
41
|
+
* `items ?? []` silently reports a large module as empty.
|
|
42
|
+
*
|
|
43
|
+
* `per_page` needs no argument here: `CanvasHttpClient.paginate` sets `per_page=100`
|
|
44
|
+
* whenever the caller did not, so this never falls back to Canvas's
|
|
45
|
+
* `Api::PER_PAGE = 10` default.
|
|
46
|
+
*
|
|
47
|
+
* @param opts.contentDetails adds `include[]=content_details`, which is the only way
|
|
48
|
+
* to see `locked_for_user` and the caller's override-applied effective `due_at` per
|
|
49
|
+
* item. Off by default so existing callers keep their current response size.
|
|
50
|
+
* @param opts.maxItems stops after this many MODULES. Pass `limit + 1` to probe for
|
|
51
|
+
* truncation: `paginate()` reports what it accumulated, never whether more was
|
|
52
|
+
* waiting, so asking for exactly `limit` makes "there are exactly `limit`" and
|
|
53
|
+
* "there are more" indistinguishable. Off by default.
|
|
34
54
|
*/
|
|
35
|
-
listWithItems(courseId: CanvasId
|
|
55
|
+
listWithItems(courseId: CanvasId, opts?: {
|
|
56
|
+
contentDetails?: boolean;
|
|
57
|
+
maxItems?: number;
|
|
58
|
+
}): Promise<(CanvasModule & {
|
|
36
59
|
items?: CanvasModuleItem[];
|
|
37
60
|
})[]>;
|
|
38
61
|
get(courseId: CanvasId, moduleId: CanvasId): Promise<CanvasModule>;
|
|
39
|
-
|
|
62
|
+
/**
|
|
63
|
+
* List one module's items. This is the paginating endpoint, so it is also the recovery
|
|
64
|
+
* path for the `include[]=items` cliff documented on {@link listWithItems}: a module
|
|
65
|
+
* with more than 100 items has to be read here.
|
|
66
|
+
*
|
|
67
|
+
* @param opts.contentDetails adds `include[]=content_details`, so a module recovered
|
|
68
|
+
* through this path carries the same `locked_for_user` and effective-date evidence
|
|
69
|
+
* as one inlined by `listWithItems({ contentDetails: true })`. Off by default.
|
|
70
|
+
*/
|
|
71
|
+
listItems(courseId: CanvasId, moduleId: CanvasId, opts?: {
|
|
72
|
+
contentDetails?: boolean;
|
|
73
|
+
}): Promise<CanvasModuleItem[]>;
|
|
40
74
|
create(courseId: CanvasId, params: {
|
|
41
75
|
name: string;
|
|
42
76
|
position?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/canvas/modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,QAAQ,CAAA;CACrB;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAEtC,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIvD
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/canvas/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