Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enrise-estools

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enrise-estools - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "enrise-estools",
"version": "0.0.6",
"version": "0.0.7",
"description": "Elasticsearch tooling functions for managing indices and aliases.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,3 +13,3 @@ 'use strict';

if (aliases.length > 1) {
throw new Error('Multiple aliases recieved');
throw new Error('Multiple aliases received');
}

@@ -48,2 +48,3 @@

// we don't need (aliases=manual, warmers we don't use)
// Scrubs those settings that elasticsearch does not accept as input when creating a new index
function getMapping(esClient, index) {

@@ -54,3 +55,10 @@ return esClient.indices.get({index})

mappings: indexInfo[index].mappings
}));
}))
.then(mapping => {
delete mapping.settings.index.creation_date;
delete mapping.settings.index.uuid;
delete mapping.settings.index.provided_name;
delete mapping.settings.index.version;
return mapping;
});
}

@@ -57,0 +65,0 @@

@@ -25,3 +25,3 @@ 'use strict';

describe('getAliasVersion', () => {
it('throws an error if multiple aliases are reseived', mochaAsync(async () => {
it('throws an error if multiple aliases are received', mochaAsync(async () => {
esClient.indices.getAlias.resolves({

@@ -38,3 +38,3 @@ 'enrise.nl-nl-v1': {},

chai.expect(err).to.be.an.instanceof(Error);
chai.expect(err.message).to.equal('Multiple aliases recieved');
chai.expect(err.message).to.equal('Multiple aliases received');
}

@@ -139,6 +139,12 @@ }));

it('retrieves the settings mapping from an index', mochaAsync(async () => {
it('retrieves the usefull settings mapping from an index', mochaAsync(async () => {
esClient.indices.get.resolves({
'enrise.nl-nl-v2': {
settings: {the: 'settings'},
settings: {index: {
uuid: 'a',
provided_name: 'b',
creation_date: 'f',
number_of_shards: '2',
version: {created: '12321'}
}},
mappings: {the: 'mappings'},

@@ -154,3 +160,3 @@ aliases: {the: 'aliases'},

chai.expect(result).to.deep.equal({
settings: {the: 'settings'},
settings: {index: {number_of_shards: '2'}},
mappings: {the: 'mappings'}

@@ -157,0 +163,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc