@undefineds.co/xpod 0.3.5 → 0.3.14

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.
Files changed (253) hide show
  1. package/config/cli.json +1 -1
  2. package/config/cloud.json +54 -22
  3. package/config/local.json +56 -12
  4. package/config/resolver.json +10 -2
  5. package/config/xpod.base.json +50 -0
  6. package/config/xpod.json +8 -8
  7. package/dist/agents/config/resolve.js +10 -10
  8. package/dist/agents/config/resolve.js.map +1 -1
  9. package/dist/api/chatkit/index.d.ts +1 -1
  10. package/dist/api/chatkit/index.js.map +1 -1
  11. package/dist/api/chatkit/pod-store.d.ts +14 -11
  12. package/dist/api/chatkit/pod-store.js +114 -78
  13. package/dist/api/chatkit/pod-store.js.map +1 -1
  14. package/dist/api/chatkit/runtime/AcpAgentRuntime.js +1 -1
  15. package/dist/api/chatkit/runtime/AcpAgentRuntime.js.map +1 -1
  16. package/dist/api/chatkit/service.js +1 -1
  17. package/dist/api/chatkit/service.js.map +1 -1
  18. package/dist/api/chatkit/types.d.ts +11 -11
  19. package/dist/api/chatkit/types.js +3 -3
  20. package/dist/api/chatkit/types.js.map +1 -1
  21. package/dist/api/container/cloud.js +0 -8
  22. package/dist/api/container/cloud.js.map +1 -1
  23. package/dist/api/container/index.js +2 -1
  24. package/dist/api/container/index.js.map +1 -1
  25. package/dist/api/container/local.js +0 -7
  26. package/dist/api/container/local.js.map +1 -1
  27. package/dist/api/container/routes.js +3 -17
  28. package/dist/api/container/routes.js.map +1 -1
  29. package/dist/api/container/types.d.ts +0 -2
  30. package/dist/api/container/types.js.map +1 -1
  31. package/dist/api/handlers/PodManagementHandler.d.ts +3 -0
  32. package/dist/api/handlers/PodManagementHandler.js +71 -1
  33. package/dist/api/handlers/PodManagementHandler.js.map +1 -1
  34. package/dist/api/handlers/RunHandler.js +5 -5
  35. package/dist/api/handlers/RunHandler.js.map +1 -1
  36. package/dist/api/runs/AgentRuntimeTypes.d.ts +7 -8
  37. package/dist/api/runs/AgentRuntimeTypes.js.map +1 -1
  38. package/dist/api/runs/InngestRunExecutionBackend.d.ts +2 -2
  39. package/dist/api/runs/ManagedRunWorker.d.ts +1 -1
  40. package/dist/api/runs/ManagedRunWorker.js +6 -6
  41. package/dist/api/runs/ManagedRunWorker.js.map +1 -1
  42. package/dist/api/runs/PiAgentRuntimeDriver.d.ts +16 -1
  43. package/dist/api/runs/PiAgentRuntimeDriver.js +182 -23
  44. package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -1
  45. package/dist/api/runs/RunStateCenter.d.ts +3 -3
  46. package/dist/api/runs/RunStateCenter.js +13 -13
  47. package/dist/api/runs/RunStateCenter.js.map +1 -1
  48. package/dist/api/runs/store.d.ts +4 -4
  49. package/dist/api/runs/store.js +2 -2
  50. package/dist/api/runs/store.js.map +1 -1
  51. package/dist/api/service/VectorStoreService.d.ts +1 -1
  52. package/dist/api/service/VectorStoreService.js +16 -16
  53. package/dist/api/service/VectorStoreService.js.map +1 -1
  54. package/dist/api/tasks/InngestTaskScheduler.d.ts +4 -4
  55. package/dist/api/tasks/TaskMaterializer.d.ts +3 -3
  56. package/dist/api/tasks/TaskMaterializer.js +11 -11
  57. package/dist/api/tasks/TaskMaterializer.js.map +1 -1
  58. package/dist/api/tasks/TaskService.d.ts +3 -3
  59. package/dist/api/tasks/TaskService.js +11 -7
  60. package/dist/api/tasks/TaskService.js.map +1 -1
  61. package/dist/api/tasks/store.d.ts +10 -4
  62. package/dist/api/tasks/store.js +14 -4
  63. package/dist/api/tasks/store.js.map +1 -1
  64. package/dist/api/workspace/types.d.ts +3 -3
  65. package/dist/api/workspace/types.js +6 -6
  66. package/dist/api/workspace/types.js.map +1 -1
  67. package/dist/cli/commands/config.js +2 -2
  68. package/dist/cli/commands/config.js.map +1 -1
  69. package/dist/cli/commands/start.js +9 -3
  70. package/dist/cli/commands/start.js.map +1 -1
  71. package/dist/components/components.jsonld +8 -2
  72. package/dist/components/context.jsonld +302 -51
  73. package/dist/http/search/SearchHttpHandler.js +8 -8
  74. package/dist/http/search/SearchHttpHandler.js.map +1 -1
  75. package/dist/identity/drizzle/PodLookupRepository.d.ts +11 -1
  76. package/dist/identity/drizzle/PodLookupRepository.js +95 -4
  77. package/dist/identity/drizzle/PodLookupRepository.js.map +1 -1
  78. package/dist/identity/drizzle/db.js +4 -43
  79. package/dist/identity/drizzle/db.js.map +1 -1
  80. package/dist/identity/drizzle/schema.pg.d.ts +0 -5
  81. package/dist/identity/drizzle/schema.pg.js +2 -16
  82. package/dist/identity/drizzle/schema.pg.js.map +1 -1
  83. package/dist/identity/drizzle/schema.sqlite.d.ts +19 -176
  84. package/dist/identity/drizzle/schema.sqlite.js +2 -16
  85. package/dist/identity/drizzle/schema.sqlite.js.map +1 -1
  86. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.d.ts +4 -4
  87. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js +7 -7
  88. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js.map +1 -1
  89. package/dist/identity/oidc/AutoDetectIdentityProviderHandler.jsonld +6 -6
  90. package/dist/identity/oidc/AutoDetectOidcHandler.d.ts +4 -4
  91. package/dist/identity/oidc/AutoDetectOidcHandler.js +6 -6
  92. package/dist/identity/oidc/AutoDetectOidcHandler.js.map +1 -1
  93. package/dist/identity/oidc/AutoDetectOidcHandler.jsonld +6 -6
  94. package/dist/identity/oidc/ScopedPickWebIdHandler.d.ts +37 -0
  95. package/dist/identity/oidc/ScopedPickWebIdHandler.js +211 -0
  96. package/dist/identity/oidc/ScopedPickWebIdHandler.js.map +1 -0
  97. package/dist/identity/oidc/ScopedPickWebIdHandler.jsonld +158 -0
  98. package/dist/index.d.ts +12 -2
  99. package/dist/index.js +16 -4
  100. package/dist/index.js.map +1 -1
  101. package/dist/main.js +8 -2
  102. package/dist/main.js.map +1 -1
  103. package/dist/provision/ProvisionPodCreator.d.ts +3 -4
  104. package/dist/provision/ProvisionPodCreator.js +8 -13
  105. package/dist/provision/ProvisionPodCreator.js.map +1 -1
  106. package/dist/provision/ProvisionPodCreator.jsonld +7 -7
  107. package/dist/runtime/Proxy.d.ts +0 -1
  108. package/dist/runtime/Proxy.js +0 -9
  109. package/dist/runtime/Proxy.js.map +1 -1
  110. package/dist/runtime/bootstrap.d.ts +1 -0
  111. package/dist/runtime/bootstrap.js +5 -2
  112. package/dist/runtime/bootstrap.js.map +1 -1
  113. package/dist/runtime/css-process.d.ts +12 -4
  114. package/dist/runtime/css-process.js +61 -14
  115. package/dist/runtime/css-process.js.map +1 -1
  116. package/dist/runtime/oidc-issuer.d.ts +3 -2
  117. package/dist/runtime/oidc-issuer.js +3 -2
  118. package/dist/runtime/oidc-issuer.js.map +1 -1
  119. package/dist/runtime/runtime-types.d.ts +1 -0
  120. package/dist/runtime/runtime-types.js.map +1 -1
  121. package/dist/solidfs/LocalFirstRdfRepresentationResolver.d.ts +21 -0
  122. package/dist/solidfs/LocalFirstRdfRepresentationResolver.js +38 -0
  123. package/dist/solidfs/LocalFirstRdfRepresentationResolver.js.map +1 -0
  124. package/dist/solidfs/LocalSolidFS.d.ts +18 -0
  125. package/dist/solidfs/LocalSolidFS.js +539 -0
  126. package/dist/solidfs/LocalSolidFS.js.map +1 -0
  127. package/dist/solidfs/PodSolidFsHttpClient.d.ts +16 -0
  128. package/dist/solidfs/PodSolidFsHttpClient.js +93 -0
  129. package/dist/solidfs/PodSolidFsHttpClient.js.map +1 -0
  130. package/dist/solidfs/PodSolidFsHydrator.d.ts +27 -0
  131. package/dist/solidfs/PodSolidFsHydrator.js +127 -0
  132. package/dist/solidfs/PodSolidFsHydrator.js.map +1 -0
  133. package/dist/solidfs/PodSolidFsSyncer.d.ts +21 -0
  134. package/dist/solidfs/PodSolidFsSyncer.js +78 -0
  135. package/dist/solidfs/PodSolidFsSyncer.js.map +1 -0
  136. package/dist/solidfs/RdfIndexSolidFsSyncer.d.ts +22 -0
  137. package/dist/solidfs/RdfIndexSolidFsSyncer.js +131 -0
  138. package/dist/solidfs/RdfIndexSolidFsSyncer.js.map +1 -0
  139. package/dist/solidfs/index.d.ts +7 -0
  140. package/dist/solidfs/index.js +24 -0
  141. package/dist/solidfs/index.js.map +1 -0
  142. package/dist/solidfs/types.d.ts +131 -0
  143. package/dist/solidfs/types.js +19 -0
  144. package/dist/solidfs/types.js.map +1 -0
  145. package/dist/storage/RepresentationPartialConvertingStore.js +6 -13
  146. package/dist/storage/RepresentationPartialConvertingStore.js.map +1 -1
  147. package/dist/storage/SparqlUpdateResourceStore.d.ts +4 -0
  148. package/dist/storage/SparqlUpdateResourceStore.js +13 -0
  149. package/dist/storage/SparqlUpdateResourceStore.js.map +1 -1
  150. package/dist/storage/SparqlUpdateResourceStore.jsonld +26 -0
  151. package/dist/storage/accessors/MinioDataAccessor.d.ts +2 -0
  152. package/dist/storage/accessors/MinioDataAccessor.js +13 -7
  153. package/dist/storage/accessors/MinioDataAccessor.js.map +1 -1
  154. package/dist/storage/accessors/MinioDataAccessor.jsonld +8 -0
  155. package/dist/storage/accessors/MixDataAccessor.d.ts +85 -4
  156. package/dist/storage/accessors/MixDataAccessor.js +511 -16
  157. package/dist/storage/accessors/MixDataAccessor.js.map +1 -1
  158. package/dist/storage/accessors/MixDataAccessor.jsonld +176 -1
  159. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.d.ts +7 -0
  160. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.js +72 -4
  161. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.js.map +1 -1
  162. package/dist/storage/accessors/QuintStoreSparqlDataAccessor.jsonld +24 -0
  163. package/dist/storage/quint/BaseQuintStore.d.ts +3 -0
  164. package/dist/storage/quint/BaseQuintStore.js +51 -27
  165. package/dist/storage/quint/BaseQuintStore.js.map +1 -1
  166. package/dist/storage/quint/PgQuintStore.d.ts +1 -0
  167. package/dist/storage/quint/PgQuintStore.js +50 -32
  168. package/dist/storage/quint/PgQuintStore.js.map +1 -1
  169. package/dist/storage/quint/PgQuintStore.jsonld +4 -3
  170. package/dist/storage/quint/SqliteQuintStore.d.ts +5 -0
  171. package/dist/storage/quint/SqliteQuintStore.js +100 -0
  172. package/dist/storage/quint/SqliteQuintStore.js.map +1 -1
  173. package/dist/storage/quint/SqliteQuintStore.jsonld +20 -0
  174. package/dist/storage/quint/types.d.ts +16 -0
  175. package/dist/storage/quint/types.js.map +1 -1
  176. package/dist/storage/rdf/Rdf3xTripleIndex.d.ts +55 -0
  177. package/dist/storage/rdf/Rdf3xTripleIndex.js +1235 -0
  178. package/dist/storage/rdf/Rdf3xTripleIndex.js.map +1 -0
  179. package/dist/storage/rdf/RdfContentTypes.d.ts +9 -0
  180. package/dist/storage/rdf/RdfContentTypes.js +79 -0
  181. package/dist/storage/rdf/RdfContentTypes.js.map +1 -0
  182. package/dist/storage/rdf/RdfLocalQueryEngine.d.ts +76 -0
  183. package/dist/storage/rdf/RdfLocalQueryEngine.js +2636 -0
  184. package/dist/storage/rdf/RdfLocalQueryEngine.js.map +1 -0
  185. package/dist/storage/rdf/RdfQuadIndex.d.ts +98 -0
  186. package/dist/storage/rdf/RdfQuadIndex.js +1840 -0
  187. package/dist/storage/rdf/RdfQuadIndex.js.map +1 -0
  188. package/dist/storage/rdf/RdfQuadIndex.jsonld +416 -0
  189. package/dist/storage/rdf/RdfShadowComparator.d.ts +12 -0
  190. package/dist/storage/rdf/RdfShadowComparator.js +47 -0
  191. package/dist/storage/rdf/RdfShadowComparator.js.map +1 -0
  192. package/dist/storage/rdf/RdfSparqlAdapter.d.ts +147 -0
  193. package/dist/storage/rdf/RdfSparqlAdapter.js +2420 -0
  194. package/dist/storage/rdf/RdfSparqlAdapter.js.map +1 -0
  195. package/dist/storage/rdf/RdfSparqlAdapter.jsonld +414 -0
  196. package/dist/storage/rdf/RdfTermDictionary.d.ts +27 -0
  197. package/dist/storage/rdf/RdfTermDictionary.js +352 -0
  198. package/dist/storage/rdf/RdfTermDictionary.js.map +1 -0
  199. package/dist/storage/rdf/RdfTermDictionary.jsonld +114 -0
  200. package/dist/storage/rdf/RdfTermSemantics.d.ts +6 -0
  201. package/dist/storage/rdf/RdfTermSemantics.js +40 -0
  202. package/dist/storage/rdf/RdfTermSemantics.js.map +1 -0
  203. package/dist/storage/rdf/RdfTextIndex.d.ts +23 -0
  204. package/dist/storage/rdf/RdfTextIndex.js +569 -0
  205. package/dist/storage/rdf/RdfTextIndex.js.map +1 -0
  206. package/dist/storage/rdf/RdfVectorIndex.d.ts +22 -0
  207. package/dist/storage/rdf/RdfVectorIndex.js +631 -0
  208. package/dist/storage/rdf/RdfVectorIndex.js.map +1 -0
  209. package/dist/storage/rdf/RdfXmlSerializer.d.ts +2 -0
  210. package/dist/storage/rdf/RdfXmlSerializer.js +123 -0
  211. package/dist/storage/rdf/RdfXmlSerializer.js.map +1 -0
  212. package/dist/storage/rdf/ShadowRdfQuintStore.d.ts +58 -0
  213. package/dist/storage/rdf/ShadowRdfQuintStore.js +202 -0
  214. package/dist/storage/rdf/ShadowRdfQuintStore.js.map +1 -0
  215. package/dist/storage/rdf/ShadowRdfQuintStore.jsonld +308 -0
  216. package/dist/storage/rdf/SolidRdfEngine.d.ts +51 -0
  217. package/dist/storage/rdf/SolidRdfEngine.js +264 -0
  218. package/dist/storage/rdf/SolidRdfEngine.js.map +1 -0
  219. package/dist/storage/rdf/SolidRdfEngine.jsonld +338 -0
  220. package/dist/storage/rdf/SolidRdfSparqlEngine.d.ts +92 -0
  221. package/dist/storage/rdf/SolidRdfSparqlEngine.js +477 -0
  222. package/dist/storage/rdf/SolidRdfSparqlEngine.js.map +1 -0
  223. package/dist/storage/rdf/SolidRdfSparqlEngine.jsonld +257 -0
  224. package/dist/storage/rdf/index.d.ts +15 -0
  225. package/dist/storage/rdf/index.js +61 -0
  226. package/dist/storage/rdf/index.js.map +1 -0
  227. package/dist/storage/rdf/models-benchmark.d.ts +260 -0
  228. package/dist/storage/rdf/models-benchmark.js +1405 -0
  229. package/dist/storage/rdf/models-benchmark.js.map +1 -0
  230. package/dist/storage/rdf/types.d.ts +726 -0
  231. package/dist/storage/rdf/types.js +3 -0
  232. package/dist/storage/rdf/types.js.map +1 -0
  233. package/dist/storage/rdf/types.jsonld +316 -0
  234. package/dist/storage/vector/VectorIndexingListener.d.ts +5 -5
  235. package/dist/storage/vector/VectorIndexingListener.js +19 -19
  236. package/dist/storage/vector/VectorIndexingListener.js.map +1 -1
  237. package/package.json +3 -2
  238. package/templates/pod/acp/.acr.hbs +39 -0
  239. package/templates/pod/acp/README.acr +18 -0
  240. package/templates/pod/acp/profile/card.acr +22 -0
  241. package/templates/pod/base/README$.md.hbs +27 -0
  242. package/templates/pod/base/profile/card$.ttl.hbs +13 -0
  243. package/templates/pod/wac/.acl.hbs +26 -0
  244. package/templates/pod/wac/README.acl.hbs +14 -0
  245. package/templates/pod/wac/profile/card.acl.hbs +19 -0
  246. package/dist/api/handlers/WebIdProfileHandler.d.ts +0 -16
  247. package/dist/api/handlers/WebIdProfileHandler.js +0 -423
  248. package/dist/api/handlers/WebIdProfileHandler.js.map +0 -1
  249. package/dist/identity/drizzle/WebIdProfileRepository.d.ts +0 -63
  250. package/dist/identity/drizzle/WebIdProfileRepository.js +0 -168
  251. package/dist/identity/drizzle/WebIdProfileRepository.js.map +0 -1
  252. package/dist/identity/drizzle/WebIdProfileRepository.jsonld +0 -112
  253. package/dist/storage/quint/BaseQuintStore.jsonld +0 -257
