ochre-sdk 1.0.76 → 1.0.78
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/constants.d.mts +13 -14
- package/dist/fetchers/gallery.d.mts +2 -3
- package/dist/fetchers/gallery.mjs +2 -1
- package/dist/fetchers/item-children.d.mts +3 -4
- package/dist/fetchers/item-children.mjs +2 -1
- package/dist/fetchers/item-links.d.mts +2 -3
- package/dist/fetchers/item-links.mjs +2 -1
- package/dist/fetchers/item-ocr-data.d.mts +2 -3
- package/dist/fetchers/item.d.mts +7 -8
- package/dist/fetchers/item.mjs +2 -1
- package/dist/fetchers/set/items.d.mts +2 -3
- package/dist/fetchers/set/items.mjs +2 -1
- package/dist/fetchers/set/property-values.d.mts +2 -3
- package/dist/fetchers/set/property-values.mjs +56 -49
- package/dist/fetchers/website-metadata.d.mts +2 -3
- package/dist/fetchers/website.d.mts +2 -3
- package/dist/getters.d.mts +40 -41
- package/dist/getters.mjs +6 -31
- package/dist/helpers.d.mts +3 -4
- package/dist/parsers/helpers.d.mts +16 -17
- package/dist/parsers/index.d.mts +19 -19
- package/dist/parsers/index.mjs +65 -48
- package/dist/parsers/mdx.d.mts +3 -4
- package/dist/parsers/multilingual.d.mts +9 -10
- package/dist/parsers/string.d.mts +5 -6
- package/dist/parsers/string.mjs +124 -146
- package/dist/parsers/website/index.d.mts +4 -5
- package/dist/parsers/website/index.mjs +598 -637
- package/dist/parsers/website/reader.d.mts +3 -4
- package/dist/query.d.mts +3 -4
- package/dist/schemas.d.mts +9 -10
- package/dist/types/index.d.mts +118 -119
- package/dist/types/website.d.mts +36 -38
- package/dist/utilities.d.mts +9 -10
- package/dist/utilities.mjs +28 -25
- package/dist/xml/dates.d.mts +13 -0
- package/dist/xml/dates.mjs +49 -0
- package/dist/xml/metadata.d.mts +3 -4
- package/dist/xml/schemas.d.mts +8 -9
- package/dist/xml/schemas.mjs +20 -27
- package/dist/xml/types.d.mts +129 -131
- package/package.json +13 -12
|
@@ -3,7 +3,7 @@ import { LanguageCodes, PropertyValueContent, SimplifiedProperty } from "../../t
|
|
|
3
3
|
import { ParserOptions } from "../helpers.mjs";
|
|
4
4
|
//#region src/parsers/website/reader.d.ts
|
|
5
5
|
type WebsitePropertyContent<T extends LanguageCodes> = PropertyValueContent<T>["content"];
|
|
6
|
-
declare class WebsitePresentationReader<T extends LanguageCodes> {
|
|
6
|
+
export declare class WebsitePresentationReader<T extends LanguageCodes> {
|
|
7
7
|
private readonly sourceProperties;
|
|
8
8
|
constructor(sourceProperties: ReadonlyArray<SimplifiedProperty<T>>);
|
|
9
9
|
property(label: string): SimplifiedProperty<T> | null;
|
|
@@ -22,6 +22,5 @@ declare class WebsitePresentationReader<T extends LanguageCodes> {
|
|
|
22
22
|
get size(): number;
|
|
23
23
|
get properties(): ReadonlyArray<SimplifiedProperty<T>>;
|
|
24
24
|
}
|
|
25
|
-
declare function websitePresentationReader<T extends LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>): WebsitePresentationReader<T>;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { WebsitePresentationReader, websitePresentationReader };
|
|
25
|
+
export declare function websitePresentationReader<T extends LanguageCodes>(properties: ReadonlyArray<SimplifiedProperty<T>>): WebsitePresentationReader<T>;
|
|
26
|
+
//#endregion
|
package/dist/query.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query } from "./types/index.mjs";
|
|
2
2
|
//#region src/query.d.ts
|
|
3
|
-
declare function buildBelongsToCollectionQueryExpression(belongsToCollectionScopeUuids: Array<string>, belongsToCollectionPropertyVariableUuid: string): string | null;
|
|
3
|
+
export declare function buildBelongsToCollectionQueryExpression(belongsToCollectionScopeUuids: Array<string>, belongsToCollectionPropertyVariableUuid: string): string | null;
|
|
4
4
|
/**
|
|
5
5
|
* Compile a query tree into the XQuery `let` clauses that bind `$items` to the
|
|
6
6
|
* matching Set items
|
|
@@ -20,7 +20,7 @@ declare function buildBelongsToCollectionQueryExpression(belongsToCollectionScop
|
|
|
20
20
|
* @param parameters.scopeQueryExpression - An optional CTS query ANDed into every compiled search
|
|
21
21
|
* @returns The prolog declaring the query helpers, and the `let` clauses binding `$items`
|
|
22
22
|
*/
|
|
23
|
-
declare function buildQueryPlan(parameters: {
|
|
23
|
+
export declare function buildQueryPlan(parameters: {
|
|
24
24
|
queries: Query | null;
|
|
25
25
|
baseItemsExpression: string;
|
|
26
26
|
scopeQueryExpression?: string | null;
|
|
@@ -28,5 +28,4 @@ declare function buildQueryPlan(parameters: {
|
|
|
28
28
|
prolog: string;
|
|
29
29
|
itemsClause: string;
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
|
-
export { buildBelongsToCollectionQueryExpression, buildQueryPlan };
|
|
31
|
+
//#endregion
|
package/dist/schemas.d.mts
CHANGED
|
@@ -5,22 +5,22 @@ import * as v from "valibot";
|
|
|
5
5
|
* Schema for validating UUIDs
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
declare const uuidSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
8
|
+
export declare const uuidSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
9
9
|
/**
|
|
10
10
|
* Schema for validating language codes
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
declare const iso639_3Schema: v.SchemaWithPipe<readonly [v.StringSchema<"Language code must be a string">, v.RegexAction<string, "Language code must be exactly 3 lowercase letters">]>;
|
|
13
|
+
export declare const iso639_3Schema: v.SchemaWithPipe<readonly [v.StringSchema<"Language code must be a string">, v.RegexAction<string, "Language code must be exactly 3 lowercase letters">]>;
|
|
14
14
|
/**
|
|
15
15
|
* Valid component types for web elements
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
|
-
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">;
|
|
18
|
+
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">;
|
|
19
19
|
/**
|
|
20
20
|
* Schema for validating gallery parameters
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
|
-
declare const gallerySchema: v.ObjectSchema<{
|
|
23
|
+
export declare const gallerySchema: v.ObjectSchema<{
|
|
24
24
|
readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
25
25
|
readonly filter: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
26
26
|
readonly page: v.SchemaWithPipe<readonly [v.NumberSchema<"Page must be positive">, v.CheckAction<number, "Page must be positive">]>;
|
|
@@ -30,12 +30,12 @@ declare const gallerySchema: v.ObjectSchema<{
|
|
|
30
30
|
* Schema for validating and parsing render options
|
|
31
31
|
* @internal
|
|
32
32
|
*/
|
|
33
|
-
declare const renderOptionsSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string[]>, v.ArraySchema<v.PicklistSchema<["bold", "italic", "underline"], undefined>, undefined>]>;
|
|
33
|
+
export declare const renderOptionsSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string[]>, v.ArraySchema<v.PicklistSchema<["bold", "italic", "underline"], undefined>, undefined>]>;
|
|
34
34
|
/**
|
|
35
35
|
* Schema for validating the parameters for the Set property values fetching function
|
|
36
36
|
* @internal
|
|
37
37
|
*/
|
|
38
|
-
declare const setPropertyValuesParametersSchema: v.ObjectSchema<{
|
|
38
|
+
export declare const setPropertyValuesParametersSchema: v.ObjectSchema<{
|
|
39
39
|
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">]>;
|
|
40
40
|
readonly belongsToCollectionScopeUuids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, readonly []>;
|
|
41
41
|
readonly queries: v.OptionalSchema<v.NullableSchema<v.GenericSchema<unknown, Query>, undefined>, null>;
|
|
@@ -52,7 +52,7 @@ declare const setPropertyValuesParametersSchema: v.ObjectSchema<{
|
|
|
52
52
|
* Schema for validating the parameters for the item OCR data fetching function
|
|
53
53
|
* @internal
|
|
54
54
|
*/
|
|
55
|
-
declare const itemOcrDataParametersSchema: v.ObjectSchema<{
|
|
55
|
+
export declare const itemOcrDataParametersSchema: v.ObjectSchema<{
|
|
56
56
|
readonly uuid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>;
|
|
57
57
|
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "A search value is required">]>;
|
|
58
58
|
readonly matchMode: v.OptionalSchema<v.PicklistSchema<["includes", "exact"], undefined>, "includes">;
|
|
@@ -62,7 +62,7 @@ declare const itemOcrDataParametersSchema: v.ObjectSchema<{
|
|
|
62
62
|
* Schema for validating Set items parameters
|
|
63
63
|
* @internal
|
|
64
64
|
*/
|
|
65
|
-
declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
65
|
+
export declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
66
66
|
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">]>;
|
|
67
67
|
readonly belongsToCollectionScopeUuids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid pseudo-UUID">]>, undefined>, readonly []>;
|
|
68
68
|
readonly queries: v.OptionalSchema<v.NullableSchema<v.GenericSchema<unknown, Query>, undefined>, null>;
|
|
@@ -84,5 +84,4 @@ declare const setItemsParametersSchema: v.ObjectSchema<{
|
|
|
84
84
|
readonly page: v.OptionalSchema<v.GenericSchema<unknown, number>, 1>;
|
|
85
85
|
readonly pageSize: v.OptionalSchema<v.GenericSchema<unknown, number>, 48>;
|
|
86
86
|
}, undefined>;
|
|
87
|
-
//#endregion
|
|
88
|
-
export { componentSchema, gallerySchema, iso639_3Schema, itemOcrDataParametersSchema, renderOptionsSchema, setItemsParametersSchema, setPropertyValuesParametersSchema, uuidSchema };
|
|
87
|
+
//#endregion
|