solid-server 5.8.5 → 5.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ jobs:
17
17
 
18
18
  strategy:
19
19
  matrix:
20
- node-version: [ '^20.17.0' ]
20
+ node-version: [ '^22.14.0' ]
21
21
  os: [ubuntu-latest]
22
22
 
23
23
  steps:
@@ -53,7 +53,7 @@ jobs:
53
53
  # test code
54
54
  - run: npm run standard
55
55
  - run: npm run validate
56
- - run: npm run c8
56
+ - run: npm run nyc
57
57
  # Test global install of the package
58
58
  - run: npm pack .
59
59
  - run: npm install -g solid-server-*.tgz
@@ -1,27 +1,35 @@
1
1
  module.exports = get
2
2
 
3
- const request = require('request')
3
+ const fetch = require('node-fetch')
4
4
  const url = require('url')
5
5
 
6
6
  function get (webid, callback) {
7
- const uri = url.URL(webid)
8
- const options = {
9
- url: uri,
10
- method: 'GET',
11
- headers: {
12
- Accept: 'text/turtle, application/ld+json'
13
- }
7
+ let uri
8
+ try {
9
+ uri = new url.URL(webid)
10
+ } catch (err) {
11
+ return callback(new Error('Invalid WebID URI: ' + webid + ': ' + err.message))
14
12
  }
15
13
 
16
- request(options, function (err, res, body) {
17
- if (err) {
18
- return callback(new Error('Failed to fetch profile from ' + uri.href + ': ' + err))
19
- }
20
-
21
- if (res.statusCode !== 200) {
22
- return callback(new Error('Failed to retrieve WebID from ' + uri.href + ': HTTP ' + res.statusCode))
23
- }
14
+ const headers = {
15
+ Accept: 'text/turtle, application/ld+json'
16
+ }
24
17
 
25
- callback(null, body, res.headers['content-type'])
26
- })
18
+ fetch(uri.href, { method: 'GET', headers })
19
+ .then(async res => {
20
+ if (!res.ok) {
21
+ return callback(new Error('Failed to retrieve WebID from ' + uri.href + ': HTTP ' + res.status))
22
+ }
23
+ const contentType = res.headers.get('content-type')
24
+ let body
25
+ if (contentType && contentType.includes('json')) {
26
+ body = JSON.stringify(await res.json(), null, 2)
27
+ } else {
28
+ body = await res.text()
29
+ }
30
+ callback(null, body, contentType)
31
+ })
32
+ .catch(err => {
33
+ return callback(new Error('Failed to fetch profile from ' + uri.href + ': ' + err))
34
+ })
27
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-server",
3
3
  "description": "Solid server on top of the file-system",
4
- "version": "5.8.5",
4
+ "version": "5.8.7",
5
5
  "author": {
6
6
  "name": "Tim Berners-Lee",
7
7
  "email": "timbl@w3.org"
@@ -60,9 +60,10 @@
60
60
  "bugs": "https://github.com/solid/node-solid-server/issues",
61
61
  "dependencies": {
62
62
  "@fastify/busboy": "^1.2.1",
63
+ "@fastify/pre-commit": "^2.2.1",
63
64
  "@solid/acl-check": "^0.4.5",
64
- "@solid/oidc-auth-manager": "^0.24.3",
65
- "@solid/oidc-op": "^0.11.6",
65
+ "@solid/oidc-auth-manager": "^0.24.5",
66
+ "@solid/oidc-op": "^0.11.7",
66
67
  "async-lock": "^1.4.1",
67
68
  "body-parser": "^1.20.3",
68
69
  "bootstrap": "^3.4.1",
@@ -92,17 +93,18 @@
92
93
  "ip-range-check": "0.2.0",
93
94
  "is-ip": "^3.1.0",
94
95
  "li": "^1.3.0",
95
- "mashlib": "^1.10.4",
96
+ "mashlib": "^1.11.1",
96
97
  "mime-types": "^2.1.35",
97
98
  "negotiator": "^0.6.4",
98
99
  "node-fetch": "^2.7.0",
99
100
  "node-forge": "^1.3.1",
100
101
  "node-mailer": "^0.1.1",
101
- "nodemailer": "^6.10.0",
102
+ "nodemailer": "^7.0.10",
103
+ "nyc": "^15.1.0",
102
104
  "oidc-op-express": "^0.0.3",
103
105
  "owasp-password-strength-test": "^1.3.0",
106
+ "rdflib": "^2.3.0",
104
107
  "recursive-readdir": "^2.2.3",
105
- "request": "^2.88.2",
106
108
  "rimraf": "^3.0.2",
107
109
  "solid-auth-client": "^2.5.6",
108
110
  "solid-namespace": "^0.5.4",
@@ -119,7 +121,6 @@
119
121
  "devDependencies": {
120
122
  "@cxres/structured-headers": "^2.0.0-nesting.0",
121
123
  "@solid/solid-auth-oidc": "0.3.0",
122
- "c8": "^10.1.3",
123
124
  "chai": "^4.5.0",
124
125
  "chai-as-promised": "7.1.2",
125
126
  "cross-env": "7.0.3",
@@ -129,7 +130,6 @@
129
130
  "mocha": "^10.8.2",
130
131
  "nock": "^13.5.6",
131
132
  "node-mocks-http": "^1.16.2",
132
- "pre-commit": "1.2.2",
133
133
  "prep-fetch": "^0.1.0",
134
134
  "randombytes": "2.1.0",
135
135
  "sinon": "12.0.1",
@@ -146,12 +146,12 @@
146
146
  "main": "index.js",
147
147
  "scripts": {
148
148
  "build": "echo nothing to build",
149
- "solid": "node --experimental-require-module ./bin/solid",
149
+ "solid": "node ./bin/solid",
150
150
  "standard": "standard \"{bin,examples,lib,test}/**/*.js\"",
151
151
  "validate": "node ./test/validate-turtle.js",
152
- "c8": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 c8 --reporter=text-summary mocha -n experimental-require-module --recursive test/integration/ test/unit/",
153
- "mocha": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha -n experimental-require-module --recursive test/integration/ test/unit/",
154
- "mocha-integration": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha -n experimental-require-module --recursive test/integration/http-test.js",
152
+ "nyc": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 nyc --reporter=text-summary mocha --recursive test/unit/ test/integration/",
153
+ "mocha": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/unit/ test/integration/",
154
+ "mocha-integration": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/http-test.js",
155
155
  "mocha-account-creation-oidc": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/account-creation-oidc-test.js",
156
156
  "mocha-account-manager": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/account-manager-test.js",
157
157
  "mocha-account-template": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/account-template-test.js",
@@ -161,11 +161,11 @@
161
161
  "mocha-ldp": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/ldp-test.js",
162
162
  "prepublishOnly": "npm test",
163
163
  "postpublish": "git push --follow-tags",
164
- "test": "npm run standard && npm run validate && npm run c8",
164
+ "test": "npm run standard && npm run validate && npm run nyc",
165
165
  "clean": "rimraf config/templates config/views",
166
166
  "reset": "rimraf .db data && npm run clean"
167
167
  },
168
- "c8": {
168
+ "nyc": {
169
169
  "reporter": [
170
170
  "html",
171
171
  "text-summary"
@@ -188,6 +188,6 @@
188
188
  "solid": "bin/solid"
189
189
  },
190
190
  "engines": {
191
- "node": ">=20.17.0 <21 || >=22.8.0"
191
+ "node": ">=20.19.0 <21 || >=22.14.0"
192
192
  }
193
193
  }