@luzmo/analytics-components-kit 1.0.1-alpha.87 → 1.0.1-alpha.90
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/angular/components/display-settings-binning.component.ts +2 -2
- package/angular/components/display-settings-datetime.component.ts +2 -2
- package/angular/components/display-settings-grand-totals.component.ts +2 -2
- package/angular/components/display-settings-numeric.component.ts +2 -2
- package/angular/components/display-settings.component.ts +3 -3
- package/angular/components/draggable-data-item/index.ts +1 -0
- package/angular/components/draggable-data-item/types.ts +42 -0
- package/angular/components/draggable-data-item-level/index.ts +1 -0
- package/angular/components/draggable-data-item-level/types.ts +15 -0
- package/angular/components/draggable-data-item-level.component.ts +4 -10
- package/angular/components/draggable-data-item.component.ts +4 -10
- package/angular/components/droppable-slot/index.ts +1 -0
- package/angular/components/droppable-slot/types.ts +16 -0
- package/angular/components/droppable-slot.component.ts +5 -3
- package/angular/components/slot-menu/index.ts +1 -0
- package/angular/components/slot-menu/types.ts +31 -0
- package/angular/components/slot-menu-list.component.ts +2 -2
- package/angular/components/slot-menu.component.ts +3 -3
- package/angular/esm/components/display-settings-binning.component.d.ts +2 -1
- package/angular/esm/components/display-settings-datetime.component.d.ts +2 -2
- package/angular/esm/components/display-settings-grand-totals.component.d.ts +2 -1
- package/angular/esm/components/display-settings-numeric.component.d.ts +2 -1
- package/angular/esm/components/display-settings.component.d.ts +3 -3
- package/angular/esm/components/draggable-data-item/index.d.ts +1 -0
- package/angular/esm/components/draggable-data-item/index.js +1 -0
- package/angular/esm/components/draggable-data-item/types.d.ts +21 -0
- package/angular/esm/components/draggable-data-item/types.js +1 -0
- package/angular/esm/components/draggable-data-item-level/index.d.ts +1 -0
- package/angular/esm/components/draggable-data-item-level/index.js +1 -0
- package/angular/esm/components/draggable-data-item-level/types.d.ts +12 -0
- package/angular/esm/components/draggable-data-item-level/types.js +1 -0
- package/angular/esm/components/draggable-data-item-level.component.d.ts +9 -7
- package/angular/esm/components/draggable-data-item-level.component.js +2 -17
- package/angular/esm/components/draggable-data-item.component.d.ts +9 -7
- package/angular/esm/components/draggable-data-item.component.js +2 -17
- package/angular/esm/components/droppable-slot/index.d.ts +1 -0
- package/angular/esm/components/droppable-slot/index.js +1 -0
- package/angular/esm/components/droppable-slot/types.d.ts +9 -0
- package/angular/esm/components/droppable-slot/types.js +1 -0
- package/angular/esm/components/droppable-slot.component.d.ts +5 -4
- package/angular/esm/components/droppable-slot.component.js +7 -2
- package/angular/esm/components/slot-menu/index.d.ts +1 -0
- package/angular/esm/components/slot-menu/index.js +1 -0
- package/angular/esm/components/slot-menu/types.d.ts +25 -0
- package/angular/esm/components/slot-menu/types.js +1 -0
- package/angular/esm/components/slot-menu-list.component.d.ts +2 -1
- package/angular/esm/components/slot-menu.component.d.ts +3 -3
- package/angular/esm/types.d.ts +9 -3
- package/angular/tsconfig.json +3 -0
- package/angular/types.ts +24 -3
- package/angular/utils/base/base.d.ts +16 -0
- package/angular/utils/base/focus-visible.d.ts +29 -0
- package/angular/utils/base/focusable.d.ts +58 -0
- package/angular/utils/base/index.d.ts +4 -0
- package/angular/utils/base/sized-mixin.d.ts +17 -0
- package/angular/utils/color/color-palettes.d.ts +17 -0
- package/angular/utils/color/extrapolate-color.d.ts +1 -0
- package/angular/utils/data/load-draggable-items-for-datasets.d.ts +24 -0
- package/angular/utils/data-broker/index.d.ts +191 -0
- package/angular/utils/data-item-types/calculate-data-item-icon.d.ts +10 -0
- package/angular/utils/data-item-types/tests/calculate-data-item-icon.test.d.ts +1 -0
- package/angular/utils/drag/draggable.d.ts +13 -0
- package/angular/utils/filters/expressions.d.ts +15 -0
- package/angular/utils/filters/index.d.ts +1 -0
- package/angular/utils/formatter/calculate-duration.d.ts +2 -0
- package/angular/utils/formatter/decompose-numeric-format.d.ts +11 -0
- package/angular/utils/formatter/default-local-formats.d.ts +20 -0
- package/angular/utils/formatter/formats/cs.d.ts +20 -0
- package/angular/utils/formatter/formats/da.d.ts +20 -0
- package/angular/utils/formatter/formats/de.d.ts +21 -0
- package/angular/utils/formatter/formats/en-GB.d.ts +21 -0
- package/angular/utils/formatter/formats/en-US.d.ts +1 -0
- package/angular/utils/formatter/formats/en.d.ts +1 -0
- package/angular/utils/formatter/formats/es.d.ts +54 -0
- package/angular/utils/formatter/formats/fi.d.ts +20 -0
- package/angular/utils/formatter/formats/fr.d.ts +54 -0
- package/angular/utils/formatter/formats/he.d.ts +20 -0
- package/angular/utils/formatter/formats/hu.d.ts +20 -0
- package/angular/utils/formatter/formats/it.d.ts +54 -0
- package/angular/utils/formatter/formats/ja.d.ts +20 -0
- package/angular/utils/formatter/formats/ko.d.ts +20 -0
- package/angular/utils/formatter/formats/mk.d.ts +20 -0
- package/angular/utils/formatter/formats/nl.d.ts +21 -0
- package/angular/utils/formatter/formats/no.d.ts +21 -0
- package/angular/utils/formatter/formats/pl.d.ts +20 -0
- package/angular/utils/formatter/formats/pt.d.ts +20 -0
- package/angular/utils/formatter/formats/ru.d.ts +20 -0
- package/angular/utils/formatter/formats/sv.d.ts +20 -0
- package/angular/utils/formatter/formats/tr.d.ts +21 -0
- package/angular/utils/formatter/formats/zh-CN.d.ts +20 -0
- package/angular/utils/formatter/formats/zh-TW.d.ts +20 -0
- package/angular/utils/formatter/formatter.d.ts +9 -0
- package/angular/utils/formatter/localize.d.ts +3 -0
- package/angular/utils/formatter/smart-datetime-formats.const.d.ts +36 -0
- package/angular/utils/get-css-variable.d.ts +1 -0
- package/angular/utils/index.d.ts +7 -0
- package/angular/utils/localize/set-locale.d.ts +7 -0
- package/angular/utils/map-tile-providers/index.d.ts +93 -0
- package/angular/utils/store/slot-context.d.ts +4 -0
- package/angular/utils/store/slot-store.d.ts +39 -0
- package/angular/utils/switch-item/index.d.ts +14 -0
- package/angular/utils/themes/bliss.d.ts +43 -0
- package/angular/utils/themes/classic-dark.d.ts +34 -0
- package/angular/utils/themes/classic.d.ts +43 -0
- package/angular/utils/themes/default-dark.d.ts +46 -0
- package/angular/utils/themes/default.d.ts +46 -0
- package/angular/utils/themes/index.d.ts +3 -0
- package/angular/utils/themes/orion.d.ts +44 -0
- package/angular/utils/themes/pinky.d.ts +42 -0
- package/angular/utils/themes/radiant.d.ts +42 -0
- package/angular/utils/themes/royale.d.ts +36 -0
- package/angular/utils/themes/seasonal.d.ts +43 -0
- package/angular/utils/themes/urban.d.ts +44 -0
- package/angular/utils/themes/vivid.d.ts +42 -0
- package/angular/utils/time/formats.const.d.ts +4 -0
- package/angular/utils/time/periods.const.d.ts +15 -0
- package/angular/utils/transformations/convert-data-item-to-slot-content.d.ts +9 -0
- package/angular/utils/transformations/convert-datasets-to-draggable-items.d.ts +17 -0
- package/angular/utils/transformations/tests/convert-data-item-to-slot-content.test.d.ts +1 -0
- package/angular/utils/transformations/tests/convert-datasets-to-draggable-items.test.d.ts +1 -0
- package/angular/utils/types/type-check.d.ts +7 -0
- package/components/ai-chat-message-assistant/index.cjs +1 -1
- package/components/ai-chat-message-assistant/index.js +0 -1
- package/components/calculate-data-item-icon-DMDhKq_m.js +147 -0
- package/components/{calculate-data-item-icon-CX4VW9Km.cjs → calculate-data-item-icon-DtVGbet3.cjs} +1 -1
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +1 -1
- package/components/display-settings/display-settings.d.ts +4 -2
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-binning/display-settings-binning.d.ts +2 -1
- package/components/display-settings-datetime/display-settings-datetime.d.ts +2 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +4 -4
- package/components/display-settings-grand-totals/display-settings-grand-totals.d.ts +2 -1
- package/components/display-settings-numeric/display-settings-numeric.d.ts +2 -1
- package/components/display-settings-numeric/index.cjs +10 -10
- package/components/display-settings-numeric/index.js +5 -5
- package/components/draggable-data-item/draggable-data-item.d.ts +5 -7
- package/components/draggable-data-item/index.cjs +14 -22
- package/components/draggable-data-item/index.d.ts +1 -0
- package/components/draggable-data-item/index.js +80 -88
- package/components/draggable-data-item/types.d.ts +21 -0
- package/components/draggable-data-item-level/draggable-data-item-level.d.ts +4 -6
- package/components/draggable-data-item-level/helpers/generate-preview.d.ts +9 -1
- package/components/draggable-data-item-level/index.cjs +13 -13
- package/components/draggable-data-item-level/index.js +84 -102
- package/components/draggable-data-item-level/types.d.ts +12 -0
- package/components/droppable-slot/droppable-slot.d.ts +4 -2
- package/components/droppable-slot/index.cjs +13 -13
- package/components/droppable-slot/index.d.ts +1 -0
- package/components/droppable-slot/index.js +198 -199
- package/components/droppable-slot/types.d.ts +9 -0
- package/components/{en-CtCctD2c.js → en-D3ihEGXg.js} +67 -67
- package/components/{en--a5SfjnM.cjs → en-DZcn_iz_.cjs} +1 -1
- package/components/{en-GB-CXVKFWyH.cjs → en-GB-TqvgIw9B.cjs} +1 -1
- package/components/{en-GB-CbNfyZMo.js → en-GB-ialeqj_z.js} +1 -1
- package/components/filter-data-item-picker/index.cjs +1 -1
- package/components/filter-data-item-picker/index.js +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +8 -8
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +1 -1
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +1 -1
- package/components/{get-css-variable-CuDaWSjr.cjs → get-css-variable-COd1d84B.cjs} +3 -3
- package/components/{get-css-variable-DEf4GhTH.js → get-css-variable-CdwF98oh.js} +31 -31
- package/components/grid/index.cjs +1 -7
- package/components/grid/index.js +0 -7
- package/components/{index-BUal0r_D.cjs → index-BekTY3Em.cjs} +1 -1
- package/components/index-CFL6gmIu.cjs +20 -0
- package/components/{index-3WsfvkZF.js → index-CqKpf0B8.js} +1 -1
- package/components/{index-BGb_wRRW.js → index-DNPULp4A.js} +177 -188
- package/components/index.cjs +1 -1
- package/components/index.js +26 -24
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +2 -2
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.d.ts +1 -0
- package/components/slot-menu/index.js +64 -69
- package/components/slot-menu/slot-menu.d.ts +7 -6
- package/components/slot-menu/types.d.ts +25 -0
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +2 -2
- package/components/slot-menu-list/slot-menu-list.d.ts +2 -1
- package/components/utils.cjs +1 -1
- package/components/utils.js +129 -62
- package/custom-elements.json +123 -126
- package/item-definitions/slicer-filter/slicer-filter-options.config.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +9 -3
- package/utils/data/load-draggable-items-for-datasets.d.ts +24 -0
- package/utils/data-broker/index.d.ts +69 -66
- package/utils/data-item-types/calculate-data-item-icon.d.ts +8 -2
- package/utils/data-item-types/tests/calculate-data-item-icon.test.d.ts +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/transformations/convert-data-item-to-slot-content.d.ts +9 -0
- package/utils/transformations/convert-datasets-to-draggable-items.d.ts +17 -0
- package/utils/transformations/tests/convert-data-item-to-slot-content.test.d.ts +1 -0
- package/utils/transformations/tests/convert-datasets-to-draggable-items.test.d.ts +1 -0
- package/components/calculate-data-item-icon-C8CbsMQf.js +0 -139
- package/components/index-D1Y5TRsH.cjs +0 -20
- package/utils/types/column.types.d.ts +0 -57
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Column, Formula, JoinType } from '@luzmo/dashboard-contents-types';
|
|
1
2
|
/**
|
|
2
3
|
* Configuration options for the DataBroker
|
|
3
4
|
*/
|
|
@@ -11,58 +12,69 @@ export interface DataBrokerConfig {
|
|
|
11
12
|
retry?: number;
|
|
12
13
|
retryDelay?: (attempt: number) => number;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
export interface DatasetListItem {
|
|
16
|
+
id: string;
|
|
17
|
+
name: Record<string, string>;
|
|
18
|
+
description?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
export interface DatasetColumnMetadata extends Pick<Column, 'id' | 'name' | 'description' | 'type' | 'subtype' | 'format' | 'lowestLevel' | 'expression' | 'joins' | 'duration_levels' | 'duration_format' | 'hierarchyLevels' | 'currency'> {
|
|
21
|
+
hidden?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type DatasetFormulaMetadata = Partial<Formula> & Pick<Formula, 'id' | 'name' | 'expression'> & {
|
|
24
|
+
hidden?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export interface DatasetMetadata extends DatasetListItem {
|
|
27
|
+
columns: DatasetColumnMetadata[];
|
|
28
|
+
formulas: DatasetFormulaMetadata[];
|
|
29
|
+
outgoingJoins?: JoinType[];
|
|
30
|
+
dateLoaded?: Date;
|
|
31
|
+
}
|
|
32
|
+
export type DatasetSummary = Pick<DatasetMetadata, 'id' | 'name' | 'columns'>;
|
|
33
|
+
interface ApiRequestInclude {
|
|
34
|
+
model: string;
|
|
35
|
+
attributes?: string[];
|
|
36
|
+
include?: ApiRequestInclude[];
|
|
37
|
+
separate?: boolean;
|
|
38
|
+
order?: [string, 'asc' | 'desc'][];
|
|
39
|
+
as?: string;
|
|
40
|
+
}
|
|
41
|
+
interface ApiRequestFindClause {
|
|
42
|
+
where?: Record<string, unknown>;
|
|
43
|
+
limit?: number;
|
|
44
|
+
offset?: number;
|
|
45
|
+
attributes?: string[];
|
|
46
|
+
include?: ApiRequestInclude[];
|
|
47
|
+
queries?: unknown[];
|
|
48
|
+
search?: {
|
|
49
|
+
match_types: string[];
|
|
50
|
+
keyphrase: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
interface ApiRequestPayload {
|
|
54
|
+
action: 'get';
|
|
55
|
+
version: string;
|
|
56
|
+
find?: ApiRequestFindClause;
|
|
57
|
+
key?: string;
|
|
58
|
+
token?: string;
|
|
59
|
+
}
|
|
60
|
+
interface PaginatedApiResponse<T> {
|
|
61
|
+
data: T[];
|
|
62
|
+
pagination: PaginationResult;
|
|
63
|
+
}
|
|
64
|
+
interface DatasetSearchResult {
|
|
65
|
+
data: DatasetListItem[];
|
|
66
|
+
pagination?: PaginationResult;
|
|
67
|
+
}
|
|
68
|
+
interface PaginationOptions {
|
|
18
69
|
offset?: number;
|
|
19
70
|
limit?: number;
|
|
20
71
|
}
|
|
21
|
-
|
|
22
|
-
* Pagination result metadata
|
|
23
|
-
*/
|
|
24
|
-
export interface PaginationResult {
|
|
72
|
+
interface PaginationResult {
|
|
25
73
|
offset: number;
|
|
26
74
|
limit: number;
|
|
27
75
|
total: number;
|
|
28
76
|
pages: number;
|
|
29
77
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Dataset query parameters
|
|
32
|
-
*/
|
|
33
|
-
export interface DatasetQueryParams {
|
|
34
|
-
filter?: Record<string, any>;
|
|
35
|
-
sort?: Record<string, 'asc' | 'desc'>;
|
|
36
|
-
page?: number;
|
|
37
|
-
limit?: number;
|
|
38
|
-
columns?: string[];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Dataset resource
|
|
42
|
-
*/
|
|
43
|
-
export interface Dataset {
|
|
44
|
-
id: string;
|
|
45
|
-
name: string;
|
|
46
|
-
description?: string;
|
|
47
|
-
createdAt?: string;
|
|
48
|
-
updatedAt?: string;
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Dataset column
|
|
53
|
-
*/
|
|
54
|
-
export interface Column {
|
|
55
|
-
id: string;
|
|
56
|
-
name: string;
|
|
57
|
-
description?: string;
|
|
58
|
-
dataType: string;
|
|
59
|
-
category?: string;
|
|
60
|
-
hidden?: boolean;
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Performance metrics
|
|
65
|
-
*/
|
|
66
78
|
export interface PerformanceMetrics {
|
|
67
79
|
validating: number;
|
|
68
80
|
preparing: number;
|
|
@@ -108,34 +120,29 @@ export declare class DataBroker {
|
|
|
108
120
|
* @returns API response
|
|
109
121
|
* @throws {Error} If API request fails
|
|
110
122
|
*/
|
|
111
|
-
fetchApi<T>(endpoint: string, jsonBody?:
|
|
123
|
+
fetchApi<T>(endpoint: string, jsonBody?: ApiRequestPayload, options?: RequestInit): Promise<T>;
|
|
112
124
|
/**
|
|
113
125
|
* Fetch all available datasets with pagination support
|
|
114
126
|
* @param options - Pagination options
|
|
115
127
|
* @returns Paginated list of datasets
|
|
116
128
|
*/
|
|
117
|
-
fetchAllDatasets(options?: PaginationOptions): Promise<
|
|
118
|
-
data: Dataset[];
|
|
119
|
-
pagination: PaginationResult;
|
|
120
|
-
}>;
|
|
129
|
+
fetchAllDatasets(options?: PaginationOptions): Promise<PaginatedApiResponse<DatasetListItem>>;
|
|
121
130
|
/**
|
|
122
131
|
* Search datasets by name or description
|
|
123
132
|
* @param query - Search query
|
|
124
133
|
* @returns List of matching datasets
|
|
125
134
|
*/
|
|
126
|
-
searchDatasets(query: string, options?: PaginationOptions): Promise<
|
|
135
|
+
searchDatasets(query: string, options?: PaginationOptions): Promise<DatasetSearchResult>;
|
|
127
136
|
/**
|
|
128
|
-
*
|
|
129
|
-
* @param
|
|
130
|
-
* @returns
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
* @param datasetId - Dataset ID
|
|
136
|
-
* @returns Dataset details
|
|
137
|
+
* Fetches multiple datasets with their associated columns and formulas metadata
|
|
138
|
+
* @param datasetIds - Array of dataset IDs to fetch
|
|
139
|
+
* @returns Promise that resolves to an array of DatasetMetadata objects containing:
|
|
140
|
+
* - Basic dataset info (id, name, description)
|
|
141
|
+
* - Columns with metadata including joins, hierarchy levels, and currency info
|
|
142
|
+
* - Formulas with their expressions and currency associations
|
|
143
|
+
* @throws Error if datasetIds is empty or null
|
|
137
144
|
*/
|
|
138
|
-
|
|
145
|
+
fetchDatasetsWithColumnsAndFormulas(datasetIds: string[]): Promise<DatasetMetadata[]>;
|
|
139
146
|
/**
|
|
140
147
|
* Fetch data from a dataset with filtering
|
|
141
148
|
* @param datasetId - Dataset ID
|
|
@@ -175,13 +182,9 @@ export declare class DataBroker {
|
|
|
175
182
|
* @returns Singleton instance
|
|
176
183
|
*/
|
|
177
184
|
static getInstance(config?: DataBrokerConfig): DataBroker;
|
|
178
|
-
fetchDatasetsRecursive(initialDatasetIds: string[]): Promise<
|
|
185
|
+
fetchDatasetsRecursive(initialDatasetIds: string[]): Promise<DatasetMetadata[]>;
|
|
179
186
|
private postProcessDatasetMetadata;
|
|
180
|
-
getAvailableDatasets():
|
|
181
|
-
id: string;
|
|
182
|
-
name: string;
|
|
183
|
-
columns: any[];
|
|
184
|
-
}[];
|
|
187
|
+
getAvailableDatasets(): DatasetSummary[];
|
|
185
188
|
getLinkedDatasetsIds(datasetId: string): string[];
|
|
186
189
|
}
|
|
187
190
|
export declare const dataBroker: DataBroker;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { IconDefinition } from '@luzmo/icons';
|
|
2
2
|
import { ElementSize } from '@luzmo/lucero';
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
import type { DraggableDataItemData } from '../../components/draggable-data-item/types';
|
|
4
|
+
export type DataItemIconType = 'array[hierarchy]' | 'array[datetime]' | 'array[numeric]' | 'array[currency]' | 'array[duration]' | 'coordinates' | 'currency' | 'date' | 'datetime' | 'derived' | 'duration' | 'hierarchy' | 'image' | 'numeric' | 'spatial' | 'topography' | 'ipaddress' | 'formula';
|
|
5
|
+
export type IconSize = Extract<ElementSize, 's' | 'm' | 'l' | 'xl'>;
|
|
6
|
+
export declare const dataIconTree: Record<DataItemIconType, Record<IconSize, IconDefinition>>;
|
|
7
|
+
export declare const dataIconSizeByElementSize: Record<ElementSize, IconSize>;
|
|
8
|
+
export declare const normalizeDataIconSize: (size?: ElementSize) => IconSize;
|
|
9
|
+
export declare const calculateDataItemIcon: (data: Pick<DraggableDataItemData, "type" | "subtype" | "lowestLevel">, size?: ElementSize) => IconDefinition;
|
|
10
|
+
export declare const calculateDataItemSecondaryIcon: (data: Pick<DraggableDataItemData, "formulaId" | "columnId" | "expression">, size?: ElementSize) => IconDefinition | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { loadDraggableItemsForDatasets } from './data/load-draggable-items-for-datasets';
|
|
1
2
|
export { decomposeNumericFormat } from './formatter/decompose-numeric-format';
|
|
2
3
|
export { formatter } from './formatter/formatter';
|
|
3
4
|
export { localize } from './formatter/localize';
|
|
4
5
|
export { switchItem } from './switch-item';
|
|
5
6
|
export * from './themes';
|
|
7
|
+
export { convertDatasetsToDraggableItems } from './transformations/convert-datasets-to-draggable-items';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GenericSlotContent } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { DraggableDataItemData } from '../../components/draggable-data-item/types';
|
|
3
|
+
/**
|
|
4
|
+
* Converts data coming from a draggable data item (representing a Dataset column or formula) to the expected format for Luzmo slot contents.
|
|
5
|
+
* @param data{DraggableDataItemData} - The DraggableDataItemData object to convert.
|
|
6
|
+
* @param isSublevelDrop{boolean} - Whether the drop is a sublevel drop.
|
|
7
|
+
* @returns - The GenericSlotContent object.
|
|
8
|
+
*/
|
|
9
|
+
export declare const convertDataItemToSlotContent: (data: DraggableDataItemData, isSublevelDrop: boolean) => GenericSlotContent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DraggableDataItemData } from '../../components/draggable-data-item/types';
|
|
2
|
+
import type { DatasetMetadata } from '../data-broker/index';
|
|
3
|
+
export interface DatasetWithDraggableDataItems {
|
|
4
|
+
id: string;
|
|
5
|
+
name: Record<string, string>;
|
|
6
|
+
description?: Record<string, string>;
|
|
7
|
+
dataItems: DraggableDataItemData[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Converts DataBroker dataset metadata to datasets with draggable data items.
|
|
11
|
+
* @param datasets Array of datasets to convert.
|
|
12
|
+
* @param options Mapping options to control visibility and item types.
|
|
13
|
+
* @returns Array of datasets, each containing its metadata and draggable data items.
|
|
14
|
+
*/
|
|
15
|
+
export declare const convertDatasetsToDraggableItems: (datasets: DatasetMetadata[], options?: {
|
|
16
|
+
includeHidden?: boolean;
|
|
17
|
+
}) => DatasetWithDraggableDataItems[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
-
* must be used according to the Luzmo Terms of Service.
|
|
7
|
-
* This license allows users with a current active Luzmo account
|
|
8
|
-
* to use the Luzmo Web Components. This license terminates
|
|
9
|
-
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
-
* SOFTWARE.
|
|
19
|
-
* */
|
|
20
|
-
import { luzmoTypeArrayHierarchy as l, luzmoTypeArrayHierarchy14 as A, luzmoTypeArrayHierarchy12 as g, luzmoTypeArrayDatetime as o, luzmoTypeArrayDatetime14 as C, luzmoTypeArrayDatetime12 as I, luzmoTypeArrayCurrency as a, luzmoTypeArrayCurrency14 as b, luzmoTypeArrayCurrency12 as v, luzmoTypeArrayDuration as t, luzmoTypeArrayDuration14 as H, luzmoTypeArrayDuration12 as N, luzmoTypeArrayNumeric as p, luzmoTypeArrayNumeric14 as F, luzmoTypeArrayNumeric12 as S, luzmoTypeImage as i, luzmoTypeImage14 as j, luzmoTypeImage12 as k, luzmoTypeTopography as u, luzmoTypeCoordinates as n, luzmoTypeCoordinates14 as q, luzmoTypeCoordinates12 as w, luzmoTypeCurrency as c, luzmoTypeCurrency14 as B, luzmoTypeCurrency12 as E, luzmoTypeDuration as T, luzmoTypeDuration14 as G, luzmoTypeDuration12 as J, luzmoTypeNumeric as s, luzmoTypeNumeric14 as K, luzmoTypeNumeric12 as L, luzmoTypeTime as z, luzmoTypeTime14 as M, luzmoTypeTime12 as O, luzmoTypeDate as d, luzmoTypeDate14 as P, luzmoTypeDate12 as Q, luzmoTypeDatetime as h, luzmoTypeDatetime14 as R, luzmoTypeDatetime12 as U, luzmoTypeIpAddress as f, luzmoTypeIpAddress14 as V, luzmoTypeIpAddress12 as W, luzmoTypeHierarchy as D, luzmoTypeHierarchy14 as X, luzmoTypeHierarchy12 as Y, luzmoTypeDerived as x, luzmoTypeDerived14 as Z, luzmoTypeDerived12 as _, luzmoFormula as m } from "@luzmo/icons";
|
|
21
|
-
const y = {
|
|
22
|
-
"array[hierarchy]": {
|
|
23
|
-
s: g,
|
|
24
|
-
m: A,
|
|
25
|
-
l,
|
|
26
|
-
xl: l
|
|
27
|
-
},
|
|
28
|
-
"array[datetime]": {
|
|
29
|
-
s: I,
|
|
30
|
-
m: C,
|
|
31
|
-
l: o,
|
|
32
|
-
xl: o
|
|
33
|
-
},
|
|
34
|
-
"array[numeric]": {
|
|
35
|
-
s: S,
|
|
36
|
-
m: F,
|
|
37
|
-
l: p,
|
|
38
|
-
xl: p
|
|
39
|
-
},
|
|
40
|
-
"array[currency]": {
|
|
41
|
-
s: v,
|
|
42
|
-
m: b,
|
|
43
|
-
l: a,
|
|
44
|
-
xl: a
|
|
45
|
-
},
|
|
46
|
-
"array[duration]": {
|
|
47
|
-
s: N,
|
|
48
|
-
m: H,
|
|
49
|
-
l: t,
|
|
50
|
-
xl: t
|
|
51
|
-
},
|
|
52
|
-
coordinates: {
|
|
53
|
-
s: w,
|
|
54
|
-
m: q,
|
|
55
|
-
l: n,
|
|
56
|
-
xl: n
|
|
57
|
-
},
|
|
58
|
-
currency: {
|
|
59
|
-
s: E,
|
|
60
|
-
m: B,
|
|
61
|
-
l: c,
|
|
62
|
-
xl: c
|
|
63
|
-
},
|
|
64
|
-
date: {
|
|
65
|
-
s: Q,
|
|
66
|
-
m: P,
|
|
67
|
-
l: d,
|
|
68
|
-
xl: d
|
|
69
|
-
},
|
|
70
|
-
datetime: {
|
|
71
|
-
s: U,
|
|
72
|
-
m: R,
|
|
73
|
-
l: h,
|
|
74
|
-
xl: h
|
|
75
|
-
},
|
|
76
|
-
derived: {
|
|
77
|
-
s: _,
|
|
78
|
-
m: Z,
|
|
79
|
-
l: x,
|
|
80
|
-
xl: x
|
|
81
|
-
},
|
|
82
|
-
duration: {
|
|
83
|
-
s: J,
|
|
84
|
-
m: G,
|
|
85
|
-
l: T,
|
|
86
|
-
xl: T
|
|
87
|
-
},
|
|
88
|
-
hierarchy: {
|
|
89
|
-
s: Y,
|
|
90
|
-
m: X,
|
|
91
|
-
l: D,
|
|
92
|
-
xl: D
|
|
93
|
-
},
|
|
94
|
-
image: {
|
|
95
|
-
s: k,
|
|
96
|
-
m: j,
|
|
97
|
-
l: i,
|
|
98
|
-
xl: i
|
|
99
|
-
},
|
|
100
|
-
numeric: {
|
|
101
|
-
s: L,
|
|
102
|
-
m: K,
|
|
103
|
-
l: s,
|
|
104
|
-
xl: s
|
|
105
|
-
},
|
|
106
|
-
time: {
|
|
107
|
-
s: O,
|
|
108
|
-
m: M,
|
|
109
|
-
l: z,
|
|
110
|
-
xl: z
|
|
111
|
-
},
|
|
112
|
-
topography: {
|
|
113
|
-
s: u,
|
|
114
|
-
m: u,
|
|
115
|
-
l: u,
|
|
116
|
-
xl: u
|
|
117
|
-
},
|
|
118
|
-
ipaddress: {
|
|
119
|
-
s: W,
|
|
120
|
-
m: V,
|
|
121
|
-
l: f,
|
|
122
|
-
xl: f
|
|
123
|
-
},
|
|
124
|
-
formula: {
|
|
125
|
-
s: m,
|
|
126
|
-
m,
|
|
127
|
-
l: m,
|
|
128
|
-
xl: m
|
|
129
|
-
}
|
|
130
|
-
}, ee = (e, r = "m") => {
|
|
131
|
-
if (e === "formula")
|
|
132
|
-
return y.formula[r];
|
|
133
|
-
if (e === "derived")
|
|
134
|
-
return y.derived[r];
|
|
135
|
-
}, re = (e, r = "m") => e?.type === "array[hierarchy]" ? y["array[hierarchy]"][r] : e?.type === "array[datetime]" ? y["array[datetime]"][r] : e?.type === "array[numeric]" ? e?.subtype === "currency" ? y["array[currency]"][r] : e?.subtype === "duration" ? y["array[duration]"][r] : y["array[numeric]"][r] : e?.type === "image" ? y.image[r] : e?.type === "spatial" ? e?.subtype === "topography" ? y.topography[r] : y.coordinates[r] : e?.type === "numeric" ? e?.subtype === "currency" ? y.currency[r] : e?.subtype === "duration" ? y.duration[r] : y.numeric[r] : e?.type === "datetime" ? e?.subtype === "time" ? y.time[r] : e?.subtype === "date" ? y.date[r] : y.datetime[r] : e?.type === "hierarchy" && e?.subtype === "ipaddress" ? y.ipaddress[r] : y.hierarchy[r];
|
|
136
|
-
export {
|
|
137
|
-
ee as a,
|
|
138
|
-
re as c
|
|
139
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
-
* must be used according to the Luzmo Terms of Service.
|
|
7
|
-
* This license allows users with a current active Luzmo account
|
|
8
|
-
* to use the Luzmo Web Components. This license terminates
|
|
9
|
-
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
-
* SOFTWARE.
|
|
19
|
-
* */
|
|
20
|
-
"use strict";var T=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Z={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},X=class{#t=Z;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Q=new X;function Y(t){setTimeout(t,0)}var M=typeof window>"u"||"Deno"in globalThis;function v(){}function tt(t,e){return typeof t=="function"?t(e):t}function et(t){return typeof t=="number"&&t>=0&&t!==1/0}function st(t,e){return Math.max(t+(e||0)-Date.now(),0)}function E(t,e){return typeof t=="function"?t(e):t}function it(t,e){return typeof t=="function"?t(e):t}function U(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:o,stale:r}=t;if(o){if(i){if(e.queryHash!==j(o,e.options))return!1}else if(!F(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof r=="boolean"&&e.isStale()!==r||n&&n!==e.state.fetchStatus||a&&!a(e))}function x(t,e){const{exact:s,status:i,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(q(e.options.mutationKey)!==q(a))return!1}else if(!F(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function j(t,e){return(e?.queryKeyHashFn||q)(t)}function q(t){return JSON.stringify(t,(e,s)=>R(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function F(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>F(t[s],e[s])):!1}var rt=Object.prototype.hasOwnProperty;function $(t,e){if(t===e)return t;const s=L(t)&&L(e);if(!s&&!(R(t)&&R(e)))return e;const n=(s?t:Object.keys(t)).length,a=s?e:Object.keys(e),o=a.length,r=s?new Array(o):{};let u=0;for(let h=0;h<o;h++){const f=s?h:a[h],l=t[f],m=e[f];if(l===m){r[f]=l,(s?h<n:rt.call(t,f))&&u++;continue}if(l===null||m===null||typeof l!="object"||typeof m!="object"){r[f]=m;continue}const w=$(l,m);r[f]=w,w===l&&u++}return n===o&&u===n?t:r}function L(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function R(t){if(!H(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!H(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function H(t){return Object.prototype.toString.call(t)==="[object Object]"}function nt(t){return new Promise(e=>{Q.setTimeout(e,t)})}function at(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?$(t,e):e}function ot(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function ut(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var I=Symbol();function J(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===I?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ht=class extends T{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!M&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},B=new ht;function ct(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),t(n)},s.reject=n=>{i({status:"rejected",reason:n}),e(n)},s}var lt=Y;function ft(){let t=[],e=0,s=r=>{r()},i=r=>{r()},n=lt;const a=r=>{e?t.push(r):n(()=>{s(r)})},o=()=>{const r=t;t=[],r.length&&n(()=>{i(()=>{r.forEach(u=>{s(u)})})})};return{batch:r=>{let u;e++;try{u=r()}finally{e--,e||o()}return u},batchCalls:r=>(...u)=>{a(()=>{r(...u)})},schedule:a,setNotifyFunction:r=>{s=r},setBatchNotifyFunction:r=>{i=r},setScheduler:r=>{n=r}}}var y=ft(),dt=class extends T{#t=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!M&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#t}},A=new dt;function yt(t){return Math.min(1e3*2**t,3e4)}function _(t){return(t??"online")==="online"?A.isOnline():!0}var K=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function z(t){let e=!1,s=0,i;const n=ct(),a=()=>n.status!=="pending",o=c=>{if(!a()){const p=new K(c);m(p),t.onCancel?.(p)}},r=()=>{e=!0},u=()=>{e=!1},h=()=>B.isFocused()&&(t.networkMode==="always"||A.isOnline())&&t.canRun(),f=()=>_(t.networkMode)&&t.canRun(),l=c=>{a()||(i?.(),n.resolve(c))},m=c=>{a()||(i?.(),n.reject(c))},w=()=>new Promise(c=>{i=p=>{(a()||h())&&c(p)},t.onPause?.()}).then(()=>{i=void 0,a()||t.onContinue?.()}),d=()=>{if(a())return;let c;const p=s===0?t.initialPromise:void 0;try{c=p??t.fn()}catch(g){c=Promise.reject(g)}Promise.resolve(c).then(l).catch(g=>{if(a())return;const b=t.retry??(M?0:3),C=t.retryDelay??yt,P=typeof C=="function"?C(s,g):C,S=b===!0||typeof b=="number"&&s<b||typeof b=="function"&&b(s,g);if(e||!S){m(g);return}s++,t.onFail?.(s,g),nt(P).then(()=>h()?void 0:w()).then(()=>{e?m(g):d()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(i?.(),n),cancelRetry:r,continueRetry:u,canStart:f,start:()=>(f()?d():w().then(d),n)}}var W=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),et(this.gcTime)&&(this.#t=Q.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(M?1/0:5*60*1e3))}clearGcTimeout(){this.#t&&(Q.clearTimeout(this.#t),this.#t=void 0)}},pt=class extends W{#t;#e;#s;#r;#i;#a;#o;constructor(t){super(),this.#o=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#s=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=G(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){if(this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=G(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=at(this.state.data,t,this.options);return this.#n({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#n({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>it(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===I||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>E(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!st(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const r=this.observers.find(u=>u.options.queryFn);r&&this.setOptions(r.options)}const s=new AbortController,i=r=>{Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},n=()=>{const r=J(this.options,e),h=(()=>{const f={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(f),f})();return this.#o=!1,this.options.persister?this.options.persister(r,h,this):r(h)},o=(()=>{const r={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:n};return i(r),r})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#n({type:"fetch",meta:o.fetchOptions?.meta}),this.#i=z({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:r=>{r instanceof K&&r.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(r,u)=>{this.#n({type:"failed",failureCount:r,error:u})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const r=await this.#i.start();if(r===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(r),this.#s.config.onSuccess?.(r,this),this.#s.config.onSettled?.(r,this.state.error,this),r}catch(r){if(r instanceof K){if(r.silent)return this.#i.promise;if(r.revert){if(this.state.data===void 0)throw r;return this.state.data}}throw this.#n({type:"error",error:r}),this.#s.config.onError?.(r,this),this.#s.config.onSettled?.(this.state.data,r,this),r}finally{this.scheduleGc()}}#n(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...mt(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=t.manual?i:void 0,i;case"error":const n=t.error;return{...s,error:n,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),y.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function mt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function G(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function N(t){return{onFetch:(e,s)=>{const i=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let r={pages:[],pageParams:[]},u=0;const h=async()=>{let f=!1;const l=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},m=J(e.options,e.fetchOptions),w=async(d,c,p)=>{if(f)return Promise.reject();if(c==null&&d.pages.length)return Promise.resolve(d);const b=(()=>{const k={client:e.client,queryKey:e.queryKey,pageParam:c,direction:p?"backward":"forward",meta:e.options.meta};return l(k),k})(),C=await m(b),{maxPages:P}=e.options,S=p?ut:ot;return{pages:S(d.pages,C,P),pageParams:S(d.pageParams,c,P)}};if(n&&a.length){const d=n==="backward",c=d?vt:V,p={pages:a,pageParams:o},g=c(i,p);r=await w(p,g,d)}else{const d=t??a.length;do{const c=u===0?o[0]??i.initialPageParam:V(i,r);if(u>0&&c==null)break;r=await w(r,c),u++}while(u<d)}return r};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=h}}}function V(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function vt(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var gt=class extends W{#t;#e;#s;#r;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||wt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=z({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#i({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i=this.state.status==="pending",n=!this.#r.canStart();try{if(i)e();else{this.#i({type:"pending",variables:t,isPaused:n}),await this.#s.config.onMutate?.(t,this,s);const o=await this.options.onMutate?.(t,s);o!==this.state.context&&this.#i({type:"pending",context:o,variables:t,isPaused:n})}const a=await this.#r.start();return await this.#s.config.onSuccess?.(a,t,this.state.context,this,s),await this.options.onSuccess?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,t,this.state.context,s),this.#i({type:"success",data:a}),a}catch(a){try{throw await this.#s.config.onError?.(a,t,this.state.context,this,s),await this.options.onError?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,a,t,this.state.context,s),a}finally{this.#i({type:"error",error:a})}}finally{this.#s.runNext(this)}}#i(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),y.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bt=class extends T{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new gt({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=D(t);if(typeof e=="string"){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=D(t);if(typeof e=="string"){const s=this.#e.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=D(t);if(typeof e=="string"){const i=this.#e.get(e)?.find(n=>n.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=D(t);return typeof e=="string"?this.#e.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){y.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>x(e,s))}findAll(t={}){return this.getAll().filter(e=>x(t,e))}notify(t){y.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return y.batch(()=>Promise.all(t.map(e=>e.continue().catch(v))))}};function D(t){return t.options.scope?.id}var Ot=class extends T{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,s){const i=e.queryKey,n=e.queryHash??j(i,e);let a=this.get(n);return a||(a=new pt({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){y.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>U(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>U(t,s)):e}notify(t){y.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){y.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){y.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ct=class{#t;#e;#s;#r;#i;#a;#o;#n;constructor(t={}){this.#t=t.queryCache||new Ot,this.#e=t.mutationCache||new bt,this.#s=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=B.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#n=A.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#n?.(),this.#n=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#t.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(E(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#t.get(i.queryHash)?.state.data,o=tt(e,a);if(o!==void 0)return this.#t.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return y.batch(()=>this.#t.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){const e=this.#t;y.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#t;return y.batch(()=>(s.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=y.batch(()=>this.#t.findAll(t).map(n=>n.cancel(s)));return Promise.all(i).then(v).catch(v)}invalidateQueries(t,e={}){return y.batch(()=>(this.#t.findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=y.batch(()=>this.#t.findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(v)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(v)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#t.build(this,e);return s.isStaleByTime(E(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(v).catch(v)}fetchInfiniteQuery(t){return t.behavior=N(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(v).catch(v)}ensureInfiniteQueryData(t){return t.behavior=N(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return A.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#r.set(q(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],s={};return e.forEach(i=>{F(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#i.set(q(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{F(t,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=j(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===I&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};class O{constructor(e={}){this.availableDatasets=[],this.apiUrl=e.apiUrl||"https://api.luzmo.com",this.apiVersion=e.apiVersion||"0.1.0",this.authKey=e.authKey||"",this.authToken=e.authToken||"",this.queryClient=new Ct({defaultOptions:{queries:{staleTime:e.staleTime||5*60*1e3,gcTime:e.gcTime||10*60*1e3,retry:e.retry||3,retryDelay:e.retryDelay||(s=>Math.min(1e3*2**s,3e4))}}}),this.initNetworkListeners()}configure(e={}){if(e.apiVersion&&(this.apiVersion=e.apiVersion),e.apiUrl&&(this.apiUrl=e.apiUrl),e.authKey&&(this.authKey=e.authKey),e.authToken&&(this.authToken=e.authToken),e.staleTime||e.gcTime||e.retry){const s={};e.staleTime&&(s.staleTime=e.staleTime),e.gcTime&&(s.gcTime=e.gcTime),e.retry&&(s.retry=e.retry),this.queryClient.setDefaultOptions({queries:{...this.queryClient.getDefaultOptions().queries,...s}})}}initNetworkListeners(){typeof window<"u"&&window.addEventListener("online",()=>{console.warn("Network connection restored, refreshing data..."),this.refreshAll()})}getHeaders(e={}){return{"Content-Type":"application/json",...e}}async fetchApi(e,s,i={}){const n=`${this.apiUrl}/${this.apiVersion}${e}`,o={method:i.method||"POST",headers:this.getHeaders(i.headers),mode:"cors",...i};s!==void 0&&(s.key=this.authKey,s.token=this.authToken,o.body=JSON.stringify(s));try{const r=await fetch(n,o);if(!r.ok){const u=await r.json().catch(()=>null);throw r.status===401||r.status===403?new Error("Authentication failed. Please check your API token."):r.status===404?new Error(`Resource not found: ${e}`):r.status===429?new Error("Rate limit exceeded. Please try again later."):new Error(u?.message||`API request failed with status ${r.status}`)}return await r.json()}catch(r){throw console.error(`API request to ${e} failed:`,r),r instanceof Error&&(r.endpoint=e,r.timestamp=new Date().toISOString()),r}}async fetchAllDatasets(e={}){const s=e.offset||0,i=e.limit||50,n=["datasets",s,i];return await this.queryClient.fetchQuery({queryKey:n,queryFn:async()=>{const a={action:"get",version:this.apiVersion,find:{where:{type:"dataset"},limit:i,offset:s}},o=await this.fetchApi("/securable",a);return{data:o?.rows||[],pagination:{offset:s,limit:i,total:o?.count??0,pages:Math.ceil((o?.count??0)/i)}}}})}async searchDatasets(e,s){if(!e)return[];const i=["datasets","search",e,s];return await this.queryClient.fetchQuery({queryKey:i,queryFn:async()=>{const n={action:"get",version:this.apiVersion,find:{where:{type:"dataset"}}};e?.length>0&&(n.find.search={match_types:["name"],keyphrase:e}),s?.offset&&(n.find.offset=s?.offset),s?.limit&&(n.find.limit=s?.limit);const a=await this.fetchApi("/securable",n),o={data:a?.rows||[]};return s?.limit&&(o.pagination={offset:s?.offset??0,limit:s?.limit,total:a?.count??0,pages:Math.ceil((a?.count??0)/s?.limit)}),o}})}async fetchDatasetsWithColumnsAndFormulas(e){if(!e||e.length===0)throw new Error("At least one dataset ID is required");const s=["datasets",e,this.authKey,this.authToken];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{where:{type:"dataset",id:{in:e}},attributes:["name","id"],include:[{model:"Column",attributes:["id","name","description","type","subtype","format","hidden","lowestLevel","expression"],separate:!0,order:[["order","asc"]],include:[{model:"Column",attributes:["id","securable_id","hierarchy_enabled","currency_id"],as:"Joins"}]},{model:"Formula",attributes:["id","name","description","type","subtype","format","hidden","lowestLevel","expression"]}]}};return(await this.fetchApi("/securable",i))?.rows||[]}})}async fetchDataset(e){if(!e)throw new Error("Dataset ID is required");const s=["dataset",e];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{where:{type:"dataset",id:e},attributes:["name","id"],include:[{model:"Column"},{model:"Formula"}]}};return(await this.fetchApi("/securable",i))?.rows?.[0]||null}})}async fetchData(e){if(!e)throw new Error("Query is required");const s=["data",e];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{queries:[e]}},n=await this.fetchApi("/data",i);return{data:n?.data||[],performance:n?.performance||{}}}})}refreshAll(){this.queryClient.refetchQueries()}invalidateDatasetData(e){e?(this.queryClient.invalidateQueries({queryKey:["dataset",e]}),this.queryClient.invalidateQueries({queryKey:["columns",e]})):this.queryClient.invalidateQueries({queryKey:["datasets"]})}invalidateAll(){this.queryClient.clear()}static getInstance(e={}){return O.instance?Object.keys(e).length>0&&O.instance.configure(e):O.instance=new O(e),O.instance}async fetchDatasetsRecursive(e){if(!e||e.length===0)throw new Error("At least one dataset ID is required");const s=[...new Set(e)],i=new Set,n=new Map,a=o=>{o&&!i.has(o)&&!s.includes(o)&&s.push(o)};for(;s.length>0;){const o=[];for(;s.length>0&&o.length<50;){const r=s.shift();i.has(r)||o.push(r)}if(o.length!==0)try{(await this.fetchDatasetsWithColumnsAndFormulas(o)).forEach(u=>{const h=this.postProcessDatasetMetadata(u);i.add(h.id),this.queryClient.setQueryData(["dataset",h.id],h),(h.outgoingJoins??[]).map(l=>l.securable_id).filter(l=>l&&l!==h.id).forEach(l=>{a(l)}),n.set(h.id,h),this.availableDatasets.some(l=>l.id===h.id)||this.availableDatasets.push({id:h.id,name:h.name,columns:h.columns})})}catch(r){console.error("Error fetching datasets recursively:",r)}}return[...n.values()]}postProcessDatasetMetadata(e){e.dateLoaded=new Date,e.outgoingJoins=[];for(const s of e.columns)if(s.joins?.length>0)for(const i of s.joins)e.outgoingJoins.push(i);return e}getAvailableDatasets(){return this.availableDatasets}getLinkedDatasetsIds(e){const s=this.queryClient.getQueryData(["dataset",e]);return s?(s.outgoingJoins??[]).map(i=>i.securable_id).filter(i=>i&&i!==e):[]}}const qt=O.getInstance();exports.dataBroker=qt;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export type HierarchyLevel = {
|
|
2
|
-
id: string;
|
|
3
|
-
color: string;
|
|
4
|
-
level: number;
|
|
5
|
-
label: Record<string, string>;
|
|
6
|
-
name: Record<string, string>;
|
|
7
|
-
};
|
|
8
|
-
export type Currency = {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
symbol: string;
|
|
12
|
-
};
|
|
13
|
-
export type JoinType = {
|
|
14
|
-
id: string;
|
|
15
|
-
currency_id: string | null;
|
|
16
|
-
securable_id: string;
|
|
17
|
-
hierarchy_enabled?: boolean;
|
|
18
|
-
join: {
|
|
19
|
-
column_id: string;
|
|
20
|
-
created_at: string;
|
|
21
|
-
update_at: string;
|
|
22
|
-
updated_at?: string;
|
|
23
|
-
subtype?: string;
|
|
24
|
-
type: 'lookup' | 'exact';
|
|
25
|
-
joins_id: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export type Column = {
|
|
29
|
-
cardinality?: number;
|
|
30
|
-
color: string;
|
|
31
|
-
currency_id?: string;
|
|
32
|
-
currency?: Currency;
|
|
33
|
-
duration_format: 'long' | 'short' | 'time';
|
|
34
|
-
duration_levels: number[];
|
|
35
|
-
expression?: string;
|
|
36
|
-
format: string;
|
|
37
|
-
hierarchy_enabled: boolean;
|
|
38
|
-
hierarchyLevels: HierarchyLevel[];
|
|
39
|
-
highestLevel: number;
|
|
40
|
-
id: string;
|
|
41
|
-
informat?: string;
|
|
42
|
-
isLabel?: boolean;
|
|
43
|
-
joins: JoinType[];
|
|
44
|
-
level?: number;
|
|
45
|
-
lowestLevel: number;
|
|
46
|
-
name: Record<string, string>;
|
|
47
|
-
description?: Record<string, string>;
|
|
48
|
-
order?: number;
|
|
49
|
-
securable_id: string;
|
|
50
|
-
source_name?: string;
|
|
51
|
-
subtype: ColumnSubtype;
|
|
52
|
-
type: ColumnType;
|
|
53
|
-
version?: number;
|
|
54
|
-
width?: number;
|
|
55
|
-
};
|
|
56
|
-
export type ColumnType = 'numeric' | 'hierarchy' | 'datetime' | 'spatial';
|
|
57
|
-
export type ColumnSubtype = 'duration' | 'currency' | 'coordinates' | 'hierarchy_element_expression' | 'topography' | 'ip_address';
|