rusticisoftware / scormcloud-api-v2-client-javascript Goto Github PK
View Code? Open in Web Editor NEWSwagger Generated Java Script Client for SCORM Cloud API v2
License: Apache License 2.0
Swagger Generated Java Script Client for SCORM Cloud API v2
License: Apache License 2.0
I am currently working on a project that involves uploading SCORM (Sharable Content Object Reference Model) files to the SCORM Cloud platform. To achieve this functionality, I have decided to use the 'scormcloud-api-v2-client-javascript' package as it seems to offer the necessary features. This works with JavaScript However, before proceeding further, I am uncertain about the package's compatibility with TypeScript.
Please assist me in clarifying the compatibility concerns and providing a viable workaround if required. Thank you!
My experience using the v2 apis is hellish so far. There are no usage examples available in the documentation. The error messages are not at all helpful while debugging as every error message is nothing but "An internal server error occurred. This has been logged for the development team. Please contact [email protected] if the error persists. Error Reference reference-id".
Only use the platform if you want to waste a lot of your time just doing hit and trial and praying for the API to work ๐ :-(
Steps to reproduce
In a Node environment with the 1.0.0-beta package installed, the following code will trigger the error:
var RusticiSoftwareCloudV2 = require("@rusticisoftware/scormcloud-api-v2-client-javascript");
var defaultClient = RusticiSoftwareCloudV2.ApiClient.instance
var APP_NORMAL = defaultClient.authentications['APP_NORMAL']
APP_NORMAL.username = // YOUR APP ID
APP_NORMAL.password = // YOUR APP SECRET KEY
var api = new RusticiSoftwareCloudV2.RegistrationApi
api.getRegistrations({'learnerId': '[email protected]'}, (e,d,r) => {
console.log(r.body)
})
Expected result
Response body r.body
would be logged to the console
Actual result
TypeError: Cannot read property 'forEach' of null
at exports.applyAuthToRequest (/app/node_modules/@rusticisoftware/scormcloud-api-v2-client-javascript/src/rustici-software-cloud-v2/ApiClient.js:278:15)
at exports.callApi (/app/node_modules/@rusticisoftware/scormcloud-api-v2-client-javascript/src/rustici-software-cloud-v2/ApiClient.js:369:10)
at exports.getRegistrations (/app/node_modules/@rusticisoftware/scormcloud-api-v2-client-javascript/src/rustici-software-cloud-v2/rustici-software-cloud-v2-api/RegistrationApi.js:1112:29)
Investigative Notes
I noticed that there are two versions of ApiClient.js
in the library; for one of them, authNames
is the 8th parameter, and one of them is the 9th parameter. It appears that the wrong one is being called. When I copy the version at src/ApiClient.js
over the version at src/rustici-software-cloud-v2/ApiClient.js
, the problem goes away.
Is there any plan to make typescript definitions for the library? I might see if I can do it but I'm no Typescript expert by any means
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.