@dcupl/common 2.0.0-beta.1 → 2.0.0-beta.11

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.
Files changed (36) hide show
  1. package/dist/esm/analytics.controller.d.ts +1 -1
  2. package/dist/esm/changeDetection.d.ts +2 -2
  3. package/dist/esm/computeSuggestions.d.ts +2 -2
  4. package/dist/esm/deep-query.service.d.ts +26 -1
  5. package/dist/esm/getAggregation.d.ts +1 -1
  6. package/dist/esm/getFacets.d.ts +26 -3
  7. package/dist/esm/helper.d.ts +1 -1
  8. package/dist/esm/index.d.ts +23 -22
  9. package/dist/esm/index.js +778 -600
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/indices.controller.d.ts +7 -1
  12. package/dist/esm/logger/index.d.ts +2 -2
  13. package/dist/esm/pivot.d.ts +2 -2
  14. package/dist/esm/property-parser.d.ts +27 -2
  15. package/dist/esm/query-builder.d.ts +2 -2
  16. package/dist/esm/query.helper.d.ts +1 -1
  17. package/dist/esm/queryData.d.ts +2 -2
  18. package/dist/esm/resource-id.d.ts +43 -0
  19. package/dist/esm/types/app-loader.types.d.ts +94 -4
  20. package/dist/esm/types/data.types.d.ts +7 -3
  21. package/dist/esm/types/dcupl.types.d.ts +21 -9
  22. package/dist/esm/types/facets.types.d.ts +6 -1
  23. package/dist/esm/types/filter.types.d.ts +3 -3
  24. package/dist/esm/types/group-by.types.d.ts +2 -2
  25. package/dist/esm/types/index.d.ts +17 -16
  26. package/dist/esm/types/internal.types.d.ts +1 -1
  27. package/dist/esm/types/key-property.types.d.ts +11 -0
  28. package/dist/esm/types/list.types.d.ts +20 -4
  29. package/dist/esm/types/model.types.d.ts +54 -5
  30. package/dist/esm/types/quality.types.d.ts +59 -1
  31. package/dist/esm/types/query.types.d.ts +19 -10
  32. package/dist/esm/types/section.types.d.ts +2 -2
  33. package/dist/esm/types/suggestion.types.d.ts +1 -1
  34. package/dist/node/index.cjs +2 -2
  35. package/dist/node/index.cjs.map +1 -1
  36. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { DcuplUpdateType } from './changeDetection';
1
+ import { DcuplUpdateType } from './changeDetection.js';
2
2
  export type AnalyticsEntryType = 'resource' | 'mark' | 'measure' | 'data' | 'sdk_action';
