@vectoriox/iox-builder 2.2.2 → 2.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -66,16 +66,24 @@ declare enum DataSourceType {
66
66
  Shop = "shop",
67
67
  ExternalApi = "external-api",
68
68
  InternalApi = "internal-api",
69
- Static = "static"
69
+ Static = "static",
70
+ /** A VIEW into another variable: `{ from: <alias>, path }` (e.g. galleryImages = product.gallery).
71
+ * Resolves to the value one (or more) level(s) into a parent variable — page-scoped. */
72
+ Derived = "derived"
70
73
  }
71
74
  interface IoxDataSource {
72
75
  id: string;
73
- type: 'cms' | 'shop' | 'internal-api' | 'external-api' | 'static';
76
+ type: 'cms' | 'shop' | 'internal-api' | 'external-api' | 'static' | 'derived';
74
77
  mode: 'single' | 'query';
75
78
  alias: string;
76
79
  request: {
77
80
  method?: 'GET' | 'POST';
78
81
  endpoint?: string;
82
+ /** `derived` alias: resolve `from` (another alias) then getByPath(value, path). */
83
+ derived?: {
84
+ from: string;
85
+ path: string;
86
+ };
79
87
  cms?: {
80
88
  contentType: string;
81
89
  filter?: any;
@@ -1767,6 +1775,14 @@ declare class BuilderDataSourceService {
1767
1775
  * Uses the SHARED `resolveRepeaterItems` so the canvas preview matches the SSR engine.
1768
1776
  */
1769
1777
  fetchRepeaterItems(ds: IoxDataSource | undefined, sourcePath?: string): Observable<any[]>;
1778
+ /**
1779
+ * Resolve a data source BY ALIAS, following `derived` aliases (a VIEW into another variable:
1780
+ * resolve the parent, then getByPath). `findByAlias` is injected so this module stays registry-free
1781
+ * (the caller passes its own page-scoped registry). Recurses for chained derived aliases.
1782
+ */
1783
+ fetchByAlias(alias: string, findByAlias: (a: string) => IoxDataSource | undefined): Observable<any>;
1784
+ /** Repeater items for an alias (follows derived aliases + applies an optional sourcePath). */
1785
+ fetchRepeaterItemsByAlias(alias: string, findByAlias: (a: string) => IoxDataSource | undefined, sourcePath?: string): Observable<any[]>;
1770
1786
  static ɵfac: i0.ɵɵFactoryDeclaration<BuilderDataSourceService, [null, { optional: true; }]>;
1771
1787
  static ɵprov: i0.ɵɵInjectableDeclaration<BuilderDataSourceService>;
1772
1788
  }