Skip to content

Latest commit

 

History

History
144 lines (92 loc) · 6.1 KB

_index_.md

File metadata and controls

144 lines (92 loc) · 6.1 KB

Module: "index"

Index

Functions

Functions

exportEntries

exportEntries(includeAssets: boolean, size: number, geoFence?: null | string | GeoFencePoint[], validAfter?: Date): Promise‹ExportEntry[]›

Exports the full StadtKatalog entries.

see https://docs.stadtkatalog.org/opendata-rest-api/#export-api

Parameters:

Name Type Default
includeAssets boolean false
size number 100
geoFence? null | string | GeoFencePoint[] -
validAfter? Date -

Returns: Promise‹ExportEntry[]›


getEntry

getEntry(id: string, validAfter?: Date): Promise‹Entry | null›

Retrieves a single entry by its ID.

see https://docs.stadtkatalog.org/opendata-rest-api/#entry-by-id

Parameters:

Name Type Description
id string the entry's id
validAfter? Date optional; if set, only return the entry if it is valid after the given point in time

Returns: Promise‹Entry | null›


getEntryData

getEntryData(id: string, validAfter?: Date): Promise‹EntryData | null›

Retrieves a entry's data by its ID. No metadata will be included.

see https://docs.stadtkatalog.org/opendata-rest-api/#entry-by-id

Parameters:

Name Type Description
id string the entry's id
validAfter? Date optional; if set, only return the entry if it is valid after the given point in time

Returns: Promise‹EntryData | null›


getEntryEnclosures

getEntryEnclosures(id: string, size: number): Promise‹Entry[] | null›

Gets all enclosed entries for the given entry.

see https://docs.stadtkatalog.org/opendata-rest-api/#entry-enclosures

Parameters:

Name Type Default Description
id string - the parent entry's id
size number 100 size of the result pages for pagination

Returns: Promise‹Entry[] | null›


searchAround

searchAround(longitude: number, latitude: number, distance: number, unit: DistanceUnit, query?: string | null, sortField: SortField, sortOrder: SortOrder, size: number, from: number, geoFence?: null | string | GeoFencePoint[], validAfter?: Date): Promise‹SearchResults | null›

Only searches around a given spot. Performs a full text queries over the following fields: name (most weighted), keywords, description.

see https://docs.stadtkatalog.org/opendata-rest-api/#location-based-query

Parameters:

Name Type Default Description
longitude number - center of the search circle
latitude number - center of the search circle
distance number - the radius of the search circle
unit DistanceUnit - the unit of the given radius distance
query? string | null - query string
sortField SortField SortField.relevance sorts the results by the given field. Note: fulltext queries cannot be sorted by distance.
sortOrder SortOrder SortOrder.desc order of the results
size number 100 order of the results, upper limit is 1,000
from number 0 the number of initial results that should be skipped
geoFence? null | string | GeoFencePoint[] - optional; a named geo-fence string, an array of points, or null if no geofence should be used.
validAfter? Date - optional; if set, only return the entry if it is valid after the given point in time

Returns: Promise‹SearchResults | null›


searchFulltext

searchFulltext(query: string, sortField: SortField, sortOrder: SortOrder, size: number, from: number, geoFence?: null | string | GeoFencePoint[], validAfter?: Date): Promise‹SearchResults | null›

Performs a full text queries over the following fields: name (most weighted), keywords, description.

see https://docs.stadtkatalog.org/opendata-rest-api/#search-api

Parameters:

Name Type Default Description
query string - query string
sortField SortField SortField.relevance sorts the results by the given field. Note: fulltext queries cannot be sorted by distance.
sortOrder SortOrder SortOrder.desc order of the results
size number 100 order of the results, upper limit is 1,000
from number 0 the number of initial results that should be skipped
geoFence? null | string | GeoFencePoint[] - optional; a named geo-fence string, an array of points, or null if no geofence should be used.
validAfter? Date - optional; if set, only return the entry if it is valid after the given point in time

Returns: Promise‹SearchResults | null›