Coder Social home page Coder Social logo

scormcloud-api-v2-client-javascript's People

Contributors

cojohnson1999 avatar dillgromble avatar mjschuetze102 avatar tedwards avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scormcloud-api-v2-client-javascript's Issues

Compatibility of `scormcloud-api-v2-client-javascript` with TypeScript and Workaround for Incompatibility

Issue Description:

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!

There are no usage examples available and the documention is hard to read.

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 ๐Ÿ‘Ž :-(

TypeError: Cannot read property 'forEach' of null when attempting to getRegistrations

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.

Typescript types

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.