@@ -1 +1 @@
1
- {"version":3,"file":"MinioDataAccessor.js","sourceRoot":"","sources":["../../../src/storage/accessors/MinioDataAccessor.ts"],"names":[],"mappings":";;;AAAA,iCAA+C;AAC/C,iEAAqD;AAIrD,8DAuBiC;AASjC,MAAa,iBAAiB;IAM5B,YACE,cAAoC,EACpC,SAAiB,EACjB,SAAiB,EACjB,QAAgB,EAChB,UAAkB;QAVD,WAAM,GAAG,IAAA,oCAAY,EAAC,IAAI,CAAC,CAAC;QAY7C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,6FAA6F;QAC7F,IAAI,QAAgB,CAAC;Q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rG,IAAI,SAAS,IAAI,eAAe,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CACF;AAvUD,8CAuUC","sourcesContent":["import { Client, BucketItemStat } from 'minio';\nimport { getLoggerFor } from 'global-logger-factory';\nimport type { DataAccessor } from '@solid/community-server';\nimport type { Readable } from 'node:stream';\nimport { DataFactory } from 'n3';\nimport {\n RepresentationMetadata,\n \n NotFoundHttpError,\n guardStream,\n isContainerIdentifier,\n isContainerPath,\n joinFilePath,\n UnsupportedMediaTypeHttpError,\n CONTENT_TYPE_TERM,\n DC,\n IANA,\n LDP,\n POSIX,\n RDF,\n SOLID_META,\n XSD,\n parseQuads,\n serializeQuads,\n addResourceMetadata,\n updateModifiedDate,\n toLiteral,\n toNamedTerm,\n} from '@solid/community-server';\nimport type { Guarded } from '@solid/community-server';\nimport type { FileIdentifierMapper, ResourceLink } from '@solid/community-server';\nimport type { \n ResourceIdentifier,\n Representation,\n MetadataRecord\n} from '@solid/community-server';\n\nexport class MinioDataAccessor implements DataAccessor {\n protected readonly logger = getLoggerFor(this);\n protected readonly resourceMapper: FileIdentifierMapper;\n private readonly client: Client;\n private readonly bucketName: string;\n\n public constructor(\n resourceMapper: FileIdentifierMapper,\n accessKey: string,\n secretKey: string,\n endpoint: string,\n bucketName: string,\n ) {\n this.resourceMapper = resourceMapper;\n\n // Parse endpoint - supports both URL format (http://host:port) and simple format (host:port)\n let endPoint: string;\n let port: number | undefined;\n let useSSL = false;\n\n if (endpoint.startsWith('http://') || endpoint.startsWith('https://')) {\n const url = new URL(endpoint);\n endPoint = url.hostname;\n port = url.port ? parseInt(url.port, 10) : undefined;\n useSSL = url.protocol === 'https:';\n } else {\n const parts = endpoint.split(':');\n endPoint = parts[0];\n port = parts[1] ? parseInt(parts[1], 10) : undefined;\n }\n\n this.client = new Client({\n accessKey,\n secretKey,\n endPoint,\n port,\n useSSL,\n });\n this.bucketName = bucketName;\n this.logger.info(`MinioDataAccessor initialized with endpoint: ${endPoint}:${port} (SSL: ${useSSL})`)\n }\n\n /**\n * Should throw a NotImplementedHttpError if the DataAccessor does not support storing the given Representation.\n *\n * @param representation - Incoming Representation.\n *\n * @throws BadRequestHttpError\n * If it does not support the incoming data.\n */\n public async canHandle(representation: Representation): Promise<void> {\n if (!representation.binary) {\n throw new UnsupportedMediaTypeHttpError('Only binary data is supported.');\n }\n }\n\n /**\n * Returns a data stream stored for the given identifier.\n * It can be assumed that the incoming identifier will always correspond to a document.\n *\n * @param identifier - Identifier for which the data is requested.\n */\n public async getData(identifier: ResourceIdentifier): Promise<Guarded<Readable>> {\n const started = Date.now();\n const url = new URL(identifier.path)\n const stream = await this.client.getObject(this.bucketName, url.pathname);\n this.logDuration('getData', identifier.path, started);\n return guardStream(stream);\n }\n\n /**\n * Generate a presigned GET URL for the given resource.\n * @param identifier - Resource identifier.\n * @param expires - URL expiry in seconds (default 3600).\n */\n public async getPresignedUrl(identifier: ResourceIdentifier, expires = 3600): Promise<string> {\n const url = new URL(identifier.path);\n const objectKey = url.pathname.replace(/^\\//, '');\n return this.client.presignedGetObject(this.bucketName, objectKey, expires);\n }\n\n /**\n * Returns the metadata corresponding to the identifier.\n * If possible, it is suggested to add a `posix:size` triple to the metadata indicating the binary size.\n * This is necessary for range requests.\n *\n * @param identifier - Identifier for which the metadata is requested.\n */\n public async getMetadata(identifier: ResourceIdentifier): Promise<RepresentationMetadata> {\n const started = Date.now();\n const url = new URL(identifier.path)\n const link = await this.resourceMapper.mapUrlToFilePath(identifier, false);\n const isDirectory = identifier.path.endsWith('/');\n const objectName = isDirectory ? `${url.pathname}/.container` : url.pathname;\n let stats: BucketItemStat;\n try {\n stats = await this.client.statObject(this.bucketName, objectName);\n } catch (error) {\n throw new NotFoundHttpError();\n }\n if (!isContainerIdentifier(identifier) && !isDirectory) {\n const metadata = await this.getFileMetadata(link, stats);\n this.logDuration('getMetadata', identifier.path, started);\n return metadata;\n }\n if (isContainerIdentifier(identifier) && isDirectory) {\n const metadata = await this.getDirectoryMetadata(link, stats);\n this.logDuration('getMetadata', identifier.path, started);\n return metadata;\n }\n throw new NotFoundHttpError();\n }\n\n /**\n * Returns metadata for all resources in the requested container.\n * This should not be all metadata of those resources (but it can be),\n * but instead the main metadata you want to show in situations\n * where all these resources are presented simultaneously.\n * Generally this would be metadata that is present for all of these resources,\n * such as resource type or last modified date.\n *\n * It can be safely assumed that the incoming identifier will always correspond to a container.\n *\n * @param identifier - Identifier of the parent container.\n */\n public async* getChildren(identifier: ResourceIdentifier): AsyncIterableIterator<RepresentationMetadata> {\n const url = new URL(identifier.path)\n const objects = this.client.listObjectsV2(this.bucketName, url.pathname);\n for await (const object of objects) {\n const metadata = await this.getMetadata(object);\n yield metadata;\n }\n }\n\n /**\n * Writes data and metadata for a document.\n * If any data and/or metadata exist for the given identifier, it should be overwritten.\n *\n * @param identifier - Identifier of the resource.\n * @param data - Data to store.\n * @param metadata - Metadata to store.\n */\n public async writeDocument(identifier: ResourceIdentifier, data: Guarded<Readable>, metadata: RepresentationMetadata): Promise<void> {\n const started = Date.now();\n const url = new URL(identifier.path);\n const link = await this.resourceMapper.mapUrlToFilePath(identifier, false);\n const itemMetadata = this.encodeMetadata(link, metadata);\n try {\n await this.client.putObject(\n this.bucketName,\n url.pathname,\n data,\n metadata.contentLength,\n itemMetadata || undefined,\n );\n this.logDuration('writeDocument', identifier.path, started);\n } catch (error) {\n this.logger.error(`Error writing document: ${identifier.path} ${error}`)\n throw error;\n }\n }\n\n /**\n * Writes metadata for a container.\n * If the container does not exist yet it should be created,\n * if it does its metadata should be overwritten, except for the containment triples.\n *\n * @param identifier - Identifier of the container.\n * @param metadata - Metadata to store.\n */\n public async writeContainer(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void> {\n const started = Date.now();\n const url = new URL(identifier.path)\n const link = await this.resourceMapper.mapUrlToFilePath(identifier, false);\n await this.client.putObject(\n this.bucketName,\n `${url.pathname}/.container`,\n Buffer.from(''),\n metadata.contentLength,\n this.encodeMetadata(link, metadata) || undefined,\n );\n this.logDuration('writeContainer', identifier.path, started);\n }\n\n /**\n * Writes metadata for a resource.\n * It can safely be assumed that the subject resource already exists.\n *\n * @param identifier - Identifier of the subject resource.\n * @param metadata - Metadata to store.\n */\n public async writeMetadata(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void> {\n throw new Error('Minio does not support writing metadata for a resource.');\n }\n\n /**\n * Deletes the resource and its corresponding metadata.\n *\n * Solid, §5.4: \"When a contained resource is deleted, the server MUST also remove the corresponding containment\n * triple, which has the effect of removing the deleted resource from the containing container.\"\n * https://solid.github.io/specification/protocol#deleting-resources\n *\n * @param identifier - Resource to delete.\n */\n public async deleteResource(identifier: ResourceIdentifier): Promise<void> {\n const link = new URL(identifier.path)\n await this.client.removeObject(this.bucketName, link.pathname);\n }\n\n /**\n * Reads and generates all metadata relevant for the given file,\n * ingesting it into a RepresentationMetadata object.\n *\n * @param link - Path related metadata.\n * @param stats - Stats object of the corresponding file.\n */\n private async getFileMetadata(link: ResourceLink, stats: BucketItemStat): Promise<RepresentationMetadata> {\n const metadata = await this.getBaseMetadata(link, stats, false);\n // If the resource is using an unsupported contentType, the original contentType was written to the metadata file.\n // As a result, we should only set the contentType derived from the file path,\n // when no previous metadata entry for contentType is present.\n if (typeof metadata.contentType === 'undefined') {\n metadata.set(CONTENT_TYPE_TERM, link.contentType);\n }\n return metadata;\n }\n\n /**\n * Reads and generates all metadata relevant for the given directory,\n * ingesting it into a RepresentationMetadata object.\n *\n * @param link - Path related metadata.\n * @param stats - Stats object of the corresponding directory.\n */\n private async getDirectoryMetadata(link: ResourceLink, stats: BucketItemStat): Promise<RepresentationMetadata> {\n return this.getBaseMetadata(link, stats, true);\n }\n \n /**\n * Generates metadata relevant for any resources stored by this accessor.\n *\n * @param link - Path related metadata.\n * @param stats - Stats objects of the corresponding directory.\n * @param isContainer - If the path points to a container (directory) or not.\n */\n private async getBaseMetadata(link: ResourceLink, stats: BucketItemStat, isContainer: boolean): Promise<RepresentationMetadata> {\n const metadata = this.decodeMetadata(link, stats.metaData);\n addResourceMetadata(metadata, isContainer);\n this.addPosixMetadata(metadata, stats, isContainer);\n return metadata;\n }\n \n /**\n * Helper function to add file system related metadata.\n *\n * @param metadata - metadata object to add to\n * @param stats - Stats of the file/directory corresponding to the resource.\n */\n private addPosixMetadata(metadata: RepresentationMetadata, stats: BucketItemStat, isDirectory: boolean): void {\n updateModifiedDate(metadata, stats.lastModified);\n metadata.add(\n POSIX.terms.mtime,\n toLiteral(Math.floor(stats.lastModified.getTime() / 1000), XSD.terms.integer),\n SOLID_META.terms.ResponseMetadata,\n );\n if (!isDirectory) {\n metadata.add(\n POSIX.terms.size,\n toLiteral(stats.size, XSD.terms.integer),\n SOLID_META.terms.ResponseMetadata,\n );\n }\n }\n\n /**\n * encode the metadata of the resource to string.\n *\n * @param link - Path related metadata of the resource.\n * @param metadata - Metadata to write.\n *\n * @returns string of metadata.\n */\n protected encodeMetadata(link: ResourceLink, metadata: RepresentationMetadata): object | null {\n // These are stored by file system conventions\n metadata.remove(RDF.terms.type, LDP.terms.Resource);\n metadata.remove(RDF.terms.type, LDP.terms.Container);\n metadata.remove(RDF.terms.type, LDP.terms.BasicContainer);\n metadata.removeAll(DC.terms.modified);\n // When writing metadata for a document, only remove the content-type when dealing with a supported media type.\n // A media type is supported if the FileIdentifierMapper can correctly store it.\n // This allows restoring the appropriate content-type on data read (see getFileMetadata).\n if (isContainerPath(link.filePath) || typeof metadata.contentType !== 'undefined') {\n metadata.removeAll(CONTENT_TYPE_TERM);\n }\n const contentTypeObject = metadata.contentTypeObject\n if (contentTypeObject === undefined\n || Object.keys(contentTypeObject.parameters).length === 0) {\n return null;\n }\n // Write metadata to file if there are quads remaining\n return contentTypeObject.parameters;\n }\n\n protected decodeMetadata(link: ResourceLink, metadata: MetadataRecord): RepresentationMetadata {\n return new RepresentationMetadata(link.identifier, metadata);\n }\n\n private logDuration(\n operation: string,\n identifierPath: string,\n started: number,\n slowThresholdMs = 100,\n warnThresholdMs = 1000,\n ): void {\n const elapsedMs = Date.now() - started;\n if (elapsedMs < slowThresholdMs) {\n return;\n }\n\n const message = `[timing] MinioDataAccessor.${operation} path=${identifierPath} took=${elapsedMs}ms`;\n if (elapsedMs >= warnThresholdMs) {\n this.logger.warn(message);\n return;\n }\n\n this.logger.info(message);\n }\n}\n"]}
1
+ {"version":3,"file":"MinioDataAccessor.js","sourceRoot":"","sources":["../../../src/storage/accessors/MinioDataAccessor.ts"],"names":[],"mappings":";;;AAAA,iCAA+C;AAC/C,iEAAqD;AAIrD,8DAuBiC;AASjC,MAAa,iBAAiB;IAM5B,YACE,cAAoC,EACpC,SAAiB,EACjB,SAAiB,EACjB,QAAgB,EAChB,UAAkB;QAVD,WAAM,GAAG,IAAA,oCAAY,EAAC,IAAI,CAAC,CAAC;QAY7C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,6FAA6F;QAC7F,IAAI,QAAgB,CAAC;QACrB,IAAI,IAAwB,CAAC;QAC7B,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACtE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC9B,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;YACxB,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACrD,MAAM,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GAAG,QAAQ,CAAC,KA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CAAC;CACF;AA/UD,8CA+UC","sourcesContent":["import { Client, BucketItemStat } from 'minio';\nimport { getLoggerFor } from 'global-logger-factory';\nimport type { DataAccessor } from '@solid/community-server';\nimport type { Readable } from 'node:stream';\nimport { DataFactory } from 'n3';\nimport {\n RepresentationMetadata,\n \n NotFoundHttpError,\n guardStream,\n isContainerIdentifier,\n isContainerPath,\n joinFilePath,\n UnsupportedMediaTypeHttpError,\n CONTENT_TYPE_TERM,\n DC,\n IANA,\n LDP,\n POSIX,\n RDF,\n SOLID_META,\n XSD,\n parseQuads,\n serializeQuads,\n addResourceMetadata,\n updateModifiedDate,\n toLiteral,\n toNamedTerm,\n} from '@solid/community-server';\nimport type { Guarded } from '@solid/community-server';\nimport type { FileIdentifierMapper, ResourceLink } from '@solid/community-server';\nimport type { \n ResourceIdentifier,\n Representation,\n MetadataRecord\n} from '@solid/community-server';\n\nexport class MinioDataAccessor implements DataAccessor {\n protected readonly logger = getLoggerFor(this);\n protected readonly resourceMapper: FileIdentifierMapper;\n private readonly client: Client;\n private readonly bucketName: string;\n\n public constructor(\n resourceMapper: FileIdentifierMapper,\n accessKey: string,\n secretKey: string,\n endpoint: string,\n bucketName: string,\n ) {\n this.resourceMapper = resourceMapper;\n\n // Parse endpoint - supports both URL format (http://host:port) and simple format (host:port)\n let endPoint: string;\n let port: number | undefined;\n let useSSL = false;\n\n if (endpoint.startsWith('http://') || endpoint.startsWith('https://')) {\n const url = new URL(endpoint);\n endPoint = url.hostname;\n port = url.port ? parseInt(url.port, 10) : undefined;\n useSSL = url.protocol === 'https:';\n } else {\n const parts = endpoint.split(':');\n endPoint = parts[0];\n port = parts[1] ? parseInt(parts[1], 10) : undefined;\n }\n\n this.client = new Client({\n accessKey,\n secretKey,\n endPoint,\n port,\n useSSL,\n });\n this.bucketName = bucketName;\n this.logger.info(`MinioDataAccessor initialized with endpoint: ${endPoint}:${port} (SSL: ${useSSL})`)\n }\n\n private objectName(url: URL): string {\n return url.pathname.replace(/^\\/+/u, '');\n }\n\n private containerObjectName(url: URL): string {\n return `${this.objectName(url).replace(/\\/+$/u, '')}/.container`;\n }\n\n /**\n * Should throw a NotImplementedHttpError if the DataAccessor does not support storing the given Representation.\n *\n * @param representation - Incoming Representation.\n *\n * @throws BadRequestHttpError\n * If it does not support the incoming data.\n */\n public async canHandle(representation: Representation): Promise<void> {\n if (!representation.binary) {\n throw new UnsupportedMediaTypeHttpError('Only binary data is supported.');\n }\n }\n\n /**\n * Returns a data stream stored for the given identifier.\n * It can be assumed that the incoming identifier will always correspond to a document.\n *\n * @param identifier - Identifier for which the data is requested.\n */\n public async getData(identifier: ResourceIdentifier): Promise<Guarded<Readable>> {\n const started = Date.now();\n const url = new URL(identifier.path)\n const stream = await this.client.getObject(this.bucketName, this.objectName(url));\n this.logDuration('getData', identifier.path, started);\n return guardStream(stream);\n }\n\n /**\n * Generate a presigned GET URL for the given resource.\n * @param identifier - Resource identifier.\n * @param expires - URL expiry in seconds (default 3600).\n */\n public async getPresignedUrl(identifier: ResourceIdentifier, expires = 3600): Promise<string> {\n const url = new URL(identifier.path);\n const objectKey = this.objectName(url);\n return this.client.presignedGetObject(this.bucketName, objectKey, expires);\n }\n\n /**\n * Returns the metadata corresponding to the identifier.\n * If possible, it is suggested to add a `posix:size` triple to the metadata indicating the binary size.\n * This is necessary for range requests.\n *\n * @param identifier - Identifier for which the metadata is requested.\n */\n public async getMetadata(identifier: ResourceIdentifier): Promise<RepresentationMetadata> {\n const started = Date.now();\n const url = new URL(identifier.path)\n const link = await this.resourceMapper.mapUrlToFilePath(identifier, false);\n const isDirectory = identifier.path.endsWith('/');\n const objectName = isDirectory ? this.containerObjectName(url) : this.objectName(url);\n let stats: BucketItemStat;\n try {\n stats = await this.client.statObject(this.bucketName, objectName);\n } catch (error) {\n throw new NotFoundHttpError();\n }\n if (!isContainerIdentifier(identifier) && !isDirectory) {\n const metadata = await this.getFileMetadata(link, stats);\n this.logDuration('getMetadata', identifier.path, started);\n return metadata;\n }\n if (isContainerIdentifier(identifier) && isDirectory) {\n const metadata = await this.getDirectoryMetadata(link, stats);\n this.logDuration('getMetadata', identifier.path, started);\n return metadata;\n }\n throw new NotFoundHttpError();\n }\n\n /**\n * Returns metadata for all resources in the requested container.\n * This should not be all metadata of those resources (but it can be),\n * but instead the main metadata you want to show in situations\n * where all these resources are presented simultaneously.\n * Generally this would be metadata that is present for all of these resources,\n * such as resource type or last modified date.\n *\n * It can be safely assumed that the incoming identifier will always correspond to a container.\n *\n * @param identifier - Identifier of the parent container.\n */\n public async* getChildren(identifier: ResourceIdentifier): AsyncIterableIterator<RepresentationMetadata> {\n const url = new URL(identifier.path)\n const objects = this.client.listObjectsV2(this.bucketName, this.objectName(url));\n for await (const object of objects) {\n const metadata = await this.getMetadata(object);\n yield metadata;\n }\n }\n\n /**\n * Writes data and metadata for a document.\n * If any data and/or metadata exist for the given identifier, it should be overwritten.\n *\n * @param identifier - Identifier of the resource.\n * @param data - Data to store.\n * @param metadata - Metadata to store.\n */\n public async writeDocument(identifier: ResourceIdentifier, data: Guarded<Readable>, metadata: RepresentationMetadata): Promise<void> {\n const started = Date.now();\n const url = new URL(identifier.path);\n const link = await this.resourceMapper.mapUrlToFilePath(identifier, false);\n const itemMetadata = this.encodeMetadata(link, metadata);\n try {\n await this.client.putObject(\n this.bucketName,\n this.objectName(url),\n data,\n metadata.contentLength,\n itemMetadata || undefined,\n );\n this.logDuration('writeDocument', identifier.path, started);\n } catch (error) {\n this.logger.error(`Error writing document: ${identifier.path} ${error}`)\n throw error;\n }\n }\n\n /**\n * Writes metadata for a container.\n * If the container does not exist yet it should be created,\n * if it does its metadata should be overwritten, except for the containment triples.\n *\n * @param identifier - Identifier of the container.\n * @param metadata - Metadata to store.\n */\n public async writeContainer(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void> {\n const started = Date.now();\n const url = new URL(identifier.path)\n const link = await this.resourceMapper.mapUrlToFilePath(identifier, false);\n await this.client.putObject(\n this.bucketName,\n this.containerObjectName(url),\n Buffer.from(''),\n metadata.contentLength,\n this.encodeMetadata(link, metadata) || undefined,\n );\n this.logDuration('writeContainer', identifier.path, started);\n }\n\n /**\n * Writes metadata for a resource.\n * It can safely be assumed that the subject resource already exists.\n *\n * @param identifier - Identifier of the subject resource.\n * @param metadata - Metadata to store.\n */\n public async writeMetadata(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void> {\n throw new Error('Minio does not support writing metadata for a resource.');\n }\n\n /**\n * Deletes the resource and its corresponding metadata.\n *\n * Solid, §5.4: \"When a contained resource is deleted, the server MUST also remove the corresponding containment\n * triple, which has the effect of removing the deleted resource from the containing container.\"\n * https://solid.github.io/specification/protocol#deleting-resources\n *\n * @param identifier - Resource to delete.\n */\n public async deleteResource(identifier: ResourceIdentifier): Promise<void> {\n const link = new URL(identifier.path)\n await this.client.removeObject(this.bucketName, this.objectName(link));\n }\n\n /**\n * Reads and generates all metadata relevant for the given file,\n * ingesting it into a RepresentationMetadata object.\n *\n * @param link - Path related metadata.\n * @param stats - Stats object of the corresponding file.\n */\n private async getFileMetadata(link: ResourceLink, stats: BucketItemStat): Promise<RepresentationMetadata> {\n const metadata = await this.getBaseMetadata(link, stats, false);\n // If the resource is using an unsupported contentType, the original contentType was written to the metadata file.\n // As a result, we should only set the contentType derived from the file path,\n // when no previous metadata entry for contentType is present.\n if (typeof metadata.contentType === 'undefined') {\n metadata.set(CONTENT_TYPE_TERM, link.contentType);\n }\n return metadata;\n }\n\n /**\n * Reads and generates all metadata relevant for the given directory,\n * ingesting it into a RepresentationMetadata object.\n *\n * @param link - Path related metadata.\n * @param stats - Stats object of the corresponding directory.\n */\n private async getDirectoryMetadata(link: ResourceLink, stats: BucketItemStat): Promise<RepresentationMetadata> {\n return this.getBaseMetadata(link, stats, true);\n }\n \n /**\n * Generates metadata relevant for any resources stored by this accessor.\n *\n * @param link - Path related metadata.\n * @param stats - Stats objects of the corresponding directory.\n * @param isContainer - If the path points to a container (directory) or not.\n */\n private async getBaseMetadata(link: ResourceLink, stats: BucketItemStat, isContainer: boolean): Promise<RepresentationMetadata> {\n const metadata = this.decodeMetadata(link, stats.metaData);\n addResourceMetadata(metadata, isContainer);\n this.addPosixMetadata(metadata, stats, isContainer);\n return metadata;\n }\n \n /**\n * Helper function to add file system related metadata.\n *\n * @param metadata - metadata object to add to\n * @param stats - Stats of the file/directory corresponding to the resource.\n */\n private addPosixMetadata(metadata: RepresentationMetadata, stats: BucketItemStat, isDirectory: boolean): void {\n updateModifiedDate(metadata, stats.lastModified);\n metadata.add(\n POSIX.terms.mtime,\n toLiteral(Math.floor(stats.lastModified.getTime() / 1000), XSD.terms.integer),\n SOLID_META.terms.ResponseMetadata,\n );\n if (!isDirectory) {\n metadata.add(\n POSIX.terms.size,\n toLiteral(stats.size, XSD.terms.integer),\n SOLID_META.terms.ResponseMetadata,\n );\n }\n }\n\n /**\n * encode the metadata of the resource to string.\n *\n * @param link - Path related metadata of the resource.\n * @param metadata - Metadata to write.\n *\n * @returns string of metadata.\n */\n protected encodeMetadata(link: ResourceLink, metadata: RepresentationMetadata): object | null {\n // These are stored by file system conventions\n metadata.remove(RDF.terms.type, LDP.terms.Resource);\n metadata.remove(RDF.terms.type, LDP.terms.Container);\n metadata.remove(RDF.terms.type, LDP.terms.BasicContainer);\n metadata.removeAll(DC.terms.modified);\n // When writing metadata for a document, only remove the content-type when dealing with a supported media type.\n // A media type is supported if the FileIdentifierMapper can correctly store it.\n // This allows restoring the appropriate content-type on data read (see getFileMetadata).\n if (isContainerPath(link.filePath) || typeof metadata.contentType !== 'undefined') {\n metadata.removeAll(CONTENT_TYPE_TERM);\n }\n const contentTypeObject = metadata.contentTypeObject\n if (contentTypeObject === undefined\n || Object.keys(contentTypeObject.parameters).length === 0) {\n return null;\n }\n // Write metadata to file if there are quads remaining\n return contentTypeObject.parameters;\n }\n\n protected decodeMetadata(link: ResourceLink, metadata: MetadataRecord): RepresentationMetadata {\n return new RepresentationMetadata(link.identifier, metadata);\n }\n\n private logDuration(\n operation: string,\n identifierPath: string,\n started: number,\n slowThresholdMs = 100,\n warnThresholdMs = 1000,\n ): void {\n const elapsedMs = Date.now() - started;\n if (elapsedMs < slowThresholdMs) {\n return;\n }\n\n const message = `[timing] MinioDataAccessor.${operation} path=${identifierPath} took=${elapsedMs}ms`;\n if (elapsedMs >= warnThresholdMs) {\n this.logger.warn(message);\n return;\n }\n\n this.logger.info(message);\n }\n}\n"]}
@@ -59,6 +59,14 @@
59
59
  "@id": "undefineds:dist/storage/accessors/MinioDataAccessor.jsonld#MinioDataAccessor__member_constructor",
