Skip to content

Commit

Permalink
Update dependencies (#325)
Browse files Browse the repository at this point in the history
* Fix #324

* npm update

* update npm outdated

* fix lint

* update npm outdated

* Explicitly use fetch from s-a-c

* npm install

* npm install rdflib@latest pane-registry@latest solid-namespace@latest

* npm install --save-dev solid-auth-cli

* npm update

* package-lock.json
  • Loading branch information
michielbdejong authored Jul 30, 2020
1 parent 7c82693 commit af52d52
Show file tree
Hide file tree
Showing 7 changed files with 4,187 additions and 3,192 deletions.
7,193 changes: 4,034 additions & 3,159 deletions package-lock.json

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,43 +51,43 @@
},
"homepage": "https://github.com/solid/solid-ui",
"dependencies": {
"@babel/runtime": "^7.10.3",
"@types/node": "^13.13.12",
"@babel/runtime": "^7.10.5",
"escape-html": "^1.0.3",
"jss": "^10.3.0",
"jss-preset-default": "^10.3.0",
"mime-types": "^2.1.27",
"node-uuid": "^1.4.7",
"pane-registry": "^2.1.1",
"rdflib": "^1.2.3",
"solid-auth-client": "^2.4.1",
"solid-auth-tls": "^0.1.2",
"solid-namespace": "^0.3.0",
"ts-jest": "^25.5.1"
"pane-registry": "^2.2.1",
"rdflib": "^1.3.1",
"solid-auth-client": "^2.5.0",
"solid-namespace": "^0.4.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
"@babel/core": "^7.10.3",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-optional-chaining": "^7.10.3",
"@babel/plugin-transform-async-to-generator": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.3",
"@babel/preset-env": "^7.10.3",
"@babel/preset-typescript": "^7.10.1",
"@types/jest": "^25.2.3",
"@types/jsdom": "^12.2.4",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"eslint": "^6.6.0",
"eslint-plugin-jest": "^23.17.0",
"husky": "^3.0.9",
"jest": "^25.5.4",
"jsdom": "^16.2.2",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.10.5",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-optional-chaining": "^7.10.4",
"@babel/plugin-transform-async-to-generator": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@types/jest": "^26.0.7",
"@types/jsdom": "^16.2.3",
"@types/node": "^14.0.26",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"eslint": "^7.5.0",
"eslint-plugin-jest": "^23.18.2",
"husky": "^4.2.5",
"jest": "^26.1.0",
"jsdom": "^16.3.0",
"lint-staged": "^10.2.11",
"solid-auth-cli": "^1.0.14",
"standard": "^14.3.4",
"typedoc": "^0.16.11",
"typescript": "^3.9.5",
"webpack": "^4.43.0",
"ts-jest": "^26.1.3",
"typedoc": "^0.17.8",
"typescript": "^3.9.7",
"webpack": "^4.44.0",
"webpack-cli": "^3.3.12"
},
"husky": {
Expand Down
7 changes: 4 additions & 3 deletions src/authn/authn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages
* @packageDocumentation
*/
import SolidTls from 'solid-auth-tls'
import Signup from './signup'
import widgets from '../widgets'
import solidAuthClient from 'solid-auth-client'
import ns from '../ns.js'
Expand Down Expand Up @@ -436,9 +436,10 @@ async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boo
await loadOneTypeIndex(context, isPublic)
if (context.index) {
debug.log(
`ensureOneTypeIndex: Type index exists already ${isPublic}`
`ensureOneTypeIndex: Type index exists already ${isPublic
? context.index.public[0]
: context.index.private[0]
}`
)
}
return context
Expand Down Expand Up @@ -964,7 +965,7 @@ function signInOrSignUpBox (
signupButton.setAttribute('style', `${signInButtonStyle}background-color: #efe;`)

signupButton.addEventListener('click', function (_event) {
const signupMgr = new SolidTls.Signup()
const signupMgr = new Signup()
signupMgr.signup().then(function (uri) {
debug.log('signInOrSignUpBox signed up ' + uri)
setUserCallback(uri)
Expand Down
42 changes: 42 additions & 0 deletions src/authn/config-default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict'
/**
* Provides a simple configuration object for Solid web client and other
* modules.
* @module config-default
*/
module.exports = {
/**
* Primary authentication endpoint
*/
authEndpoint: '',

/**
* Fallback authentication endpoint
*/
fallbackAuthEndpoint: 'https://databox.me/',

/**
* Default signup endpoints (list of identity providers)
*/
signupEndpoint: 'https://solid.github.io/solid-idps/',

/**
* Default height of the Signup popup window, in pixels
*/
signupWindowHeight: 600,

/**
* Default width of the Signup popup window, in pixels
*/
signupWindowWidth: 1024,

/**
* Path to the client private key (only needed when running within node)
*/
key: '',

/**
* Path to the client certificate (only needed when running within node)
*/
cert: ''
}
76 changes: 76 additions & 0 deletions src/authn/signup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
var defaultConfig = require('./config-default')

/**
* Provides functionality for signing up with a Solid provider
* @module signup
*/

/**
* Creates a Signup UI manager
* @class
*/
function Signup (config) {
this.config = config || defaultConfig
}

/**
* Sets up an event listener to monitor login messages from child window/iframe
* @method listen
* @return {Promise<String>} Event listener promise, resolves to user's WebID
*/
Signup.prototype.listen = function listen () {
var promise = new Promise(function (resolve, reject) {
var eventMethod = window.addEventListener
? 'addEventListener'
: 'attachEvent'
var eventListener = window[eventMethod]
var messageEvent = eventMethod === 'attachEvent'
? 'onmessage'
: 'message'
eventListener(messageEvent, function (e) {
var u = e.data
if (u.slice(0, 5) === 'User:') {
var user = u.slice(5, u.length)
if (user && user.length > 0 && user.slice(0, 4) === 'http') {
return resolve(user)
} else {
return reject(user)
}
}
}, true)
})
return promise
}

/**
* Opens a signup popup window, sets up `listen()`.
* @method signup
* @static
* @param signupUrl {String} Location of a Solid server for user signup.
* @return {Promise<String>} Returns a listener promise, resolves with signed
* up user's WebID.
*/
Signup.prototype.signup = function signup (signupUrl) {
signupUrl = signupUrl || this.config.signupEndpoint
var width = this.config.signupWindowWidth
var height = this.config.signupWindowHeight
// set borders
var leftPosition = (window.screen.width / 2) - ((width / 2) + 10)
// set title and status bars
var topPosition = (window.screen.height / 2) - ((height / 2) + 50)
var windowTitle = 'Solid signup'
var windowUrl = signupUrl + '?origin=' +
encodeURIComponent(window.location.origin)
var windowSpecs = 'resizable,scrollbars,status,width=' + width + ',height=' +
height + ',left=' + leftPosition + ',top=' + topPosition
window.open(windowUrl, windowTitle, windowSpecs)
var self = this
return new Promise(function (resolve) {
self.listen()
.then(function (webid) {
return resolve(webid)
})
})
}

module.exports = Signup
3 changes: 2 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
//

import * as debug from './debug'
import { fetch } from 'solid-auth-client'

var rdf = require('rdflib')
var store = (module.exports = rdf.graph()) // Make a Quad store
rdf.fetcher(store) // Attach a web I/O module, store.fetcher
rdf.fetcher(store, { fetch }) // Attach a web I/O module, store.fetcher
store.updater = new rdf.UpdateManager(store) // Add real-time live updates store.updater

debug.log('Unique quadstore initialized.')
Expand Down
2 changes: 1 addition & 1 deletion test/unit/acl/acl-control.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('preventBrowserDropEvents', () => {

describe('handleDrop', () => {
beforeEach(() => {
setGlobalWindow(window)
setGlobalWindow(window as unknown as Window)
event.dataTransfer = { files: [{}] }
window.confirm = jest.fn(() => false)
handleDrop(event)
Expand Down

0 comments on commit af52d52

Please sign in to comment.