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.6 to 0.1.7

3

index.js

@@ -13,2 +13,3 @@ 'use strict';

const STARTING_RATE_LIMIT_REMAINING = 700;
const DEFAULT_MAX_SIMULTANEOUS_REQUESTS = 10;

@@ -18,2 +19,4 @@ module.exports = function(config) {

canvas.maxSimultaneousRequests = config.maxSimultaneousRequests || DEFAULT_MAX_SIMULTANEOUS_REQUESTS;
if(config.tokens) {

@@ -20,0 +23,0 @@ canvas.tokens = [];

3

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

@@ -33,2 +33,3 @@ "main": "index.js",

"dependencies": {
"promise-subarrays": "^0.1.1",
"request": "^2.87.0",

@@ -35,0 +36,0 @@ "request-promise": "^4.2.2",

'use strict';
const logger = require('./utils/logger');
const uuid = require('uuid');
const PromiseArray = require('promise-subarrays');

@@ -41,11 +42,17 @@ module.exports = function(canvas) {

const sections = [];
const promiseArray = PromiseArray();
for(let course of courses) {
logger.info(`Getting sections for course ${course.sis_course_id}`);
const courseSections = await canvas.requestAll(`courses/${course.id}/sections?include=students`);
for(let courseSection of courseSections) {
courseSection.account_id = course.account_id;
courseSection.workflow_state = course.workflow_state;
sections.push(courseSection);
}
promiseArray.push(async function(course) {
logger.info(`Getting sections for course ${course.sis_course_id}`);
const courseSections = await canvas.requestAll(`courses/${course.id}/sections?include=students`);
for(let courseSection of courseSections) {
courseSection.account_id = course.account_id;
courseSection.workflow_state = course.workflow_state;
sections.push(courseSection);
}
}, [course]);
}
await promiseArray.awaitAll(canvas.maxSimultaneousRequests);
return sections;

@@ -52,0 +59,0 @@ };

@@ -8,3 +8,4 @@ 'use strict';

token: process.env.TOKEN,
subdomain: process.env.SUBDOMAIN
subdomain: process.env.SUBDOMAIN,
maxSimultaneousRequests: 5
});

@@ -11,0 +12,0 @@ const logger = require('./src/utils/logger');

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