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

upload-js

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

upload-js - npm Package Compare versions

Comparing version 2.16.0 to 2.17.0

1

dist/AuthSession.d.ts
export interface AuthSession {
accessToken: string | undefined;
accessTokenRefreshHandle: number | undefined;
authUrl: string;
isActive: boolean;
}

63

dist/main.js

@@ -578,11 +578,24 @@ module.exports =

return x.beginAuthSession(authUrl, authHeaders);
}), function () {
return Upload_call(endAuthSession, function () {
}), Upload_async(function () {
debug("User code called 'beginAuthSession'"); // Explanation:
// - Prevents restarting the auth session on accidental double-calls to 'beginAuthSession': in some users' code,
// this happens accidentally every second, so we want to bail-out if we detect this is occurring.
// - We only check 'authUrl' to determine if the 'same call' is being made, since 'authHeaders' is a function
// and therefore its body can be switched-out by the user's code if they desire a change to its behaviour, so
// don't need to call 'beginAuthSession' just to update it.
if ((lastAuthSession === null || lastAuthSession === void 0 ? void 0 : lastAuthSession.authUrl) === authUrl) {
error("'beginAuthSession' has already been called. Ignoring this call. (Hint: call 'endAuthSession' and then 'beginAuthSession' if you want to restart the auth session.)");
return;
}
return Upload_call(doEndAuthSession, function () {
var authSession = {
accessToken: undefined,
accessTokenRefreshHandle: undefined,
isActive: true
isActive: true,
authUrl: authUrl
}; // Does not need to be inside the mutex since the environment is single-threaded, and we have not async-yielded
// since the mutex from 'endAuthSession' was relinquished (meaning we still have execution, so we know a) nothing
// can interject and b) nothing has interjected since the lock was relinquished).
// since the mutex from 'endAuthSession' was relinquished (meaning we still have execution,
// so we know a) nothing can interject and b) nothing has interjected since the lock was relinquished).

@@ -592,3 +605,3 @@ lastAuthSession = authSession;

});
}));
})));
});

@@ -600,17 +613,4 @@

}), Upload_async(function () {
return Upload_awaitIgnored(authMutex.safe(Upload_async(function () {
if (lastAuthSession === undefined) {
return;
}
var authSession = lastAuthSession;
lastAuthSession = undefined;
if (authSession.accessTokenRefreshHandle !== undefined) {
clearTimeout(authSession.accessTokenRefreshHandle);
}
authSession.isActive = false;
return _callIgnored(deleteAccessToken);
})));
debug("User code called 'endAuthSession'");
return _callIgnored(doEndAuthSession);
})));

@@ -621,3 +621,4 @@ });

var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
// Initial progress (raised immediately and synchronously).
debug("User code called 'uploadFile'"); // Initial progress (raised immediately and synchronously).
var cancellationHandlers = [];

@@ -668,2 +669,20 @@

var doEndAuthSession = Upload_async(function () {
return Upload_awaitIgnored(authMutex.safe(Upload_async(function () {
if (lastAuthSession === undefined) {
return;
}
var authSession = lastAuthSession;
lastAuthSession = undefined;
if (authSession.accessTokenRefreshHandle !== undefined) {
clearTimeout(authSession.accessTokenRefreshHandle);
}
authSession.isActive = false;
return _callIgnored(deleteAccessToken);
})));
});
var beginFileUpload = Upload_async(function (file, params, addCancellationHandler) {

@@ -670,0 +689,0 @@ var progressSmoother = (0,external_progress_smoother_namespaceObject.ProgressSmoother)({

{
"name": "upload-js",
"version": "2.16.0",
"version": "2.17.0",
"author": "Upload <hello@upload.io> (https://upload.io)",

@@ -5,0 +5,0 @@ "description": "File Upload Library — Upload.js gives developers AJAX multipart file uploading via XHR 🚀 Comes with Cloud Storage 🌐",

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