Skip to content

Commit af52d52

Browse files
Update dependencies (#325)
* 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
1 parent 7c82693 commit af52d52

File tree

7 files changed

+4187
-3192
lines changed

7 files changed

+4187
-3192
lines changed

package-lock.json

Lines changed: 4034 additions & 3159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,43 +51,43 @@
5151
},
5252
"homepage": "https://github.com/solid/solid-ui",
5353
"dependencies": {
54-
"@babel/runtime": "^7.10.3",
55-
"@types/node": "^13.13.12",
54+
"@babel/runtime": "^7.10.5",
5655
"escape-html": "^1.0.3",
5756
"jss": "^10.3.0",
5857
"jss-preset-default": "^10.3.0",
5958
"mime-types": "^2.1.27",
6059
"node-uuid": "^1.4.7",
61-
"pane-registry": "^2.1.1",
62-
"rdflib": "^1.2.3",
63-
"solid-auth-client": "^2.4.1",
64-
"solid-auth-tls": "^0.1.2",
65-
"solid-namespace": "^0.3.0",
66-
"ts-jest": "^25.5.1"
60+
"pane-registry": "^2.2.1",
61+
"rdflib": "^1.3.1",
62+
"solid-auth-client": "^2.5.0",
63+
"solid-namespace": "^0.4.0"
6764
},
6865
"devDependencies": {
69-
"@babel/cli": "^7.10.3",
70-
"@babel/core": "^7.10.3",
71-
"@babel/plugin-proposal-class-properties": "^7.10.1",
72-
"@babel/plugin-proposal-optional-chaining": "^7.10.3",
73-
"@babel/plugin-transform-async-to-generator": "^7.10.1",
74-
"@babel/plugin-transform-runtime": "^7.10.3",
75-
"@babel/preset-env": "^7.10.3",
76-
"@babel/preset-typescript": "^7.10.1",
77-
"@types/jest": "^25.2.3",
78-
"@types/jsdom": "^12.2.4",
79-
"@typescript-eslint/eslint-plugin": "^2.34.0",
80-
"@typescript-eslint/parser": "^2.34.0",
81-
"eslint": "^6.6.0",
82-
"eslint-plugin-jest": "^23.17.0",
83-
"husky": "^3.0.9",
84-
"jest": "^25.5.4",
85-
"jsdom": "^16.2.2",
66+
"@babel/cli": "^7.10.5",
67+
"@babel/core": "^7.10.5",
68+
"@babel/plugin-proposal-class-properties": "^7.10.4",
69+
"@babel/plugin-proposal-optional-chaining": "^7.10.4",
70+
"@babel/plugin-transform-async-to-generator": "^7.10.4",
71+
"@babel/plugin-transform-runtime": "^7.10.5",
72+
"@babel/preset-env": "^7.10.4",
73+
"@babel/preset-typescript": "^7.10.4",
74+
"@types/jest": "^26.0.7",
75+
"@types/jsdom": "^16.2.3",
76+
"@types/node": "^14.0.26",
77+
"@typescript-eslint/eslint-plugin": "^3.7.0",
78+
"@typescript-eslint/parser": "^3.7.0",
79+
"eslint": "^7.5.0",
80+
"eslint-plugin-jest": "^23.18.2",
81+
"husky": "^4.2.5",
82+
"jest": "^26.1.0",
83+
"jsdom": "^16.3.0",
8684
"lint-staged": "^10.2.11",
85+
"solid-auth-cli": "^1.0.14",
8786
"standard": "^14.3.4",
88-
"typedoc": "^0.16.11",
89-
"typescript": "^3.9.5",
90-
"webpack": "^4.43.0",
87+
"ts-jest": "^26.1.3",
88+
"typedoc": "^0.17.8",
89+
"typescript": "^3.9.7",
90+
"webpack": "^4.44.0",
9191
"webpack-cli": "^3.3.12"
9292
},
9393
"husky": {

src/authn/authn.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages
2020
* @packageDocumentation
2121
*/
22-
import SolidTls from 'solid-auth-tls'
22+
import Signup from './signup'
2323
import widgets from '../widgets'
2424
import solidAuthClient from 'solid-auth-client'
2525
import ns from '../ns.js'
@@ -436,9 +436,10 @@ async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boo
436436
await loadOneTypeIndex(context, isPublic)
437437
if (context.index) {
438438
debug.log(
439-
`ensureOneTypeIndex: Type index exists already ${isPublic}`
439+
`ensureOneTypeIndex: Type index exists already ${isPublic
440440
? context.index.public[0]
441441
: context.index.private[0]
442+
}`
442443
)
443444
}
444445
return context
@@ -964,7 +965,7 @@ function signInOrSignUpBox (
964965
signupButton.setAttribute('style', `${signInButtonStyle}background-color: #efe;`)
965966

966967
signupButton.addEventListener('click', function (_event) {
967-
const signupMgr = new SolidTls.Signup()
968+
const signupMgr = new Signup()
968969
signupMgr.signup().then(function (uri) {
969970
debug.log('signInOrSignUpBox signed up ' + uri)
970971
setUserCallback(uri)

src/authn/config-default.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
'use strict'
2+
/**
3+
* Provides a simple configuration object for Solid web client and other
4+
* modules.
5+
* @module config-default
6+
*/
7+
module.exports = {
8+
/**
9+
* Primary authentication endpoint
10+
*/
11+
authEndpoint: '',
12+
13+
/**
14+
* Fallback authentication endpoint
15+
*/
16+
fallbackAuthEndpoint: 'https://databox.me/',
17+
18+
/**
19+
* Default signup endpoints (list of identity providers)
20+
*/
21+
signupEndpoint: 'https://solid.github.io/solid-idps/',
22+
23+
/**
24+
* Default height of the Signup popup window, in pixels
25+
*/
26+
signupWindowHeight: 600,
27+
28+
/**
29+
* Default width of the Signup popup window, in pixels
30+
*/
31+
signupWindowWidth: 1024,
32+
33+
/**
34+
* Path to the client private key (only needed when running within node)
35+
*/
36+
key: '',
37+
38+
/**
39+
* Path to the client certificate (only needed when running within node)
40+
*/
41+
cert: ''
42+
}

src/authn/signup.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
var defaultConfig = require('./config-default')
2+
3+
/**
4+
* Provides functionality for signing up with a Solid provider
5+
* @module signup
6+
*/
7+
8+
/**
9+
* Creates a Signup UI manager
10+
* @class
11+
*/
12+
function Signup (config) {
13+
this.config = config || defaultConfig
14+
}
15+
16+
/**
17+
* Sets up an event listener to monitor login messages from child window/iframe
18+
* @method listen
19+
* @return {Promise<String>} Event listener promise, resolves to user's WebID
20+
*/
21+
Signup.prototype.listen = function listen () {
22+
var promise = new Promise(function (resolve, reject) {
23+
var eventMethod = window.addEventListener
24+
? 'addEventListener'
25+
: 'attachEvent'
26+
var eventListener = window[eventMethod]
27+
var messageEvent = eventMethod === 'attachEvent'
28+
? 'onmessage'
29+
: 'message'
30+
eventListener(messageEvent, function (e) {
31+
var u = e.data
32+
if (u.slice(0, 5) === 'User:') {
33+
var user = u.slice(5, u.length)
34+
if (user && user.length > 0 && user.slice(0, 4) === 'http') {
35+
return resolve(user)
36+
} else {
37+
return reject(user)
38+
}
39+
}
40+
}, true)
41+
})
42+
return promise
43+
}
44+
45+
/**
46+
* Opens a signup popup window, sets up `listen()`.
47+
* @method signup
48+
* @static
49+
* @param signupUrl {String} Location of a Solid server for user signup.
50+
* @return {Promise<String>} Returns a listener promise, resolves with signed
51+
* up user's WebID.
52+
*/
53+
Signup.prototype.signup = function signup (signupUrl) {
54+
signupUrl = signupUrl || this.config.signupEndpoint
55+
var width = this.config.signupWindowWidth
56+
var height = this.config.signupWindowHeight
57+
// set borders
58+
var leftPosition = (window.screen.width / 2) - ((width / 2) + 10)
59+
// set title and status bars
60+
var topPosition = (window.screen.height / 2) - ((height / 2) + 50)
61+
var windowTitle = 'Solid signup'
62+
var windowUrl = signupUrl + '?origin=' +
63+
encodeURIComponent(window.location.origin)
64+
var windowSpecs = 'resizable,scrollbars,status,width=' + width + ',height=' +
65+
height + ',left=' + leftPosition + ',top=' + topPosition
66+
window.open(windowUrl, windowTitle, windowSpecs)
67+
var self = this
68+
return new Promise(function (resolve) {
69+
self.listen()
70+
.then(function (webid) {
71+
return resolve(webid)
72+
})
73+
})
74+
}
75+
76+
module.exports = Signup

src/store.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
//
33

44
import * as debug from './debug'
5+
import { fetch } from 'solid-auth-client'
56

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

1112
debug.log('Unique quadstore initialized.')

test/unit/acl/acl-control.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('preventBrowserDropEvents', () => {
5656

5757
describe('handleDrop', () => {
5858
beforeEach(() => {
59-
setGlobalWindow(window)
59+
setGlobalWindow(window as unknown as Window)
6060
event.dataTransfer = { files: [{}] }
6161
window.confirm = jest.fn(() => false)
6262
handleDrop(event)

0 commit comments

Comments
 (0)