javascript-solid-server 0.0.123 → 0.0.124
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.
- package/.claude/settings.local.json +3 -1
- package/package.json +1 -1
- package/src/handlers/container.js +10 -10
- package/src/server.js +8 -8
- package/src/webid/profile.js +7 -7
- package/test/pod.test.js +4 -4
|
@@ -333,7 +333,9 @@
|
|
|
333
333
|
"Bash(npm init:*)",
|
|
334
334
|
"WebFetch(domain:webtorrent.io)",
|
|
335
335
|
"Bash(TORRENT=/home/melvin/.claude/projects/-home-melvin-remote-github-com-JavaScriptSolidServer-JavaScriptSolidServer/a05da419-92b7-4056-93b8-e97b2035d4ae/tool-results/webfetch-1774004425803-fce7mx.bin npx -y parse-torrent $TORRENT)",
|
|
336
|
-
"Bash(gh issue:*)"
|
|
336
|
+
"Bash(gh issue:*)",
|
|
337
|
+
"Bash(sed -i 's|Settings/|settings/|g' src/server.js src/handlers/container.js src/webid/profile.js)",
|
|
338
|
+
"Bash(sed -i 's|// Settings folder|// settings folder|' src/handlers/container.js)"
|
|
337
339
|
]
|
|
338
340
|
}
|
|
339
341
|
}
|
package/package.json
CHANGED
|
@@ -165,12 +165,12 @@ export async function createPodStructure(name, webId, podUri, issuer, defaultQuo
|
|
|
165
165
|
const podPath = `/${name}/`;
|
|
166
166
|
|
|
167
167
|
// Create pod directory structure
|
|
168
|
-
//
|
|
168
|
+
// Pod settings directory
|
|
169
169
|
await storage.createContainer(podPath);
|
|
170
170
|
await storage.createContainer(`${podPath}inbox/`);
|
|
171
171
|
await storage.createContainer(`${podPath}public/`);
|
|
172
172
|
await storage.createContainer(`${podPath}private/`);
|
|
173
|
-
await storage.createContainer(`${podPath}
|
|
173
|
+
await storage.createContainer(`${podPath}settings/`);
|
|
174
174
|
await storage.createContainer(`${podPath}profile/`);
|
|
175
175
|
|
|
176
176
|
// Generate and write WebID profile at /profile/card (standard Solid location)
|
|
@@ -179,14 +179,14 @@ export async function createPodStructure(name, webId, podUri, issuer, defaultQuo
|
|
|
179
179
|
|
|
180
180
|
// Generate and write preferences (mashlib-compatible paths)
|
|
181
181
|
const prefs = generatePreferences({ webId, podUri });
|
|
182
|
-
await storage.write(`${podPath}
|
|
182
|
+
await storage.write(`${podPath}settings/Preferences.ttl`, serialize(prefs));
|
|
183
183
|
|
|
184
184
|
// Generate and write type indexes with .ttl extension for mashlib
|
|
185
|
-
const publicTypeIndex = generateTypeIndex(`${podUri}
|
|
186
|
-
await storage.write(`${podPath}
|
|
185
|
+
const publicTypeIndex = generateTypeIndex(`${podUri}settings/publicTypeIndex.ttl`);
|
|
186
|
+
await storage.write(`${podPath}settings/publicTypeIndex.ttl`, serialize(publicTypeIndex));
|
|
187
187
|
|
|
188
|
-
const privateTypeIndex = generateTypeIndex(`${podUri}
|
|
189
|
-
await storage.write(`${podPath}
|
|
188
|
+
const privateTypeIndex = generateTypeIndex(`${podUri}settings/privateTypeIndex.ttl`);
|
|
189
|
+
await storage.write(`${podPath}settings/privateTypeIndex.ttl`, serialize(privateTypeIndex));
|
|
190
190
|
|
|
191
191
|
// Create default ACL files
|
|
192
192
|
// Pod root: owner full control, public read
|
|
@@ -197,9 +197,9 @@ export async function createPodStructure(name, webId, podUri, issuer, defaultQuo
|
|
|
197
197
|
const privateAcl = generatePrivateAcl(`${podUri}private/`, webId);
|
|
198
198
|
await storage.write(`${podPath}private/.acl`, serializeAcl(privateAcl));
|
|
199
199
|
|
|
200
|
-
//
|
|
201
|
-
const settingsAcl = generatePrivateAcl(`${podUri}
|
|
202
|
-
await storage.write(`${podPath}
|
|
200
|
+
// settings folder: owner only
|
|
201
|
+
const settingsAcl = generatePrivateAcl(`${podUri}settings/`, webId);
|
|
202
|
+
await storage.write(`${podPath}settings/.acl`, serializeAcl(settingsAcl));
|
|
203
203
|
|
|
204
204
|
// Inbox: owner full, public append
|
|
205
205
|
const inboxAcl = generateInboxAcl(`${podUri}inbox/`, webId);
|
package/src/server.js
CHANGED
|
@@ -571,7 +571,7 @@ export function createServer(options = {}) {
|
|
|
571
571
|
await storage.createContainer('/inbox/');
|
|
572
572
|
await storage.createContainer('/public/');
|
|
573
573
|
await storage.createContainer('/private/');
|
|
574
|
-
await storage.createContainer('/
|
|
574
|
+
await storage.createContainer('/settings/');
|
|
575
575
|
await storage.createContainer('/profile/');
|
|
576
576
|
|
|
577
577
|
// Generate profile
|
|
@@ -580,13 +580,13 @@ export function createServer(options = {}) {
|
|
|
580
580
|
|
|
581
581
|
// Preferences and type indexes
|
|
582
582
|
const prefs = generatePreferences({ webId, podUri });
|
|
583
|
-
await storage.write('/
|
|
583
|
+
await storage.write('/settings/Preferences.ttl', serialize(prefs));
|
|
584
584
|
|
|
585
|
-
const publicTypeIndex = generateTypeIndex(`${podUri}
|
|
586
|
-
await storage.write('/
|
|
585
|
+
const publicTypeIndex = generateTypeIndex(`${podUri}settings/publicTypeIndex.ttl`);
|
|
586
|
+
await storage.write('/settings/publicTypeIndex.ttl', serialize(publicTypeIndex));
|
|
587
587
|
|
|
588
|
-
const privateTypeIndex = generateTypeIndex(`${podUri}
|
|
589
|
-
await storage.write('/
|
|
588
|
+
const privateTypeIndex = generateTypeIndex(`${podUri}settings/privateTypeIndex.ttl`);
|
|
589
|
+
await storage.write('/settings/privateTypeIndex.ttl', serialize(privateTypeIndex));
|
|
590
590
|
|
|
591
591
|
// ACL files
|
|
592
592
|
const rootAcl = generateOwnerAcl(podUri, webId, true);
|
|
@@ -595,8 +595,8 @@ export function createServer(options = {}) {
|
|
|
595
595
|
const privateAcl = generatePrivateAcl(`${podUri}private/`, webId);
|
|
596
596
|
await storage.write('/private/.acl', serializeAcl(privateAcl));
|
|
597
597
|
|
|
598
|
-
const settingsAcl = generatePrivateAcl(`${podUri}
|
|
599
|
-
await storage.write('/
|
|
598
|
+
const settingsAcl = generatePrivateAcl(`${podUri}settings/`, webId);
|
|
599
|
+
await storage.write('/settings/.acl', serializeAcl(settingsAcl));
|
|
600
600
|
|
|
601
601
|
const inboxAcl = generateInboxAcl(`${podUri}inbox/`, webId);
|
|
602
602
|
await storage.write('/inbox/.acl', serializeAcl(inboxAcl));
|
package/src/webid/profile.js
CHANGED
|
@@ -45,9 +45,9 @@ export function generateProfileJsonLd({ webId, name, podUri, issuer }) {
|
|
|
45
45
|
'inbox': `${pod}inbox/`,
|
|
46
46
|
'storage': pod,
|
|
47
47
|
'oidcIssuer': issuer,
|
|
48
|
-
'preferencesFile': `${pod}
|
|
49
|
-
'publicTypeIndex': `${pod}
|
|
50
|
-
'privateTypeIndex': `${pod}
|
|
48
|
+
'preferencesFile': `${pod}settings/Preferences.ttl`,
|
|
49
|
+
'publicTypeIndex': `${pod}settings/publicTypeIndex.ttl`,
|
|
50
|
+
'privateTypeIndex': `${pod}settings/privateTypeIndex.ttl`
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -133,7 +133,7 @@ function escapeHtml(str) {
|
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* Generate preferences file as JSON-LD
|
|
136
|
-
* Uses mashlib-compatible paths (
|
|
136
|
+
* Uses mashlib-compatible paths (settings/Preferences.ttl)
|
|
137
137
|
* @param {object} options
|
|
138
138
|
* @param {string} options.webId - Full WebID URI
|
|
139
139
|
* @param {string} options.podUri - Pod root URI
|
|
@@ -149,9 +149,9 @@ export function generatePreferences({ webId, podUri }) {
|
|
|
149
149
|
'publicTypeIndex': { '@id': 'solid:publicTypeIndex', '@type': '@id' },
|
|
150
150
|
'privateTypeIndex': { '@id': 'solid:privateTypeIndex', '@type': '@id' }
|
|
151
151
|
},
|
|
152
|
-
'@id': `${pod}
|
|
153
|
-
'publicTypeIndex': `${pod}
|
|
154
|
-
'privateTypeIndex': `${pod}
|
|
152
|
+
'@id': `${pod}settings/Preferences.ttl`,
|
|
153
|
+
'publicTypeIndex': `${pod}settings/publicTypeIndex.ttl`,
|
|
154
|
+
'privateTypeIndex': `${pod}settings/privateTypeIndex.ttl`
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
|
package/test/pod.test.js
CHANGED
|
@@ -96,7 +96,7 @@ describe('Pod Lifecycle', () => {
|
|
|
96
96
|
assertStatus(priv, 200);
|
|
97
97
|
|
|
98
98
|
// Check Settings exists (needs auth)
|
|
99
|
-
const settings = await request('/carol/
|
|
99
|
+
const settings = await request('/carol/settings/', { auth: 'carol' });
|
|
100
100
|
assertStatus(settings, 200);
|
|
101
101
|
});
|
|
102
102
|
|
|
@@ -104,15 +104,15 @@ describe('Pod Lifecycle', () => {
|
|
|
104
104
|
await createTestPod('dan');
|
|
105
105
|
|
|
106
106
|
// Check Preferences.ttl (needs auth - Settings is private)
|
|
107
|
-
const prefs = await request('/dan/
|
|
107
|
+
const prefs = await request('/dan/settings/Preferences.ttl', { auth: 'dan' });
|
|
108
108
|
assertStatus(prefs, 200);
|
|
109
109
|
|
|
110
110
|
// Check public type index (needs auth)
|
|
111
|
-
const pubIndex = await request('/dan/
|
|
111
|
+
const pubIndex = await request('/dan/settings/publicTypeIndex.ttl', { auth: 'dan' });
|
|
112
112
|
assertStatus(pubIndex, 200);
|
|
113
113
|
|
|
114
114
|
// Check private type index (needs auth)
|
|
115
|
-
const privIndex = await request('/dan/
|
|
115
|
+
const privIndex = await request('/dan/settings/privateTypeIndex.ttl', { auth: 'dan' });
|
|
116
116
|
assertStatus(privIndex, 200);
|
|
117
117
|
});
|
|
118
118
|
});
|