ochre-sdk 1.3.25 → 1.3.26
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/categories.d.mts +56 -56
- package/dist/categories.mjs +39 -39
- package/dist/constants.d.mts +8 -8
- package/dist/constants.mjs +6 -6
- package/dist/errors.d.mts +12 -12
- package/dist/errors.mjs +22 -23
- package/dist/fetchers/container-items.d.mts +28 -28
- package/dist/fetchers/container-items.mjs +27 -27
- package/dist/fetchers/gallery.d.mts +13 -13
- package/dist/fetchers/gallery.mjs +2 -2
- package/dist/fetchers/item-children.d.mts +12 -12
- package/dist/fetchers/item-children.mjs +2 -2
- package/dist/fetchers/item-links.d.mts +10 -10
- package/dist/fetchers/item-links.mjs +6 -6
- package/dist/fetchers/item-locations.d.mts +20 -20
- package/dist/fetchers/item-locations.mjs +3 -3
- package/dist/fetchers/item-ocr-data.d.mts +23 -23
- package/dist/fetchers/item-ocr-data.mjs +44 -44
- package/dist/fetchers/item.d.mts +14 -14
- package/dist/fetchers/item.mjs +14 -14
- package/dist/fetchers/map-layers.d.mts +15 -15
- package/dist/fetchers/map-layers.mjs +12 -11
- package/dist/fetchers/request.d.mts +40 -40
- package/dist/fetchers/request.mjs +37 -37
- package/dist/fetchers/set/items.d.mts +15 -15
- package/dist/fetchers/set/items.mjs +1 -1
- package/dist/fetchers/set/property-values.d.mts +16 -16
- package/dist/fetchers/set/property-values.mjs +43 -43
- package/dist/fetchers/tree/items.d.mts +27 -27
- package/dist/fetchers/tree/items.mjs +1 -1
- package/dist/fetchers/website-metadata.d.mts +4 -4
- package/dist/fetchers/website-metadata.mjs +9 -9
- package/dist/fetchers/website.d.mts +10 -10
- package/dist/fetchers/website.mjs +12 -12
- package/dist/getters.d.mts +83 -83
- package/dist/getters.mjs +74 -74
- package/dist/helpers.d.mts +4 -4
- package/dist/helpers.mjs +7 -7
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +5 -5
- package/dist/languages.d.mts +58 -58
- package/dist/languages.mjs +21 -21
- package/dist/ocr.d.mts +27 -27
- package/dist/ocr.mjs +29 -29
- package/dist/parsers/helpers.d.mts +23 -23
- package/dist/parsers/helpers.mjs +8 -8
- package/dist/parsers/index.d.mts +2 -2
- package/dist/parsers/index.mjs +15 -15
- package/dist/parsers/languages.d.mts +49 -49
- package/dist/parsers/languages.mjs +49 -49
- package/dist/parsers/multilingual.d.mts +174 -174
- package/dist/parsers/multilingual.mjs +146 -146
- package/dist/parsers/partial-date.d.mts +12 -12
- package/dist/parsers/partial-date.mjs +11 -11
- package/dist/parsers/property-token.d.mts +20 -20
- package/dist/parsers/property-token.mjs +16 -16
- package/dist/parsers/string.d.mts +33 -33
- package/dist/parsers/string.mjs +62 -64
- package/dist/parsers/website/bounds.d.mts +6 -6
- package/dist/parsers/website/bounds.mjs +5 -5
- package/dist/parsers/website/components.d.mts +50 -31
- package/dist/parsers/website/components.mjs +79 -51
- package/dist/parsers/website/index.d.mts +1 -1
- package/dist/parsers/website/index.mjs +43 -47
- package/dist/parsers/website/links.d.mts +24 -24
- package/dist/parsers/website/links.mjs +18 -18
- package/dist/parsers/website/messages.d.mts +16 -16
- package/dist/parsers/website/messages.mjs +14 -14
- package/dist/parsers/website/options.d.mts +1 -1
- package/dist/parsers/website/properties.d.mts +17 -8
- package/dist/parsers/website/properties.mjs +22 -10
- package/dist/parsers/website/reader.d.mts +55 -46
- package/dist/parsers/website/reader.mjs +64 -46
- package/dist/parsers/website/slug.d.mts +50 -50
- package/dist/parsers/website/slug.mjs +36 -36
- package/dist/parsers/website/styles.d.mts +18 -18
- package/dist/parsers/website/styles.mjs +19 -19
- package/dist/parsers/website/walk.d.mts +46 -46
- package/dist/parsers/website/walk.mjs +34 -34
- package/dist/query.d.mts +63 -63
- package/dist/query.mjs +137 -140
- package/dist/reflection.d.mts +51 -51
- package/dist/reflection.mjs +45 -45
- package/dist/schemas.d.mts +44 -44
- package/dist/schemas.mjs +50 -50
- package/dist/types/index.d.mts +192 -192
- package/dist/types/utilities.d.mts +5 -5
- package/dist/types/website.d.mts +67 -62
- package/dist/xml/dates.d.mts +9 -9
- package/dist/xml/dates.mjs +9 -9
- package/dist/xml/metadata.d.mts +14 -14
- package/dist/xml/metadata.mjs +18 -18
- package/dist/xml/schemas.mjs +24 -24
- package/dist/xml/types.d.mts +9 -9
- package/dist/xquery.d.mts +49 -49
- package/dist/xquery.mjs +50 -50
- package/package.json +10 -10
package/dist/schemas.d.mts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { Query } from "./types/index.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Validates a pseudo-UUID string
|
|
5
|
+
@param value - The string to validate
|
|
6
|
+
@returns True if the string is a valid pseudo-UUID, false otherwise
|
|
7
|
+
@internal
|
|
8
|
+
*/
|
|
9
9
|
export declare function isPseudoUuid(value: string): boolean;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
Schema for validating UUIDs
|
|
12
|
+
@internal
|
|
13
|
+
*/
|
|
14
14
|
export declare const uuidSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
Schema for validating OCHRE language codes
|
|
17
|
+
|
|
18
|
+
Rejects standard codes OCHRE does not store, naming the OCHRE code to use
|
|
19
|
+
instead (`per` for ISO 639-3 `fas`).
|
|
20
|
+
@internal
|
|
21
|
+
*/
|
|
22
22
|
export declare const ochreLanguageCodeSchema: v.SchemaWithPipe<readonly [v.StringSchema<"Language code must be a string">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Valid component types for web elements
|
|
25
|
+
@internal
|
|
26
|
+
*/
|
|
27
27
|
export declare const componentSchema: v.PicklistSchema<readonly ["3d-viewer", "advanced-search", "annotated-document", "annotated-image", "audio-player", "bibliography", "button", "collection", "empty-space", "entries", "iframe", "iiif-viewer", "image", "image-gallery", "map", "query", "search-bar", "table", "text", "timeline", "video"], "Invalid/unknown web element component">;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
Valid variants for the "collection" component
|
|
30
|
+
@internal
|
|
31
|
+
*/
|
|
32
32
|
export declare const collectionVariantSchema: v.PicklistSchema<readonly ["slide", "table", "card", "tile", "showcase"], undefined>;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
Schema for validating gallery parameters
|
|
35
|
+
@internal
|
|
36
|
+
*/
|
|
37
37
|
export declare const gallerySchema: v.ObjectSchema<{
|
|
38
38
|
readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
39
39
|
readonly filter: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -41,37 +41,37 @@ export declare const gallerySchema: v.ObjectSchema<{
|
|
|
41
41
|
readonly perPage: v.SchemaWithPipe<readonly [v.NumberSchema<"Per page must be positive">, v.CheckAction<number, "Per page must be positive">]>;
|
|
42
42
|
}, undefined>;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
Schema for validating and parsing render options
|
|
45
|
+
@internal
|
|
46
|
+
*/
|
|
47
47
|
export declare const renderOptionsSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string[]>, v.ArraySchema<v.PicklistSchema<["bold", "italic", "underline"], undefined>, undefined>]>;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Schema for validating the parameters for the Set property values fetching function
|
|
50
|
+
@internal
|
|
51
|
+
*/
|
|
52
52
|
export declare const setPropertyValuesParametersSchema: v.ObjectSchema<{
|
|
53
53
|
readonly setScopeUuids: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, v.MinLengthAction<string[], 1, "At least one set scope UUID is required">]>;
|
|
54
54
|
readonly belongsToCollectionScopeUuids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, readonly []>;
|
|
55
55
|
readonly queries: v.OptionalSchema<v.NullableSchema<v.GenericSchema<unknown, Query>, undefined>, null>;
|
|
56
56
|
readonly attributes: v.OptionalSchema<v.ObjectSchema<{
|
|
57
|
-
readonly bibliographies: v.
|
|
58
|
-
readonly periods: v.
|
|
57
|
+
readonly bibliographies: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
58
|
+
readonly periods: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
59
59
|
}, undefined>, {
|
|
60
60
|
readonly bibliographies: false;
|
|
61
61
|
readonly periods: false;
|
|
62
62
|
}>;
|
|
63
|
-
readonly isLimitedToLeafPropertyValues: v.
|
|
64
|
-
readonly language: v.
|
|
63
|
+
readonly isLimitedToLeafPropertyValues: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
64
|
+
readonly language: v.OptionalSchema<v.StringSchema<undefined>, "eng">;
|
|
65
65
|
}, undefined>;
|
|
66
66
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
Schema for validating the parameters for the item OCR data fetching function
|
|
68
|
+
@internal
|
|
69
|
+
*/
|
|
70
70
|
export declare const itemOcrDataParametersSchema: v.ObjectSchema<{
|
|
71
71
|
readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
72
72
|
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "A search value is required">]>;
|
|
73
73
|
readonly matchMode: v.OptionalSchema<v.PicklistSchema<["includes", "exact"], undefined>, "includes">;
|
|
74
|
-
readonly isCaseSensitive: v.
|
|
74
|
+
readonly isCaseSensitive: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
75
75
|
}, undefined>;
|
|
76
76
|
export declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
77
77
|
readonly belongsToCollectionScopeUuids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, readonly []>;
|
|
@@ -81,7 +81,7 @@ export declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
|
81
81
|
}, undefined>, v.StrictObjectSchema<{
|
|
82
82
|
readonly target: v.LiteralSchema<"title", undefined>;
|
|
83
83
|
readonly direction: v.OptionalSchema<v.PicklistSchema<["asc", "desc"], undefined>, "asc">;
|
|
84
|
-
readonly language: v.
|
|
84
|
+
readonly language: v.OptionalSchema<v.StringSchema<undefined>, "eng">;
|
|
85
85
|
}, undefined>, v.StrictObjectSchema<{
|
|
86
86
|
readonly target: v.LiteralSchema<"date", undefined>;
|
|
87
87
|
readonly direction: v.OptionalSchema<v.PicklistSchema<["asc", "desc"], undefined>, "asc">;
|
|
@@ -90,7 +90,7 @@ export declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
|
90
90
|
readonly propertyVariableUuid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
91
91
|
readonly dataType: v.PicklistSchema<readonly ["string", "integer", "decimal", "boolean", "date", "dateTime", "time", "IDREF"], undefined>;
|
|
92
92
|
readonly direction: v.OptionalSchema<v.PicklistSchema<["asc", "desc"], undefined>, "asc">;
|
|
93
|
-
readonly language: v.
|
|
93
|
+
readonly language: v.OptionalSchema<v.StringSchema<undefined>, "eng">;
|
|
94
94
|
}, undefined>, v.StrictObjectSchema<{
|
|
95
95
|
readonly target: v.LiteralSchema<"distance", undefined>;
|
|
96
96
|
readonly latitude: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
|
@@ -104,9 +104,9 @@ export declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
|
104
104
|
readonly setScopeUuids: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, v.MinLengthAction<string[], 1, "At least one set scope UUID is required">]>;
|
|
105
105
|
}, undefined>;
|
|
106
106
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
Schema for validating the parameters of the item locations fetching function
|
|
108
|
+
@internal
|
|
109
|
+
*/
|
|
110
110
|
export declare const itemLocationsParametersSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
111
111
|
readonly setScopeUuids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, readonly []>;
|
|
112
112
|
readonly treeScopeUuids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, readonly []>;
|
|
@@ -130,7 +130,7 @@ export declare const treeItemsParametersSchema: v.ObjectSchema<{
|
|
|
130
130
|
}, undefined>, v.StrictObjectSchema<{
|
|
131
131
|
readonly target: v.LiteralSchema<"title", undefined>;
|
|
132
132
|
readonly direction: v.OptionalSchema<v.PicklistSchema<["asc", "desc"], undefined>, "asc">;
|
|
133
|
-
readonly language: v.
|
|
133
|
+
readonly language: v.OptionalSchema<v.StringSchema<undefined>, "eng">;
|
|
134
134
|
}, undefined>, v.StrictObjectSchema<{
|
|
135
135
|
readonly target: v.LiteralSchema<"date", undefined>;
|
|
136
136
|
readonly direction: v.OptionalSchema<v.PicklistSchema<["asc", "desc"], undefined>, "asc">;
|
|
@@ -139,7 +139,7 @@ export declare const treeItemsParametersSchema: v.ObjectSchema<{
|
|
|
139
139
|
readonly propertyVariableUuid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
140
140
|
readonly dataType: v.PicklistSchema<readonly ["string", "integer", "decimal", "boolean", "date", "dateTime", "time", "IDREF"], undefined>;
|
|
141
141
|
readonly direction: v.OptionalSchema<v.PicklistSchema<["asc", "desc"], undefined>, "asc">;
|
|
142
|
-
readonly language: v.
|
|
142
|
+
readonly language: v.OptionalSchema<v.StringSchema<undefined>, "eng">;
|
|
143
143
|
}, undefined>, v.StrictObjectSchema<{
|
|
144
144
|
readonly target: v.LiteralSchema<"distance", undefined>;
|
|
145
145
|
readonly latitude: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
|
package/dist/schemas.mjs
CHANGED
|
@@ -4,29 +4,29 @@ import * as v from "valibot";
|
|
|
4
4
|
// src/schemas.ts
|
|
5
5
|
const PSEUDO_UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/i;
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Validates a pseudo-UUID string
|
|
8
|
+
@param value - The string to validate
|
|
9
|
+
@returns True if the string is a valid pseudo-UUID, false otherwise
|
|
10
|
+
@internal
|
|
11
11
|
*/
|
|
12
12
|
function isPseudoUuid(value) {
|
|
13
13
|
return PSEUDO_UUID_REGEX.test(value);
|
|
14
14
|
}
|
|
15
15
|
const positiveNumber = (message) => v.pipe(v.number(), v.minValue(1, message));
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const defaultLanguageSchema = v.optional(v.string(), "eng");
|
|
17
|
+
const defaultFalseSchema = v.optional(v.boolean(), false);
|
|
18
18
|
const sortDirectionSchema = v.optional(v.picklist(["asc", "desc"]), "asc");
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
Schema for validating UUIDs
|
|
21
|
+
@internal
|
|
22
22
|
*/
|
|
23
23
|
const uuidSchema = v.pipe(v.string(), v.check(isPseudoUuid, "Invalid pseudo-UUID"));
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
Schema for validating OCHRE language codes
|
|
26
|
+
|
|
27
|
+
Rejects standard codes OCHRE does not store, naming the OCHRE code to use
|
|
28
|
+
instead (`per` for ISO 639-3 `fas`).
|
|
29
|
+
@internal
|
|
30
30
|
*/
|
|
31
31
|
const ochreLanguageCodeSchema = v.pipe(v.string("Language code must be a string"), v.check(isOchreLanguageCode, (issue) => {
|
|
32
32
|
const input = issue.input;
|
|
@@ -34,8 +34,8 @@ const ochreLanguageCodeSchema = v.pipe(v.string("Language code must be a string"
|
|
|
34
34
|
return ochreCode == null ? `Unknown OCHRE language code "${input}"` : `Unknown OCHRE language code "${input}"; OCHRE publishes this language as "${ochreCode}"`;
|
|
35
35
|
}));
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
Valid component types for web elements
|
|
38
|
+
@internal
|
|
39
39
|
*/
|
|
40
40
|
const componentSchema = v.picklist([
|
|
41
41
|
"3d-viewer",
|
|
@@ -61,8 +61,8 @@ const componentSchema = v.picklist([
|
|
|
61
61
|
"video"
|
|
62
62
|
], "Invalid/unknown web element component");
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
Valid variants for the "collection" component
|
|
65
|
+
@internal
|
|
66
66
|
*/
|
|
67
67
|
const collectionVariantSchema = v.picklist([
|
|
68
68
|
"slide",
|
|
@@ -72,8 +72,8 @@ const collectionVariantSchema = v.picklist([
|
|
|
72
72
|
"showcase"
|
|
73
73
|
]);
|
|
74
74
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
Schema for validating gallery parameters
|
|
76
|
+
@internal
|
|
77
77
|
*/
|
|
78
78
|
const gallerySchema = v.object({
|
|
79
79
|
uuid: v.pipe(v.string(), v.check(isPseudoUuid, "Invalid pseudo-UUID")),
|
|
@@ -82,8 +82,8 @@ const gallerySchema = v.object({
|
|
|
82
82
|
perPage: v.pipe(v.number("Per page must be positive"), v.check((n) => n > 0, "Per page must be positive"))
|
|
83
83
|
});
|
|
84
84
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
Schema for validating and parsing render options
|
|
86
|
+
@internal
|
|
87
87
|
*/
|
|
88
88
|
const renderOptionsSchema = v.pipe(v.string(), v.transform((string) => string.split(" ")), v.array(v.picklist([
|
|
89
89
|
"bold",
|
|
@@ -91,25 +91,25 @@ const renderOptionsSchema = v.pipe(v.string(), v.transform((string) => string.sp
|
|
|
91
91
|
"underline"
|
|
92
92
|
])));
|
|
93
93
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
Schema for validating date data types
|
|
95
|
+
@internal
|
|
96
96
|
*/
|
|
97
97
|
const dateDataTypeSchema = v.picklist(["date", "dateTime"]);
|
|
98
98
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
Shared schema for query fields
|
|
100
|
+
@internal
|
|
101
101
|
*/
|
|
102
102
|
const standardQueryFields = {
|
|
103
103
|
matchMode: v.picklist(["includes", "exact"]),
|
|
104
104
|
isCaseSensitive: v.boolean(),
|
|
105
|
-
language:
|
|
105
|
+
language: defaultLanguageSchema,
|
|
106
106
|
fallbackLanguage: v.optional(v.string()),
|
|
107
|
-
isNegated:
|
|
107
|
+
isNegated: defaultFalseSchema
|
|
108
108
|
};
|
|
109
109
|
const propertyRelationSchema = v.picklist(["related", "inverse"]);
|
|
110
110
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
Shared schema for Set queries
|
|
112
|
+
@internal
|
|
113
113
|
*/
|
|
114
114
|
const setQueryLeafSchema = v.union([
|
|
115
115
|
v.pipe(v.strictObject({
|
|
@@ -191,8 +191,8 @@ const setQueryLeafSchema = v.union([
|
|
|
191
191
|
})
|
|
192
192
|
]);
|
|
193
193
|
/**
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
Schema for validating Set queries
|
|
195
|
+
@internal
|
|
196
196
|
*/
|
|
197
197
|
const setQuerySchema = v.lazy(() => v.union([
|
|
198
198
|
setQueryLeafSchema,
|
|
@@ -200,20 +200,20 @@ const setQuerySchema = v.lazy(() => v.union([
|
|
|
200
200
|
v.strictObject({ or: v.pipe(v.array(setQuerySchema), v.minLength(1, "OR groups must contain at least one query")) })
|
|
201
201
|
]));
|
|
202
202
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
Schema for validating Set queries
|
|
204
|
+
@internal
|
|
205
205
|
*/
|
|
206
206
|
const setQueriesSchema = v.optional(v.nullable(setQuerySchema), null);
|
|
207
207
|
/**
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
Schema for validating Set items sort
|
|
209
|
+
@internal
|
|
210
210
|
*/
|
|
211
211
|
const setItemsSortSchema = v.optional(v.variant("target", [
|
|
212
212
|
v.strictObject({ target: v.literal("none") }),
|
|
213
213
|
v.strictObject({
|
|
214
214
|
target: v.literal("title"),
|
|
215
215
|
direction: sortDirectionSchema,
|
|
216
|
-
language:
|
|
216
|
+
language: defaultLanguageSchema
|
|
217
217
|
}),
|
|
218
218
|
v.strictObject({
|
|
219
219
|
target: v.literal("date"),
|
|
@@ -233,7 +233,7 @@ const setItemsSortSchema = v.optional(v.variant("target", [
|
|
|
233
233
|
"IDREF"
|
|
234
234
|
]),
|
|
235
235
|
direction: sortDirectionSchema,
|
|
236
|
-
language:
|
|
236
|
+
language: defaultLanguageSchema
|
|
237
237
|
}),
|
|
238
238
|
v.strictObject({
|
|
239
239
|
target: v.literal("distance"),
|
|
@@ -243,36 +243,36 @@ const setItemsSortSchema = v.optional(v.variant("target", [
|
|
|
243
243
|
})
|
|
244
244
|
]), { target: "none" });
|
|
245
245
|
/**
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
Schema for validating the parameters for the Set property values fetching function
|
|
247
|
+
@internal
|
|
248
248
|
*/
|
|
249
249
|
const setPropertyValuesParametersSchema = v.object({
|
|
250
250
|
setScopeUuids: v.pipe(v.array(uuidSchema), v.minLength(1, "At least one set scope UUID is required")),
|
|
251
251
|
belongsToCollectionScopeUuids: v.optional(v.array(uuidSchema), []),
|
|
252
252
|
queries: setQueriesSchema,
|
|
253
253
|
attributes: v.optional(v.object({
|
|
254
|
-
bibliographies:
|
|
255
|
-
periods:
|
|
254
|
+
bibliographies: defaultFalseSchema,
|
|
255
|
+
periods: defaultFalseSchema
|
|
256
256
|
}), {
|
|
257
257
|
bibliographies: false,
|
|
258
258
|
periods: false
|
|
259
259
|
}),
|
|
260
|
-
isLimitedToLeafPropertyValues:
|
|
261
|
-
language:
|
|
260
|
+
isLimitedToLeafPropertyValues: defaultFalseSchema,
|
|
261
|
+
language: defaultLanguageSchema
|
|
262
262
|
});
|
|
263
263
|
/**
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
Schema for validating the parameters for the item OCR data fetching function
|
|
265
|
+
@internal
|
|
266
266
|
*/
|
|
267
267
|
const itemOcrDataParametersSchema = v.object({
|
|
268
268
|
uuid: uuidSchema,
|
|
269
269
|
value: v.pipe(v.string(), v.check((value) => value.trim() !== "", "A search value is required")),
|
|
270
270
|
matchMode: v.optional(v.picklist(["includes", "exact"]), "includes"),
|
|
271
|
-
isCaseSensitive:
|
|
271
|
+
isCaseSensitive: defaultFalseSchema
|
|
272
272
|
});
|
|
273
273
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
Schema for validating Set items parameters
|
|
275
|
+
@internal
|
|
276
276
|
*/
|
|
277
277
|
const containerItemsParametersEntries = {
|
|
278
278
|
belongsToCollectionScopeUuids: v.optional(v.array(uuidSchema), []),
|
|
@@ -286,8 +286,8 @@ const setItemsParametersSchema = v.object({
|
|
|
286
286
|
...containerItemsParametersEntries
|
|
287
287
|
});
|
|
288
288
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
Schema for validating the parameters of the item locations fetching function
|
|
290
|
+
@internal
|
|
291
291
|
*/
|
|
292
292
|
const itemLocationsParametersSchema = v.pipe(v.object({
|
|
293
293
|
setScopeUuids: v.optional(v.array(uuidSchema), []),
|