@digitalculture/ochre-sdk 0.18.12 → 0.18.13
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.mjs +8 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3596,7 +3596,7 @@ function buildXQuery$2(params, options) {
|
|
|
3596
3596
|
const startPos = (page - 1) * pageSize + 1;
|
|
3597
3597
|
const endPos = page * pageSize;
|
|
3598
3598
|
let belongsToCollectionScopeFilter = "";
|
|
3599
|
-
if (belongsToCollectionScopeUuids.length > 0) belongsToCollectionScopeFilter = `[properties
|
|
3599
|
+
if (belongsToCollectionScopeUuids.length > 0) belongsToCollectionScopeFilter = `[.//properties[property[label/@uuid="${BELONG_TO_COLLECTION_UUID}" and value/(${belongsToCollectionScopeUuids.map((uuid) => `@uuid="${uuid}"`).join(" or ")})]]`;
|
|
3600
3600
|
const propertyVariables = propertyVariableUuids.map((uuid) => `@uuid="${uuid}"`).join(" or ");
|
|
3601
3601
|
const propertyValuesFilters = propertyValues.map(({ dataType, value }) => {
|
|
3602
3602
|
if (dataType === "IDREF") return `value[@uuid="${value}"]`;
|
|
@@ -3605,8 +3605,8 @@ function buildXQuery$2(params, options) {
|
|
|
3605
3605
|
}).join(" or ");
|
|
3606
3606
|
return `<ochre>{${`let $match-uuids := distinct-values(
|
|
3607
3607
|
${version === 2 ? "doc()" : "input()"}/ochre[@uuidBelongsTo="${projectScopeUuid}"]
|
|
3608
|
-
|
|
3609
|
-
|
|
3608
|
+
${belongsToCollectionScopeFilter}
|
|
3609
|
+
//property[label[${propertyVariables}]][${propertyValuesFilters}]]
|
|
3610
3610
|
/@uuid
|
|
3611
3611
|
)
|
|
3612
3612
|
|
|
@@ -3619,11 +3619,11 @@ function buildXQuery$2(params, options) {
|
|
|
3619
3619
|
|
|
3620
3620
|
return <items totalCount="{$totalCount}" page="${page}" pageSize="${pageSize}">{
|
|
3621
3621
|
for $uuid in $unique-uuids[position() ge ${startPos} and position() le ${endPos}]
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3622
|
+
let $item := ($items[@uuid = $uuid])[1]
|
|
3623
|
+
let $category := local-name($item)
|
|
3624
|
+
return element { node-name($item) } {
|
|
3625
|
+
$item/@*, ${includeChildItems ? "$item/node()" : "$item/node()[not(local-name(.) = $category)]"}
|
|
3626
|
+
}
|
|
3627
3627
|
}</items>`}}</ochre>`;
|
|
3628
3628
|
}
|
|
3629
3629
|
/**
|
package/package.json
CHANGED