@semapps/semantic-data-provider 1.1.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +271 -175
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.ts +2380 -0
- package/dist/index.d.ts +172 -188
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +266 -170
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.tsx +2439 -0
- package/package.json +14 -8
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import {createConnectedLdoDataset as $fj9kP$createConnectedLdoDataset} from "@ldo/connected";
|
|
2
|
+
import {solidConnectedPlugin as $fj9kP$solidConnectedPlugin} from "@ldo/connected-solid";
|
|
1
3
|
import $fj9kP$speakingurl from "speakingurl";
|
|
2
4
|
import $fj9kP$jsonld from "jsonld";
|
|
3
|
-
import $fj9kP$rdfjsdatamodel
|
|
5
|
+
import $fj9kP$rdfjsdatamodel from "@rdfjs/data-model";
|
|
4
6
|
import {Generator as $fj9kP$Generator} from "sparqljs";
|
|
5
7
|
import $fj9kP$cryptojsmd5 from "crypto-js/md5";
|
|
6
8
|
import {fetchUtils as $fj9kP$fetchUtils, useDataProvider as $fj9kP$useDataProvider, DataProviderContext as $fj9kP$DataProviderContext, useRecordContext as $fj9kP$useRecordContext, useGetList as $fj9kP$useGetList, ArrayInput as $fj9kP$ArrayInput, SimpleFormIterator as $fj9kP$SimpleFormIterator, TextInput as $fj9kP$TextInput} from "react-admin";
|
|
@@ -10,14 +12,13 @@ import $fj9kP$httplinkheader from "http-link-header";
|
|
|
10
12
|
import {capitalCase as $fj9kP$capitalCase} from "change-case";
|
|
11
13
|
import $fj9kP$react, {useState as $fj9kP$useState, useEffect as $fj9kP$useEffect, useMemo as $fj9kP$useMemo, useCallback as $fj9kP$useCallback, useContext as $fj9kP$useContext} from "react";
|
|
12
14
|
import {jsx as $fj9kP$jsx, Fragment as $fj9kP$Fragment, jsxs as $fj9kP$jsxs} from "react/jsx-runtime";
|
|
13
|
-
import $fj9kP$
|
|
15
|
+
import {makeStyles as $fj9kP$makeStyles} from "tss-react/mui";
|
|
14
16
|
|
|
15
|
-
var $11242e90250f263e$exports = {};
|
|
16
|
-
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
const $eadae1e342076a7b$var$fetchResource = async (resourceUri, config)=>{
|
|
21
22
|
const { httpClient: httpClient, jsonContext: jsonContext } = config;
|
|
22
23
|
let { json: data } = await httpClient(resourceUri);
|
|
23
24
|
if (!data) throw new Error(`Not a valid JSON: ${resourceUri}`);
|
|
@@ -27,14 +28,14 @@ const $336b7edf722fe53e$var$fetchResource = async (resourceUri, config)=>{
|
|
|
27
28
|
if (data['@context'] !== jsonContext) data = await (0, $fj9kP$jsonld).compact(data, jsonContext);
|
|
28
29
|
return data;
|
|
29
30
|
};
|
|
30
|
-
var $
|
|
31
|
+
var $eadae1e342076a7b$export$2e2bcd8739ae039 = $eadae1e342076a7b$var$fetchResource;
|
|
31
32
|
|
|
32
33
|
|
|
33
|
-
const $
|
|
34
|
+
const $4861cda99f97e87d$var$getOneMethod = (config)=>async (resourceId, params)=>{
|
|
34
35
|
const { resources: resources } = config;
|
|
35
36
|
const dataModel = resources[resourceId];
|
|
36
37
|
if (!dataModel) throw new Error(`Resource ${resourceId} is not mapped in resources file`);
|
|
37
|
-
const data = await (0, $
|
|
38
|
+
const data = await (0, $eadae1e342076a7b$export$2e2bcd8739ae039)(params.id, config);
|
|
38
39
|
// Transform single value into array if forceArray is set
|
|
39
40
|
if (dataModel.list?.forceArray) {
|
|
40
41
|
for (const forceArrayItem of dataModel.list?.forceArray || [])if (data[forceArrayItem] && !Array.isArray(data[forceArrayItem])) data[forceArrayItem] = [
|
|
@@ -63,7 +64,7 @@ const $ed447224dd38ce82$var$getOneMethod = (config)=>async (resourceId, params)=
|
|
|
63
64
|
data: data
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
|
-
var $
|
|
67
|
+
var $4861cda99f97e87d$export$2e2bcd8739ae039 = $4861cda99f97e87d$var$getOneMethod;
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
const $c35ffbda15247c32$var$getUploadsContainerUri = (config, serverKey)=>{
|
|
@@ -114,22 +115,22 @@ var $b17c43e3301545ca$export$2e2bcd8739ae039 = {
|
|
|
114
115
|
};
|
|
115
116
|
|
|
116
117
|
|
|
117
|
-
const $
|
|
118
|
+
const $aed10b8332b5d58a$var$getServerKeyFromType = (type, dataServers)=>{
|
|
118
119
|
return dataServers && Object.keys(dataServers).find((key)=>{
|
|
119
120
|
return dataServers[key][type];
|
|
120
121
|
});
|
|
121
122
|
};
|
|
122
|
-
var $
|
|
123
|
+
var $aed10b8332b5d58a$export$2e2bcd8739ae039 = $aed10b8332b5d58a$var$getServerKeyFromType;
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
const $99cc2e4a2a3c100b$var$parseServerKey = (serverKey, dataServers)=>{
|
|
126
127
|
switch(serverKey){
|
|
127
128
|
case '@default':
|
|
128
|
-
return (0, $
|
|
129
|
+
return (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('default', dataServers);
|
|
129
130
|
case '@pod':
|
|
130
|
-
return (0, $
|
|
131
|
+
return (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('pod', dataServers);
|
|
131
132
|
case '@authServer':
|
|
132
|
-
return (0, $
|
|
133
|
+
return (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('authServer', dataServers);
|
|
133
134
|
default:
|
|
134
135
|
return serverKey;
|
|
135
136
|
}
|
|
@@ -143,7 +144,7 @@ const $99cc2e4a2a3c100b$var$parseServerKeys = (serverKeys, dataServers)=>{
|
|
|
143
144
|
} else if (typeof serverKeys === 'string') {
|
|
144
145
|
if (serverKeys === '@all') return Object.keys(dataServers);
|
|
145
146
|
else if (serverKeys === '@remote') {
|
|
146
|
-
const defaultServerKey = (0, $
|
|
147
|
+
const defaultServerKey = (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('default', dataServers);
|
|
147
148
|
return Object.keys(dataServers).filter((serverKey)=>serverKey !== defaultServerKey);
|
|
148
149
|
} else return [
|
|
149
150
|
$99cc2e4a2a3c100b$var$parseServerKey(serverKeys, dataServers)
|
|
@@ -180,7 +181,7 @@ const $7c772a9c0c25a69d$var$findContainersWithURIs = (containersUris, dataServer
|
|
|
180
181
|
var $7c772a9c0c25a69d$export$2e2bcd8739ae039 = $7c772a9c0c25a69d$var$findContainersWithURIs;
|
|
181
182
|
|
|
182
183
|
|
|
183
|
-
const $
|
|
184
|
+
const $d12d4cfb47175317$var$createMethod = (config)=>async (resourceId, params)=>{
|
|
184
185
|
const { dataServers: dataServers, resources: resources, httpClient: httpClient, jsonContext: jsonContext } = config;
|
|
185
186
|
const dataModel = resources[resourceId];
|
|
186
187
|
if (!dataModel) Error(`Resource ${resourceId} is not mapped in resources file`);
|
|
@@ -223,7 +224,7 @@ const $5a7a2f7583392866$var$createMethod = (config)=>async (resourceId, params)=
|
|
|
223
224
|
});
|
|
224
225
|
// Retrieve newly-created resource
|
|
225
226
|
const resourceUri = responseHeaders.get('Location');
|
|
226
|
-
return await (0, $
|
|
227
|
+
return await (0, $4861cda99f97e87d$export$2e2bcd8739ae039)(config)(resourceId, {
|
|
227
228
|
id: resourceUri
|
|
228
229
|
});
|
|
229
230
|
}
|
|
@@ -238,12 +239,12 @@ const $5a7a2f7583392866$var$createMethod = (config)=>async (resourceId, params)=
|
|
|
238
239
|
`
|
|
239
240
|
});
|
|
240
241
|
// Create must return the new data, so get them from the remote URI
|
|
241
|
-
return await (0, $
|
|
242
|
+
return await (0, $4861cda99f97e87d$export$2e2bcd8739ae039)(config)(resourceId, {
|
|
242
243
|
id: params.id
|
|
243
244
|
});
|
|
244
245
|
}
|
|
245
246
|
};
|
|
246
|
-
var $
|
|
247
|
+
var $d12d4cfb47175317$export$2e2bcd8739ae039 = $d12d4cfb47175317$var$createMethod;
|
|
247
248
|
|
|
248
249
|
|
|
249
250
|
const $9510970b8e7eb9e2$var$deleteMethod = (config)=>async (resourceId, params)=>{
|
|
@@ -260,7 +261,7 @@ const $9510970b8e7eb9e2$var$deleteMethod = (config)=>async (resourceId, params)=
|
|
|
260
261
|
var $9510970b8e7eb9e2$export$2e2bcd8739ae039 = $9510970b8e7eb9e2$var$deleteMethod;
|
|
261
262
|
|
|
262
263
|
|
|
263
|
-
const $
|
|
264
|
+
const $9b978ac85d859b57$var$deleteManyMethod = (config)=>async (resourceId, params)=>{
|
|
264
265
|
const { httpClient: httpClient } = config;
|
|
265
266
|
const ids = [];
|
|
266
267
|
for (const id of params.ids)try {
|
|
@@ -275,19 +276,19 @@ const $298dd1ae21173ea0$var$deleteManyMethod = (config)=>async (resourceId, para
|
|
|
275
276
|
data: ids
|
|
276
277
|
};
|
|
277
278
|
};
|
|
278
|
-
var $
|
|
279
|
+
var $9b978ac85d859b57$export$2e2bcd8739ae039 = $9b978ac85d859b57$var$deleteManyMethod;
|
|
279
280
|
|
|
280
281
|
|
|
281
|
-
const $
|
|
282
|
+
const $294fdd580f2e7246$var$getDataServers = (config)=>()=>{
|
|
282
283
|
return config.dataServers;
|
|
283
284
|
};
|
|
284
|
-
var $
|
|
285
|
+
var $294fdd580f2e7246$export$2e2bcd8739ae039 = $294fdd580f2e7246$var$getDataServers;
|
|
285
286
|
|
|
286
287
|
|
|
287
|
-
const $
|
|
288
|
+
const $52333268224773ef$var$getDataModels = (config)=>()=>{
|
|
288
289
|
return config.resources;
|
|
289
290
|
};
|
|
290
|
-
var $
|
|
291
|
+
var $52333268224773ef$export$2e2bcd8739ae039 = $52333268224773ef$var$getDataModels;
|
|
291
292
|
|
|
292
293
|
|
|
293
294
|
|
|
@@ -312,7 +313,7 @@ const $c83d324c3b433284$var$fetchSelectedResources = async (containers, excluded
|
|
|
312
313
|
let selectedResourcesUris = containers.filter((c)=>c.selectedResources).map((c)=>c.selectedResources).flat();
|
|
313
314
|
// Filter out resources which are already included in the SPARQL query results
|
|
314
315
|
selectedResourcesUris = selectedResourcesUris.filter((uri)=>!excludedResourcesUris.includes(uri));
|
|
315
|
-
const selectedResources = await Promise.all(selectedResourcesUris.map((resourceUri)=>(0, $
|
|
316
|
+
const selectedResources = await Promise.all(selectedResourcesUris.map((resourceUri)=>(0, $eadae1e342076a7b$export$2e2bcd8739ae039)(resourceUri, config)));
|
|
316
317
|
return selectedResources;
|
|
317
318
|
};
|
|
318
319
|
var $c83d324c3b433284$export$2e2bcd8739ae039 = $c83d324c3b433284$var$fetchSelectedResources;
|
|
@@ -404,7 +405,10 @@ const $aba124ea15ea8bc6$var$fetchContainers = async (containers, params, config)
|
|
|
404
405
|
});
|
|
405
406
|
// Sorting
|
|
406
407
|
if (params.sort) resources = resources.sort((a, b)=>{
|
|
407
|
-
|
|
408
|
+
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
|
|
409
|
+
if (params.sort.order === 'ASC') // @ts-expect-error TS(2532): Object is possibly 'undefined'.
|
|
410
|
+
return (a[params.sort.field] ?? '').localeCompare(b[params.sort.field] ?? '');
|
|
411
|
+
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
|
|
408
412
|
return (b[params.sort.field] ?? '').localeCompare(a[params.sort.field] ?? '');
|
|
409
413
|
});
|
|
410
414
|
// Pagination
|
|
@@ -419,7 +423,7 @@ var $aba124ea15ea8bc6$export$2e2bcd8739ae039 = $aba124ea15ea8bc6$var$fetchContai
|
|
|
419
423
|
|
|
420
424
|
|
|
421
425
|
|
|
422
|
-
const $
|
|
426
|
+
const $30358023049c31e9$var$getEmbedFrame = (blankNodes)=>{
|
|
423
427
|
let embedFrame = {};
|
|
424
428
|
let predicates;
|
|
425
429
|
if (blankNodes) {
|
|
@@ -430,7 +434,8 @@ const $3007d5479dd82d51$var$getEmbedFrame = (blankNodes)=>{
|
|
|
430
434
|
];
|
|
431
435
|
embedFrame = {
|
|
432
436
|
...embedFrame,
|
|
433
|
-
...predicates.reduce((accumulator
|
|
437
|
+
...predicates.reduce(// @ts-expect-error TS(7006): Parameter 'accumulator' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
438
|
+
(accumulator, predicate)=>({
|
|
434
439
|
[predicate]: {
|
|
435
440
|
'@embed': '@last',
|
|
436
441
|
...accumulator
|
|
@@ -441,7 +446,7 @@ const $3007d5479dd82d51$var$getEmbedFrame = (blankNodes)=>{
|
|
|
441
446
|
return embedFrame;
|
|
442
447
|
}
|
|
443
448
|
};
|
|
444
|
-
var $
|
|
449
|
+
var $30358023049c31e9$export$2e2bcd8739ae039 = $30358023049c31e9$var$getEmbedFrame;
|
|
445
450
|
|
|
446
451
|
|
|
447
452
|
|
|
@@ -462,22 +467,22 @@ const $4872a1c30c1fc60e$var$getUriFromPrefix = (item, ontologies)=>{
|
|
|
462
467
|
var $4872a1c30c1fc60e$export$2e2bcd8739ae039 = $4872a1c30c1fc60e$var$getUriFromPrefix;
|
|
463
468
|
|
|
464
469
|
|
|
465
|
-
const $
|
|
470
|
+
const $4e30f9af2d448bb4$var$defaultToArray = (value)=>!value ? [] : Array.isArray(value) ? value : [
|
|
466
471
|
value
|
|
467
472
|
];
|
|
468
473
|
// We need to always include the type or React-Admin will not work properly
|
|
469
|
-
const $
|
|
470
|
-
const $
|
|
474
|
+
const $4e30f9af2d448bb4$var$typeQuery = (0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable('s1'), (0, $fj9kP$rdfjsdatamodel).namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), (0, $fj9kP$rdfjsdatamodel).variable('type'));
|
|
475
|
+
const $4e30f9af2d448bb4$var$buildBaseQuery = (predicates, ontologies)=>{
|
|
471
476
|
let baseTriples;
|
|
472
477
|
if (predicates) {
|
|
473
|
-
baseTriples = $
|
|
478
|
+
baseTriples = $4e30f9af2d448bb4$var$defaultToArray(predicates).map((predicate, i)=>(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable('s1'), (0, $fj9kP$rdfjsdatamodel).namedNode((0, $4872a1c30c1fc60e$export$2e2bcd8739ae039)(predicate, ontologies)), (0, $fj9kP$rdfjsdatamodel).variable(`o${i + 1}`)));
|
|
474
479
|
return {
|
|
475
480
|
construct: [
|
|
476
|
-
$
|
|
481
|
+
$4e30f9af2d448bb4$var$typeQuery,
|
|
477
482
|
...baseTriples
|
|
478
483
|
],
|
|
479
484
|
where: [
|
|
480
|
-
$
|
|
485
|
+
$4e30f9af2d448bb4$var$typeQuery,
|
|
481
486
|
...baseTriples.map((triple)=>({
|
|
482
487
|
type: 'optional',
|
|
483
488
|
patterns: [
|
|
@@ -488,21 +493,22 @@ const $47d734d7812e6861$var$buildBaseQuery = (predicates, ontologies)=>{
|
|
|
488
493
|
};
|
|
489
494
|
}
|
|
490
495
|
baseTriples = [
|
|
491
|
-
(0, $fj9kP$
|
|
496
|
+
(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable('s1'), (0, $fj9kP$rdfjsdatamodel).variable('p1'), (0, $fj9kP$rdfjsdatamodel).variable('o1'))
|
|
492
497
|
];
|
|
493
498
|
return {
|
|
494
499
|
construct: baseTriples,
|
|
495
500
|
where: baseTriples
|
|
496
501
|
};
|
|
497
502
|
};
|
|
498
|
-
var $
|
|
503
|
+
var $4e30f9af2d448bb4$export$2e2bcd8739ae039 = $4e30f9af2d448bb4$var$buildBaseQuery;
|
|
499
504
|
|
|
500
505
|
|
|
506
|
+
// @ts-expect-error TS(7016): Could not find a declaration file for module 'cryp... Remove this comment to see the full error message
|
|
501
507
|
|
|
502
508
|
|
|
503
509
|
|
|
504
510
|
// Transform ['ont:predicate1/ont:predicate2'] to ['ont:predicate1', 'ont:predicate1/ont:predicate2']
|
|
505
|
-
const $
|
|
511
|
+
const $8ad7b5ebbca2bb3e$var$extractNodes = (blankNodes)=>{
|
|
506
512
|
const nodes = [];
|
|
507
513
|
if (blankNodes) {
|
|
508
514
|
for (const predicate of blankNodes)if (predicate.includes('/')) {
|
|
@@ -512,10 +518,10 @@ const $865f630cc944e818$var$extractNodes = (blankNodes)=>{
|
|
|
512
518
|
}
|
|
513
519
|
return nodes;
|
|
514
520
|
};
|
|
515
|
-
const $
|
|
516
|
-
const $
|
|
517
|
-
const $
|
|
518
|
-
const $
|
|
521
|
+
const $8ad7b5ebbca2bb3e$var$generateSparqlVarName = (node)=>(0, $fj9kP$cryptojsmd5)(node);
|
|
522
|
+
const $8ad7b5ebbca2bb3e$var$getParentNode = (node)=>node.includes('/') && node.split('/')[0];
|
|
523
|
+
const $8ad7b5ebbca2bb3e$var$getPredicate = (node)=>node.includes('/') ? node.split('/')[1] : node;
|
|
524
|
+
const $8ad7b5ebbca2bb3e$var$buildUnionQuery = (queries)=>queries.map((q)=>{
|
|
519
525
|
let triples = q.query;
|
|
520
526
|
const firstTriple = queries.find((q2)=>q.parentNode === q2.node);
|
|
521
527
|
if (firstTriple !== undefined) triples = triples.concat(firstTriple.query[0]);
|
|
@@ -524,18 +530,18 @@ const $865f630cc944e818$var$buildUnionQuery = (queries)=>queries.map((q)=>{
|
|
|
524
530
|
triples: triples
|
|
525
531
|
};
|
|
526
532
|
});
|
|
527
|
-
const $
|
|
533
|
+
const $8ad7b5ebbca2bb3e$var$buildBlankNodesQuery = (blankNodes, baseQuery, ontologies)=>{
|
|
528
534
|
const queries = [];
|
|
529
|
-
const nodes = $
|
|
535
|
+
const nodes = $8ad7b5ebbca2bb3e$var$extractNodes(blankNodes);
|
|
530
536
|
if (nodes && ontologies && ontologies.length > 0) {
|
|
531
537
|
for (const node of nodes){
|
|
532
|
-
const parentNode = $
|
|
533
|
-
const predicate = $
|
|
534
|
-
const varName = $
|
|
535
|
-
const parentVarName = parentNode ? $
|
|
538
|
+
const parentNode = $8ad7b5ebbca2bb3e$var$getParentNode(node);
|
|
539
|
+
const predicate = $8ad7b5ebbca2bb3e$var$getPredicate(node);
|
|
540
|
+
const varName = $8ad7b5ebbca2bb3e$var$generateSparqlVarName(node);
|
|
541
|
+
const parentVarName = parentNode ? $8ad7b5ebbca2bb3e$var$generateSparqlVarName(parentNode) : '1';
|
|
536
542
|
const query = [
|
|
537
|
-
(0, $fj9kP$
|
|
538
|
-
(0, $fj9kP$
|
|
543
|
+
(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable(`s${parentVarName}`), (0, $fj9kP$rdfjsdatamodel).namedNode((0, $4872a1c30c1fc60e$export$2e2bcd8739ae039)(predicate, ontologies)), (0, $fj9kP$rdfjsdatamodel).variable(`s${varName}`)),
|
|
544
|
+
(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable(`s${varName}`), (0, $fj9kP$rdfjsdatamodel).variable(`p${varName}`), (0, $fj9kP$rdfjsdatamodel).variable(`o${varName}`))
|
|
539
545
|
];
|
|
540
546
|
queries.push({
|
|
541
547
|
node: node,
|
|
@@ -550,7 +556,7 @@ const $865f630cc944e818$var$buildBlankNodesQuery = (blankNodes, baseQuery, ontol
|
|
|
550
556
|
type: 'union',
|
|
551
557
|
patterns: [
|
|
552
558
|
baseQuery.where,
|
|
553
|
-
...$
|
|
559
|
+
...$8ad7b5ebbca2bb3e$var$buildUnionQuery(queries)
|
|
554
560
|
]
|
|
555
561
|
}
|
|
556
562
|
};
|
|
@@ -560,11 +566,11 @@ const $865f630cc944e818$var$buildBlankNodesQuery = (blankNodes, baseQuery, ontol
|
|
|
560
566
|
where: ''
|
|
561
567
|
};
|
|
562
568
|
};
|
|
563
|
-
var $
|
|
569
|
+
var $8ad7b5ebbca2bb3e$export$2e2bcd8739ae039 = $8ad7b5ebbca2bb3e$var$buildBlankNodesQuery;
|
|
564
570
|
|
|
565
571
|
|
|
566
572
|
|
|
567
|
-
const $
|
|
573
|
+
const $6aa919fd3fcf3e9c$var$buildAutoDetectBlankNodesQuery = (depth, baseQuery)=>{
|
|
568
574
|
const construct = [
|
|
569
575
|
...baseQuery.construct
|
|
570
576
|
];
|
|
@@ -575,7 +581,7 @@ const $efbe3fa6f1479c06$var$buildAutoDetectBlankNodesQuery = (depth, baseQuery)=
|
|
|
575
581
|
baseQuery.where
|
|
576
582
|
]);
|
|
577
583
|
for(let i = 1; i <= depth; i++){
|
|
578
|
-
construct.push((0, $fj9kP$
|
|
584
|
+
construct.push((0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable(`o${i}`), (0, $fj9kP$rdfjsdatamodel).variable(`p${i + 1}`), (0, $fj9kP$rdfjsdatamodel).variable(`o${i + 1}`)));
|
|
579
585
|
whereQueries.push([
|
|
580
586
|
...whereQueries[whereQueries.length - 1],
|
|
581
587
|
{
|
|
@@ -584,11 +590,11 @@ const $efbe3fa6f1479c06$var$buildAutoDetectBlankNodesQuery = (depth, baseQuery)=
|
|
|
584
590
|
type: 'operation',
|
|
585
591
|
operator: 'isblank',
|
|
586
592
|
args: [
|
|
587
|
-
(0, $fj9kP$variable
|
|
593
|
+
(0, $fj9kP$rdfjsdatamodel).variable(`o${i}`)
|
|
588
594
|
]
|
|
589
595
|
}
|
|
590
596
|
},
|
|
591
|
-
(0, $fj9kP$
|
|
597
|
+
(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable(`o${i}`), (0, $fj9kP$rdfjsdatamodel).variable(`p${i + 1}`), (0, $fj9kP$rdfjsdatamodel).variable(`o${i + 1}`))
|
|
592
598
|
]);
|
|
593
599
|
}
|
|
594
600
|
where = {
|
|
@@ -602,16 +608,15 @@ const $efbe3fa6f1479c06$var$buildAutoDetectBlankNodesQuery = (depth, baseQuery)=
|
|
|
602
608
|
where: where
|
|
603
609
|
};
|
|
604
610
|
};
|
|
605
|
-
var $
|
|
611
|
+
var $6aa919fd3fcf3e9c$export$2e2bcd8739ae039 = $6aa919fd3fcf3e9c$var$buildAutoDetectBlankNodesQuery;
|
|
606
612
|
|
|
607
613
|
|
|
608
614
|
|
|
609
615
|
|
|
610
|
-
var $
|
|
611
|
-
const
|
|
612
|
-
const $6cde9a8fbbde3ffb$var$generator = new $6cde9a8fbbde3ffb$require$SparqlGenerator({
|
|
616
|
+
var $dcde11998342d30d$require$SparqlGenerator = $fj9kP$Generator;
|
|
617
|
+
const $dcde11998342d30d$var$generator = new $dcde11998342d30d$require$SparqlGenerator({
|
|
613
618
|
});
|
|
614
|
-
const $
|
|
619
|
+
const $dcde11998342d30d$var$reservedFilterKeys = [
|
|
615
620
|
'q',
|
|
616
621
|
'sparqlWhere',
|
|
617
622
|
'blankNodes',
|
|
@@ -619,7 +624,7 @@ const $6cde9a8fbbde3ffb$var$reservedFilterKeys = [
|
|
|
619
624
|
'_servers',
|
|
620
625
|
'_predicates'
|
|
621
626
|
];
|
|
622
|
-
const $
|
|
627
|
+
const $dcde11998342d30d$var$buildSparqlQuery = ({ containersUris: containersUris, params: params, dataModel: dataModel, ontologies: ontologies })=>{
|
|
623
628
|
const blankNodes = params.filter?.blankNodes || dataModel.list?.blankNodes;
|
|
624
629
|
const predicates = params.filter?._predicates || dataModel.list?.predicates;
|
|
625
630
|
const blankNodesDepth = params.filter?.blankNodesDepth ?? dataModel.list?.blankNodesDepth ?? 2;
|
|
@@ -627,7 +632,7 @@ const $6cde9a8fbbde3ffb$var$buildSparqlQuery = ({ containersUris: containersUris
|
|
|
627
632
|
...dataModel.list?.filter,
|
|
628
633
|
...params.filter
|
|
629
634
|
};
|
|
630
|
-
const baseQuery = (0, $
|
|
635
|
+
const baseQuery = (0, $4e30f9af2d448bb4$export$2e2bcd8739ae039)(predicates, ontologies);
|
|
631
636
|
const sparqlJsParams = {
|
|
632
637
|
queryType: 'CONSTRUCT',
|
|
633
638
|
template: baseQuery.construct,
|
|
@@ -639,17 +644,17 @@ const $6cde9a8fbbde3ffb$var$buildSparqlQuery = ({ containersUris: containersUris
|
|
|
639
644
|
{
|
|
640
645
|
type: 'values',
|
|
641
646
|
values: containersUris.map((containerUri)=>({
|
|
642
|
-
'?containerUri': $
|
|
647
|
+
'?containerUri': (0, $fj9kP$rdfjsdatamodel).namedNode(containerUri)
|
|
643
648
|
}))
|
|
644
649
|
},
|
|
645
|
-
$
|
|
650
|
+
(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable('containerUri'), (0, $fj9kP$rdfjsdatamodel).namedNode('http://www.w3.org/ns/ldp#contains'), (0, $fj9kP$rdfjsdatamodel).variable('s1')),
|
|
646
651
|
{
|
|
647
652
|
type: 'filter',
|
|
648
653
|
expression: {
|
|
649
654
|
type: 'operation',
|
|
650
655
|
operator: 'isiri',
|
|
651
656
|
args: [
|
|
652
|
-
$
|
|
657
|
+
(0, $fj9kP$rdfjsdatamodel).variable('s1')
|
|
653
658
|
]
|
|
654
659
|
}
|
|
655
660
|
}
|
|
@@ -661,10 +666,10 @@ const $6cde9a8fbbde3ffb$var$buildSparqlQuery = ({ containersUris: containersUris
|
|
|
661
666
|
{
|
|
662
667
|
"sparqlWhere": {
|
|
663
668
|
"type": "bgp",
|
|
664
|
-
"
|
|
665
|
-
"subject": {"termType": "
|
|
669
|
+
"rdf.quads": [{
|
|
670
|
+
"subject": {"termType": "rdf.variable", "value": "s1"},
|
|
666
671
|
"predicate": {"termType": "NameNode", "value": "http://virtual-assembly.org/ontologies/pair#label"},
|
|
667
|
-
"object": {"termType": "
|
|
672
|
+
"object": {"termType": "rdf.literal", "value": "My Organization"}
|
|
668
673
|
}]
|
|
669
674
|
}
|
|
670
675
|
}
|
|
@@ -681,17 +686,17 @@ const $6cde9a8fbbde3ffb$var$buildSparqlQuery = ({ containersUris: containersUris
|
|
|
681
686
|
{
|
|
682
687
|
queryType: 'SELECT',
|
|
683
688
|
variables: [
|
|
684
|
-
$
|
|
689
|
+
(0, $fj9kP$rdfjsdatamodel).variable('s1')
|
|
685
690
|
],
|
|
686
691
|
where: [
|
|
687
|
-
$
|
|
692
|
+
(0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable('s1'), (0, $fj9kP$rdfjsdatamodel).variable('p1'), (0, $fj9kP$rdfjsdatamodel).variable('o1')),
|
|
688
693
|
{
|
|
689
694
|
type: 'filter',
|
|
690
695
|
expression: {
|
|
691
696
|
type: 'operation',
|
|
692
697
|
operator: 'isliteral',
|
|
693
698
|
args: [
|
|
694
|
-
$
|
|
699
|
+
(0, $fj9kP$rdfjsdatamodel).variable('o1')
|
|
695
700
|
]
|
|
696
701
|
}
|
|
697
702
|
},
|
|
@@ -709,12 +714,13 @@ const $6cde9a8fbbde3ffb$var$buildSparqlQuery = ({ containersUris: containersUris
|
|
|
709
714
|
type: 'operation',
|
|
710
715
|
operator: 'str',
|
|
711
716
|
args: [
|
|
712
|
-
$
|
|
717
|
+
(0, $fj9kP$rdfjsdatamodel).variable('o1')
|
|
713
718
|
]
|
|
714
719
|
}
|
|
715
720
|
]
|
|
716
721
|
},
|
|
717
|
-
|
|
722
|
+
// @ts-expect-error TS(2554): Expected 1-2 arguments, but got 3.
|
|
723
|
+
(0, $fj9kP$rdfjsdatamodel).literal(filter.q.toLowerCase(), '', (0, $fj9kP$rdfjsdatamodel).namedNode('http://www.w3.org/2001/XMLSchema#string'))
|
|
718
724
|
]
|
|
719
725
|
}
|
|
720
726
|
}
|
|
@@ -727,23 +733,27 @@ const $6cde9a8fbbde3ffb$var$buildSparqlQuery = ({ containersUris: containersUris
|
|
|
727
733
|
// SPARQL keyword a = filter based on the class of a resource (example => 'a': 'pair:OrganizationType')
|
|
728
734
|
// Other filters are based on a value (example => 'petr:hasAudience': 'http://localhost:3000/audiences/tout-public')
|
|
729
735
|
Object.entries(filter).forEach(([predicate, object])=>{
|
|
730
|
-
if (!$
|
|
736
|
+
if (!$dcde11998342d30d$var$reservedFilterKeys.includes(predicate)) resourceWhere.unshift((0, $fj9kP$rdfjsdatamodel).quad((0, $fj9kP$rdfjsdatamodel).variable('s1'), (0, $fj9kP$rdfjsdatamodel).namedNode((0, $4872a1c30c1fc60e$export$2e2bcd8739ae039)(predicate, ontologies)), // @ts-expect-error TS(2345): Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message
|
|
737
|
+
(0, $fj9kP$rdfjsdatamodel).namedNode((0, $4872a1c30c1fc60e$export$2e2bcd8739ae039)(object, ontologies))));
|
|
731
738
|
});
|
|
732
739
|
}
|
|
733
740
|
// Blank nodes
|
|
734
|
-
const blankNodesQuery = blankNodes ? (0, $
|
|
741
|
+
const blankNodesQuery = blankNodes ? (0, $8ad7b5ebbca2bb3e$export$2e2bcd8739ae039)(blankNodes, baseQuery, ontologies) : (0, $6aa919fd3fcf3e9c$export$2e2bcd8739ae039)(blankNodesDepth, baseQuery);
|
|
735
742
|
if (blankNodesQuery && blankNodesQuery.construct) {
|
|
743
|
+
// @ts-expect-error TS(2769): No overload matches this call.
|
|
736
744
|
resourceWhere = resourceWhere.concat(blankNodesQuery.where);
|
|
745
|
+
// @ts-expect-error TS(2769): No overload matches this call.
|
|
737
746
|
sparqlJsParams.template = sparqlJsParams.template.concat(blankNodesQuery.construct);
|
|
738
747
|
} else resourceWhere.push(baseQuery.where);
|
|
748
|
+
// @ts-expect-error TS(2345): Argument of type '(uad | { type: string; values: ... Remove this comment to see the full error message
|
|
739
749
|
sparqlJsParams.where.push(containerWhere, resourceWhere);
|
|
740
|
-
return $
|
|
750
|
+
return $dcde11998342d30d$var$generator.stringify(sparqlJsParams);
|
|
741
751
|
};
|
|
742
|
-
var $
|
|
752
|
+
var $dcde11998342d30d$export$2e2bcd8739ae039 = $dcde11998342d30d$var$buildSparqlQuery;
|
|
743
753
|
|
|
744
754
|
|
|
745
755
|
|
|
746
|
-
const $
|
|
756
|
+
const $4aa3fb2e83f6c3a3$var$compare = (a, b)=>{
|
|
747
757
|
switch(typeof a){
|
|
748
758
|
case 'string':
|
|
749
759
|
return a.localeCompare(b);
|
|
@@ -753,7 +763,7 @@ const $05a1b4063d50f1b7$var$compare = (a, b)=>{
|
|
|
753
763
|
return 0;
|
|
754
764
|
}
|
|
755
765
|
};
|
|
756
|
-
const $
|
|
766
|
+
const $4aa3fb2e83f6c3a3$var$fetchSparqlEndpoints = async (containers, resourceId, params, config)=>{
|
|
757
767
|
const { dataServers: dataServers, httpClient: httpClient, jsonContext: jsonContext, ontologies: ontologies } = config;
|
|
758
768
|
const dataModel = config.resources[resourceId];
|
|
759
769
|
// Find servers to query with SPARQL
|
|
@@ -765,7 +775,7 @@ const $05a1b4063d50f1b7$var$fetchSparqlEndpoints = async (containers, resourceId
|
|
|
765
775
|
// Run simultaneous SPARQL queries
|
|
766
776
|
const results = await Promise.all(serversToQuery.map((serverKey)=>new Promise((resolve, reject)=>{
|
|
767
777
|
const blankNodes = params.filter?.blankNodes || dataModel.list?.blankNodes;
|
|
768
|
-
const sparqlQuery = (0, $
|
|
778
|
+
const sparqlQuery = (0, $dcde11998342d30d$export$2e2bcd8739ae039)({
|
|
769
779
|
containersUris: containers.filter((c)=>c.server === serverKey && !c.selectedResources).map((c)=>c.uri),
|
|
770
780
|
params: params,
|
|
771
781
|
dataModel: dataModel,
|
|
@@ -782,7 +792,7 @@ const $05a1b4063d50f1b7$var$fetchSparqlEndpoints = async (containers, resourceId
|
|
|
782
792
|
'@context': jsonContext,
|
|
783
793
|
'@type': dataModel.types,
|
|
784
794
|
'@embed': '@never',
|
|
785
|
-
...(0, $
|
|
795
|
+
...(0, $30358023049c31e9$export$2e2bcd8739ae039)(blankNodes)
|
|
786
796
|
} : {
|
|
787
797
|
'@context': jsonContext,
|
|
788
798
|
'@type': dataModel.types
|
|
@@ -824,8 +834,8 @@ const $05a1b4063d50f1b7$var$fetchSparqlEndpoints = async (containers, resourceId
|
|
|
824
834
|
// TODO sort and paginate the results in the SPARQL query to improve performances
|
|
825
835
|
if (params.sort) returnData = returnData.sort((a, b)=>{
|
|
826
836
|
if (a[params.sort.field] !== undefined && b[params.sort.field] !== undefined) {
|
|
827
|
-
if (params.sort.order === 'ASC') return $
|
|
828
|
-
return $
|
|
837
|
+
if (params.sort.order === 'ASC') return $4aa3fb2e83f6c3a3$var$compare(a[params.sort.field], b[params.sort.field]);
|
|
838
|
+
return $4aa3fb2e83f6c3a3$var$compare(b[params.sort.field], a[params.sort.field]);
|
|
829
839
|
}
|
|
830
840
|
return 0;
|
|
831
841
|
});
|
|
@@ -835,7 +845,7 @@ const $05a1b4063d50f1b7$var$fetchSparqlEndpoints = async (containers, resourceId
|
|
|
835
845
|
total: results.length
|
|
836
846
|
};
|
|
837
847
|
};
|
|
838
|
-
var $
|
|
848
|
+
var $4aa3fb2e83f6c3a3$export$2e2bcd8739ae039 = $4aa3fb2e83f6c3a3$var$fetchSparqlEndpoints;
|
|
839
849
|
|
|
840
850
|
|
|
841
851
|
|
|
@@ -869,15 +879,15 @@ const $1caf729dc3ce856d$var$getListMethod = (config)=>async (resourceId, params)
|
|
|
869
879
|
else // Otherwise find the container URIs on the given servers (either in the filter or the data model)
|
|
870
880
|
containers = (0, $15b841e67a1ba752$export$2e2bcd8739ae039)((0, $cc8adac4b83414eb$export$2e2bcd8739ae039)(dataModel.types), params?.filter?._servers || dataModel.list?.servers, dataServers);
|
|
871
881
|
if (dataModel.list?.fetchContainer) return (0, $aba124ea15ea8bc6$export$2e2bcd8739ae039)(containers, params, config);
|
|
872
|
-
else return (0, $
|
|
882
|
+
else return (0, $4aa3fb2e83f6c3a3$export$2e2bcd8739ae039)(containers, resourceId, params, config);
|
|
873
883
|
};
|
|
874
884
|
var $1caf729dc3ce856d$export$2e2bcd8739ae039 = $1caf729dc3ce856d$var$getListMethod;
|
|
875
885
|
|
|
876
886
|
|
|
877
887
|
|
|
878
|
-
const $
|
|
888
|
+
const $4704ee0f6c5ac80d$var$getManyMethod = (config)=>async (resourceId, params)=>{
|
|
879
889
|
const { returnFailedResources: returnFailedResources } = config;
|
|
880
|
-
let returnData = await Promise.all(params.ids.map((id)=>(0, $
|
|
890
|
+
let returnData = await Promise.all(params.ids.map((id)=>(0, $4861cda99f97e87d$export$2e2bcd8739ae039)(config)(resourceId, {
|
|
881
891
|
id: typeof id === 'object' ? id['@id'] : id
|
|
882
892
|
}).then(({ data: data })=>data).catch(()=>{
|
|
883
893
|
// Catch if one resource fails to load
|
|
@@ -895,19 +905,20 @@ const $f1e05270f9a21255$var$getManyMethod = (config)=>async (resourceId, params)
|
|
|
895
905
|
data: returnData
|
|
896
906
|
};
|
|
897
907
|
};
|
|
898
|
-
var $
|
|
908
|
+
var $4704ee0f6c5ac80d$export$2e2bcd8739ae039 = $4704ee0f6c5ac80d$var$getManyMethod;
|
|
899
909
|
|
|
900
910
|
|
|
901
911
|
|
|
902
|
-
const $
|
|
912
|
+
const $ca9c98aad8d79793$var$getManyReferenceMethod = (config)=>async (resourceId, params)=>{
|
|
903
913
|
params.filter = {
|
|
904
914
|
...params.filter,
|
|
905
915
|
[params.target]: params.id
|
|
906
916
|
};
|
|
917
|
+
// @ts-expect-error ts(2790): The operand of a 'delete' operator must be optional.
|
|
907
918
|
delete params.target;
|
|
908
919
|
return await (0, $1caf729dc3ce856d$export$2e2bcd8739ae039)(config)(resourceId, params);
|
|
909
920
|
};
|
|
910
|
-
var $
|
|
921
|
+
var $ca9c98aad8d79793$export$2e2bcd8739ae039 = $ca9c98aad8d79793$var$getManyReferenceMethod;
|
|
911
922
|
|
|
912
923
|
|
|
913
924
|
|
|
@@ -951,7 +962,7 @@ var $cdfdce6efa87baab$export$2e2bcd8739ae039 = $cdfdce6efa87baab$var$patchMethod
|
|
|
951
962
|
|
|
952
963
|
|
|
953
964
|
// Return the first server matching with the baseUrl
|
|
954
|
-
const $
|
|
965
|
+
const $2ae722513e522d60$var$getServerKeyFromUri = (uri, dataServers)=>{
|
|
955
966
|
if (!uri) throw Error(`No URI provided to getServerKeyFromUri`);
|
|
956
967
|
return dataServers && Object.keys(dataServers).find((key)=>{
|
|
957
968
|
if (dataServers[key].pod) // The baseUrl ends with /data so remove this part to match with the webId and webId-related URLs (/inbox, /outbox...)
|
|
@@ -959,12 +970,12 @@ const $47e21ee81eed09a6$var$getServerKeyFromUri = (uri, dataServers)=>{
|
|
|
959
970
|
return uri.startsWith(dataServers[key].baseUrl);
|
|
960
971
|
});
|
|
961
972
|
};
|
|
962
|
-
var $
|
|
973
|
+
var $2ae722513e522d60$export$2e2bcd8739ae039 = $2ae722513e522d60$var$getServerKeyFromUri;
|
|
963
974
|
|
|
964
975
|
|
|
965
976
|
const $c5031381f4dfc62d$var$updateMethod = (config)=>async (resourceId, params)=>{
|
|
966
977
|
const { httpClient: httpClient, jsonContext: jsonContext, dataServers: dataServers } = config;
|
|
967
|
-
const serverKey = (0, $
|
|
978
|
+
const serverKey = (0, $2ae722513e522d60$export$2e2bcd8739ae039)(params.id, dataServers);
|
|
968
979
|
// Upload files, if there are any
|
|
969
980
|
const { updatedRecord: updatedRecord } = await (0, $b17c43e3301545ca$export$2e2bcd8739ae039).upload(params.data, config, serverKey);
|
|
970
981
|
params.data = updatedRecord;
|
|
@@ -985,40 +996,43 @@ var $c5031381f4dfc62d$export$2e2bcd8739ae039 = $c5031381f4dfc62d$var$updateMetho
|
|
|
985
996
|
|
|
986
997
|
|
|
987
998
|
|
|
988
|
-
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
|
|
999
|
+
/**
|
|
1000
|
+
*
|
|
1001
|
+
* @param dataServers Data servers configuration
|
|
1002
|
+
* @param fetchFn The fetch function to use for the actual fetch call, e.g. `fetchUtils.fetchJson` or `fetch`
|
|
1003
|
+
* @returns
|
|
1004
|
+
*/ const $00b6445d7042c29d$var$fetchBase = (dataServers, fetchFn)=>(url, options = {})=>{
|
|
992
1005
|
if (!url) throw new Error(`No URL provided on httpClient call`);
|
|
993
|
-
const authServerKey = (0, $
|
|
994
|
-
const serverKey = (0, $
|
|
995
|
-
const useProxy = serverKey !== authServerKey &&
|
|
996
|
-
|
|
1006
|
+
const authServerKey = (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('authServer', dataServers);
|
|
1007
|
+
const serverKey = (0, $2ae722513e522d60$export$2e2bcd8739ae039)(url, dataServers);
|
|
1008
|
+
const useProxy = serverKey !== authServerKey && // The server is different from the auth server.
|
|
1009
|
+
!!dataServers[authServerKey]?.proxyUrl && // A proxy URL is configured on the auth server.
|
|
1010
|
+
dataServers[serverKey]?.noProxy !== true; // The server does not explicitly disable the proxy.
|
|
1011
|
+
const headers = new Headers(options.headers);
|
|
997
1012
|
switch(options.method){
|
|
998
1013
|
case 'POST':
|
|
999
1014
|
case 'PATCH':
|
|
1000
1015
|
case 'PUT':
|
|
1001
|
-
if (!
|
|
1002
|
-
if (!
|
|
1016
|
+
if (!headers.has('Accept')) headers.set('Accept', 'application/ld+json');
|
|
1017
|
+
if (!headers.has('Content-Type')) headers.set('Content-Type', 'application/ld+json');
|
|
1003
1018
|
break;
|
|
1004
1019
|
case 'DELETE':
|
|
1005
1020
|
break;
|
|
1006
1021
|
case 'GET':
|
|
1007
1022
|
default:
|
|
1008
|
-
if (!
|
|
1023
|
+
if (!headers.has('Accept')) headers.set('Accept', 'application/ld+json');
|
|
1009
1024
|
break;
|
|
1010
1025
|
}
|
|
1011
1026
|
if (useProxy) {
|
|
1027
|
+
// To the proxy endpoint, we post the URL, method, headers and body (if any) as multipart/form-data.
|
|
1012
1028
|
const formData = new FormData();
|
|
1013
1029
|
formData.append('id', url);
|
|
1014
1030
|
formData.append('method', options.method || 'GET');
|
|
1015
|
-
formData.append('headers', JSON.stringify(Object.fromEntries(
|
|
1016
|
-
if (options.body)
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
// Post to proxy endpoint with multipart/form-data format
|
|
1021
|
-
return (0, $fj9kP$fetchUtils).fetchJson(dataServers[authServerKey].proxyUrl, {
|
|
1031
|
+
formData.append('headers', JSON.stringify(Object.fromEntries(headers.entries())));
|
|
1032
|
+
if (options.body instanceof File) formData.append('body', options.body, options.body.name);
|
|
1033
|
+
else if (options.body instanceof Blob || typeof options.body === 'string') formData.append('body', options.body);
|
|
1034
|
+
// POST request to proxy endpoint.
|
|
1035
|
+
return fetchFn(dataServers[authServerKey].proxyUrl, {
|
|
1022
1036
|
method: 'POST',
|
|
1023
1037
|
headers: new Headers({
|
|
1024
1038
|
Authorization: `Bearer ${localStorage.getItem('token')}`
|
|
@@ -1026,14 +1040,39 @@ var $c5031381f4dfc62d$export$2e2bcd8739ae039 = $c5031381f4dfc62d$var$updateMetho
|
|
|
1026
1040
|
body: formData
|
|
1027
1041
|
});
|
|
1028
1042
|
}
|
|
1029
|
-
// Add token if the server is the same as the auth server
|
|
1043
|
+
// Add token if the server is the same as the auth server.
|
|
1030
1044
|
if (serverKey === authServerKey) {
|
|
1031
1045
|
const token = localStorage.getItem('token');
|
|
1032
|
-
if (token)
|
|
1046
|
+
if (token) headers.set('Authorization', `Bearer ${token}`);
|
|
1033
1047
|
}
|
|
1034
|
-
|
|
1048
|
+
options.headers = headers;
|
|
1049
|
+
return fetchFn(url, options);
|
|
1050
|
+
};
|
|
1051
|
+
/**
|
|
1052
|
+
* Creates a fetch function that can be used to make calls to the data servers and which returns data formatted as JSON.
|
|
1053
|
+
* It will use the proxy endpoint if available and if the server is different from the auth server.
|
|
1054
|
+
* It will also set the Accept and Content-Type headers to `application/ld+json` for `POST`, `PATCH`, `PUT` and `GET` requests.
|
|
1055
|
+
* @param dataServers Data servers configuration
|
|
1056
|
+
* @returns A function with react-admin's fetchJson signature that can be used to make calls to the data servers.
|
|
1057
|
+
*
|
|
1058
|
+
*/ const $00b6445d7042c29d$export$5ff1805767bd358a = (dataServers)=>{
|
|
1059
|
+
const fetchBaseFn = $00b6445d7042c29d$var$fetchBase(dataServers, (0, $fj9kP$fetchUtils).fetchJson);
|
|
1060
|
+
return (url, options)=>{
|
|
1061
|
+
return fetchBaseFn(url, options);
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
/**
|
|
1065
|
+
* Creates an authenticated fetch function that can be used to make calls to the data servers.
|
|
1066
|
+
* It will use the proxy endpoint if available and if the server is different from the auth server.
|
|
1067
|
+
* @param dataServers Data servers configuration
|
|
1068
|
+
* @returns A function that can be used to make authenticated fetch calls.
|
|
1069
|
+
*/ const $00b6445d7042c29d$export$1ac69e0fa5b5498b = (dataServers)=>{
|
|
1070
|
+
const fetchBaseFn = $00b6445d7042c29d$var$fetchBase(dataServers, fetch);
|
|
1071
|
+
const fetchFunction = (url, options)=>{
|
|
1072
|
+
return fetchBaseFn(url, options);
|
|
1035
1073
|
};
|
|
1036
|
-
|
|
1074
|
+
return fetchFunction;
|
|
1075
|
+
};
|
|
1037
1076
|
|
|
1038
1077
|
|
|
1039
1078
|
|
|
@@ -1099,7 +1138,10 @@ const $ab7d38fd091ff1b6$var$getTypesFromShapeTree = async (shapeTreeUri)=>{
|
|
|
1099
1138
|
var $ab7d38fd091ff1b6$export$2e2bcd8739ae039 = $ab7d38fd091ff1b6$var$getTypesFromShapeTree;
|
|
1100
1139
|
|
|
1101
1140
|
|
|
1102
|
-
|
|
1141
|
+
/**
|
|
1142
|
+
* For data server containers, expands types and adds `uri` and `server` properties.
|
|
1143
|
+
* For resources, expands types (if applicable from shape tree information).
|
|
1144
|
+
*/ const $33bf2a661b5c0cbd$var$normalizeConfig = async (config)=>{
|
|
1103
1145
|
const newConfig = {
|
|
1104
1146
|
...config
|
|
1105
1147
|
};
|
|
@@ -1151,64 +1193,89 @@ const $143de1c1f21344e7$var$getOntologiesFromContext = async (context)=>{
|
|
|
1151
1193
|
var $143de1c1f21344e7$export$2e2bcd8739ae039 = $143de1c1f21344e7$var$getOntologiesFromContext;
|
|
1152
1194
|
|
|
1153
1195
|
|
|
1154
|
-
|
|
1196
|
+
const $9808be090468fc68$var$dataProvider = (originalConfig)=>{
|
|
1155
1197
|
// Keep in memory for refresh
|
|
1156
|
-
let config
|
|
1157
|
-
...originalConfig
|
|
1158
|
-
};
|
|
1198
|
+
let config;
|
|
1159
1199
|
const prepareConfig = async ()=>{
|
|
1200
|
+
const fetchJson = (0, $00b6445d7042c29d$export$5ff1805767bd358a)(originalConfig.dataServers);
|
|
1201
|
+
const authFetchFn = (0, $00b6445d7042c29d$export$1ac69e0fa5b5498b)(originalConfig.dataServers);
|
|
1202
|
+
const dataset = (0, $fj9kP$createConnectedLdoDataset)([
|
|
1203
|
+
(0, $fj9kP$solidConnectedPlugin)
|
|
1204
|
+
]);
|
|
1205
|
+
dataset.setContext('solid', {
|
|
1206
|
+
fetch: authFetchFn
|
|
1207
|
+
});
|
|
1208
|
+
config = {
|
|
1209
|
+
...originalConfig,
|
|
1210
|
+
httpClient: fetchJson,
|
|
1211
|
+
authFetch: authFetchFn,
|
|
1212
|
+
dataset: dataset
|
|
1213
|
+
};
|
|
1160
1214
|
config.dataServers ??= {};
|
|
1161
|
-
//
|
|
1162
|
-
|
|
1163
|
-
|
|
1215
|
+
// Load plugins.
|
|
1216
|
+
for (const plugin of config.plugins){
|
|
1217
|
+
if (plugin.transformConfig) try {
|
|
1218
|
+
config = await plugin.transformConfig(config);
|
|
1219
|
+
} catch (error) {
|
|
1220
|
+
console.error('Error setting up data provider plugin', plugin.name, error);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
// Configure httpClient & authFetch again with possibly updated data servers
|
|
1224
|
+
config.httpClient = (0, $00b6445d7042c29d$export$5ff1805767bd358a)(config.dataServers);
|
|
1225
|
+
config.authFetch = (0, $00b6445d7042c29d$export$1ac69e0fa5b5498b)(config.dataServers);
|
|
1226
|
+
dataset.setContext('solid', {
|
|
1227
|
+
fetch: config.authFetch
|
|
1228
|
+
});
|
|
1229
|
+
// Create the LDO dataset with the solidConnectedPlugin. It will be used to manage the RDF data.
|
|
1230
|
+
config.dataset = dataset;
|
|
1231
|
+
// Useful for debugging: Attach httpClient & authFetch to global document.
|
|
1232
|
+
// @ts-expect-error TS(2339)
|
|
1164
1233
|
document.httpClient = config.httpClient;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
config.httpClient = (0, $22b4895a4ca7d626$export$2e2bcd8739ae039)(config.dataServers);
|
|
1234
|
+
// @ts-expect-error TS(2339)
|
|
1235
|
+
document.authFetch = authFetchFn;
|
|
1168
1236
|
if (!config.ontologies && config.jsonContext) config.ontologies = await (0, $143de1c1f21344e7$export$2e2bcd8739ae039)(config.jsonContext);
|
|
1169
1237
|
else if (!config.jsonContext && config.ontologies) config.jsonContext = config.ontologies;
|
|
1170
1238
|
else if (!config.jsonContext && !config.ontologies) throw new Error(`Either the JSON context or the ontologies must be set`);
|
|
1171
1239
|
if (!config.returnFailedResources) config.returnFailedResources = false;
|
|
1172
1240
|
config = await (0, $33bf2a661b5c0cbd$export$2e2bcd8739ae039)(config);
|
|
1173
|
-
console.
|
|
1241
|
+
console.debug('Config after plugins', config);
|
|
1174
1242
|
};
|
|
1175
1243
|
// Immediately call the preload plugins
|
|
1176
1244
|
const prepareConfigPromise = prepareConfig();
|
|
1177
|
-
const waitForPrepareConfig = (method)=>async (...
|
|
1245
|
+
const waitForPrepareConfig = (method)=>async (...args)=>{
|
|
1178
1246
|
await prepareConfigPromise; // Return immediately if plugins have already been loaded
|
|
1179
|
-
return method(config)(...
|
|
1247
|
+
return method(config)(...args);
|
|
1180
1248
|
};
|
|
1181
1249
|
return {
|
|
1182
1250
|
getList: waitForPrepareConfig((0, $1caf729dc3ce856d$export$2e2bcd8739ae039)),
|
|
1183
|
-
getMany: waitForPrepareConfig((0, $
|
|
1184
|
-
getManyReference: waitForPrepareConfig((0, $
|
|
1185
|
-
getOne: waitForPrepareConfig((0, $
|
|
1186
|
-
create: waitForPrepareConfig((0, $
|
|
1251
|
+
getMany: waitForPrepareConfig((0, $4704ee0f6c5ac80d$export$2e2bcd8739ae039)),
|
|
1252
|
+
getManyReference: waitForPrepareConfig((0, $ca9c98aad8d79793$export$2e2bcd8739ae039)),
|
|
1253
|
+
getOne: waitForPrepareConfig((0, $4861cda99f97e87d$export$2e2bcd8739ae039)),
|
|
1254
|
+
create: waitForPrepareConfig((0, $d12d4cfb47175317$export$2e2bcd8739ae039)),
|
|
1187
1255
|
update: waitForPrepareConfig((0, $c5031381f4dfc62d$export$2e2bcd8739ae039)),
|
|
1188
1256
|
updateMany: ()=>{
|
|
1189
1257
|
throw new Error('updateMany is not implemented yet');
|
|
1190
1258
|
},
|
|
1191
1259
|
delete: waitForPrepareConfig((0, $9510970b8e7eb9e2$export$2e2bcd8739ae039)),
|
|
1192
|
-
deleteMany: waitForPrepareConfig((0, $
|
|
1260
|
+
deleteMany: waitForPrepareConfig((0, $9b978ac85d859b57$export$2e2bcd8739ae039)),
|
|
1193
1261
|
// Custom methods
|
|
1194
1262
|
patch: waitForPrepareConfig((0, $cdfdce6efa87baab$export$2e2bcd8739ae039)),
|
|
1195
|
-
getDataModels: waitForPrepareConfig((0, $
|
|
1196
|
-
getDataServers: waitForPrepareConfig((0, $
|
|
1197
|
-
getLocalDataServers: (0, $
|
|
1198
|
-
fetch: waitForPrepareConfig((c)=>(0, $
|
|
1263
|
+
getDataModels: waitForPrepareConfig((0, $52333268224773ef$export$2e2bcd8739ae039)),
|
|
1264
|
+
getDataServers: waitForPrepareConfig((0, $294fdd580f2e7246$export$2e2bcd8739ae039)),
|
|
1265
|
+
getLocalDataServers: (0, $294fdd580f2e7246$export$2e2bcd8739ae039)(originalConfig),
|
|
1266
|
+
fetch: waitForPrepareConfig((c)=>(0, $00b6445d7042c29d$export$5ff1805767bd358a)(c.dataServers)),
|
|
1267
|
+
authFetch: waitForPrepareConfig((c)=>(0, $00b6445d7042c29d$export$1ac69e0fa5b5498b)(c.dataServers)),
|
|
1268
|
+
getDataset: waitForPrepareConfig((c)=>()=>c.dataset),
|
|
1199
1269
|
uploadFile: waitForPrepareConfig((c)=>(rawFile)=>(0, $b17c43e3301545ca$export$a5575dbeeffdad98)(rawFile, c)),
|
|
1200
1270
|
expandTypes: waitForPrepareConfig((c)=>(types)=>(0, $36aa010ec46eaf45$export$2e2bcd8739ae039)(types, c.jsonContext)),
|
|
1201
1271
|
getConfig: waitForPrepareConfig((c)=>()=>c),
|
|
1202
1272
|
refreshConfig: async ()=>{
|
|
1203
|
-
config = {
|
|
1204
|
-
...originalConfig
|
|
1205
|
-
};
|
|
1206
1273
|
await prepareConfig();
|
|
1207
1274
|
return config;
|
|
1208
1275
|
}
|
|
1209
1276
|
};
|
|
1210
1277
|
};
|
|
1211
|
-
var $
|
|
1278
|
+
var $9808be090468fc68$export$2e2bcd8739ae039 = $9808be090468fc68$var$dataProvider;
|
|
1212
1279
|
|
|
1213
1280
|
|
|
1214
1281
|
|
|
@@ -1225,7 +1292,10 @@ var $861da9be2c0e62eb$export$2e2bcd8739ae039 = $861da9be2c0e62eb$var$getPrefixFr
|
|
|
1225
1292
|
|
|
1226
1293
|
|
|
1227
1294
|
|
|
1228
|
-
|
|
1295
|
+
/**
|
|
1296
|
+
* Adds `dataServers.user` properties to configuration (baseUrl, sparqlEndpoint, proxyUrl, ...).
|
|
1297
|
+
*/ const $cdd3c71a628eeefe$var$configureUserStorage = ()=>({
|
|
1298
|
+
name: 'configureUserStorage',
|
|
1229
1299
|
transformConfig: async (config)=>{
|
|
1230
1300
|
const token = localStorage.getItem('token');
|
|
1231
1301
|
// If the user is logged in
|
|
@@ -1299,7 +1369,7 @@ const $d7a7484a035f15cd$var$getContainerFromDataRegistration = async (dataRegist
|
|
|
1299
1369
|
'@container': '@language'
|
|
1300
1370
|
}
|
|
1301
1371
|
});
|
|
1302
|
-
const userStorage = (0, $
|
|
1372
|
+
const userStorage = (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('default', config.dataServers);
|
|
1303
1373
|
const { baseUrl: baseUrl } = config.dataServers[userStorage];
|
|
1304
1374
|
const containerPath = dataRegistration.id.replace(baseUrl, '');
|
|
1305
1375
|
const container = {
|
|
@@ -1329,6 +1399,7 @@ var $d7a7484a035f15cd$export$2e2bcd8739ae039 = $d7a7484a035f15cd$var$getContaine
|
|
|
1329
1399
|
*/ const $2c257b4237cb14ca$var$fetchAppRegistration = (pluginConfig = {})=>{
|
|
1330
1400
|
const { includeSelectedResources: includeSelectedResources = true } = pluginConfig;
|
|
1331
1401
|
return {
|
|
1402
|
+
name: 'fetchAppRegistration',
|
|
1332
1403
|
transformConfig: async (config)=>{
|
|
1333
1404
|
const token = localStorage.getItem('token');
|
|
1334
1405
|
// If the user is logged in
|
|
@@ -1385,7 +1456,14 @@ var $2c257b4237cb14ca$export$2e2bcd8739ae039 = $2c257b4237cb14ca$var$fetchAppReg
|
|
|
1385
1456
|
|
|
1386
1457
|
|
|
1387
1458
|
|
|
1388
|
-
|
|
1459
|
+
/**
|
|
1460
|
+
* Plugin to add data registrations to the user containers, by fetching the registry set.
|
|
1461
|
+
*
|
|
1462
|
+
* Requires the `configureUserStorage` plugin.
|
|
1463
|
+
*
|
|
1464
|
+
* @returns {Configuration} The configuration with the data registrations added to `dataServers.user.containers`
|
|
1465
|
+
*/ const $91255e144bb55afc$var$fetchDataRegistry = ()=>({
|
|
1466
|
+
name: 'fetchDataRegistry',
|
|
1389
1467
|
transformConfig: async (config)=>{
|
|
1390
1468
|
const token = localStorage.getItem('token');
|
|
1391
1469
|
// If the user is logged in
|
|
@@ -1394,7 +1472,9 @@ const $91255e144bb55afc$var$fetchDataRegistry = ()=>({
|
|
|
1394
1472
|
const webId = payload.webId || payload.webid; // Currently we must deal with both formats
|
|
1395
1473
|
if (!config.dataServers[webId]) throw new Error(`You must configure the user storage first with the configureUserStorage plugin`);
|
|
1396
1474
|
const { json: user } = await config.httpClient(webId);
|
|
1475
|
+
if (!user['interop:hasRegistrySet']) throw new Error(`User ${webId} is missing interop:hasRegistrySet`);
|
|
1397
1476
|
const { json: registrySet } = await config.httpClient(user['interop:hasRegistrySet']);
|
|
1477
|
+
if (!registrySet['interop:hasDataRegistry']) throw new Error(`User ${webId} is missing interop:hasDataRegistry`);
|
|
1398
1478
|
const { json: dataRegistry } = await config.httpClient(registrySet['interop:hasDataRegistry']);
|
|
1399
1479
|
if (dataRegistry['interop:hasDataRegistration']) {
|
|
1400
1480
|
const results = await Promise.all(dataRegistry['interop:hasDataRegistration'].map((dataRegistrationUri)=>{
|
|
@@ -1418,7 +1498,14 @@ var $91255e144bb55afc$export$2e2bcd8739ae039 = $91255e144bb55afc$var$fetchDataRe
|
|
|
1418
1498
|
|
|
1419
1499
|
|
|
1420
1500
|
|
|
1421
|
-
|
|
1501
|
+
/**
|
|
1502
|
+
* Plugin to add type indexes to the user containers, by fetching the them.
|
|
1503
|
+
*
|
|
1504
|
+
* Requires the `configureUserStorage` plugin.
|
|
1505
|
+
*
|
|
1506
|
+
* @returns {Configuration} The configuration with the data registrations added to `dataServers.user.containers`
|
|
1507
|
+
*/ const $2d5f75df63129ebc$var$fetchTypeIndexes = ()=>({
|
|
1508
|
+
name: 'fetchTypeIndexes',
|
|
1422
1509
|
transformConfig: async (config)=>{
|
|
1423
1510
|
const token = localStorage.getItem('token');
|
|
1424
1511
|
// If the user is logged in
|
|
@@ -1478,6 +1565,7 @@ var $2d5f75df63129ebc$export$2e2bcd8739ae039 = $2d5f75df63129ebc$var$fetchTypeIn
|
|
|
1478
1565
|
|
|
1479
1566
|
|
|
1480
1567
|
const $a87fd63d8fca0380$var$fetchVoidEndpoints = ()=>({
|
|
1568
|
+
name: 'fetchVoidEndpoints',
|
|
1481
1569
|
transformConfig: async (config)=>{
|
|
1482
1570
|
let results = [];
|
|
1483
1571
|
try {
|
|
@@ -1706,12 +1794,12 @@ const $8dbb0c8c3814e663$var$useGetCreateContainerUri = ()=>{
|
|
|
1706
1794
|
const dataModels = (0, $3a9656756670cb78$export$2e2bcd8739ae039)();
|
|
1707
1795
|
const dataServers = (0, $4daf4cf698ee4eed$export$2e2bcd8739ae039)();
|
|
1708
1796
|
const getCreateContainerUri = (0, $fj9kP$useCallback)((resourceId)=>{
|
|
1709
|
-
if (!dataModels || !dataServers || !dataModels[resourceId]) return undefined;
|
|
1797
|
+
if (!resourceId || !dataModels || !dataServers || !dataModels[resourceId]) return undefined;
|
|
1710
1798
|
const dataModel = dataModels[resourceId];
|
|
1711
1799
|
if (dataModel.create?.container) return dataModel.create.container;
|
|
1712
1800
|
else if (dataModel.create?.server) return (0, $7d9911a250866af6$export$2e2bcd8739ae039)(dataModel.types, dataModel.create.server, dataServers);
|
|
1713
1801
|
else {
|
|
1714
|
-
const defaultServerKey = (0, $
|
|
1802
|
+
const defaultServerKey = (0, $aed10b8332b5d58a$export$2e2bcd8739ae039)('default', dataServers);
|
|
1715
1803
|
if (!defaultServerKey) throw new Error(`No default dataServer found. You can set explicitly one setting the "default" attribute to true`);
|
|
1716
1804
|
return (0, $7d9911a250866af6$export$2e2bcd8739ae039)(dataModel.types, defaultServerKey, dataServers);
|
|
1717
1805
|
}
|
|
@@ -1749,16 +1837,19 @@ var $e5a0eacd756fd1d5$export$2e2bcd8739ae039 = $e5a0eacd756fd1d5$var$useDataMode
|
|
|
1749
1837
|
|
|
1750
1838
|
|
|
1751
1839
|
|
|
1752
|
-
const $
|
|
1753
|
-
const $
|
|
1754
|
-
const $
|
|
1840
|
+
const $0c5cccc31d3b196d$var$compute = (externalLinks, record)=>typeof externalLinks === 'function' ? externalLinks(record) : externalLinks;
|
|
1841
|
+
const $0c5cccc31d3b196d$var$isURL = (url)=>typeof url === 'string' && url.startsWith('http');
|
|
1842
|
+
const $0c5cccc31d3b196d$var$useGetExternalLink = (componentExternalLinks)=>{
|
|
1755
1843
|
// Since the externalLinks config is defined only locally, we don't need to wait for VOID endpoints fetching
|
|
1756
1844
|
const dataProvider = (0, $fj9kP$useContext)((0, $fj9kP$DataProviderContext));
|
|
1845
|
+
// @ts-expect-error TS(2531): Object is possibly 'null'.
|
|
1757
1846
|
const dataServers = dataProvider.getLocalDataServers();
|
|
1758
1847
|
const serversExternalLinks = (0, $fj9kP$useMemo)(()=>{
|
|
1759
1848
|
if (dataServers) return Object.fromEntries(Object.values(dataServers).map((server)=>{
|
|
1760
1849
|
// If externalLinks is not defined in the data server, use external links for non-default servers
|
|
1850
|
+
// @ts-expect-error TS(2571): Object is of type 'unknown'.
|
|
1761
1851
|
const externalLinks = server.externalLinks !== undefined ? server.externalLinks : !server.default;
|
|
1852
|
+
// @ts-expect-error TS(2571): Object is of type 'unknown'.
|
|
1762
1853
|
return [
|
|
1763
1854
|
server.baseUrl,
|
|
1764
1855
|
externalLinks
|
|
@@ -1768,25 +1859,25 @@ const $87656edf926c0f1f$var$useGetExternalLink = (componentExternalLinks)=>{
|
|
|
1768
1859
|
dataServers
|
|
1769
1860
|
]);
|
|
1770
1861
|
return (0, $fj9kP$useCallback)((record)=>{
|
|
1771
|
-
const computedComponentExternalLinks = $
|
|
1862
|
+
const computedComponentExternalLinks = $0c5cccc31d3b196d$var$compute(componentExternalLinks, record);
|
|
1772
1863
|
// If the component explicitly asks not to display as external links, use an internal link
|
|
1773
1864
|
if (computedComponentExternalLinks === false) return false;
|
|
1774
1865
|
if (!record?.id) return false;
|
|
1775
1866
|
const serverBaseUrl = Object.keys(serversExternalLinks).find((baseUrl)=>record?.id.startsWith(baseUrl));
|
|
1776
1867
|
// If no matching data servers could be found, assume we have an internal link
|
|
1777
1868
|
if (!serverBaseUrl) return false;
|
|
1778
|
-
const computedServerExternalLinks = $
|
|
1869
|
+
const computedServerExternalLinks = $0c5cccc31d3b196d$var$compute(serversExternalLinks[serverBaseUrl], record);
|
|
1779
1870
|
// If the data server explicitly asks not to display as external links, use an internal link
|
|
1780
1871
|
if (computedServerExternalLinks === false) return false;
|
|
1781
|
-
if ($
|
|
1782
|
-
if ($
|
|
1872
|
+
if ($0c5cccc31d3b196d$var$isURL(computedComponentExternalLinks)) return computedComponentExternalLinks;
|
|
1873
|
+
if ($0c5cccc31d3b196d$var$isURL(computedServerExternalLinks)) return computedServerExternalLinks;
|
|
1783
1874
|
return record.id;
|
|
1784
1875
|
}, [
|
|
1785
1876
|
serversExternalLinks,
|
|
1786
1877
|
componentExternalLinks
|
|
1787
1878
|
]);
|
|
1788
1879
|
};
|
|
1789
|
-
var $
|
|
1880
|
+
var $0c5cccc31d3b196d$export$2e2bcd8739ae039 = $0c5cccc31d3b196d$var$useGetExternalLink;
|
|
1790
1881
|
|
|
1791
1882
|
|
|
1792
1883
|
|
|
@@ -1816,7 +1907,7 @@ var $487567a146508c4e$export$2e2bcd8739ae039 = $487567a146508c4e$var$useGetPrefi
|
|
|
1816
1907
|
* </SingleFieldList>
|
|
1817
1908
|
* </FilterHandler>
|
|
1818
1909
|
* </Show>
|
|
1819
|
-
*/ const $
|
|
1910
|
+
*/ const $d8039fd362ad4925$var$FilterHandler = ({ children: children, record: record, filter: filter, source: source, ...otherProps })=>{
|
|
1820
1911
|
const [filtered, setFiltered] = (0, $fj9kP$useState)();
|
|
1821
1912
|
(0, $fj9kP$useEffect)(()=>{
|
|
1822
1913
|
if (record && source && Array.isArray(record?.[source])) {
|
|
@@ -1852,7 +1943,7 @@ var $487567a146508c4e$export$2e2bcd8739ae039 = $487567a146508c4e$var$useGetPrefi
|
|
|
1852
1943
|
})
|
|
1853
1944
|
});
|
|
1854
1945
|
};
|
|
1855
|
-
var $
|
|
1946
|
+
var $d8039fd362ad4925$export$2e2bcd8739ae039 = $d8039fd362ad4925$var$FilterHandler;
|
|
1856
1947
|
|
|
1857
1948
|
|
|
1858
1949
|
|
|
@@ -1919,12 +2010,13 @@ var $406574efa35ec6f1$export$2e2bcd8739ae039 = $406574efa35ec6f1$var$FilterHandl
|
|
|
1919
2010
|
* </GroupedReferenceHandler>
|
|
1920
2011
|
*
|
|
1921
2012
|
*
|
|
1922
|
-
*/ const $
|
|
2013
|
+
*/ const $207a50667fa8cffa$var$GroupedReferenceHandler = ({ children: children, groupReference: groupReference, groupLabel: groupLabel, groupHeader: groupHeader, filterProperty: filterProperty, ...otherProps })=>{
|
|
1923
2014
|
const record = (0, $fj9kP$useRecordContext)();
|
|
1924
2015
|
const { data: data } = (0, $fj9kP$useGetList)(groupReference);
|
|
1925
2016
|
return /*#__PURE__*/ (0, $fj9kP$jsx)((0, $fj9kP$Fragment), {
|
|
1926
2017
|
children: data?.map((data, index)=>{
|
|
1927
2018
|
const filter = {};
|
|
2019
|
+
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1928
2020
|
filter[filterProperty] = data.id;
|
|
1929
2021
|
return /*#__PURE__*/ (0, $fj9kP$jsxs)((0, $fj9kP$Fragment), {
|
|
1930
2022
|
children: [
|
|
@@ -1932,7 +2024,7 @@ var $406574efa35ec6f1$export$2e2bcd8739ae039 = $406574efa35ec6f1$var$FilterHandl
|
|
|
1932
2024
|
...otherProps,
|
|
1933
2025
|
group: data
|
|
1934
2026
|
}),
|
|
1935
|
-
/*#__PURE__*/ (0, $fj9kP$jsx)((0, $
|
|
2027
|
+
/*#__PURE__*/ (0, $fj9kP$jsx)((0, $d8039fd362ad4925$export$2e2bcd8739ae039), {
|
|
1936
2028
|
...otherProps,
|
|
1937
2029
|
record: record,
|
|
1938
2030
|
filter: filter,
|
|
@@ -1944,14 +2036,14 @@ var $406574efa35ec6f1$export$2e2bcd8739ae039 = $406574efa35ec6f1$var$FilterHandl
|
|
|
1944
2036
|
})
|
|
1945
2037
|
});
|
|
1946
2038
|
};
|
|
1947
|
-
var $
|
|
2039
|
+
var $207a50667fa8cffa$export$2e2bcd8739ae039 = $207a50667fa8cffa$var$GroupedReferenceHandler;
|
|
1948
2040
|
|
|
1949
2041
|
|
|
1950
2042
|
|
|
1951
2043
|
|
|
1952
2044
|
|
|
1953
2045
|
|
|
1954
|
-
const $
|
|
2046
|
+
const $1a24ef5e038900c4$var$useReferenceInputStyles = (0, $fj9kP$makeStyles)()({
|
|
1955
2047
|
form: {
|
|
1956
2048
|
display: 'flex'
|
|
1957
2049
|
},
|
|
@@ -1959,18 +2051,19 @@ const $6844bbce0ad66151$var$useReferenceInputStyles = (0, $fj9kP$muistylesmakeSt
|
|
|
1959
2051
|
paddingRight: '20px'
|
|
1960
2052
|
}
|
|
1961
2053
|
});
|
|
1962
|
-
const $
|
|
2054
|
+
const $1a24ef5e038900c4$var$useHideInputStyles = (0, $fj9kP$makeStyles)()({
|
|
1963
2055
|
root: {
|
|
1964
2056
|
display: 'none'
|
|
1965
2057
|
}
|
|
1966
2058
|
});
|
|
1967
|
-
const $
|
|
2059
|
+
const $1a24ef5e038900c4$var$ReificationArrayInput = (props)=>{
|
|
1968
2060
|
const { reificationClass: reificationClass, children: children, ...otherProps } = props;
|
|
1969
|
-
const flexFormClasses = $
|
|
1970
|
-
const hideInputStyles = $
|
|
2061
|
+
const { classes: flexFormClasses } = $1a24ef5e038900c4$var$useReferenceInputStyles();
|
|
2062
|
+
const { classes: hideInputStyles } = $1a24ef5e038900c4$var$useHideInputStyles();
|
|
1971
2063
|
return /*#__PURE__*/ (0, $fj9kP$jsx)((0, $fj9kP$ArrayInput), {
|
|
1972
2064
|
...otherProps,
|
|
1973
2065
|
children: /*#__PURE__*/ (0, $fj9kP$jsxs)((0, $fj9kP$SimpleFormIterator), {
|
|
2066
|
+
// @ts-expect-error TS(2322): Type '{ children: any[]; classes: { form: any; }; ... Remove this comment to see the full error message
|
|
1974
2067
|
classes: {
|
|
1975
2068
|
form: flexFormClasses.form
|
|
1976
2069
|
},
|
|
@@ -1983,13 +2076,14 @@ const $6844bbce0ad66151$var$ReificationArrayInput = (props)=>{
|
|
|
1983
2076
|
/*#__PURE__*/ (0, $fj9kP$jsx)((0, $fj9kP$TextInput), {
|
|
1984
2077
|
className: hideInputStyles.root,
|
|
1985
2078
|
source: "type",
|
|
2079
|
+
// @ts-expect-error TS(2322): Type '{ className: any; source: string; initialVal... Remove this comment to see the full error message
|
|
1986
2080
|
initialValue: reificationClass
|
|
1987
2081
|
})
|
|
1988
2082
|
]
|
|
1989
2083
|
})
|
|
1990
2084
|
});
|
|
1991
2085
|
};
|
|
1992
|
-
var $
|
|
2086
|
+
var $1a24ef5e038900c4$export$2e2bcd8739ae039 = $1a24ef5e038900c4$var$ReificationArrayInput;
|
|
1993
2087
|
|
|
1994
2088
|
|
|
1995
2089
|
|
|
@@ -2093,8 +2187,10 @@ const $03d52e691e8dc945$var$registeredWebSockets = new Map();
|
|
|
2093
2187
|
};
|
|
2094
2188
|
|
|
2095
2189
|
|
|
2190
|
+
var $11242e90250f263e$exports = {};
|
|
2191
|
+
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
|
|
2096
2192
|
|
|
2097
2193
|
|
|
2098
2194
|
|
|
2099
|
-
export {$
|
|
2195
|
+
export {$9808be090468fc68$export$2e2bcd8739ae039 as dataProvider, $dcde11998342d30d$export$2e2bcd8739ae039 as buildSparqlQuery, $8ad7b5ebbca2bb3e$export$2e2bcd8739ae039 as buildBlankNodesQuery, $4872a1c30c1fc60e$export$2e2bcd8739ae039 as getUriFromPrefix, $861da9be2c0e62eb$export$2e2bcd8739ae039 as getPrefixFromUri, $cdd3c71a628eeefe$export$2e2bcd8739ae039 as configureUserStorage, $2c257b4237cb14ca$export$2e2bcd8739ae039 as fetchAppRegistration, $91255e144bb55afc$export$2e2bcd8739ae039 as fetchDataRegistry, $2d5f75df63129ebc$export$2e2bcd8739ae039 as fetchTypeIndexes, $a87fd63d8fca0380$export$2e2bcd8739ae039 as fetchVoidEndpoints, $72db0904d77f0f1e$export$2e2bcd8739ae039 as useCompactPredicate, $586fa0ea9d02fa12$export$2e2bcd8739ae039 as useContainers, $9d2c669bd52faa31$export$2e2bcd8739ae039 as useContainersByTypes, $43097d0b613bd4db$export$2e2bcd8739ae039 as useContainerByUri, $35f3e75c86e51f35$export$2e2bcd8739ae039 as useCreateContainerUri, $e5a0eacd756fd1d5$export$2e2bcd8739ae039 as useDataModel, $3a9656756670cb78$export$2e2bcd8739ae039 as useDataModels, $3677b4de74c3d10d$export$2e2bcd8739ae039 as useDataProviderConfig, $4daf4cf698ee4eed$export$2e2bcd8739ae039 as useDataServers, $8dbb0c8c3814e663$export$2e2bcd8739ae039 as useGetCreateContainerUri, $0c5cccc31d3b196d$export$2e2bcd8739ae039 as useGetExternalLink, $487567a146508c4e$export$2e2bcd8739ae039 as useGetPrefixFromUri, $d8039fd362ad4925$export$2e2bcd8739ae039 as FilterHandler, $207a50667fa8cffa$export$2e2bcd8739ae039 as GroupedReferenceHandler, $1a24ef5e038900c4$export$2e2bcd8739ae039 as ReificationArrayInput, $03d52e691e8dc945$export$28772ab4c256e709 as createWsChannel, $03d52e691e8dc945$export$8d60734939c59ced as getOrCreateWsChannel, $03d52e691e8dc945$export$3edfe18db119b920 as createSolidNotificationChannel};
|
|
2100
2196
|
//# sourceMappingURL=index.es.js.map
|