@adobe/helix-shared-config 9.0.0 → 9.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/helix-shared-config-v9.1.1](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config-v9.1.0...@adobe/helix-shared-config-v9.1.1) (2022-09-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * @adobe/helix-fetch -> @adobe/helix ([0d05930](https://github.com/adobe/helix-shared/commit/0d05930fa34bcb9f641f1bd85b603647e7b210cf))
7
+
8
+ # [@adobe/helix-shared-config-v9.1.0](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config-v9.0.0...@adobe/helix-shared-config-v9.1.0) (2022-09-13)
9
+
10
+
11
+ ### Features
12
+
13
+ * replace index definition ([#714](https://github.com/adobe/helix-shared/issues/714)) ([88b6389](https://github.com/adobe/helix-shared/commit/88b6389793f0c23181f05cd663c8129c6a95de25))
14
+
1
15
  # [@adobe/helix-shared-config-v9.0.0](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config-v8.3.0...@adobe/helix-shared-config-v9.0.0) (2022-09-13)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-shared-config",
3
- "version": "9.0.0",
3
+ "version": "9.1.1",
4
4
  "description": "Shared modules of the Helix Project - config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -28,16 +28,16 @@
28
28
  "reporter-options": "configFile=.mocha-multi.json"
29
29
  },
30
30
  "dependencies": {
31
- "@adobe/helix-fetch": "^3.0.3",
31
+ "@adobe/fetch": "^3.1.4",
32
32
  "@adobe/helix-shared-git": "^2.0.4",
33
33
  "@adobe/helix-shared-prune": "^1.0.5",
34
- "@adobe/helix-shared-utils": "^2.0.11",
34
+ "@adobe/helix-shared-utils": "^2.1.0",
35
35
  "ajv": "8.11.0",
36
36
  "ajv-formats": "2.1.1",
37
37
  "cookie": "0.5.0",
38
38
  "fs-extra": "10.1.0",
39
39
  "ignore": "5.2.0",
40
- "lru-cache": "7.10.2",
40
+ "lru-cache": "7.14.0",
41
41
  "object-hash": "3.0.0",
42
42
  "uri-js": "4.4.1",
43
43
  "yaml": "2.1.1"
@@ -63,6 +63,31 @@ class IndexConfig extends SchemaDerivedConfig {
63
63
  this._document = null;
64
64
  }
65
65
 
66
+ /**
67
+ * Replaces an index definition.
68
+ *
69
+ * @param {Object} index index configuration
70
+ * @param {string} index.name index name
71
+ * @param {Array} index.include paths to include
72
+ * @param {Array} index.exclude paths to exclude
73
+ * @param {string} index.target target
74
+ * @param {object} index.properties properties to add to the index
75
+ */
76
+ replaceIndex({
77
+ name, include, exclude, target, properties,
78
+ }) {
79
+ const { indices } = this._cfg;
80
+ indices[name] = {
81
+ include,
82
+ exclude,
83
+ target,
84
+ properties,
85
+ };
86
+
87
+ // let BaseConfig.toYAML() use the JSON output
88
+ this._document = null;
89
+ }
90
+
66
91
  /**
67
92
  * Evaluates a variable expression
68
93
  * @param {string} expression the expression to encode
@@ -9,7 +9,7 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- const fetchAPI = require('@adobe/helix-fetch');
12
+ const fetchAPI = require('@adobe/fetch');
13
13
  const { NamedMapHandler } = require('./NamedMapHandler.js');
14
14
 
15
15
  const wrap = (sitemap) => {
@@ -9,7 +9,7 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- const { Request, Response } = require('@adobe/helix-fetch');
12
+ const { Request, Response } = require('@adobe/fetch');
13
13
  const { cleanupHeaderValue } = require('@adobe/helix-shared-utils');
14
14
  const fstab = require('./MountConfig');
15
15
  const index = require('./IndexConfig');
@@ -88,7 +88,7 @@ function wrap(func, required, ...configs) {
88
88
  options.headers.authorization = authorization;
89
89
  }
90
90
 
91
- // init is a helper function in helix-fetch that makes it easy
91
+ // init is a helper function in @adobe.fetch that makes it easy
92
92
  // to recreate a request by returning the inital options
93
93
  // the request needs to be re-created because `getData` consumed
94
94
  // the body
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- const fetchAPI = require('@adobe/helix-fetch');
13
+ const fetchAPI = require('@adobe/fetch');
14
14
  const utils = require('@adobe/helix-shared-utils');
15
15
  const cache = require('./cache');
16
16