@adobe/helix-config 5.14.0 → 5.15.0

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,10 @@
1
+ # [5.15.0](https://github.com/adobe/helix-config/compare/v5.14.0...v5.15.0) (2026-09-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * **config-view:** add partition option to restrict metadata ([#410](https://github.com/adobe/helix-config/issues/410)) ([7a3e729](https://github.com/adobe/helix-config/commit/7a3e72943cdfb9a20c1f2055abbe784e1c05cd4e))
7
+
1
8
  # [5.14.0](https://github.com/adobe/helix-config/compare/v5.13.1...v5.14.0) (2026-09-02)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "5.14.0",
3
+ "version": "5.15.0",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "eslint": "9.39.5",
45
45
  "husky": "9.1.7",
46
46
  "junit-report-builder": "5.1.2",
47
- "lint-staged": "17.3.0",
47
+ "lint-staged": "17.4.1",
48
48
  "mocha": "11.8.0",
49
49
  "mocha-multi-reporters": "1.5.1",
50
50
  "mocha-suppress-logs": "0.6.0",
@@ -337,9 +337,11 @@ async function loadProfile(ctx, rso, name) {
337
337
  * @param ctx
338
338
  * @param {RSO} rso
339
339
  * @param {string} scope
340
+ * @param {string} [partition] the partition to restrict to. if omitted or invalid,
341
+ * all partitions are returned.
340
342
  * @return {Promise<ConfigObject|null>}
341
343
  */
342
- async function resolveConfig(ctx, rso, scope) {
344
+ async function resolveConfig(ctx, rso, scope, partition) {
343
345
  // try to load site config from config-bus
344
346
  const key = `orgs/${rso.org}/sites/${rso.site}.json`;
345
347
  ctx.timer?.update('load-config');
@@ -379,10 +381,13 @@ async function resolveConfig(ctx, rso, scope) {
379
381
  const config = site.data;
380
382
  if (scope === SCOPE_PIPELINE) {
381
383
  ctx.timer?.update('metadata');
382
- config.metadata = {
383
- preview: await loadMetadata(ctx, config, 'preview'),
384
- live: await loadMetadata(ctx, config, 'live'),
385
- };
384
+ config.metadata = {};
385
+ if (partition !== 'live') {
386
+ config.metadata.preview = await loadMetadata(ctx, config, 'preview');
387
+ }
388
+ if (partition !== 'preview') {
389
+ config.metadata.live = await loadMetadata(ctx, config, 'live');
390
+ }
386
391
  }
387
392
  if (scope === SCOPE_PIPELINE || scope === SCOPE_RAW) {
388
393
  if (!config.robots) {
@@ -644,7 +649,7 @@ function computeTrustedHosts(org, site, siteConfig) {
644
649
 
645
650
  export async function getConfigResponse(ctx, opts) {
646
651
  const {
647
- ref, site, org, scope,
652
+ ref, site, org, scope, partition,
648
653
  } = opts;
649
654
  if (!VALID_SCOPES.includes(scope)) {
650
655
  return new PipelineResponse('', {
@@ -658,7 +663,7 @@ export async function getConfigResponse(ctx, opts) {
658
663
  const rso = { ref, site, org };
659
664
  let siteConfig;
660
665
  try {
661
- siteConfig = await resolveConfig(ctx, rso, scope);
666
+ siteConfig = await resolveConfig(ctx, rso, scope, partition);
662
667
  } catch (e) {
663
668
  return new PipelineResponse('', {
664
669
  status: 502,
package/src/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export declare class ConfigRequestOptions {
20
20
  org: string;
21
21
  site: string;
22
22
  ref: string;
23
+ partition?: 'preview' | 'live';
23
24
  }
24
25
 
25
26
  export function getConfigResponse(ctx: ConfigContext, opts: ConfigRequestOptions): Promise<PipelineResponse>;