@elastic/ems-client 8.4.1 → 8.5.1
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/.github/CODEOWNERS +2 -0
- package/CHANGELOG.md +18 -5
- package/CONTRIBUTING.md +4 -5
- package/docs/openapi/Makefile +35 -0
- package/docs/openapi/README.md +41 -0
- package/docs/openapi/components/attribution.yaml +19 -0
- package/docs/openapi/components/examples/file_service_200.json +1 -0
- package/docs/openapi/components/examples/file_service_404.xml +1 -0
- package/docs/openapi/components/examples/tile_service_200.json +1 -0
- package/docs/openapi/components/examples/tile_service_404.html +10 -0
- package/docs/openapi/ems_file_service/bundled.json +533 -0
- package/docs/openapi/ems_file_service/bundled.yaml +347 -0
- package/docs/openapi/ems_file_service/entrypoint.yaml +152 -0
- package/docs/openapi/ems_tile_service/bundled.json +307 -0
- package/docs/openapi/ems_tile_service/bundled.yaml +195 -0
- package/docs/openapi/ems_tile_service/entrypoint.yaml +92 -0
- package/package.json +1 -1
- package/src/ems_client.ts +37 -32
- package/src/index.ts +1 -1
- package/target/ems_client.d.ts +3 -2
- package/target/index.d.ts +1 -1
- package/target/node/ems_client.js +34 -34
- package/target/node/index.js +6 -0
- package/target/web/ems_client.js +68 -89
- package/target/web/index.js +1 -1
- package/test/ems_client.test.ts +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,24 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
5
|
|
|
6
|
-
## [8.
|
|
6
|
+
## [8.5.1] - 2023-11-09
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
### Added
|
|
9
|
+
- Add a new `getEmsVersion` method #204
|
|
10
|
+
- Include OpenAPI specification #196 #197
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Update release documentation #194
|
|
14
|
+
- Update dependencies #198 #205
|
|
15
|
+
- Update resources for Buildkite build # 199
|
|
16
|
+
- Migration to Node 20 #208
|
|
17
|
+
|
|
18
|
+
## [8.5.0] - 2023-08-23
|
|
19
|
+
|
|
20
|
+
- Migration from Jenkins to Buildkite for automatic testing #145 #147
|
|
21
|
+
- Detached the releases of EMS Client from the services consumed #185
|
|
22
|
+
- Updated the client to support date based versions #185
|
|
23
|
+
- Update dependencies #159 #165 #173 #176 #181 #184
|
|
11
24
|
|
|
12
25
|
## [8.4.0] - 2023-01-11
|
|
13
26
|
|
|
@@ -27,7 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
27
40
|
|
|
28
41
|
## [8.3.1] - 2022-05-06
|
|
29
42
|
|
|
30
|
-
|
|
43
|
+
- Added static methods to help translating basemap labels and blending colors to paint properties #105
|
|
31
44
|
- Add optional `format` argument to `getMinZoom` and `getMaxZoom` #90
|
|
32
45
|
|
|
33
46
|
## [8.3.0] - 2022-04-18
|
package/CONTRIBUTING.md
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Releasing
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> ℹ️ Before 8.5.0, releases for @elastic/ems-client must match the corresponding minor version of Elastic Maps Service (EMS). Patch releases (e.g. v7.2.1) can be created for bug fixes. **8.5.0** is the first release decoupled of the rest of the Elastic Stack given the stability of the EMS services, and will only do new releases when necessary.
|
|
6
6
|
|
|
7
7
|
> ℹ️ Elastic Maps Service may not have minor releases. For example, there are no v7.1 or v7.3 releases for EMS. So @elastic/ems-client may also skip minor releases.
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
If you have access to make releases, the process is as follows:
|
|
11
11
|
|
|
12
|
-
1. Be sure you have checked out the `master` branch and have pulled latest changes
|
|
13
|
-
1. Update the version in `package.json`
|
|
14
|
-
1. If necessary, update the `DEFAULT_EMS_VERSION` constant in `ems_client.js`.
|
|
12
|
+
1. Be sure you have checked out the `master` or released branch and have pulled latest changes
|
|
13
|
+
1. Update the version in `package.json` accordingly.
|
|
15
14
|
1. Update the CHANGELOG.md
|
|
16
15
|
1. Commit changes with message "bump to x.y.z" where x.y.z is the version in package.json
|
|
17
16
|
1. Tag the commit with `git tag vx.y.x`, for example `git tag v7.2.1`
|
|
@@ -19,7 +18,7 @@ If you have access to make releases, the process is as follows:
|
|
|
19
18
|
1. Update the latest major branch on upstream with `git push upstream <major_branch>`
|
|
20
19
|
1. Build the targets with `yarn build`
|
|
21
20
|
1. Publish to npm with `npm publish --access public`
|
|
22
|
-
|
|
21
|
+
1. If necessary, push the new branch upstream and create/archive Snyk targets
|
|
23
22
|
|
|
24
23
|
## Continuous Integration
|
|
25
24
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.DEFAULT_GOAL=help
|
|
2
|
+
|
|
3
|
+
.PHONY: help
|
|
4
|
+
help: ## Show this help message
|
|
5
|
+
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
|
|
6
|
+
|
|
7
|
+
.PHONY: clean
|
|
8
|
+
clean: ## remove generated spec files
|
|
9
|
+
find . -name "bundled.*" -delete
|
|
10
|
+
|
|
11
|
+
.PHONY: validate
|
|
12
|
+
validate: ## Validate the specs
|
|
13
|
+
@npx swagger-cli validate "ems_file_service/entrypoint.yaml"
|
|
14
|
+
@npx swagger-cli validate "ems_tile_service/entrypoint.yaml"
|
|
15
|
+
|
|
16
|
+
.PHONY: dev-validate
|
|
17
|
+
dev-validate: ## Listen for changes on specs and validate
|
|
18
|
+
ls ems_file_service/entrypoint.yaml ems_tile_service/entrypoint.yaml \
|
|
19
|
+
| entr -c make validate
|
|
20
|
+
|
|
21
|
+
.PHONY: bundle
|
|
22
|
+
bundle:
|
|
23
|
+
for e in ems_file_service ems_tile_service; do \
|
|
24
|
+
for f in yaml json; do \
|
|
25
|
+
npx @redocly/cli bundle \
|
|
26
|
+
--output "$${e}/bundled.$${f}" \
|
|
27
|
+
--ext "$${f}" "$${e}/entrypoint.yaml";\
|
|
28
|
+
done; \
|
|
29
|
+
done;
|
|
30
|
+
$(MAKE) lint
|
|
31
|
+
|
|
32
|
+
.PHONY: lint
|
|
33
|
+
lint: ## lint bundled.json
|
|
34
|
+
@npx @redocly/cli lint ems_file_service/bundled.json
|
|
35
|
+
@npx @redocly/cli lint ems_tile_service/bundled.json
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# OpenAPI (Experimental)
|
|
2
|
+
|
|
3
|
+
Spec files for Elastic Map Service manifests can be used for online tools like those found at https://openapi.tools/.
|
|
4
|
+
|
|
5
|
+
* **EMS Tile Service** as [JSON](https://raw.githubusercontent.com/elastic/ems-client/master/docs/openapi/ems_tile_service/bundled.json) or [YAML](https://raw.githubusercontent.com/elastic/ems-client/master/docs/openapi/ems_tile_service/bundled.yaml)
|
|
6
|
+
* **EMS File Service** as [JSON](https://raw.githubusercontent.com/elastic/ems-client/master/docs/openapi/ems_file_service/bundled.json) or [YAML](https://raw.githubusercontent.com/elastic/ems-client/master/docs/openapi/ems_file_service/bundled.yaml)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/).
|
|
10
|
+
|
|
11
|
+
## Tools
|
|
12
|
+
|
|
13
|
+
You can use the `Makefile` script with the `validate`, `bundle`, and `clean` targets.
|
|
14
|
+
|
|
15
|
+
Alternatively, you can run this validate the docs before bundling them with the following command in the `docs/openapi/` folder:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
for e in ems_file_service ems_tile_service; do
|
|
19
|
+
npx swagger-cli validate "${e}/entrypoint.yaml";
|
|
20
|
+
done
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then you can generate the `bundled` files by running the following commands:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
for e in ems_file_service ems_tile_service; do
|
|
27
|
+
for f in yaml json; do
|
|
28
|
+
npx @redocly/cli bundle \
|
|
29
|
+
--output "${e}/bundled.${f}" \
|
|
30
|
+
--ext "${f}" "${e}/entrypoint.yaml"
|
|
31
|
+
done
|
|
32
|
+
done
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
You can run additional linting with the following command:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
for e in ems_file_service ems_tile_service; do
|
|
39
|
+
npx @redocly/cli lint "${e}/bundled.json";
|
|
40
|
+
done
|
|
41
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type: array
|
|
2
|
+
description: The attribution of this data
|
|
3
|
+
minItems: 1
|
|
4
|
+
items:
|
|
5
|
+
type: object
|
|
6
|
+
properties:
|
|
7
|
+
label:
|
|
8
|
+
type: object
|
|
9
|
+
properties:
|
|
10
|
+
en:
|
|
11
|
+
type: string
|
|
12
|
+
description: English attribution label
|
|
13
|
+
url:
|
|
14
|
+
type: object
|
|
15
|
+
properties:
|
|
16
|
+
en:
|
|
17
|
+
type: string
|
|
18
|
+
description: Attribution details URL
|
|
19
|
+
format: URL
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "version": "2023-10-31", "layers": [ { "layer_id": "world_countries", "created_at": "2020-10-28T16:16:08.720286", "attribution": [ { "label": { "en": "Made with NaturalEarth" }, "url": { "en": "http://www.naturalearthdata.com/about/terms-of-use" } }, { "label": { "en": "OpenStreetMap contributors" }, "url": { "en": "https://www.openstreetmap.org/copyright" } }, { "label": { "en": "Elastic Maps Service" }, "url": { "en": "https://www.elastic.co/elastic-maps-service" } } ], "formats": [ { "type": "topojson", "url": "/files/world_countries_v7.topo.json", "legacy_default": true, "meta": { "feature_collection_path": "data" } }, { "type": "geojson", "url": "/files/world_countries_v7.geo.json", "legacy_default": false } ], "fields": [ { "type": "id", "id": "iso2", "label": { "en": "ISO 3166-1 alpha-2 code", "af": "landkode (ISO 3166-1 alpha-2)", "ar": "أيزو 3166-1 حرفي-2" }, "regex": "^[A-Z]{2}$", "alias": ["(geo\\.){0,}country_iso_code$", "(country|countries)"], "values": ["AD", "AE", "ZW"] }, { "type": "id", "id": "iso3", "label": { "en": "ISO 3166-1 alpha-3 code", "af": "landkode (ISO 3166-1 alpha-3)", "ar": "أيزو 3166-1 حرفي-3" }, "regex": "^[A-Z]{3}$", "values": ["AND", "ARE", "ZWE"] }, { "type": "id", "id": "iso_numeric", "label": { "en": "ISO 3166-1 numeric code", "af": "landkode (ISO 3166-1 numeries)", "ar": "رمز إيزو الرقمي 3166-1" } }, { "type": "property", "id": "name", "label": { "en": "name", "am": "ስም" }, "alias": ["(country|countries)"] } ], "legacy_ids": ["World Countries"], "layer_name": { "en": "World Countries", "zh-tw": "國家" } }, { "layer_id": "administrative_regions_lvl2", "created_at": "2020-07-06T22:19:49.290894", "attribution": [ { "label": { "en": "Made with NaturalEarth" }, "url": { "en": "http://www.naturalearthdata.com/about/terms-of-use" } }, { "label": { "en": "OpenStreetMap contributors" }, "url": { "en": "https://www.openstreetmap.org/copyright" } }, { "label": { "en": "Elastic Maps Service" }, "url": { "en": "https://www.elastic.co/elastic-maps-service" } } ], "formats": [ { "type": "topojson", "url": "/files/admin_regions_lvl2_v2.topo.json", "legacy_default": true, "meta": { "feature_collection_path": "data" } }, { "type": "geojson", "url": "/files/admin_regions_lvl2_v2.geo.json", "legacy_default": false } ], "fields": [ { "type": "id", "id": "region_iso_code", "label": { "en": "Region ISO code" }, "regex": "^[A-Z]{2}-[A-Z0-9]{1,3}~?$", "alias": ["(geo\\.){0,}region_iso_code"], "values": ["AD-02", "AD-03", "AD-04"] }, { "type": "property", "id": "region_name", "label": { "en": "Region name" } }, { "type": "property", "id": "country_iso2_code", "label": { "en": "Country ISO2 code" } }, { "type": "property", "id": "country_iso3_code", "label": { "en": "Country ISO3 code" } }, { "type": "property", "id": "country_name", "label": { "en": "Country name" } } ], "legacy_ids": ["Administrative regions"], "layer_name": { "en": "Administrative regions", "zh-sg": "行政领土实体", "zh-tw": "行政領土實體" } }, { "layer_id": "albania_counties", "created_at": "2019-08-06T22:16:16.377Z", "attribution": [ { "label": { "en": "OpenStreetMap contributors" }, "url": { "en": "https://www.openstreetmap.org/copyright" } }, { "label": { "en": "Elastic Maps Service" }, "url": { "en": "https://www.elastic.co/elastic-maps-service" } } ], "formats": [ { "type": "geojson", "url": "/files/albania_counties_v1.geo.json", "legacy_default": true } ], "fields": [ { "type": "id", "id": "iso_3166_2", "label": { "en": "ISO 3166-2 code", "af": "ISO 3166-2", "ar": "أيزو 3166-2" }, "values": ["AL-05", "AL-01", "AL-12"] }, { "type": "property", "id": "label_en", "label": { "en": "name (en)", "am": "ስም (en)", "ar": "الاسم (en)" } }, { "type": "property", "id": "label_sq", "label": { "en": "name (sq)", "am": "ስም (sq)", "ar": "الاسم (sq)" } } ], "legacy_ids": ["Albania Counties"], "layer_name": { "en": "Albania Counties", "zh-sg": "阿尔巴尼亚行政区划", "zh-tw": "阿爾巴尼亞行政區劃" } } ] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message></Error>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version": "2023-10-31", "services": [{"id": "road_map", "name": {"en": "Classic"}, "attribution": [{"label": {"en": "OpenStreetMap contributors"}, "url": {"en": "https://www.openstreetmap.org/copyright"}}, {"label": {"en": "OpenMapTiles"}, "url": {"en": "https://openmaptiles.org"}}, {"label": {"en": "Elastic Maps Service"}, "url": {"en": "https://www.elastic.co/elastic-maps-service"}}], "formats": [{"locale": "en", "format": "vector", "url": "/2023-10-31/styles/osm-bright/style.json"}, {"locale": "en", "format": "raster", "url": "/2023-10-31/styles/osm-bright.json"}]}, {"id": "road_map_desaturated", "name": {"en": "Light"}, "attribution": [{"label": {"en": "OpenStreetMap contributors"}, "url": {"en": "https://www.openstreetmap.org/copyright"}}, {"label": {"en": "OpenMapTiles"}, "url": {"en": "https://openmaptiles.org"}}, {"label": {"en": "Elastic Maps Service"}, "url": {"en": "https://www.elastic.co/elastic-maps-service"}}], "formats": [{"locale": "en", "format": "vector", "url": "/2023-10-31/styles/osm-bright-desaturated/style.json"}, {"locale": "en", "format": "raster", "url": "/2023-10-31/styles/osm-bright-desaturated.json"}]}, {"id": "dark_map", "name": {"en": "Dark"}, "attribution": [{"label": {"en": "OpenStreetMap contributors"}, "url": {"en": "https://www.openstreetmap.org/copyright"}}, {"label": {"en": "OpenMapTiles"}, "url": {"en": "https://openmaptiles.org"}}, {"label": {"en": "Elastic Maps Service"}, "url": {"en": "https://www.elastic.co/elastic-maps-service"}}], "formats": [{"locale": "en", "format": "vector", "url": "/2023-10-31/styles/dark-matter/style.json"}, {"locale": "en", "format": "raster", "url": "/2023-10-31/styles/dark-matter.json"}]}]}
|