From 96999bdfaf7e5c676335a032f981fd7a4f47fdcb Mon Sep 17 00:00:00 2001 From: Laurin Weger <59744144+Laurin-W@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:33:00 +0100 Subject: [PATCH 1/2] Use correct type for semantic-data-provider fetch function --- .../src/hooks/useCollection.ts | 2 +- .../semantic-data-provider/dist/index.cjs.js | 7 ++-- .../dist/index.cjs.js.map | 2 +- .../semantic-data-provider/dist/index.d.ts | 36 +++++-------------- .../dist/index.d.ts.map | 2 +- .../semantic-data-provider/dist/index.es.js | 7 ++-- .../dist/index.es.js.map | 2 +- .../src/dataProvider/dataProvider.js | 2 ++ .../src/dataProvider/types.ts | 12 +++---- .../subscribeToUpdates.ts | 16 +++------ 10 files changed, 31 insertions(+), 57 deletions(-) diff --git a/src/frontend/packages/activitypub-components/src/hooks/useCollection.ts b/src/frontend/packages/activitypub-components/src/hooks/useCollection.ts index ca02e1bf3..e05171f75 100644 --- a/src/frontend/packages/activitypub-components/src/hooks/useCollection.ts +++ b/src/frontend/packages/activitypub-components/src/hooks/useCollection.ts @@ -26,7 +26,7 @@ const useItemsFromPages = (pages: any[], dereferenceItems: boolean) => { .map(itemUri => ({ queryKey: ['resource', itemUri], queryFn: async () => (await dataProvider.fetch(itemUri)).json, - staleTime: Infinity + staleTime: Infinity // Activities are immutable, so no need to refetch.. })) ); diff --git a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js index 0783087e7..549a30f32 100644 --- a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js +++ b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js @@ -51,6 +51,9 @@ $parcel$export(module.exports, "ReificationArrayInput", () => $030f1232f6810456$ $parcel$export(module.exports, "createWsChannel", () => $84ab912646919f8c$export$28772ab4c256e709); $parcel$export(module.exports, "getOrCreateWsChannel", () => $84ab912646919f8c$export$8d60734939c59ced); $parcel$export(module.exports, "createSolidNotificationChannel", () => $84ab912646919f8c$export$3edfe18db119b920); +var $1bc09db736a9cb94$exports = {}; +/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ + const $3db7a4510a668a04$var$fetchResource = async (resourceUri, config)=>{ @@ -1183,7 +1186,7 @@ var $59a07b932dae8600$export$2e2bcd8739ae039 = $59a07b932dae8600$var$getServerKe var $341dff85fe619d85$export$2e2bcd8739ae039 = $341dff85fe619d85$var$httpClient; -const $7f6a16d0025dc83a$var$dataProvider = (config)=>{ +/** @type {(config: Configuration) => SemanticDataProvider} */ const $7f6a16d0025dc83a$var$dataProvider = (config)=>{ // TODO verify all data provider config + data models if (!(0, $8f44b7c15b8b8e1d$export$2e2bcd8739ae039)("default", config.dataServers)) throw new Error("You must define a default server in your dataServers config"); if (!config.jsonContext) config.jsonContext = Object.fromEntries(config.ontologies.map((o)=>[ @@ -1724,8 +1727,6 @@ const $84ab912646919f8c$var$registeredWebSockets = new Map(); }; -var $1bc09db736a9cb94$exports = {}; -/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ $parcel$exportWildcard(module.exports, $1bc09db736a9cb94$exports); diff --git a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map index 78da61398..8f2046b15 100644 --- a/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map +++ b/src/frontend/packages/semantic-data-provider/dist/index.cjs.js.map @@ -1 +1 @@ -{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIEA,MAAM,sCAAgB,OAAO,aAAa;IACxC,MAAM,cAAE,UAAU,eAAE,WAAW,EAAE,GAAG;IAEpC,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,MAAM,WAAW;IAEtC,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAE7D,KAAK,EAAE,GAAG,KAAK,EAAE,IAAI,IAAI,CAAC,MAAM;IAEhC,sFAAsF;IAC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AM,0CAA+B,oBAAoB,aAAa;IACtF,MAAM,cAAsB,QAAQ,WAAW,IAAI,OAAO,CAAC,qBAAqB;IAEhF,OAAO,IAAI,UAAU;AACvB;AAEA,MAAM,6CAAuB,IAAI;AAEjC;;;;;CAKC,GACD,MAAM,4CAAuB,OAC3B,oBACA,aACA,UAAqC;IAAE,MAAM;IAAwB,YAAY;AAAe,CAAC;IAEjG,MAAM,SAAS,2CAAqB,GAAG,CAAC;IACxC,IAAI,QACF,uCAAuC;IACvC,OAAO;IAGT,qEAAqE;IACrE,iEAAiE;IACjE,MAAM,YAAY,0CAAgB,oBAAoB,aAAa;QAAE,GAAG,OAAO;QAAE,MAAM;IAAuB,GAAG,IAAI,CACnH,CAAA;QACE,mDAAmD;QACnD,GAAG,gBAAgB,CAAC,SAAS,CAAA;YAC3B,2CAAqB,MAAM,CAAC;QAC9B;QACA,+DAA+D;QAC/D,MAAM,UAAU,QAAQ,UAAU,IAAK,CAAA,QAAQ,KAAK,IAAI,IAAI,KAAK,QAAQ,KAAK,EAAE,OAAO,KAAK,KAAK,GAAG,EAAC;QACrG,IAAI,SACF,WAAW;YACT,GAAG,KAAK;QACV,GAAG;QAEL,OAAO;IACT;IAGF,2CAAqB,GAAG,CAAC,aAAa;IACtC,OAAO;AACT;;;;ACnJA,oEAAoE,GACpE;","sources":["packages/semantic-data-provider/src/index.ts","packages/semantic-data-provider/src/dataProvider/dataProvider.js","packages/semantic-data-provider/src/dataProvider/methods/create.js","packages/semantic-data-provider/src/dataProvider/methods/getOne.js","packages/semantic-data-provider/src/dataProvider/utils/fetchResource.js","packages/semantic-data-provider/src/dataProvider/utils/handleFiles.ts","packages/semantic-data-provider/src/dataProvider/utils/findContainersWithTypes.ts","packages/semantic-data-provider/src/dataProvider/utils/parseServerKeys.js","packages/semantic-data-provider/src/dataProvider/utils/getServerKeyFromType.js","packages/semantic-data-provider/src/dataProvider/methods/delete.ts","packages/semantic-data-provider/src/dataProvider/methods/deleteMany.js","packages/semantic-data-provider/src/dataProvider/methods/getDataServers.js","packages/semantic-data-provider/src/dataProvider/methods/getDataModels.js","packages/semantic-data-provider/src/dataProvider/methods/getList.js","packages/semantic-data-provider/src/dataProvider/utils/fetchContainers.ts","packages/semantic-data-provider/src/dataProvider/utils/arrayOf.ts","packages/semantic-data-provider/src/dataProvider/utils/fetchSparqlEndpoints.js","packages/semantic-data-provider/src/dataProvider/utils/getEmbedFrame.js","packages/semantic-data-provider/src/dataProvider/utils/buildSparqlQuery.js","packages/semantic-data-provider/src/dataProvider/utils/buildBaseQuery.js","packages/semantic-data-provider/src/dataProvider/utils/resolvePrefix.js","packages/semantic-data-provider/src/dataProvider/utils/buildBlankNodesQuery.js","packages/semantic-data-provider/src/dataProvider/utils/buildAutoDetectBlankNodesQuery.js","packages/semantic-data-provider/src/dataProvider/utils/findContainersWithPath.js","packages/semantic-data-provider/src/dataProvider/methods/getMany.js","packages/semantic-data-provider/src/dataProvider/methods/getManyReference.js","packages/semantic-data-provider/src/dataProvider/methods/patch.ts","packages/semantic-data-provider/src/dataProvider/methods/update.ts","packages/semantic-data-provider/src/dataProvider/utils/fetchUserConfig.js","packages/semantic-data-provider/src/dataProvider/utils/fetchVoidEndpoints.js","packages/semantic-data-provider/src/dataProvider/httpClient.js","packages/semantic-data-provider/src/dataProvider/utils/getServerKeyFromUri.js","packages/semantic-data-provider/src/hooks/useGetExternalLink.js","packages/semantic-data-provider/src/hooks/useContainers.ts","packages/semantic-data-provider/src/hooks/useDataModel.ts","packages/semantic-data-provider/src/hooks/useDataServers.ts","packages/semantic-data-provider/src/hooks/useCreateContainer.js","packages/semantic-data-provider/src/dataProvider/utils/findCreateContainerWithTypes.ts","packages/semantic-data-provider/src/hooks/useCreateContainerUri.ts","packages/semantic-data-provider/src/hooks/useDataModels.ts","packages/semantic-data-provider/src/reification/FilterHandler.js","packages/semantic-data-provider/src/reification/GroupedReferenceHandler.js","packages/semantic-data-provider/src/reification/ReificationArrayInput.js","packages/semantic-data-provider/src/notificationChannels/subscribeToUpdates.ts","packages/semantic-data-provider/src/dataProvider/types.ts"],"sourcesContent":["export { default as dataProvider } from './dataProvider/dataProvider';\n\nexport { default as buildSparqlQuery } from './dataProvider/utils/buildSparqlQuery';\nexport { default as buildBlankNodesQuery } from './dataProvider/utils/buildBlankNodesQuery';\n\nexport { default as useGetExternalLink } from './hooks/useGetExternalLink';\nexport { default as useContainers } from './hooks/useContainers';\nexport { default as useCreateContainer } from './hooks/useCreateContainer';\nexport { default as useCreateContainerUri } from './hooks/useCreateContainerUri';\nexport { default as useDataModel } from './hooks/useDataModel';\nexport { default as useDataModels } from './hooks/useDataModels';\nexport { default as useDataServers } from './hooks/useDataServers';\n\nexport { default as FilterHandler } from './reification/FilterHandler';\nexport { default as GroupedReferenceHandler } from './reification/GroupedReferenceHandler';\nexport { default as ReificationArrayInput } from './reification/ReificationArrayInput';\n\nexport {\n createWsChannel,\n getOrCreateWsChannel,\n createSolidNotificationChannel\n} from './notificationChannels/subscribeToUpdates';\n\nexport * from './dataProvider/types';\n","import createMethod from './methods/create';\nimport deleteMethod from './methods/delete';\nimport deleteManyMethod from './methods/deleteMany';\nimport getDataServersMethod from './methods/getDataServers';\nimport getDataModelsMethod from './methods/getDataModels';\nimport getListMethod from './methods/getList';\nimport getManyMethod from './methods/getMany';\nimport getManyReferenceMethod from './methods/getManyReference';\nimport getOneMethod from './methods/getOne';\nimport patchMethod from './methods/patch';\nimport updateMethod from './methods/update';\nimport fetchUserConfig from './utils/fetchUserConfig';\nimport fetchVoidEndpoints from './utils/fetchVoidEndpoints';\nimport getServerKeyFromType from './utils/getServerKeyFromType';\nimport httpClient from './httpClient';\n\nconst dataProvider = config => {\n // TODO verify all data provider config + data models\n if (!getServerKeyFromType('default', config.dataServers))\n throw new Error('You must define a default server in your dataServers config');\n\n if (!config.jsonContext) config.jsonContext = Object.fromEntries(config.ontologies.map(o => [o.prefix, o.url]));\n if (!config.returnFailedResources) config.returnFailedResources = false;\n\n // Configure httpClient with data servers (this is needed for proxy calls)\n config.httpClient = httpClient(config.dataServers);\n\n // Keep in memory for refresh\n const originalConfig = { ...config };\n\n let fetchUserConfigPromise = fetchUserConfig(config);\n let fetchVoidEndpointsPromise = fetchVoidEndpoints(config);\n\n const waitForConfig =\n method =>\n async (...arg) => {\n await fetchUserConfigPromise;\n await fetchVoidEndpointsPromise; // Return immediately if promise is fulfilled\n return await method(...arg);\n };\n\n return {\n getList: waitForConfig(getListMethod(config)),\n getMany: waitForConfig(getManyMethod(config)),\n getManyReference: waitForConfig(getManyReferenceMethod(config)),\n getOne: waitForConfig(getOneMethod(config)),\n create: waitForConfig(createMethod(config)),\n update: waitForConfig(updateMethod(config)),\n updateMany: () => {\n throw new Error('updateMany is not implemented yet');\n },\n delete: waitForConfig(deleteMethod(config)),\n deleteMany: waitForConfig(deleteManyMethod(config)),\n // Custom methods\n patch: waitForConfig(patchMethod(config)),\n getDataModels: waitForConfig(getDataModelsMethod(config)),\n getDataServers: waitForConfig(getDataServersMethod(config)),\n getLocalDataServers: getDataServersMethod(config),\n fetch: waitForConfig(config.httpClient),\n refreshConfig: async () => {\n config = { ...originalConfig };\n fetchUserConfigPromise = fetchUserConfig(config);\n fetchVoidEndpointsPromise = fetchVoidEndpoints(config);\n await fetchUserConfigPromise;\n await fetchVoidEndpointsPromise;\n return config;\n }\n };\n};\n\nexport default dataProvider;\n","import urlJoin from 'url-join';\nimport getOne from './getOne';\nimport handleFiles from '../utils/handleFiles';\nimport findContainersWithTypes from '../utils/findContainersWithTypes';\n\nconst createMethod = config => async (resourceId, params) => {\n const { dataServers, resources, httpClient, jsonContext } = config;\n const dataModel = resources[resourceId];\n\n if (!dataModel) Error(`Resource ${resourceId} is not mapped in resources file`);\n\n const headers = new Headers();\n\n let containerUri;\n let serverKey;\n if (dataModel.create?.container) {\n serverKey = Object.keys(dataModel.create.container)[0];\n containerUri = urlJoin(dataServers[serverKey].baseUrl, Object.values(dataModel.create.container)[0]);\n } else {\n serverKey = dataModel.create?.server || Object.keys(dataServers).find(key => dataServers[key].default === true);\n if (!serverKey) throw new Error('You must define a server for the creation, or a container, or a default server');\n\n const containers = findContainersWithTypes(dataModel.types, [serverKey], dataServers);\n // Extract the containerUri from the results (and ensure there is only one)\n const serverKeys = Object.keys(containers);\n\n if (!serverKeys || serverKeys.length === 0)\n throw new Error(`No container with types ${JSON.stringify(dataModel.types)} found on server ${serverKey}`);\n if (serverKeys.length > 1 || containers[serverKeys[0]].length > 1)\n throw new Error(\n `More than one container detected with types ${JSON.stringify(dataModel.types)} on server ${serverKey}`\n );\n containerUri = containers[serverKeys[0]][0];\n }\n\n if (params.data) {\n if (dataModel.fieldsMapping?.title) {\n if (Array.isArray(dataModel.fieldsMapping.title)) {\n headers.set('Slug', dataModel.fieldsMapping.title.map(f => params.data[f]).join(' '));\n } else {\n headers.set('Slug', params.data[dataModel.fieldsMapping.title]);\n }\n }\n\n // Upload files, if there are any\n const { updatedRecord } = await handleFiles.upload(params.data, config);\n params.data = updatedRecord;\n\n const { headers: responseHeaders } = await httpClient(containerUri, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n '@context': jsonContext,\n '@type': dataModel.types,\n ...params.data\n })\n });\n\n // Retrieve newly-created resource\n const resourceUri = responseHeaders.get('Location');\n return await getOne(config)(resourceId, { id: resourceUri });\n }\n if (params.id) {\n headers.set('Content-Type', 'application/sparql-update');\n\n await httpClient(containerUri, {\n method: 'PATCH',\n headers,\n body: `\n PREFIX ldp: \n INSERT DATA { <${containerUri}> ldp:contains <${params.id}>. };\n `\n });\n\n // Create must return the new data, so get them from the remote URI\n return await getOne(config)(resourceId, { id: params.id });\n }\n};\n\nexport default createMethod;\n","import fetchResource from '../utils/fetchResource';\n\nconst getOneMethod = config => async (resourceId, params) => {\n const { resources } = config;\n const dataModel = resources[resourceId];\n\n if (!dataModel) throw new Error(`Resource ${resourceId} is not mapped in resources file`);\n\n const data = await fetchResource(params.id, config);\n\n // Transform single value into array if forceArray is set\n if (dataModel.list?.forceArray) {\n for (const forceArrayItem of dataModel.list?.forceArray || []) {\n if (data[forceArrayItem] && !Array.isArray(data[forceArrayItem])) {\n data[forceArrayItem] = [data[forceArrayItem]];\n }\n }\n }\n\n // TODO activate defaultFetchPlan option\n // if (dataModel.list?.defaultFetchPlan) {\n // for (const node of dataModel.list?.defaultFetchPlan) {\n // if (\n // data[node] &&\n // typeof data[node] === 'string' &&\n // data[node].startsWith('http')\n // ) {\n // try {\n // const dataToEmbed = await fetchResource(data[node], config);\n // delete dataToEmbed['@context'];\n // data[node] = dataToEmbed;\n // } catch (e) {\n // // Ignore errors (this may happen if user does not have rights to see the resource)\n // }\n // }\n // }\n // }\n\n return { data };\n};\n\nexport default getOneMethod;\n","import jsonld from 'jsonld';\n\nconst fetchResource = async (resourceUri, config) => {\n const { httpClient, jsonContext } = config;\n\n let { json: data } = await httpClient(resourceUri);\n\n if (!data) throw new Error(`Not a valid JSON: ${resourceUri}`);\n\n data.id = data.id || data['@id'];\n\n // We compact only if the context is different between the frontend and the middleware\n // TODO deep compare if the context is an object\n if (data['@context'] !== jsonContext) {\n data = await jsonld.compact(data, jsonContext);\n }\n\n return data;\n};\n\nexport default fetchResource;\n","import urlJoin from 'url-join';\nimport { RaRecord } from 'react-admin';\nimport { Configuration } from '../types';\n\nconst isFile = (o: any): o is { rawFile: File } => o?.rawFile && o.rawFile instanceof File;\nconst isFileToDelete = (o: any): o is { fileToDelete: string } =>\n o?.fileToDelete !== undefined && o?.fileToDelete !== null;\n\nconst getUploadsContainerUri = (config: Configuration) => {\n const serverKey = Object.keys(config.dataServers).find(key => config.dataServers[key].uploadsContainer);\n if (serverKey && config.dataServers[serverKey].uploadsContainer) {\n return urlJoin(config.dataServers[serverKey].baseUrl, config.dataServers[serverKey].uploadsContainer!);\n }\n return null;\n};\n\nconst uploadFile = async (rawFile: File, config: Configuration) => {\n const uploadsContainerUri = getUploadsContainerUri(config);\n if (!uploadsContainerUri) throw new Error(\"You must define an uploadsContainer in one of the server's configuration\");\n\n const response = await config.httpClient(uploadsContainerUri, {\n method: 'POST',\n body: rawFile,\n headers: new Headers({\n 'Content-Type': rawFile.type\n })\n });\n\n if (response.status === 201) {\n return response.headers.get('Location');\n }\n return null;\n};\n\nconst deleteFiles = async (filesToDelete: string[], config: Configuration) => {\n return Promise.all(\n filesToDelete.map(file =>\n config.httpClient(file, {\n method: 'DELETE'\n })\n )\n );\n};\n\n/*\n * Look for raw files in the record data.\n * If there are any, upload them and replace the file by its URL.\n */\nconst uploadAllFiles = async (record: Partial, config: Configuration) => {\n const filesToDelete: string[] = [];\n const updatedRecord = { ...record };\n\n for (const property of Object.keys(record)) {\n const value = record[property];\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const itemValue = value[i];\n if (isFile(itemValue)) {\n if (isFileToDelete(itemValue)) {\n filesToDelete.push(itemValue.fileToDelete);\n }\n updatedRecord[property][i] = await uploadFile(itemValue.rawFile, config);\n } else if (isFileToDelete(itemValue)) {\n filesToDelete.push(itemValue.fileToDelete);\n updatedRecord[property][i] = null;\n }\n }\n } else if (isFile(value)) {\n if (isFileToDelete(value)) {\n filesToDelete.push(value.fileToDelete);\n }\n updatedRecord[property] = await uploadFile(value.rawFile, config);\n } else if (isFileToDelete(value)) {\n filesToDelete.push(value.fileToDelete);\n updatedRecord[property] = null;\n }\n }\n\n return {\n updatedRecord,\n filesToDelete\n };\n};\n\nexport default {\n upload: uploadAllFiles,\n delete: deleteFiles\n};\n","import urlJoin from 'url-join';\nimport { Configuration, DataServerKey } from '../types';\nimport parseServerKeys from './parseServerKeys';\n\nconst findContainersWithTypes = (\n types: string[],\n serverKeys: string | string[] | undefined,\n dataServers: Configuration['dataServers']\n) => {\n const containers = {} as Record;\n const existingContainers: string[] = [];\n\n const parsedServerKeys = parseServerKeys(serverKeys, dataServers);\n\n Object.keys(dataServers)\n .filter(dataServerKey => dataServers[dataServerKey].containers)\n .forEach(dataServerKey => {\n Object.keys(dataServers[dataServerKey].containers || {}).forEach(containerKey => {\n if (!parsedServerKeys || parsedServerKeys.includes(containerKey)) {\n Object.keys(dataServers[dataServerKey].containers![containerKey]).forEach(type => {\n if (types.includes(type)) {\n dataServers[dataServerKey].containers![containerKey][type].map(path => {\n const containerUri = urlJoin(dataServers[containerKey].baseUrl, path);\n\n // Avoid returning the same container several times\n if (!existingContainers.includes(containerUri)) {\n existingContainers.push(containerUri);\n\n if (!containers[dataServerKey]) containers[dataServerKey] = [];\n containers[dataServerKey].push(containerUri);\n }\n });\n }\n });\n }\n });\n });\n return containers;\n};\n\nexport default findContainersWithTypes;\n","import getServerKeyFromType from './getServerKeyFromType';\n\nconst parseServerKey = (serverKey, dataServers) => {\n switch (serverKey) {\n case '@default':\n return getServerKeyFromType('default', dataServers);\n case '@pod':\n return getServerKeyFromType('pod', dataServers);\n case '@authServer':\n return getServerKeyFromType('authServer', dataServers);\n default:\n return serverKey;\n }\n};\n\n// Return the list of servers keys in an array\n// parsing keywords like @all, @default, @pod and @authServer\nconst parseServerKeys = (serverKeys, dataServers) => {\n if (Array.isArray(serverKeys)) {\n if (serverKeys.includes('@all')) {\n return Object.keys(dataServers);\n }\n return serverKeys.map(serverKey => parseServerKey(serverKey, dataServers));\n }\n if (typeof serverKeys === 'string') {\n if (serverKeys === '@all') {\n return Object.keys(dataServers);\n }\n if (serverKeys === '@remote') {\n const defaultServerKey = getServerKeyFromType('default', dataServers);\n return Object.keys(dataServers).filter(serverKey => serverKey !== defaultServerKey);\n }\n return [parseServerKey(serverKeys, dataServers)];\n }\n // If server key is empty\n return false;\n};\n\nexport default parseServerKeys;\n","const getServerKeyFromType = (type, dataServers) => {\n return Object.keys(dataServers).find(key => {\n return dataServers[key][type];\n });\n};\n\nexport default getServerKeyFromType;\n","import { DeleteParams, RaRecord } from 'react-admin';\nimport { Configuration } from '../types';\nimport handleFiles from '../utils/handleFiles';\n\nconst deleteMethod = (config: Configuration) => async (resourceId: string, params: DeleteParams) => {\n const { httpClient } = config;\n\n await httpClient(`${params.id}`, {\n method: 'DELETE'\n });\n\n if (params.meta?.filesToDelete) {\n await handleFiles.delete(params.meta.filesToDelete, config);\n }\n\n return { data: { id: params.id } };\n};\n\nexport default deleteMethod;\n","const deleteManyMethod = config => async (resourceId, params) => {\n const { httpClient } = config;\n const ids = [];\n\n for (const id of params.ids) {\n try {\n await httpClient(id, {\n method: 'DELETE'\n });\n ids.push(id);\n } catch (e) {\n // Do nothing if we fail to delete a resource\n }\n }\n\n return { data: ids };\n};\n\nexport default deleteManyMethod;\n","const getDataServers = config => () => {\n return config.dataServers;\n};\n\nexport default getDataServers;\n","const getDataModels = config => () => {\n return config.resources;\n};\n\nexport default getDataModels;\n","import findContainersWithTypes from '../utils/findContainersWithTypes';\nimport fetchContainers from '../utils/fetchContainers';\nimport fetchSparqlEndpoints from '../utils/fetchSparqlEndpoints';\nimport findContainersWithPaths from '../utils/findContainersWithPath';\n\nconst getListMethod =\n config =>\n async (resourceId, params = {}) => {\n const { dataServers, resources } = config;\n const dataModel = resources[resourceId];\n\n if (!dataModel) throw new Error(`Resource ${resourceId} is not mapped in resources file`);\n\n let containers;\n if (!params.filter?._servers && dataModel.list?.containers) {\n if (Array.isArray(dataModel.list?.containers))\n throw new Error(\n `The list.containers property of ${resourceId} dataModel must be of type object ({ serverKey: [containerUri] })`\n );\n // If containers are set explicitly, use them\n containers = findContainersWithPaths(dataModel.list.containers, dataServers);\n } else {\n // Otherwise find the container URIs on the given servers (either in the filter or the data model)\n containers = findContainersWithTypes(\n dataModel.types,\n params.filter?._servers || dataModel.list?.servers,\n dataServers\n );\n }\n\n if (dataModel.list?.fetchContainer) {\n return fetchContainers(containers, params, config);\n }\n return fetchSparqlEndpoints(containers, resourceId, params, config);\n };\n\nexport default getListMethod;\n","import jsonld, { ContextDefinition } from 'jsonld';\nimport { GetListParams } from 'react-admin';\nimport arrayOf from './arrayOf';\nimport { Configuration, ContainerURI, DataServerKey } from '../types';\n\ntype LDPContainerType = 'ldp:Container' | 'ldp:BasicContainer';\n\ninterface LDPContainerBase {\n '@context': Configuration['jsonContext'];\n id: string;\n 'ldp:contains': Record[];\n}\n\ninterface LDPContainerWithType extends LDPContainerBase {\n type: LDPContainerType | LDPContainerType[];\n}\n\ninterface LDPContainerWithAtType extends LDPContainerBase {\n '@type': LDPContainerType | LDPContainerType[];\n}\n\ntype LDPContainer = LDPContainerWithType | LDPContainerWithAtType;\n\ntype LDPResource = {\n '@context': Configuration['jsonContext'];\n [key: string]: any;\n};\n\ntype ListFilters = Partial<{\n q: string;\n type: string;\n _predicates: string[];\n _servers: DataServerKey[];\n [attribute: string]: any;\n}>;\n\nconst isValidLDPContainer = (container: LDPContainer) => {\n const resourceType = (container as LDPContainerWithType).type || (container as LDPContainerWithAtType)['@type'];\n return Array.isArray(resourceType) ? resourceType.includes('ldp:Container') : resourceType === 'ldp:Container';\n};\n\nconst isObject = (val: any) => {\n return val != null && typeof val === 'object' && !Array.isArray(val);\n};\n\nconst fetchContainers = async (\n containers: Record,\n params: GetListParams,\n { httpClient, jsonContext }: Configuration\n) => {\n const containersUri = Object.values(containers).flat();\n\n const fetchPromises = containersUri.map(containerUri =>\n httpClient(containerUri)\n .then(async ({ json }) => {\n const jsonResponse: LDPContainer = json;\n\n // If container's context is different, compact it to have an uniform result\n // TODO deep compare if the context is an object\n if (jsonResponse['@context'] !== jsonContext) {\n return jsonld.compact(jsonResponse, jsonContext as ContextDefinition) as unknown as Promise;\n }\n\n return jsonResponse;\n })\n .then((json: LDPContainer) => {\n if (!isValidLDPContainer(json)) {\n throw new Error(`${containerUri} is not a LDP container`);\n }\n\n return arrayOf(json['ldp:contains']).map(resource => ({\n '@context': json['@context'],\n ...resource\n }));\n })\n );\n\n // Fetch simultaneously all containers\n const results = await Promise.all(fetchPromises);\n let resources = results.flat();\n\n resources = resources.map(resource => {\n resource.id = resource.id || resource['@id'];\n return resource;\n });\n\n // Apply filter to results\n const filters: ListFilters = params.filter;\n\n // For SPARQL queries, we use \"a\" to filter types, but in containers it must be \"type\"\n if (filters.a) {\n filters.type = filters.a;\n delete filters.a;\n }\n\n // Filter resources attributes according to _predicates list\n if (filters._predicates && Array.isArray(filters._predicates)) {\n const predicates = filters._predicates;\n const mandatoryAttributes = ['id'];\n\n resources = resources.map(resource => {\n return Object.keys(resource)\n .filter(key => predicates.includes(key) || mandatoryAttributes.includes(key))\n .reduce(\n (filteredResource, key) => {\n filteredResource[key] = resource[key];\n return filteredResource;\n },\n { '@context': [] }\n );\n });\n }\n\n if (Object.keys(filters).filter(f => !['_predicates', '_servers'].includes(f)).length > 0) {\n resources = resources.filter(resource => {\n // Full text filtering\n if (filters.q) {\n return Object.values(resource).some(attributeValue => {\n if (!isObject(attributeValue)) {\n const arrayValues = Array.isArray(attributeValue) ? attributeValue : [attributeValue];\n return arrayValues.some(value => {\n if (typeof value === 'string') {\n return value.toLowerCase().normalize('NFD').includes(filters.q!.toLowerCase().normalize('NFD'));\n }\n return false;\n });\n }\n return false;\n });\n }\n\n // Attribute filtering\n const attributesFilters = Object.keys(filters).filter(f => !['_predicates', '_servers', 'q'].includes(f));\n\n return attributesFilters.every(attribute => {\n if (resource[attribute]) {\n const arrayValues: any[] = Array.isArray(resource[attribute]) ? resource[attribute] : [resource[attribute]];\n return arrayValues.some(\n (value: any) => typeof value === 'string' && value.includes(filters[attribute] as string)\n );\n }\n\n return false;\n });\n });\n }\n\n // Sorting\n if (params.sort) {\n resources = resources.sort((a, b) => {\n if (a[params.sort.field] && b[params.sort.field]) {\n if (params.sort.order === 'ASC') {\n return a[params.sort.field].localeCompare(b[params.sort.field]);\n }\n return b[params.sort.field].localeCompare(a[params.sort.field]);\n }\n return true;\n });\n }\n\n // Pagination\n const total = resources.length;\n\n if (params.pagination) {\n resources = resources.slice(\n (params.pagination.page - 1) * params.pagination.perPage,\n params.pagination.page * params.pagination.perPage\n );\n }\n\n return { data: resources, total };\n};\n\nexport default fetchContainers;\n","const arrayOf = (value: T | T[]) => {\n // If the field is null-ish, we suppose there are no values.\n if (!value) {\n return [];\n }\n // Return as is.\n if (Array.isArray(value)) {\n return value;\n }\n // Single value is made an array.\n return [value];\n};\n\nexport default arrayOf;\n","import jsonld from 'jsonld';\nimport getEmbedFrame from './getEmbedFrame';\nimport buildSparqlQuery from './buildSparqlQuery';\n\nconst compare = (a, b) => {\n switch (typeof a) {\n case 'string':\n return a.localeCompare(b);\n case 'number':\n case 'bigint':\n return a - b;\n default:\n return 0;\n }\n};\n\nconst fetchSparqlEndpoints = async (containers, resourceId, params, config) => {\n const { dataServers, resources, httpClient, jsonContext, ontologies } = config;\n const dataModel = resources[resourceId];\n\n const sparqlQueryPromises = Object.keys(containers).map(\n serverKey =>\n new Promise((resolve, reject) => {\n const blankNodes = params.filter?.blankNodes || dataModel.list?.blankNodes;\n\n // When the SPARQL request comes from the browser's URL, it comes as JSON string which must must be parsed\n if (\n params.filter?.sparqlWhere &&\n (typeof params.filter.sparqlWhere === 'string' || params.filter.sparqlWhere instanceof String)\n ) {\n params.filter.sparqlWhere = JSON.parse(decodeURIComponent(params.filter.sparqlWhere));\n }\n const sparqlQuery = buildSparqlQuery({\n containers: containers[serverKey],\n params,\n dataModel,\n ontologies\n });\n\n httpClient(dataServers[serverKey].sparqlEndpoint, {\n method: 'POST',\n body: sparqlQuery\n })\n .then(({ json }) => {\n // If we declared the blank nodes to dereference, embed only those blank nodes\n // This solve problems which can occur when same-type resources are embedded in other resources\n // To increase performances, you can set explicitEmbedOnFraming to false (make sure the result is still OK)\n const frame =\n blankNodes && dataModel.list?.explicitEmbedOnFraming !== false\n ? {\n '@context': jsonContext,\n '@type': dataModel.types,\n '@embed': '@never',\n ...getEmbedFrame(blankNodes)\n }\n : {\n '@context': jsonContext,\n '@type': dataModel.types\n };\n\n // omitGraph option force results to be in a @graph, even if we have a single result\n return jsonld.frame(json, frame, { omitGraph: false });\n })\n .then(compactJson => {\n if (compactJson['@id']) {\n const { '@context': context, ...rest } = compactJson;\n compactJson = {\n '@context': context,\n '@graph': [rest]\n };\n }\n resolve(\n compactJson['@graph'].map(resource => ({ '@context': compactJson['@context'], ...resource })) || []\n );\n })\n .catch(e => reject(e));\n })\n );\n\n // Run simultaneous SPARQL queries\n let results = await Promise.all(sparqlQueryPromises);\n\n if (results.length === 0) {\n return { data: [], total: 0 };\n }\n // Merge all results in one array\n results = [].concat(...results);\n\n // Add id in addition to @id, as this is what React-Admin expects\n let returnData = results.map(item => {\n item.id = item.id || item['@id'];\n return item;\n });\n\n // TODO sort and paginate the results in the SPARQL query to improve performances\n if (params.sort) {\n returnData = returnData.sort((a, b) => {\n if (a[params.sort.field] !== undefined && b[params.sort.field] !== undefined) {\n if (params.sort.order === 'ASC') {\n return compare(a[params.sort.field], b[params.sort.field]);\n }\n return compare(b[params.sort.field], a[params.sort.field]);\n }\n return 0;\n });\n }\n if (params.pagination) {\n returnData = returnData.slice(\n (params.pagination.page - 1) * params.pagination.perPage,\n params.pagination.page * params.pagination.perPage\n );\n }\n\n return { data: returnData, total: results.length };\n};\n\nexport default fetchSparqlEndpoints;\n","const getEmbedFrame = blankNodes => {\n let embedFrame = {};\n let predicates;\n if (blankNodes) {\n for (const blankNode of blankNodes) {\n if (blankNode.includes('/')) {\n predicates = blankNode.split('/').reverse();\n } else {\n predicates = [blankNode];\n }\n embedFrame = {\n ...embedFrame,\n ...predicates.reduce(\n (accumulator, predicate) => ({\n [predicate]: {\n '@embed': '@last',\n ...accumulator\n }\n }),\n {}\n )\n };\n }\n return embedFrame;\n }\n};\n\nexport default getEmbedFrame;\n","import DataFactory from '@rdfjs/data-model';\nimport buildBaseQuery from './buildBaseQuery';\nimport buildBlankNodesQuery from './buildBlankNodesQuery';\nimport buildAutoDetectBlankNodesQuery from './buildAutoDetectBlankNodesQuery';\nimport resolvePrefix from './resolvePrefix';\n\nconst SparqlGenerator = require('sparqljs').Generator;\n\nconst { literal, namedNode, triple, variable } = DataFactory;\n\nconst generator = new SparqlGenerator({\n /* prefixes, baseIRI, factory, sparqlStar */\n});\n\nconst reservedFilterKeys = ['q', 'sparqlWhere', 'blankNodes', 'blankNodesDepth', '_servers', '_predicates'];\n\nconst buildSparqlQuery = ({ containers, params, dataModel, ontologies }) => {\n const blankNodes = params.filter?.blankNodes || dataModel.list?.blankNodes;\n const predicates = params.filter?._predicates || dataModel.list?.predicates;\n const blankNodesDepth = params.filter?.blankNodesDepth ?? dataModel.list?.blankNodesDepth ?? 2;\n const filter = { ...dataModel.list?.filter, ...params.filter };\n const baseQuery = buildBaseQuery(predicates, ontologies);\n\n const sparqlJsParams = {\n queryType: 'CONSTRUCT',\n template: baseQuery.construct,\n where: [],\n type: 'query',\n prefixes: Object.fromEntries(ontologies.map(ontology => [ontology.prefix, ontology.url]))\n };\n\n const containerWhere = [\n {\n type: 'values',\n values: containers.map(containerUri => ({ '?containerUri': namedNode(containerUri) }))\n },\n triple(variable('containerUri'), namedNode('http://www.w3.org/ns/ldp#contains'), variable('s1')),\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'isiri',\n args: [variable('s1')]\n }\n }\n ];\n\n let resourceWhere = [];\n\n if (filter && Object.keys(filter).length > 0) {\n const hasSPARQLFilter = filter.sparqlWhere && Object.keys(filter.sparqlWhere).length > 0;\n const hasFullTextSearch = filter.q && filter.q.length > 0;\n\n if (hasSPARQLFilter) {\n /*\n Example of usage :\n {\n \"sparqlWhere\": {\n \"type\": \"bgp\",\n \"triples\": [{\n \"subject\": {\"termType\": \"Variable\", \"value\": \"s1\"},\n \"predicate\": {\"termType\": \"NameNode\", \"value\": \"http://virtual-assembly.org/ontologies/pair#label\"},\n \"object\": {\"termType\": \"Literal\", \"value\": \"My Organization\"}\n }]\n }\n }\n */\n // initialize array in case of single value :\n [].concat(filter.sparqlWhere).forEach(sw => {\n resourceWhere.push(sw);\n });\n }\n\n if (hasFullTextSearch) {\n resourceWhere.push({\n type: 'group',\n patterns: [\n {\n queryType: 'SELECT',\n variables: [variable('s1')],\n where: [\n triple(variable('s1'), variable('p1'), variable('o1')),\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'isliteral',\n args: [variable('o1')]\n }\n },\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'regex',\n args: [\n {\n type: 'operation',\n operator: 'lcase',\n args: [\n {\n type: 'operation',\n operator: 'str',\n args: [variable('o1')]\n }\n ]\n },\n literal(filter.q.toLowerCase(), '', namedNode('http://www.w3.org/2001/XMLSchema#string'))\n ]\n }\n }\n ],\n type: 'query'\n }\n ]\n });\n }\n\n // Other filters\n // SPARQL keyword a = filter based on the class of a resource (example => 'a': 'pair:OrganizationType')\n // Other filters are based on a value (example => 'petr:hasAudience': 'http://localhost:3000/audiences/tout-public')\n Object.entries(filter).forEach(([predicate, object]) => {\n if (!reservedFilterKeys.includes(predicate)) {\n resourceWhere.unshift(\n triple(\n variable('s1'),\n namedNode(resolvePrefix(predicate, ontologies)),\n namedNode(resolvePrefix(object, ontologies))\n )\n );\n }\n });\n }\n\n // Blank nodes\n const blankNodesQuery = blankNodes\n ? buildBlankNodesQuery(blankNodes, baseQuery, ontologies)\n : buildAutoDetectBlankNodesQuery(blankNodesDepth, baseQuery);\n\n if (blankNodesQuery && blankNodesQuery.construct) {\n resourceWhere = resourceWhere.concat(blankNodesQuery.where);\n sparqlJsParams.template = sparqlJsParams.template.concat(blankNodesQuery.construct);\n } else {\n resourceWhere.push(baseQuery.where);\n }\n\n sparqlJsParams.where.push(\n {\n type: 'union',\n patterns: [\n containerWhere,\n {\n type: 'graph',\n name: namedNode('http://semapps.org/mirror'),\n patterns: containerWhere\n }\n ]\n },\n {\n type: 'union',\n patterns: [\n resourceWhere,\n {\n type: 'graph',\n name: namedNode('http://semapps.org/mirror'),\n patterns: resourceWhere\n }\n ]\n }\n );\n\n return generator.stringify(sparqlJsParams);\n};\n\nexport default buildSparqlQuery;\n","import { namedNode, triple, variable } from '@rdfjs/data-model';\nimport resolvePrefix from './resolvePrefix';\n\nconst defaultToArray = value => (!value ? [] : Array.isArray(value) ? value : [value]);\n\n// We need to always include the type or React-Admin will not work properly\nconst typeQuery = triple(\n variable('s1'),\n namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),\n variable('type')\n);\n\nconst buildBaseQuery = (predicates, ontologies) => {\n let baseTriples;\n if (predicates) {\n baseTriples = defaultToArray(predicates).map((predicate, i) =>\n triple(variable('s1'), namedNode(resolvePrefix(predicate, ontologies)), variable(`o${i + 1}`))\n );\n return {\n construct: [typeQuery, ...baseTriples],\n where: [typeQuery, ...baseTriples.map(triple => ({ type: 'optional', patterns: [triple] }))]\n };\n }\n baseTriples = [triple(variable('s1'), variable('p1'), variable('o1'))];\n return {\n construct: baseTriples,\n where: baseTriples\n };\n};\n\nexport default buildBaseQuery;\n","const resolvePrefix = (item, ontologies) => {\n if (item.startsWith('http://') || item.startsWith('https://')) {\n // Already resolved, return the URI\n return item;\n }\n if (item === 'a') {\n // Special case\n return 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';\n }\n const [prefix, value] = item.split(':');\n if (value) {\n const ontology = ontologies.find(ontology => ontology.prefix === prefix);\n if (ontology) {\n return ontology.url + value;\n }\n throw new Error(`No ontology found with prefix ${prefix}`);\n } else {\n throw new Error(`The value \"${item}\" is not correct. It must include a prefix or be a full URI.`);\n }\n};\n\nexport default resolvePrefix;\n","import md5 from 'crypto-js/md5';\nimport { namedNode, triple, variable } from '@rdfjs/data-model';\nimport resolvePrefix from './resolvePrefix';\n\n// Transform ['ont:predicate1/ont:predicate2'] to ['ont:predicate1', 'ont:predicate1/ont:predicate2']\nconst extractNodes = blankNodes => {\n const nodes = [];\n if (blankNodes) {\n for (const predicate of blankNodes) {\n if (predicate.includes('/')) {\n const nodeNames = predicate.split('/');\n for (let i = 1; i <= nodeNames.length; i++) {\n nodes.push(nodeNames.slice(0, i).join('/'));\n }\n } else {\n nodes.push(predicate);\n }\n }\n }\n return nodes;\n};\n\nconst generateSparqlVarName = node => md5(node);\n\nconst getParentNode = node => node.includes('/') && node.split('/')[0];\n\nconst getPredicate = node => (node.includes('/') ? node.split('/')[1] : node);\n\nconst buildUnionQuery = queries =>\n queries.map(q => {\n let triples = q.query;\n const firstTriple = queries.find(q2 => q.parentNode === q2.node);\n if (firstTriple !== undefined) {\n triples = triples.concat(firstTriple.query[0]);\n }\n return {\n type: 'bgp',\n triples\n };\n });\n\nconst buildBlankNodesQuery = (blankNodes, baseQuery, ontologies) => {\n const queries = [];\n const nodes = extractNodes(blankNodes);\n\n if (nodes && ontologies && ontologies.length > 0) {\n for (const node of nodes) {\n const parentNode = getParentNode(node);\n const predicate = getPredicate(node);\n const varName = generateSparqlVarName(node);\n const parentVarName = parentNode ? generateSparqlVarName(parentNode) : '1';\n\n const query = [\n triple(variable(`s${parentVarName}`), namedNode(resolvePrefix(predicate, ontologies)), variable(`s${varName}`)),\n triple(variable(`s${varName}`), variable(`p${varName}`), variable(`o${varName}`))\n ];\n\n queries.push({\n node,\n parentNode,\n query,\n filter: '' // `FILTER(isBLANK(?s${varName})) .`\n });\n }\n\n return {\n construct: queries.length > 0 ? queries.map(q => q.query).reduce((pre, cur) => pre.concat(cur)) : null,\n where: {\n type: 'union',\n patterns: [baseQuery.where, ...buildUnionQuery(queries)]\n }\n };\n }\n return {\n construct: '',\n where: ''\n };\n};\n\nexport default buildBlankNodesQuery;\n","import { triple, variable } from '@rdfjs/data-model';\n\nconst buildAutoDetectBlankNodesQuery = (depth, baseQuery) => {\n const construct = [...baseQuery.construct];\n let where = {};\n if (depth > 0) {\n const whereQueries = [];\n whereQueries.push([baseQuery.where]);\n for (let i = 1; i <= depth; i++) {\n construct.push(triple(variable(`o${i}`), variable(`p${i + 1}`), variable(`o${i + 1}`)));\n whereQueries.push([\n ...whereQueries[whereQueries.length - 1],\n {\n type: 'filter',\n expression: {\n type: 'operation',\n operator: 'isblank',\n args: [variable(`o${i}`)]\n }\n },\n triple(variable(`o${i}`), variable(`p${i + 1}`), variable(`o${i + 1}`))\n ]);\n }\n where = {\n type: 'union',\n patterns: whereQueries\n };\n } else if (depth === 0) {\n where = baseQuery.where;\n } else {\n throw new Error('The depth of buildAutoDetectBlankNodesQuery should be 0 or more');\n }\n\n return { construct, where };\n};\n\nexport default buildAutoDetectBlankNodesQuery;\n","import urlJoin from 'url-join';\n\nconst findContainersWithPaths = (paths, dataServers) => {\n const containers = {};\n Object.keys(paths).forEach(serverKey => {\n if (dataServers[serverKey]) {\n containers[serverKey] = [];\n paths[serverKey].forEach(path => {\n containers[serverKey].push(urlJoin(dataServers[serverKey].baseUrl, path));\n });\n } else {\n throw new Error(`No server found with key ${serverKey}`);\n }\n });\n return containers;\n};\n\nexport default findContainersWithPaths;\n","import getOne from './getOne';\n\nconst getManyMethod = config => async (resourceId, params) => {\n const { returnFailedResources } = config;\n\n let returnData = await Promise.all(\n params.ids.map(id =>\n getOne(config)(resourceId, { id: typeof id === 'object' ? id['@id'] : id })\n .then(({ data }) => data)\n .catch(() => {\n // Catch if one resource fails to load\n // Otherwise no references will be show if only one is missing\n // See https://github.com/marmelab/react-admin/issues/5190\n if (returnFailedResources) {\n return { id, _error: true };\n }\n // Returning nothing\n })\n )\n );\n\n // We don't want undefined results to appear in the results as it will break with react-admin\n returnData = returnData.filter(e => e);\n\n return { data: returnData };\n};\n\nexport default getManyMethod;\n","import getList from './getList';\n\nconst getManyReferenceMethod = config => async (resourceId, params) => {\n params.filter = { ...params.filter, [params.target]: params.id };\n delete params.target;\n return await getList(config)(resourceId, params);\n};\n\nexport default getManyReferenceMethod;\n","import { RaRecord } from 'react-admin';\nimport { Generator as SparqlGenerator, Update } from 'sparqljs';\nimport { Configuration, PatchParams } from '../types';\n\nconst generator = new SparqlGenerator();\n\nconst patchMethod = (config: Configuration) => async (resourceId: string, params: PatchParams) => {\n const { httpClient } = config;\n\n const sparqlUpdate = {\n type: 'update',\n prefixes: {},\n updates: []\n } as Update;\n\n if (params.triplesToAdd) {\n sparqlUpdate.updates.push({\n updateType: 'insert',\n insert: [{ type: 'bgp', triples: params.triplesToAdd }]\n });\n }\n\n if (params.triplesToRemove) {\n sparqlUpdate.updates.push({\n updateType: 'delete',\n delete: [{ type: 'bgp', triples: params.triplesToRemove }]\n });\n }\n\n await httpClient(`${params.id}`, {\n method: 'PATCH',\n headers: new Headers({\n 'Content-Type': 'application/sparql-update'\n }),\n body: generator.stringify(sparqlUpdate)\n });\n};\n\nexport default patchMethod;\n","import { RaRecord, UpdateParams } from 'react-admin';\nimport { Configuration } from '../types';\nimport handleFiles from '../utils/handleFiles';\n\nconst updateMethod = (config: Configuration) => async (resourceId: string, params: UpdateParams) => {\n const { httpClient, jsonContext } = config;\n\n // Upload files, if there are any\n const { updatedRecord, filesToDelete } = await handleFiles.upload(params.data, config);\n params.data = updatedRecord;\n\n await httpClient(`${params.id}`, {\n method: 'PUT',\n body: JSON.stringify({\n '@context': jsonContext,\n ...params.data\n })\n });\n\n // Delete files only if update is successful\n await handleFiles.delete(filesToDelete, config);\n\n return { data: params.data };\n};\n\nexport default updateMethod;\n","import jwtDecode from 'jwt-decode';\nimport urlJoin from 'url-join';\nimport getServerKeyFromType from './getServerKeyFromType';\n\nconst fetchUserConfig = async config => {\n const { dataServers, httpClient } = config;\n const token = localStorage.getItem('token');\n const podKey = getServerKeyFromType('pod', dataServers);\n const authServerKey = getServerKeyFromType('authServer', dataServers);\n\n // If the user is logged in\n if (token) {\n const payload = jwtDecode(token);\n const webId = payload.webId || payload.webid; // Currently we must deal with both formats\n let userData;\n\n try {\n const { json } = await httpClient(webId);\n userData = json;\n } catch (e) {\n console.error(e);\n // If the webId cannot be fetched, assume an invalid token and disconnect the user\n localStorage.clear();\n window.location.reload();\n return;\n }\n\n // If we have a POD server\n if (podKey) {\n // Fill the config provided to the data provider\n // We must modify the config object directly\n config.dataServers[podKey].name = 'My Pod';\n config.dataServers[podKey].baseUrl = userData['pim:storage'] || urlJoin(webId, 'data');\n config.dataServers[podKey].sparqlEndpoint =\n userData.endpoints?.['void:sparqlEndpoint'] || urlJoin(webId, 'sparql');\n }\n\n if (authServerKey) {\n // Fill the config provided to the data provider\n // We must modify the config object directly\n config.dataServers[authServerKey].proxyUrl = userData.endpoints?.proxyUrl;\n }\n } else if (podKey) {\n // If the user is not logged in, ignore the POD server\n delete config.dataServers[podKey];\n }\n};\n\nexport default fetchUserConfig;\n","const defaultToArray = value => (!value ? undefined : Array.isArray(value) ? value : [value]);\n\nconst fetchVoidEndpoints = async config => {\n const fetchPromises = Object.entries(config.dataServers)\n .filter(([key, server]) => server.pod !== true && server.void !== false)\n .map(([key, server]) =>\n config\n .httpClient(new URL('/.well-known/void', server.baseUrl).toString())\n .then(result => ({ key, datasets: result.json['@graph'] }))\n .catch(e => {\n if (e.status === 404 || e.status === 401 || e.status === 500) {\n return { key, error: e };\n }\n throw e;\n })\n );\n\n let results = [];\n\n try {\n results = await Promise.all(fetchPromises);\n } catch (e) {\n // Do not throw error if no endpoint found\n }\n\n for (const result of results) {\n config.dataServers[result.key].containers = config.dataServers[result.key].containers || {};\n config.dataServers[result.key].blankNodes = config.dataServers[result.key].blankNodes || {};\n\n // Ignore unfetchable endpoints\n if (result.datasets) {\n for (const dataset of result.datasets) {\n const datasetServerKey = Object.keys(config.dataServers).find(\n key => dataset['void:uriSpace'] === config.dataServers[key].baseUrl\n );\n\n // If the dataset is not part of a server mapped in the dataServers, ignore it\n if (datasetServerKey) {\n // If this is the local dataset, add the base information\n if (datasetServerKey === result.key) {\n config.dataServers[result.key].name = config.dataServers[result.key].name || dataset['dc:title'];\n config.dataServers[result.key].description =\n config.dataServers[result.key].description || dataset['dc:description'];\n config.dataServers[result.key].sparqlEndpoint =\n config.dataServers[result.key].sparqlEndpoint || dataset['void:sparqlEndpoint'];\n }\n\n config.dataServers[result.key].containers[datasetServerKey] =\n config.dataServers[result.key].containers[datasetServerKey] || {};\n\n for (const partition of defaultToArray(dataset['void:classPartition'])) {\n for (const type of defaultToArray(partition['void:class'])) {\n // Set containers by type\n const path = partition['void:uriSpace'].replace(dataset['void:uriSpace'], '/');\n if (config.dataServers[result.key].containers[datasetServerKey][type]) {\n config.dataServers[result.key].containers[datasetServerKey][type].push(path);\n } else {\n config.dataServers[result.key].containers[datasetServerKey][type] = [path];\n }\n }\n }\n }\n }\n }\n }\n};\n\nexport default fetchVoidEndpoints;\n","import { fetchUtils } from 'react-admin';\nimport getServerKeyFromUri from './utils/getServerKeyFromUri';\nimport getServerKeyFromType from './utils/getServerKeyFromType';\n\n/*\n * HTTP client used by all calls in data provider and auth provider\n * Do proxy calls if a proxy endpoint is available and the server is different from the auth server\n */\nconst httpClient =\n dataServers =>\n (url, options = {}) => {\n const authServerKey = getServerKeyFromType('authServer', dataServers);\n const serverKey = getServerKeyFromUri(url, dataServers);\n const useProxy =\n serverKey !== authServerKey && dataServers[authServerKey]?.proxyUrl && dataServers[serverKey]?.noProxy !== true;\n\n if (!options.headers) options.headers = new Headers();\n\n switch (options.method) {\n case 'POST':\n case 'PATCH':\n case 'PUT':\n if (!options.headers.has('Accept')) options.headers.set('Accept', 'application/ld+json');\n if (!options.headers.has('Content-Type')) options.headers.set('Content-Type', 'application/ld+json');\n break;\n\n case 'DELETE':\n break;\n\n case 'GET':\n default:\n if (!options.headers.has('Accept')) options.headers.set('Accept', 'application/ld+json');\n break;\n }\n\n if (useProxy) {\n const formData = new FormData();\n\n formData.append('id', url);\n formData.append('method', options.method || 'GET');\n formData.append('headers', JSON.stringify(Object.fromEntries(options.headers.entries())));\n\n if (options.body) {\n if (options.body instanceof File) {\n formData.append('body', options.body, options.body.name);\n } else {\n formData.append('body', options.body);\n }\n }\n\n // Post to proxy endpoint with multipart/form-data format\n return fetchUtils.fetchJson(dataServers[authServerKey].proxyUrl, {\n method: 'POST',\n headers: new Headers({\n Authorization: `Bearer ${localStorage.getItem('token')}`\n }),\n body: formData\n });\n }\n // Add token if the server is the same as the auth server\n if (serverKey === authServerKey) {\n const token = localStorage.getItem('token');\n if (token) options.headers.set('Authorization', `Bearer ${token}`);\n }\n return fetchUtils.fetchJson(url, options);\n };\n\nexport default httpClient;\n","// Return the first server matching with the baseUrl\nconst getServerKeyFromUri = (uri, dataServers) => {\n if (!uri) throw Error(`No URI provided to getServerKeyFromUri`);\n return Object.keys(dataServers).find(key => {\n if (dataServers[key].pod) {\n // The baseUrl ends with /data so remove this part to match with the webId and webId-related URLs (/inbox, /outbox...)\n return dataServers[key].baseUrl && uri.startsWith(dataServers[key].baseUrl.replace('/data', ''));\n }\n return uri.startsWith(dataServers[key].baseUrl);\n });\n};\n\nexport default getServerKeyFromUri;\n","import { useCallback, useMemo, useContext } from 'react';\nimport { DataProviderContext } from 'react-admin';\n\nconst compute = (externalLinks, record) =>\n typeof externalLinks === 'function' ? externalLinks(record) : externalLinks;\nconst isURL = url => typeof url === 'string' && url.startsWith('http');\n\nconst useGetExternalLink = componentExternalLinks => {\n // Since the externalLinks config is defined only locally, we don't need to wait for VOID endpoints fetching\n const dataProvider = useContext(DataProviderContext);\n const dataServers = dataProvider.getLocalDataServers();\n\n const serversExternalLinks = useMemo(() => {\n if (dataServers) {\n return Object.fromEntries(\n Object.values(dataServers).map(server => {\n // If externalLinks is not defined in the data server, use external links for non-default servers\n const externalLinks = server.externalLinks !== undefined ? server.externalLinks : !server.default;\n return [server.baseUrl, externalLinks];\n })\n );\n }\n }, [dataServers]);\n\n return useCallback(\n record => {\n const computedComponentExternalLinks = compute(componentExternalLinks, record);\n // If the component explicitly asks not to display as external links, use an internal link\n if (computedComponentExternalLinks === false) return false;\n\n if (!record?.id) return false;\n\n const serverBaseUrl = Object.keys(serversExternalLinks).find(baseUrl => record?.id.startsWith(baseUrl));\n // If no matching data servers could be found, assume we have an internal link\n if (!serverBaseUrl) return false;\n\n const computedServerExternalLinks = compute(serversExternalLinks[serverBaseUrl], record);\n // If the data server explicitly asks not to display as external links, use an internal link\n if (computedServerExternalLinks === false) return false;\n\n if (isURL(computedComponentExternalLinks)) {\n return computedComponentExternalLinks;\n }\n if (isURL(computedServerExternalLinks)) {\n return computedServerExternalLinks;\n }\n return record.id;\n },\n [serversExternalLinks, componentExternalLinks]\n );\n};\n\nexport default useGetExternalLink;\n","import { useState, useEffect } from 'react';\nimport useDataModel from './useDataModel';\nimport useDataServers from './useDataServers';\nimport findContainersWithTypes from '../dataProvider/utils/findContainersWithTypes';\nimport { DataServerKey } from '../dataProvider/types';\n\nconst useContainers = (resourceId: string, serverKeys = '@all') => {\n const dataModel = useDataModel(resourceId);\n const dataServers = useDataServers();\n const [containers, setContainers] = useState>();\n\n useEffect(() => {\n if (dataModel && dataServers) {\n setContainers(findContainersWithTypes(dataModel.types, serverKeys, dataServers));\n }\n }, [dataModel, dataServers, serverKeys]);\n\n return containers;\n};\n\nexport default useContainers;\n","import { useContext, useState, useEffect } from 'react';\nimport { DataProviderContext } from 'react-admin';\n\nconst useDataModel = (resourceId: string) => {\n // Get the raw data provider, since useDataProvider returns a wrapper\n const dataProvider = useContext(DataProviderContext);\n const [dataModel, setDataModel] = useState(undefined); // TODO: Type this object\n\n useEffect(() => {\n dataProvider.getDataModels().then((results: any) => setDataModel(results[resourceId]));\n }, [dataProvider, resourceId, setDataModel]);\n\n return dataModel;\n};\n\nexport default useDataModel;\n","import { useState, useEffect } from 'react';\nimport { useDataProvider } from 'react-admin';\nimport { SemanticDataProvider, DataServersConfig } from '../dataProvider/types';\n\nconst useDataServers = () => {\n const dataProvider = useDataProvider();\n const [dataServers, setDataServers] = useState();\n\n useEffect(() => {\n dataProvider.getDataServers().then(results => {\n setDataServers(results);\n });\n }, [dataProvider, setDataServers]);\n\n return dataServers;\n};\n\nexport default useDataServers;\n","import { useState, useEffect } from 'react';\nimport urlJoin from 'url-join';\nimport useDataModel from './useDataModel';\nimport useDataServers from './useDataServers';\nimport findCreateContainerWithTypes from '../dataProvider/utils/findCreateContainerWithTypes';\nimport getServerKeyFromType from '../dataProvider/utils/getServerKeyFromType';\n\n/** @deprecated Use \"useCreateContainerUri\" instead */\nconst useCreateContainer = resourceId => {\n const dataModel = useDataModel(resourceId);\n const dataServers = useDataServers();\n const [createContainer, setCreateContainer] = useState();\n\n useEffect(() => {\n if (dataModel && dataServers) {\n if (dataModel.create?.container) {\n const [serverKey, path] = Object.entries(dataModel.create.container)[0];\n if (!serverKey || !dataServers[serverKey]) {\n throw new Error(`Wrong key for the dataModel.create.container config of resource ${resourceId}`);\n }\n setCreateContainer(urlJoin(dataServers[serverKey].baseUrl, path));\n } else if (dataModel.create?.server) {\n setCreateContainer(findCreateContainerWithTypes(dataModel.types, dataModel.create?.server, dataServers));\n } else {\n const defaultServerKey = getServerKeyFromType('default', dataServers);\n setCreateContainer(findCreateContainerWithTypes(dataModel.types, defaultServerKey, dataServers));\n }\n }\n }, [dataModel, dataServers, setCreateContainer]);\n\n return createContainer;\n};\n\nexport default useCreateContainer;\n","import urlJoin from 'url-join';\nimport { DataModel, DataServerKey, DataServersConfig } from '../types';\n\nconst findCreateContainerWithTypes = (\n types: DataModel['types'],\n createServerKey: DataServerKey,\n dataServers: DataServersConfig\n) => {\n const containers: string[] = [];\n\n Object.keys(dataServers[createServerKey].containers?.[createServerKey] || {}).forEach(type => {\n if (types.includes(type)) {\n dataServers[createServerKey].containers![createServerKey][type].forEach(path => {\n const containerUri = urlJoin(dataServers[createServerKey].baseUrl, path);\n if (!containers.includes(containerUri)) {\n containers.push(containerUri);\n }\n });\n }\n });\n\n if (containers.length === 0) {\n throw new Error(\n `No container found matching with types ${JSON.stringify(\n types\n )}. You can set explicitely the create.container property of the resource.`\n );\n } else if (containers.length > 1) {\n throw new Error(\n `More than one container found matching with types ${JSON.stringify(\n types\n )}. You must set the create.server or create.container property for the resource.`\n );\n }\n\n return containers[0];\n};\n\nexport default findCreateContainerWithTypes;\n","import { useCallback } from 'react';\nimport urlJoin from 'url-join';\nimport useDataServers from './useDataServers';\nimport findCreateContainerWithTypes from '../dataProvider/utils/findCreateContainerWithTypes';\nimport getServerKeyFromType from '../dataProvider/utils/getServerKeyFromType';\nimport useDataModels from './useDataModels';\n\nconst useCreateContainerUri = () => {\n const dataModels = useDataModels();\n const dataServers = useDataServers();\n\n const getContainerUri = useCallback(\n (resourceId: string) => {\n if (!dataModels || !dataServers || !dataModels[resourceId]) {\n return undefined;\n }\n\n const dataModel = dataModels[resourceId];\n\n if (dataModel.create?.container) {\n const [serverKey, path] = Object.entries(dataModel.create.container)[0];\n if (!serverKey || !dataServers[serverKey]) {\n throw new Error(`Wrong key for the dataModel.create.container config of resource ${resourceId}`);\n }\n return urlJoin(dataServers[serverKey].baseUrl, path);\n }\n\n if (dataModel.create?.server) {\n return findCreateContainerWithTypes(dataModel.types, dataModel.create?.server, dataServers);\n }\n\n const defaultServerKey = getServerKeyFromType('default', dataServers);\n\n if (!defaultServerKey) {\n throw new Error(\n `No default dataServer found. You can set explicitly one setting the \"default\" attribute to true`\n );\n }\n\n return findCreateContainerWithTypes(dataModel.types, defaultServerKey, dataServers);\n },\n [dataModels, dataServers]\n );\n\n return getContainerUri;\n};\n\nexport default useCreateContainerUri;\n","import { useState, useEffect } from 'react';\nimport { useDataProvider } from 'react-admin';\nimport { DataModel, SemanticDataProvider } from '../dataProvider/types';\n\nconst useDataModels = () => {\n const dataProvider = useDataProvider();\n const [dataModels, setDataModels] = useState>();\n\n useEffect(() => {\n dataProvider.getDataModels().then(results => {\n setDataModels(results);\n });\n }, [dataProvider, setDataModels]);\n\n return dataModels;\n};\n\nexport default useDataModels;\n","import React, { useState, useEffect } from 'react';\n\n/**\n * @example\n * \n * \n * \n * \n * \n * \n */\n\nconst FilterHandler = ({ children, record, filter, source, ...otherProps }) => {\n const [filtered, setFiltered] = useState();\n useEffect(() => {\n if (record && source && Array.isArray(record?.[source])) {\n const filteredData = record?.[source].filter(r => {\n let eq = true;\n for (const key in filter) {\n const value = r[key];\n if (Array.isArray(value)) {\n if (!value.includes(filter[key])) {\n eq = false;\n }\n } else if (value !== filter[key]) {\n eq = false;\n }\n }\n return eq;\n });\n const newRecord = {\n ...record\n };\n // undefined setted if no data to obtain no render in RightLabel or equivalent\n newRecord[source] = filteredData.length > 0 ? filteredData : undefined;\n setFiltered(newRecord);\n }\n }, [record, source, filter]);\n\n return (\n <>\n {React.Children.map(children, (child, i) => {\n return React.cloneElement(child, {\n ...otherProps,\n record: filtered,\n source\n });\n })}\n \n );\n};\nexport default FilterHandler;\n","import React from 'react';\nimport { useGetList, useRecordContext } from 'react-admin';\nimport { default as FilterHandler } from './FilterHandler';\n\n/*\n * @example Label used in examples\n * const Label = ({label, ...otherProps})=>{\n * return

{label}

\n * }\n *\n * @example show header for each group with group property thanks to groupHeader\n * }\n * filterProperty=\"property of source filtered by groupReference\"\n * >\n * // same props as GroupedArrayField source\n * \n * \n * \n * \n *\n * @example call chhildren with label thanks to groupLabel\n * \n *