60
60
  "memberFieldName": "constructor"
61
61
  },
62
+ {
63
+ "@id": "undefineds:dist/storage/accessors/MinioDataAccessor.jsonld#MinioDataAccessor__member_objectName",
64
+ "memberFieldName": "objectName"
65
+ },
66
+ {
67
+ "@id": "undefineds:dist/storage/accessors/MinioDataAccessor.jsonld#MinioDataAccessor__member_containerObjectName",
68
+ "memberFieldName": "containerObjectName"
69
+ },
62
70
  {
63
71
  "@id": "undefineds:dist/storage/accessors/MinioDataAccessor.jsonld#MinioDataAccessor__member_canHandle",
64
72
  "memberFieldName": "canHandle"
@@ -1,10 +1,34 @@
1
- import type { Readable } from 'stream';
1
+ import { Readable } from 'stream';
2
+ import type { Quad } from '@rdfjs/types';
2
3
  import { RepresentationMetadata } from '@solid/community-server';
3
4
  import type { Representation, ResourceIdentifier, Guarded, DataAccessor } from '@solid/community-server';
5
+ import type { RdfSourceInput } from '../rdf/types';
6
+ export interface LocalRdfDocument {
7
+ data: Guarded<Readable>;
8
+ metadata: RepresentationMetadata;
9
+ }
10
+ export interface LocalRdfReadableAccessor {
11
+ getLocalRdfDocument(identifier: ResourceIdentifier): Promise<LocalRdfDocument>;
12
+ }
13
+ export interface LocalRdfIndexAccessor {
14
+ syncLocalRdfDocument(identifier: ResourceIdentifier, data?: Guarded<Readable>, contentType?: string, options?: LocalRdfSyncOptions): Promise<void>;
15
+ deleteLocalRdfIndex(identifier: ResourceIdentifier): Promise<void>;
16
+ }
17
+ export interface LocalRdfSyncOptions {
18
+ source?: string;
19
+ workspace?: string;
20
+ localPath?: string;
21
+ sourceVersion?: string;
22
+ }
23
+ export interface SourceScopedStructuredRdfAccessor {
24
+ writeRdfSourceDocument(identifier: ResourceIdentifier, quads: Quad[], metadata: RepresentationMetadata, source: RdfSourceInput): Promise<void>;
25
+ deleteRdfSourceDocument(identifier: ResourceIdentifier): Promise<void>;
26
+ }
4
27
  /**
5
28
  * MixDataAccessor - Routes data to appropriate storage based on content type
6
29
  *
7
30
  * - RDF data (internal/quads) -> structuredDataAccessor (Quadstore or QuintStore)
31
+ * - RDF file mirrors (.ttl/.jsonld) -> rdfFileDataAccessor (local FileSystem)
8
32
  * - Other data (binary, text, etc.) -> unstructuredDataAccessor (FileSystem, Minio, etc.)
9
33
  *
10
34
  * This uses composition instead of inheritance, allowing any DataAccessor
@@ -12,11 +36,13 @@ import type { Representation, ResourceIdentifier, Guarded, DataAccessor } from '
12
36
  */
13
37
  export declare class MixDataAccessor implements DataAccessor {
14
38
  protected readonly logger: import("global-logger-factory").Logger<unknown>;
39
+ private readonly rdfSparqlAdapter;
15
40
  private readonly structuredDataAccessor;
16
41
  private readonly unstructuredDataAccessor;
42
+ private readonly rdfFileDataAccessor;
17
43
  private readonly presignedRedirectEnabled;
18
44
  private readonly mirrorContainersToUnstructured;
19
- constructor(structuredDataAccessor: DataAccessor, unstructuredDataAccessor: DataAccessor, presignedRedirectEnabled?: boolean, mirrorContainersToUnstructured?: boolean);
45
+ constructor(structuredDataAccessor: DataAccessor, unstructuredDataAccessor: DataAccessor, presignedRedirectEnabled?: boolean, mirrorContainersToUnstructured?: boolean, rdfFileDataAccessor?: DataAccessor);
20
46
  /**
21
47
  * This accessor supports all types of data.
22
48
  */
@@ -26,6 +52,14 @@ export declare class MixDataAccessor implements DataAccessor {
26
52
  */
27
53
  private isUnstructured;
28
54
  getData(identifier: ResourceIdentifier): Promise<Guarded<Readable>>;
55
+ /**
56
+ * Read the local RDF file mirror used by SolidFS/local-first HTTP reads.
57
+ *
58
+ * `getData()` intentionally keeps returning the structured quad stream for
59
+ * CSS internals. This method is the explicit file-content path for callers
60
+ * that need a real Turtle/JSON-LD byte stream.
61
+ */
62
+ getLocalRdfDocument(identifier: ResourceIdentifier): Promise<LocalRdfDocument>;
29
63
  getMetadata(identifier: ResourceIdentifier): Promise<RepresentationMetadata>;
30
64
  getChildren(identifier: ResourceIdentifier): AsyncIterableIterator<RepresentationMetadata>;
31
65
  writeContainer(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void>;
@@ -33,14 +67,61 @@ export declare class MixDataAccessor implements DataAccessor {
33
67
  writeMetadata(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void>;
34
68
  deleteResource(identifier: ResourceIdentifier): Promise<void>;
35
69
  /**
36
- * Execute SPARQL UPDATE on structured data accessor.
37
- * Delegates to the underlying structuredDataAccessor if it supports SPARQL.
70
+ * Execute SPARQL UPDATE.
71
+ *
72
+ * Supported embedded deltas patch the local RDF authority file first and then
73
+ * rebuild the structured RDF index. Unsupported shapes keep using the
74
+ * compatibility accessor until the embedded engine covers them.
38
75
  */
39
76
  executeSparqlUpdate(query: string, baseIri?: string): Promise<void>;
77
+ private executeLocalRdfSparqlUpdate;
78
+ private applyLocalRdfDelta;
79
+ private assertLocalRdfDeltaTargetsGraph;
80
+ private queryLocalUpdateBindings;
81
+ private queryGraphTerms;
82
+ private readLocalRdfTextOrEmpty;
83
+ private writeLocalRdfAuthority;
84
+ private toDefaultGraphQuad;
85
+ private toGraphQuad;
86
+ private quadKey;
87
+ /**
88
+ * Rebuild the structured RDF index from an already-written local RDF file.
89
+ *
90
+ * SolidFS uses this after tools edit `.ttl`/`.jsonld` files directly. The
91
+ * local file remains the content authority; the structured accessor is only
92
+ * refreshed as query/index state.
93
+ */
94
+ syncLocalRdfDocument(identifier: ResourceIdentifier, data?: Guarded<Readable>, contentType?: string, options?: LocalRdfSyncOptions): Promise<void>;
95
+ deleteLocalRdfIndex(identifier: ResourceIdentifier): Promise<void>;
96
+ private writeRdfDocument;
97
+ private writeStructuredRdfIndex;
98
+ private refreshLocalRdfMirror;
99
+ private getLocalRdfMetadata;
100
+ private getExistingLocalRdfMetadata;
101
+ private createLocalRdfMetadata;
102
+ private localRdfContentType;
103
+ private sourceScopedStructuredAccessor;
104
+ private rdfSourceInput;
105
+ private relativePathFromWorkspace;
106
+ private isByLineRdfIdentifier;
107
+ private isRdfDocumentIdentifier;
108
+ private isLocalMirroredRdf;
109
+ private serializeQuadsForLocalFile;
110
+ private serializeNQuads;
111
+ private parseLocalRdf;
112
+ private readStreamText;
40
113
  /**
41
114
  * Write unstructured document: store data in unstructured accessor,
42
115
  * then save metadata in structured accessor.
43
116
  */
44
117
  private writeUnstructuredDocument;
118
+ private deleteUnstructuredResourceIfPresent;
119
+ private deleteRdfFileResourceIfPresent;
120
+ private ensureUnstructuredParentContainers;
121
+ private ensureRdfFileParentContainers;
122
+ private ensureParentContainers;
123
+ private writeContainerIfMissing;
124
+ private sameIdentifier;
125
+ private parentContainer;
45
126
  private invalidateMetadataCache;
46
127
  }