Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@byu-oit/canvas-sdk

Package Overview
Dependencies
Maintainers
12
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byu-oit/canvas-sdk - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "@byu-oit/canvas-sdk",
"version": "0.1.2",
"version": "0.1.3",
"description": "A wrapper around Instructure's Canvas API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -81,7 +81,11 @@ 'use strict';

sections.getEnrollment = async function(sisSectionId, sisUserId) {
sections.getEnrollment = async function(sisSectionId, sisUserId, type) {
if(!sisSectionId) {
logger.error("Must provide sisSectionId to sections.getEnrollment");
}
const res = await canvas.request('GET', `users/sis_user_id:${sisUserId}/enrollments?sis_section_id=${sisSectionId}&state[]=active&state[]=invited&state[]=inactive&state[]=completed`);
let url = `users/sis_user_id:${sisUserId}/enrollments?sis_section_id=${sisSectionId}&state[]=active&state[]=invited&state[]=inactive&state[]=completed`;
if(type) {
url = `${url}&type[]=${type}`;
}
const res = await canvas.request('GET', url.toString());
if(res) {

@@ -88,0 +92,0 @@ if(res.length > 1) {

@@ -116,2 +116,6 @@ 'use strict';

assert.strictEqual(enrollment.sis_user_id, SIS_USER_ID);
enrollment = await canvas.sections.getEnrollment(SIS_SECTION_ID, SIS_USER_ID, 'StudentEnrollment');
assert.strictEqual(enrollment.sis_user_id, SIS_USER_ID);
enrollment = await canvas.sections.getEnrollment(SIS_SECTION_ID, SIS_USER_ID, 'TeacherEnrollment');
assert.ok(! enrollment);
await canvas.sections.changeEnrollment(SIS_SECTION_ID, SIS_USER_ID, 'deactivate');

@@ -118,0 +122,0 @@ enrollment = await canvas.sections.getEnrollment(SIS_SECTION_ID, SIS_USER_ID);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc