es-alchemy
Advanced tools
Comparing version 8.1.1 to 8.2.0
@@ -58,2 +58,3 @@ "use strict"; | ||
getRels: idx => versions.getRels(idx), | ||
list: idx => versions.list(idx).sort(), | ||
persist: folder => versions.persist(indices, folder), | ||
@@ -60,0 +61,0 @@ load: folder => versions.load(folder) |
@@ -71,2 +71,13 @@ "use strict"; | ||
const indexVersions = {}; | ||
const getVersions = index => { | ||
const result = indexVersions[index]; | ||
if (result === undefined) { | ||
throw new Error('Index must be loaded'); | ||
} | ||
return result; | ||
}; | ||
return { | ||
@@ -149,13 +160,5 @@ getModel: idx => Object.values(indexVersions[idx])[0].specs.model, | ||
}, | ||
list: () => Object.keys(indexVersions), | ||
get: index => { | ||
const result = indexVersions[index]; | ||
if (result === undefined) { | ||
throw new Error('Index must be loaded'); | ||
} | ||
return result; | ||
} | ||
list: (index = null) => index === null ? Object.keys(indexVersions) : Object.keys(getVersions(index)).map(v => `${index}@${v}`), | ||
get: getVersions | ||
}; | ||
}; |
{ | ||
"name": "es-alchemy", | ||
"version": "8.1.1", | ||
"version": "8.2.0", | ||
"description": "Simplification of Elasticsearch interactions", | ||
@@ -43,4 +43,4 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@babel/cli": "7.13.14", | ||
"@babel/core": "7.13.15", | ||
"@babel/cli": "7.13.16", | ||
"@babel/core": "7.13.16", | ||
"@babel/register": "7.13.14", | ||
@@ -47,0 +47,0 @@ "@blackflux/eslint-plugin-rules": "2.0.3", |
@@ -367,2 +367,3 @@ # ESAlchemy | ||
- `versions.list(name: String)` - List versions locally known for index | ||
- `versions.persist(folder: String)` - persist index versions to a specified folder (history of versions) | ||
@@ -369,0 +370,0 @@ - `versions.load(folder: String)` - loads persisted index versions into memory |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71487
1606
436