# Cached APIs
# Description
A locally cached version of SCBD's most static API's.
# Install
# initializeApiStore = (opts = {})
initializes the local store (IndexedDB/WebSQL/local storage) depending on client.
# Properties: (options:Object)
const validationMap = { expiry: Number, name: String, apisUrls: Object, dataSources: Array, version: String }
# Options: apisUrls
const apisUrls = {
regions : 'https://api.cbd.int/api/v2013/thesaurus/domains/regions/terms',
countries : 'https://api.cbd.int/api/v2013/thesaurus/domains/countries/terms',
orgTypes : 'https://api.cbd.int/api/v2013/thesaurus/domains/Organization%20Types/terms',
govTypes : 'https://api.cbd.int/api/v2013/thesaurus/domains/Organization%20Types/terms',
aichis : 'https://api.cbd.int/api/v2013/thesaurus/domains/AICHI-TARGETS/terms',
subjects : 'https://api.cbd.int/api/v2013/thesaurus/domains/CBD-SUBJECTS/terms',
jurisdictions: 'https://api.cbd.int/api/v2013/thesaurus/domains/50AC1489-92B8-4D99-965A-AAE97A80F38E/terms',
sdgs : 'https://unstats.un.org/SDGAPI/v1/sdg/Goal/List?includechildren=false'
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# Options: dataSources
const dataSources = [ ...Object.keys(apisUrls), 'geoLocations', 'actionCategories', 'all', 'documentStates' ]
# getData = async (dataSource, noCache=false)
# lookUp = async(dataSource, keys, single=false)
# Data References
# Action Categories
[]
# Thematic Areas
[]
# Government Types
[]
# Organization Types
[]
# Regions
[]
# Aichi Biodiversity Targets
[]
# SDG's
[]
# Countries
[]
# Jurisdictions
[]
# Example
lookUp('all', ['528B1187-F1BD-4479-9FB3-ADBD9076D361', 'ca' ,'AICHI-TARGET-10','CBD-SUBJECT-ABS'])
[]#
CachedApis.getData('actionCategories')
[]
Form →