3
3
  export type AnalyticsEntryBase<Value = any> = {
4
4
  name: string;
@@ -1,5 +1,5 @@
1
- import { CallbackFunction, DcuplInitOptions } from './types';
2
- import { AnalyticsController } from './analytics.controller';
1
+ import { CallbackFunction, DcuplInitOptions } from './types/index.js';
2
+ import { AnalyticsController } from './analytics.controller.js';
3
3
  export type DcuplUpdateScope = 'all' | 'global' | 'list' | 'list$';
4
4
  export type DcuplUpdateTrigger = 'user' | 'loader';
5
5
  export type DcuplUpdateType = 'data_change' | 'dcupl_destroyed' | 'dcupl_handle_datacontainer' | 'dcupl_initialized' | 'dcupl_updated_manually' | 'dcupl_partial_update' | 'filter_many' | 'filter_one' | 'fn_aggregate' | 'fn_facets' | 'fn_groupBy' | 'fn_metadata' | 'fn_pivot' | 'fn_suggest' | 'list_created' | 'list_destroyed' | 'list_updated' | 'loader_added' | 'loader_config_fetched' | 'loader_data_fetched' | 'loader_models_fetched' | 'loader_scripts_fetched' | 'loader_processed' | 'loader_removed' | 'model_add' | 'query_apply_options' | 'query_apply' | 'query_execute' | 'query_get' | 'query_has' | 'query_many' | 'query_one' | 'query_remove' | 'query_reset' | 'result_updated' | 'view_add';
@@ -1,3 +1,3 @@
1
- import { ListItem, Suggestion, SuggestionOptions, InverseIndexValuesMap } from './types';
2
- import { QueryManager } from '.';
1
+ import { ListItem, Suggestion, SuggestionOptions, InverseIndexValuesMap } from './types/index.js';
2
+ import { QueryManager } from './index.js';
3
3
  export declare function computeSuggestions<ListType extends ListItem = ListItem>(data: Map<string, ListType>, index: InverseIndexValuesMap, options: SuggestionOptions, queryManager: QueryManager): Suggestion[];
@@ -1,4 +1,4 @@
1
- import { QueryAttributeEntry } from './query-builder';
1
+ import { QueryAttributeEntry } from './query-builder.js';
2
2
  /**
3
3
  * Result of path validation
4
4
  */
@@ -131,3 +131,28 @@ export declare class DeepQueryService {
131
131
  * Singleton instance for global use
132
132
  */
133
133
  export declare const deepQueryService: DeepQueryService;
134
+ /**
135
+ * Extract all values from an object using a path that may contain [*] wildcards.
136
+ *
137
+ * This function handles patterns like:
138
+ * - `articleIds[*].vendorId.location` - expands [*] to iterate over array elements
139
+ * - `a[*].b[*].c` - supports nested wildcards (cross-product)
140
+ * - `simple.path` - falls back to lodash get for non-wildcard paths
141
+ *
142
+ * @param item - The object to extract values from
143
+ * @param path - The path string, possibly containing [*] wildcards
144
+ * @returns Array of all values found at the path
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * const order = {
149
+ * articleIds: [
150
+ * { vendorId: { location: 'Berlin' } },
151
+ * { vendorId: { location: 'Vienna' } }
152
+ * ]
153
+ * };
154
+ * getDeepPathValues(order, 'articleIds[*].vendorId.location');
155
+ * // Returns: ['Berlin', 'Vienna']
156
+ * ```
157
+ */
158
+ export declare function getDeepPathValues(item: any, path: string): any[];
@@ -1,3 +1,3 @@
1
- import { Aggregation, AggregationDistinctValue, AggregationOptions, InverseIndexValuesMap, ListItem } from './types';
1
+ import { Aggregation, AggregationDistinctValue, AggregationOptions, InverseIndexValuesMap, ListItem } from './types/index.js';
2
2
  export declare const getAggregation: (options: AggregationOptions, relevantData: Map<string, ListItem>, indexMap: InverseIndexValuesMap, attribute: string) => Aggregation;
3
3
  export declare const getDistinct: (options: AggregationOptions, data: Map<string, ListItem>, indexMap: InverseIndexValuesMap) => AggregationDistinctValue[];
@@ -1,3 +1,26 @@
1
- import { ListItem, DcuplFilterOptions, InverseIndexReferenceMap, DcuplGlobalQueryOptions, DcuplFacet } from './types';
2
- import { QueryManager } from './queryData';
3
- export declare function getFacets<ListType extends ListItem = ListItem>(modelData: Map<string, ListType>, remoteModelData: Map<string, ListType>, options: DcuplFilterOptions, query: DcuplGlobalQueryOptions<any>, attribute: string, modelIndexMap: InverseIndexReferenceMap, queryManager: QueryManager): DcuplFacet[];
1
+ import { ListItem, DcuplFilterOptions, InverseIndexReferenceMap, DcuplGlobalQueryOptions, DcuplFacet } from './types/index.js';
2
+ import { QueryManager } from './queryData.js';
3
+ /**
4
+ * Build facet entries for `attribute`.
5
+ *
6
+ * Pipeline order — IMPORTANT, do not shuffle:
7
+ *
8
+ * Fast path (options.sort omitted, default):
9
+ * 1. walk validFacetKeys in insertion order
10
+ * 2. for each key: compute entry (binary size if calculateFacets is false)
11
+ * 3. skip if excludeZeros && size === 0 (does NOT advance count)
12
+ * 4. early-return when filterItemEntries.length === count
13
+ * 5. push and continue
14
+ *
15
+ * Sort path (options.sort set):
16
+ * 1. walk ALL validFacetKeys (ignore count for early-return)
17
+ * 2. for each key: compute entry with FULL size (override calculateFacets: false)
18
+ * 3. push every entry
19
+ * 4. drop zeros if excludeZeros
20
+ * 5. sort by chosen mode (size sorts tie-break on value asc, undefined last)
21
+ * 6. truncate to count
22
+ *
23
+ * The sort path is opt-in because it forfeits both early-return optimizations.
24
+ * Most call sites only need a partial answer and stay on the fast path.
25
+ */
26
+ export declare function getFacets<ListType extends ListItem = ListItem>(modelData: Map<string, ListType>, remoteModelData: Map<string, ListType> | undefined, options: DcuplFilterOptions, query: DcuplGlobalQueryOptions<any>, attribute: string, modelIndexMap: InverseIndexReferenceMap, queryManager: QueryManager): DcuplFacet[];
@@ -1,4 +1,4 @@
1
- import { DateFilterOptions, NumberFilterOptions } from './types';
1
+ import { DateFilterOptions, NumberFilterOptions } from './types/index.js';
2
2
  export declare const getFilterEntryId: (filterItemId: string, value?: string) => string;
3
3
  export declare const getNumberConstraintUid: (options: NumberFilterOptions) => string;
4
4
  export declare const getDateConstraintUid: (options: DateFilterOptions) => string;
@@ -1,22 +1,23 @@
1
- export * from './analytics.controller';
2
- export * from './attribute-dependency-graph';
3
- export * from './cache.controller';
4
- export * from './changeDetection';
5
- export * from './computeSuggestions';
6
- export * from './date-utils';
7
- export * from './deep-query.service';
8
- export * from './dependency-graph';
9
- export * from './getAggregation';
10
- export * from './getFacets';
11
- export * from './helper';
12
- export * from './indices.controller';
13
- export * from './logger';
14
- export * from './performance';
15
- export * from './pivot';
16
- export * from './property-parser';
17
- export * from './query-builder';
18
- export * from './query.helper';
19
- export * from './queryData';
20
- export * from './script.controller';
21
- export * from './template-parser';
22
- export * from './types';
1
+ export * from './analytics.controller.js';
2
+ export * from './attribute-dependency-graph.js';
3
+ export * from './cache.controller.js';
4
+ export * from './changeDetection.js';
5
+ export * from './computeSuggestions.js';
6
+ export * from './date-utils.js';
7
+ export * from './deep-query.service.js';
8
+ export * from './dependency-graph.js';
9
+ export * from './getAggregation.js';
10
+ export * from './getFacets.js';
11
+ export * from './helper.js';
12
+ export * from './indices.controller.js';
13
+ export * from './logger/index.js';
14
+ export * from './performance.js';
15
+ export * from './pivot.js';
16
+ export * from './property-parser.js';
17
+ export * from './query-builder.js';
18
+ export * from './query.helper.js';
19
+ export * from './queryData.js';
20
+ export * from './resource-id.js';
21
+ export * from './script.controller.js';
22
+ export * from './template-parser.js';
23
+ export * from './types/index.js';