Comments (2)
- The library at the moment probably isn't flexible enough to handle no auth being provided, but it should be I agree. I'll try to slate some time soon for it, but if you want to submit a PR that'd likely be faster.
- Since doing sync requests from Node.js is generally not suggested I don't have plans (nor would really accept the changes) to add sync handling to that particular environment file. The long term plan is to remove sync handling completely from both environments (node + browser) so that we can adopt a promises based approach.
- The callback arguments should be node conformant. Can you provide a code sample that doesn't work as expected? (Certainly have been issues in this area before, so I'm happy to check.) The arguments provided should be either
null
or the error message, and then the xhr that was used. Some calls do translation of the response on success, such asretrieveStatement
which returns the TinCan.Statement itself as the second argument when possible. Trying to support backwards compat and effectively 3 environments (browser, IE, node) has been a pretty big pain, so there could certainly still be bugs in there. You might have a look at the test files for more sample code, or even better to create a test case that shows the issue you are running into. See:
https://github.com/RusticiSoftware/TinCanJS/tree/master/test/js/unit
The design of the API is lacking in this area as this was the first library created and based on an older design that was even less sufficient. I have it on my docket to solidify the context handling and callback structure to use proper response objects like the other OSS libraries have. Unfortunately I can't provide a timeline for any of that.
from tincanjs.
I should follow this up by saying that if you know what you are doing (and it sounds like you do) that it would be pretty easy to implement your own async handling that has a different callback argument structure and/or overall request handling (for instance to use Node's builtin HTTP client lib or the request
lib from npm). Take a look at the current Environment/Node.js
file and you can see that it is really just one method that needs to be overloaded:
https://github.com/RusticiSoftware/TinCanJS/blob/master/src/Environment/Node.js
It doesn't help you with the call structure, but it is a pretty isolated piece of code otherwise, particularly if you are controlling your environment.
from tincanjs.
Related Issues (20)
- LRS invalid: failed to divide URL parts HOT 5
- disregard
- LRS.queryStatements drops more link for multipart response?
- `LRS.moreStatements` doesn't handle multipart responses
- StatementsResult object should handle `more: ""` like `null`
- Return value from Statement() is not a valid xAPI statement HOT 3
- Need access to original statement from HTTP response HOT 3
- Unity with TinCan API Version Question HOT 4
- Exclude cryptoJs to build for include in dependancy.
- Catch error when neither auth or username and password LRS properties are set
- Paging does not work with attachments
- Future plans with this project? HOT 2
- How to load activity_id from query string instead of config HOT 3
- agent block causes an error if it doesn't contain an "mbox" key/value pair HOT 3
- Typscript type definitions? HOT 3
- How to saveAgentProfile? HOT 1
- error while installing in nodejs HOT 1
- How best to defeat browser caching when requesting Activity Profile HOT 2
- What is the difference between this and the official xApiWrapper?
- Using TinCanJS in my application
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tincanjs.