javascript-solid-server 0.0.98 → 0.0.100

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/ap/index.js CHANGED
@@ -148,7 +148,7 @@ export async function activityPubPlugin(fastify, options = {}) {
148
148
  version: '2.1',
149
149
  software: {
150
150
  name: 'jss',
151
- version: '0.0.98',
151
+ version: '0.0.99',
152
152
  repository: 'https://github.com/JavaScriptSolidServer/JavaScriptSolidServer'
153
153
  },
154
154
  protocols: ['activitypub', 'solid'],
@@ -115,7 +115,7 @@ export function createInstanceHandler (config) {
115
115
  title: config.displayName || 'JSS',
116
116
  description: 'SAND Stack: Solid + ActivityPub + Nostr + DID',
117
117
  short_description: 'Solid pod with Mastodon-compatible API',
118
- version: '4.0.0 (compatible; JSS 0.0.98)',
118
+ version: '4.0.0 (compatible; JSS 0.0.99)',
119
119
  urls: {
120
120
  streaming_api: `${wsProtocol}://${host}`
121
121
  },
@@ -98,6 +98,19 @@ export async function remoteStoragePlugin (fastify, options = {}) {
98
98
  }
99
99
 
100
100
  const info = await storage.stat(storagePath)
101
+
102
+ // Non-existent folder → return empty listing (RS spec: clients expect 200 to start writing)
103
+ // No ETag — forces RS clients to process the folder each sync cycle (304 would skip push logic)
104
+ if (!info && storagePath.endsWith('/')) {
105
+ return reply
106
+ .header('Content-Type', 'application/ld+json')
107
+ .header('Cache-Control', 'no-cache')
108
+ .send({
109
+ '@context': 'http://remotestorage.io/spec/folder-description',
110
+ items: {}
111
+ })
112
+ }
113
+
101
114
  if (!info) {
102
115
  return reply.code(404).send({ error: 'Not found' })
103
116
  }
@@ -112,7 +125,14 @@ export async function remoteStoragePlugin (fastify, options = {}) {
112
125
  if (info.isDirectory) {
113
126
  const entries = await storage.listContainer(storagePath)
114
127
  if (!entries) {
115
- return reply.code(404).send({ error: 'Not found' })
128
+ return reply
129
+ .header('Content-Type', 'application/ld+json')
130
+ .header('ETag', info.etag || '"empty"')
131
+ .header('Cache-Control', 'no-cache')
132
+ .send({
133
+ '@context': 'http://remotestorage.io/spec/folder-description',
134
+ items: {}
135
+ })
116
136
  }
117
137
 
118
138
  const items = {}