This class allows making GET requests to the countries catalog resource in OpenGate North API.
It needs the _internalCountriesFilter client option, and there is no default. It is built that way on purpose: the catalogue is not an endpoint but an asset entity with
entityType WIRE and an identifier of the form DOMAIN_<domain>, so the caller has to say which
entity to read, the same way it says which api key to use. There is an intention to
replace this with a real catalogue endpoint and drop the option again.
new OpenGateAPI({ url, apiKey, _internalCountriesFilter: { organization: ‘myorg’, identifier: ‘DOMAIN_myorg’, ds: ‘provision.administration.countries’ } });
Without it, getCountries() used to die with
Cannot read properties of undefined (reading 'organization'), which said nothing about the
option that was missing.
constructor
Constructor
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| ogapi | InternalOpenGateAPI |
❌ | Reference to the API object. |
getCountries()
Performs a get that returns countries
Retorna
Tip
Tipo: Promise