Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update elasticsearch package to be compatible with elasticsearch8
The previous package was producing an error[^1]. Given that the old npm package is deprecated[^2], I've switched to the new recommended client. The new npm package has a peculiar (though well reasoned) versioning scheme. The major version of the new npm package denotes the minimum supported elasticsearch server version. The package is (apparently) given forward compatibility with newer version. So in this case, using version 7, means we can talk to elasticsearch7 and elasticsearch8 (but not elasticsearch6). This does mean that breaking changes, like dropping node versions, can occur in a minor release, hence the more restrictive versioning constraint (~7.17.0 instead of ^7.17.0). [1] fixes error: ``` -------------- create index -------------- /home/runner/work/schema/schema/node_modules/elasticsearch/src/lib/utils.js:303 throw new TypeError(err); ^ TypeError: Invalid apiVersion "8.0", expected a function or one of _default, 7.6, 7.5, 7.4, 7.3, 7.2, 7.1, 7.0, 6.8, 5.6, 7.7, 7.x, master at Object.utils.funcEnum (/home/runner/work/schema/schema/node_modules/elasticsearch/src/lib/utils.js:303:13) at new Client (/home/runner/work/schema/schema/node_modules/elasticsearch/src/lib/client.js:74:33) at Object.<anonymous> (/home/runner/work/schema/schema/scripts/create_index.js:11:16) at Module._compile (node:internal/modules/cjs/loader:1196:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10) at Module.load (node:internal/modules/cjs/loader:1074:32) at Function.Module._load (node:internal/modules/cjs/loader:909:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 Error: Process completed with exit code 1. ``` [2] old package is deprecated From https://www.npmjs.com/package/elasticsearch >⚠️ This client is no longer maintained. We strongly advise you to migrate to the [new Elasticsearch client](https://www.elastic.co/blog/new-elasticsearch-javascript-client-released).
- Loading branch information