ochre-sdk 0.19.4 → 0.19.5
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.d.mts +124 -124
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -640,129 +640,6 @@ type PropertyValueQueryItem = {
|
|
|
640
640
|
label: string | null;
|
|
641
641
|
};
|
|
642
642
|
//#endregion
|
|
643
|
-
//#region src/utils/fetchers/gallery.d.ts
|
|
644
|
-
/**
|
|
645
|
-
* Fetches and parses a gallery from the OCHRE API
|
|
646
|
-
*
|
|
647
|
-
* @param uuid - The UUID of the gallery
|
|
648
|
-
* @param filter - The filter to apply to the gallery
|
|
649
|
-
* @param page - The page number to fetch
|
|
650
|
-
* @param pageSize - The number of items per page
|
|
651
|
-
* @param options - The options for the fetch
|
|
652
|
-
* @param options.fetch - The fetch function to use
|
|
653
|
-
* @param options.version - The version of the OCHRE API to use
|
|
654
|
-
* @returns The parsed gallery or an error message if the fetch/parse fails
|
|
655
|
-
*/
|
|
656
|
-
declare function fetchGallery(uuid: string, filter: string, page: number, pageSize: number, options?: {
|
|
657
|
-
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
658
|
-
version?: ApiVersion;
|
|
659
|
-
}): Promise<{
|
|
660
|
-
item: Gallery | null;
|
|
661
|
-
error: null;
|
|
662
|
-
} | {
|
|
663
|
-
item: null;
|
|
664
|
-
error: string;
|
|
665
|
-
}>;
|
|
666
|
-
//#endregion
|
|
667
|
-
//#region src/utils/fetchers/item.d.ts
|
|
668
|
-
/**
|
|
669
|
-
* Fetches and parses an OCHRE item from the OCHRE API
|
|
670
|
-
*
|
|
671
|
-
* @param uuid - The UUID of the OCHRE item to fetch
|
|
672
|
-
* @returns Object containing the parsed OCHRE item, or an error message if the fetch/parse fails
|
|
673
|
-
*/
|
|
674
|
-
declare function fetchItem<T extends DataCategory = DataCategory, U extends DataCategory | Array<DataCategory> = (T extends "tree" ? Exclude<DataCategory, "tree"> : T extends "set" ? Array<DataCategory> : never)>(uuid: string, category?: T, itemCategories?: U, options?: {
|
|
675
|
-
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
676
|
-
version?: ApiVersion;
|
|
677
|
-
}): Promise<{
|
|
678
|
-
error: null;
|
|
679
|
-
item: Item<T, U>;
|
|
680
|
-
} | {
|
|
681
|
-
error: string;
|
|
682
|
-
item: never;
|
|
683
|
-
}>;
|
|
684
|
-
//#endregion
|
|
685
|
-
//#region src/utils/fetchers/items-by-property-values.d.ts
|
|
686
|
-
/**
|
|
687
|
-
* Fetches and parses items by property values from the OCHRE API
|
|
688
|
-
*
|
|
689
|
-
* @param params - The parameters for the fetch
|
|
690
|
-
* @param params.projectScopeUuid - The UUID of the project scope
|
|
691
|
-
* @param params.belongsToCollectionScopeUuids - The collection scope UUIDs to filter by
|
|
692
|
-
* @param params.propertyVariableUuids - The property variable UUIDs to query by
|
|
693
|
-
* @param params.propertyValues - The property values to query by
|
|
694
|
-
* @param params.page - The page number (1-indexed)
|
|
695
|
-
* @param params.pageSize - The number of items per page
|
|
696
|
-
* @param params.itemCategory - The category of the items to fetch
|
|
697
|
-
* @param params.includeChildItems - Whether to include child items of the same category
|
|
698
|
-
* @param categoryParams - The category parameters for the fetch
|
|
699
|
-
* @param categoryParams.category - The category of the items to fetch
|
|
700
|
-
* @param categoryParams.itemCategories - The categories of the items to fetch
|
|
701
|
-
* @param options - Options for the fetch
|
|
702
|
-
* @param options.fetch - The fetch function to use
|
|
703
|
-
* @param options.version - The version of the OCHRE API to use
|
|
704
|
-
* @returns The parsed items by property values or null if the fetch/parse fails
|
|
705
|
-
*/
|
|
706
|
-
declare function fetchItemsByPropertyValues<T extends DataCategory = DataCategory, U extends DataCategory | Array<DataCategory> = (T extends "tree" ? Exclude<DataCategory, "tree"> : T extends "set" ? Array<DataCategory> : never)>(params: {
|
|
707
|
-
projectScopeUuid: string;
|
|
708
|
-
belongsToCollectionScopeUuids: Array<string>;
|
|
709
|
-
propertyVariableUuids: Array<string>;
|
|
710
|
-
propertyValues: Array<{
|
|
711
|
-
dataType: Exclude<PropertyValueContentType, "coordinate">;
|
|
712
|
-
value: string;
|
|
713
|
-
}>;
|
|
714
|
-
page: number;
|
|
715
|
-
pageSize?: number;
|
|
716
|
-
itemCategory?: "resource" | "spatialUnit" | "concept" | "text";
|
|
717
|
-
includeChildItems?: boolean;
|
|
718
|
-
}, categoryParams?: {
|
|
719
|
-
category?: T;
|
|
720
|
-
itemCategories?: U;
|
|
721
|
-
}, options?: {
|
|
722
|
-
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
723
|
-
version?: ApiVersion;
|
|
724
|
-
}): Promise<{
|
|
725
|
-
totalCount: number;
|
|
726
|
-
page: number;
|
|
727
|
-
pageSize: number;
|
|
728
|
-
items: Array<Item<T, U>>;
|
|
729
|
-
error: null;
|
|
730
|
-
} | {
|
|
731
|
-
totalCount: null;
|
|
732
|
-
page: null;
|
|
733
|
-
pageSize: null;
|
|
734
|
-
items: null;
|
|
735
|
-
error: string;
|
|
736
|
-
}>;
|
|
737
|
-
//#endregion
|
|
738
|
-
//#region src/utils/fetchers/property-values-by-property-variables.d.ts
|
|
739
|
-
/**
|
|
740
|
-
* Fetches and parses property values by property variables from the OCHRE API
|
|
741
|
-
*
|
|
742
|
-
* @param params - The parameters for the fetch
|
|
743
|
-
* @param params.projectScopeUuid - The UUID of the project scope
|
|
744
|
-
* @param params.belongsToCollectionScopeUuids - The collection scope UUIDs to filter by
|
|
745
|
-
* @param params.propertyVariableUuids - The property variable UUIDs to query by
|
|
746
|
-
* @param options - Options for the fetch
|
|
747
|
-
* @param options.fetch - The fetch function to use
|
|
748
|
-
* @param options.version - The version of the OCHRE API to use
|
|
749
|
-
* @returns The parsed property values by property variables or null if the fetch/parse fails
|
|
750
|
-
*/
|
|
751
|
-
declare function fetchPropertyValuesByPropertyVariables(params: {
|
|
752
|
-
projectScopeUuid: string;
|
|
753
|
-
belongsToCollectionScopeUuids: Array<string>;
|
|
754
|
-
propertyVariableUuids: Array<string>;
|
|
755
|
-
}, options?: {
|
|
756
|
-
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
757
|
-
version?: ApiVersion;
|
|
758
|
-
}): Promise<{
|
|
759
|
-
items: Array<PropertyValueQueryItem> | null;
|
|
760
|
-
error: null;
|
|
761
|
-
} | {
|
|
762
|
-
items: null;
|
|
763
|
-
error: string;
|
|
764
|
-
}>;
|
|
765
|
-
//#endregion
|
|
766
643
|
//#region src/types/website.d.ts
|
|
767
644
|
/**
|
|
768
645
|
* Represents a level context item with a variable and value
|
|
@@ -1198,6 +1075,129 @@ type WebBlock<T extends WebBlockLayout = WebBlockLayout> = {
|
|
|
1198
1075
|
};
|
|
1199
1076
|
};
|
|
1200
1077
|
//#endregion
|
|
1078
|
+
//#region src/utils/fetchers/gallery.d.ts
|
|
1079
|
+
/**
|
|
1080
|
+
* Fetches and parses a gallery from the OCHRE API
|
|
1081
|
+
*
|
|
1082
|
+
* @param uuid - The UUID of the gallery
|
|
1083
|
+
* @param filter - The filter to apply to the gallery
|
|
1084
|
+
* @param page - The page number to fetch
|
|
1085
|
+
* @param pageSize - The number of items per page
|
|
1086
|
+
* @param options - The options for the fetch
|
|
1087
|
+
* @param options.fetch - The fetch function to use
|
|
1088
|
+
* @param options.version - The version of the OCHRE API to use
|
|
1089
|
+
* @returns The parsed gallery or an error message if the fetch/parse fails
|
|
1090
|
+
*/
|
|
1091
|
+
declare function fetchGallery(uuid: string, filter: string, page: number, pageSize: number, options?: {
|
|
1092
|
+
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
1093
|
+
version?: ApiVersion;
|
|
1094
|
+
}): Promise<{
|
|
1095
|
+
item: Gallery | null;
|
|
1096
|
+
error: null;
|
|
1097
|
+
} | {
|
|
1098
|
+
item: null;
|
|
1099
|
+
error: string;
|
|
1100
|
+
}>;
|
|
1101
|
+
//#endregion
|
|
1102
|
+
//#region src/utils/fetchers/item.d.ts
|
|
1103
|
+
/**
|
|
1104
|
+
* Fetches and parses an OCHRE item from the OCHRE API
|
|
1105
|
+
*
|
|
1106
|
+
* @param uuid - The UUID of the OCHRE item to fetch
|
|
1107
|
+
* @returns Object containing the parsed OCHRE item, or an error message if the fetch/parse fails
|
|
1108
|
+
*/
|
|
1109
|
+
declare function fetchItem<T extends DataCategory = DataCategory, U extends DataCategory | Array<DataCategory> = (T extends "tree" ? Exclude<DataCategory, "tree"> : T extends "set" ? Array<DataCategory> : never)>(uuid: string, category?: T, itemCategories?: U, options?: {
|
|
1110
|
+
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
1111
|
+
version?: ApiVersion;
|
|
1112
|
+
}): Promise<{
|
|
1113
|
+
error: null;
|
|
1114
|
+
item: Item<T, U>;
|
|
1115
|
+
} | {
|
|
1116
|
+
error: string;
|
|
1117
|
+
item: never;
|
|
1118
|
+
}>;
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/utils/fetchers/items-by-property-values.d.ts
|
|
1121
|
+
/**
|
|
1122
|
+
* Fetches and parses items by property values from the OCHRE API
|
|
1123
|
+
*
|
|
1124
|
+
* @param params - The parameters for the fetch
|
|
1125
|
+
* @param params.projectScopeUuid - The UUID of the project scope
|
|
1126
|
+
* @param params.belongsToCollectionScopeUuids - The collection scope UUIDs to filter by
|
|
1127
|
+
* @param params.propertyVariableUuids - The property variable UUIDs to query by
|
|
1128
|
+
* @param params.propertyValues - The property values to query by
|
|
1129
|
+
* @param params.page - The page number (1-indexed)
|
|
1130
|
+
* @param params.pageSize - The number of items per page
|
|
1131
|
+
* @param params.itemCategory - The category of the items to fetch
|
|
1132
|
+
* @param params.includeChildItems - Whether to include child items of the same category
|
|
1133
|
+
* @param categoryParams - The category parameters for the fetch
|
|
1134
|
+
* @param categoryParams.category - The category of the items to fetch
|
|
1135
|
+
* @param categoryParams.itemCategories - The categories of the items to fetch
|
|
1136
|
+
* @param options - Options for the fetch
|
|
1137
|
+
* @param options.fetch - The fetch function to use
|
|
1138
|
+
* @param options.version - The version of the OCHRE API to use
|
|
1139
|
+
* @returns The parsed items by property values or null if the fetch/parse fails
|
|
1140
|
+
*/
|
|
1141
|
+
declare function fetchItemsByPropertyValues<T extends DataCategory = DataCategory, U extends DataCategory | Array<DataCategory> = (T extends "tree" ? Exclude<DataCategory, "tree"> : T extends "set" ? Array<DataCategory> : never)>(params: {
|
|
1142
|
+
projectScopeUuid: string;
|
|
1143
|
+
belongsToCollectionScopeUuids: Array<string>;
|
|
1144
|
+
propertyVariableUuids: Array<string>;
|
|
1145
|
+
propertyValues: Array<{
|
|
1146
|
+
dataType: Exclude<PropertyValueContentType, "coordinate">;
|
|
1147
|
+
value: string;
|
|
1148
|
+
}>;
|
|
1149
|
+
page: number;
|
|
1150
|
+
pageSize?: number;
|
|
1151
|
+
itemCategory?: "resource" | "spatialUnit" | "concept" | "text";
|
|
1152
|
+
includeChildItems?: boolean;
|
|
1153
|
+
}, categoryParams?: {
|
|
1154
|
+
category?: T;
|
|
1155
|
+
itemCategories?: U;
|
|
1156
|
+
}, options?: {
|
|
1157
|
+
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
1158
|
+
version?: ApiVersion;
|
|
1159
|
+
}): Promise<{
|
|
1160
|
+
totalCount: number;
|
|
1161
|
+
page: number;
|
|
1162
|
+
pageSize: number;
|
|
1163
|
+
items: Array<Item<T, U>>;
|
|
1164
|
+
error: null;
|
|
1165
|
+
} | {
|
|
1166
|
+
totalCount: null;
|
|
1167
|
+
page: null;
|
|
1168
|
+
pageSize: null;
|
|
1169
|
+
items: null;
|
|
1170
|
+
error: string;
|
|
1171
|
+
}>;
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region src/utils/fetchers/property-values-by-property-variables.d.ts
|
|
1174
|
+
/**
|
|
1175
|
+
* Fetches and parses property values by property variables from the OCHRE API
|
|
1176
|
+
*
|
|
1177
|
+
* @param params - The parameters for the fetch
|
|
1178
|
+
* @param params.projectScopeUuid - The UUID of the project scope
|
|
1179
|
+
* @param params.belongsToCollectionScopeUuids - The collection scope UUIDs to filter by
|
|
1180
|
+
* @param params.propertyVariableUuids - The property variable UUIDs to query by
|
|
1181
|
+
* @param options - Options for the fetch
|
|
1182
|
+
* @param options.fetch - The fetch function to use
|
|
1183
|
+
* @param options.version - The version of the OCHRE API to use
|
|
1184
|
+
* @returns The parsed property values by property variables or null if the fetch/parse fails
|
|
1185
|
+
*/
|
|
1186
|
+
declare function fetchPropertyValuesByPropertyVariables(params: {
|
|
1187
|
+
projectScopeUuid: string;
|
|
1188
|
+
belongsToCollectionScopeUuids: Array<string>;
|
|
1189
|
+
propertyVariableUuids: Array<string>;
|
|
1190
|
+
}, options?: {
|
|
1191
|
+
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
1192
|
+
version?: ApiVersion;
|
|
1193
|
+
}): Promise<{
|
|
1194
|
+
items: Array<PropertyValueQueryItem> | null;
|
|
1195
|
+
error: null;
|
|
1196
|
+
} | {
|
|
1197
|
+
items: null;
|
|
1198
|
+
error: string;
|
|
1199
|
+
}>;
|
|
1200
|
+
//#endregion
|
|
1201
1201
|
//#region src/utils/fetchers/website.d.ts
|
|
1202
1202
|
/**
|
|
1203
1203
|
* Fetches and parses a website configuration from the OCHRE API
|
|
@@ -1351,4 +1351,4 @@ declare const DEFAULT_PAGE_SIZE = 48;
|
|
|
1351
1351
|
*/
|
|
1352
1352
|
declare function flattenItemProperties<T extends DataCategory = DataCategory, U extends DataCategory | Array<DataCategory> = (T extends "tree" ? Exclude<DataCategory, "tree"> : T extends "set" ? Array<DataCategory> : never)>(item: Item<T, U>): Item<T, U>;
|
|
1353
1353
|
//#endregion
|
|
1354
|
-
export { ApiVersion, Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, DEFAULT_API_VERSION, DEFAULT_PAGE_SIZE, Data, DataCategory, Event, FileFormat, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyValue, PropertyValueContent, PropertyValueContentType, PropertyValueQueryItem, PropertyVariable, Resource, Section, Set, SpatialUnit, Text, Tree, fetchGallery, fetchItem, fetchItemsByPropertyValues, fetchPropertyValuesByPropertyVariables, fetchWebsite, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByLabel, getPropertyByLabelAndValue, getPropertyByLabelAndValues, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
|
|
1354
|
+
export { ApiVersion, Bibliography, Concept, Context, ContextItem, ContextNode, Coordinate, DEFAULT_API_VERSION, DEFAULT_PAGE_SIZE, Data, DataCategory, Event, FileFormat, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, Item, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyContexts, PropertyValue, PropertyValueContent, PropertyValueContentType, PropertyValueQueryItem, PropertyVariable, Resource, Scope, Section, Set, SpatialUnit, Style, Text, Tree, WebBlock, WebBlockLayout, WebElement, WebElementComponent, WebImage, WebSegment, WebSegmentItem, WebTitle, Webpage, Website, WebsiteType, fetchGallery, fetchItem, fetchItemsByPropertyValues, fetchPropertyValuesByPropertyVariables, fetchWebsite, filterProperties, flattenItemProperties, getLeafPropertyValues, getPropertyByLabel, getPropertyByLabelAndValue, getPropertyByLabelAndValues, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };
|