@gooddata/sdk-code-convertors 11.28.0-alpha.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/LICENSE +7 -0
- package/README.md +42 -0
- package/esm/configs/areaChart.d.ts +113 -0
- package/esm/configs/areaChart.d.ts.map +1 -0
- package/esm/configs/areaChart.js +232 -0
- package/esm/configs/areaChart.js.map +1 -0
- package/esm/configs/barChart.d.ts +101 -0
- package/esm/configs/barChart.d.ts.map +1 -0
- package/esm/configs/barChart.js +210 -0
- package/esm/configs/barChart.js.map +1 -0
- package/esm/configs/bubbleChart.d.ts +93 -0
- package/esm/configs/bubbleChart.d.ts.map +1 -0
- package/esm/configs/bubbleChart.js +186 -0
- package/esm/configs/bubbleChart.js.map +1 -0
- package/esm/configs/bulletChart.d.ts +87 -0
- package/esm/configs/bulletChart.d.ts.map +1 -0
- package/esm/configs/bulletChart.js +174 -0
- package/esm/configs/bulletChart.js.map +1 -0
- package/esm/configs/columnChart.d.ts +101 -0
- package/esm/configs/columnChart.d.ts.map +1 -0
- package/esm/configs/columnChart.js +210 -0
- package/esm/configs/columnChart.js.map +1 -0
- package/esm/configs/comboChart.d.ts +155 -0
- package/esm/configs/comboChart.d.ts.map +1 -0
- package/esm/configs/comboChart.js +355 -0
- package/esm/configs/comboChart.js.map +1 -0
- package/esm/configs/dependencyWheelChart.d.ts +37 -0
- package/esm/configs/dependencyWheelChart.d.ts.map +1 -0
- package/esm/configs/dependencyWheelChart.js +81 -0
- package/esm/configs/dependencyWheelChart.js.map +1 -0
- package/esm/configs/donutChart.d.ts +47 -0
- package/esm/configs/donutChart.d.ts.map +1 -0
- package/esm/configs/donutChart.js +96 -0
- package/esm/configs/donutChart.js.map +1 -0
- package/esm/configs/funnelChart.d.ts +47 -0
- package/esm/configs/funnelChart.d.ts.map +1 -0
- package/esm/configs/funnelChart.js +96 -0
- package/esm/configs/funnelChart.js.map +1 -0
- package/esm/configs/geoAreaChart.d.ts +62 -0
- package/esm/configs/geoAreaChart.d.ts.map +1 -0
- package/esm/configs/geoAreaChart.js +123 -0
- package/esm/configs/geoAreaChart.js.map +1 -0
- package/esm/configs/geoChart.d.ts +49 -0
- package/esm/configs/geoChart.d.ts.map +1 -0
- package/esm/configs/geoChart.js +157 -0
- package/esm/configs/geoChart.js.map +1 -0
- package/esm/configs/headlineChart.d.ts +89 -0
- package/esm/configs/headlineChart.d.ts.map +1 -0
- package/esm/configs/headlineChart.js +124 -0
- package/esm/configs/headlineChart.js.map +1 -0
- package/esm/configs/heatmapChart.d.ts +75 -0
- package/esm/configs/heatmapChart.d.ts.map +1 -0
- package/esm/configs/heatmapChart.js +158 -0
- package/esm/configs/heatmapChart.js.map +1 -0
- package/esm/configs/lineChart.d.ts +135 -0
- package/esm/configs/lineChart.d.ts.map +1 -0
- package/esm/configs/lineChart.js +294 -0
- package/esm/configs/lineChart.js.map +1 -0
- package/esm/configs/pieChart.d.ts +47 -0
- package/esm/configs/pieChart.d.ts.map +1 -0
- package/esm/configs/pieChart.js +96 -0
- package/esm/configs/pieChart.js.map +1 -0
- package/esm/configs/pyramidChart.d.ts +47 -0
- package/esm/configs/pyramidChart.d.ts.map +1 -0
- package/esm/configs/pyramidChart.js +96 -0
- package/esm/configs/pyramidChart.js.map +1 -0
- package/esm/configs/repeaterChart.d.ts +36 -0
- package/esm/configs/repeaterChart.d.ts.map +1 -0
- package/esm/configs/repeaterChart.js +104 -0
- package/esm/configs/repeaterChart.js.map +1 -0
- package/esm/configs/sankeyChart.d.ts +39 -0
- package/esm/configs/sankeyChart.d.ts.map +1 -0
- package/esm/configs/sankeyChart.js +84 -0
- package/esm/configs/sankeyChart.js.map +1 -0
- package/esm/configs/scatterChart.d.ts +95 -0
- package/esm/configs/scatterChart.d.ts.map +1 -0
- package/esm/configs/scatterChart.js +198 -0
- package/esm/configs/scatterChart.js.map +1 -0
- package/esm/configs/table.d.ts +61 -0
- package/esm/configs/table.d.ts.map +1 -0
- package/esm/configs/table.js +169 -0
- package/esm/configs/table.js.map +1 -0
- package/esm/configs/treemapChart.d.ts +47 -0
- package/esm/configs/treemapChart.d.ts.map +1 -0
- package/esm/configs/treemapChart.js +96 -0
- package/esm/configs/treemapChart.js.map +1 -0
- package/esm/configs/types.d.ts +93 -0
- package/esm/configs/types.d.ts.map +1 -0
- package/esm/configs/types.js +3 -0
- package/esm/configs/types.js.map +1 -0
- package/esm/configs/utils.d.ts +12 -0
- package/esm/configs/utils.d.ts.map +1 -0
- package/esm/configs/utils.js +76 -0
- package/esm/configs/utils.js.map +1 -0
- package/esm/configs/waterfallChart.d.ts +109 -0
- package/esm/configs/waterfallChart.d.ts.map +1 -0
- package/esm/configs/waterfallChart.js +214 -0
- package/esm/configs/waterfallChart.js.map +1 -0
- package/esm/conts.d.ts +9 -0
- package/esm/conts.d.ts.map +1 -0
- package/esm/conts.js +41 -0
- package/esm/conts.js.map +1 -0
- package/esm/execution/buildAfmExecution.d.ts +5 -0
- package/esm/execution/buildAfmExecution.d.ts.map +1 -0
- package/esm/execution/buildAfmExecution.js +374 -0
- package/esm/execution/buildAfmExecution.js.map +1 -0
- package/esm/from/declarativeAttributeHierarchyToYaml.d.ts +12 -0
- package/esm/from/declarativeAttributeHierarchyToYaml.d.ts.map +1 -0
- package/esm/from/declarativeAttributeHierarchyToYaml.js +26 -0
- package/esm/from/declarativeAttributeHierarchyToYaml.js.map +1 -0
- package/esm/from/declarativeDashboardToYaml.d.ts +59 -0
- package/esm/from/declarativeDashboardToYaml.d.ts.map +1 -0
- package/esm/from/declarativeDashboardToYaml.js +771 -0
- package/esm/from/declarativeDashboardToYaml.js.map +1 -0
- package/esm/from/declarativeDatasetToYaml.d.ts +9 -0
- package/esm/from/declarativeDatasetToYaml.d.ts.map +1 -0
- package/esm/from/declarativeDatasetToYaml.js +239 -0
- package/esm/from/declarativeDatasetToYaml.js.map +1 -0
- package/esm/from/declarativeDateInstanceToYaml.d.ts +8 -0
- package/esm/from/declarativeDateInstanceToYaml.d.ts.map +1 -0
- package/esm/from/declarativeDateInstanceToYaml.js +30 -0
- package/esm/from/declarativeDateInstanceToYaml.js.map +1 -0
- package/esm/from/declarativeMetricToYaml.d.ts +8 -0
- package/esm/from/declarativeMetricToYaml.d.ts.map +1 -0
- package/esm/from/declarativeMetricToYaml.js +34 -0
- package/esm/from/declarativeMetricToYaml.js.map +1 -0
- package/esm/from/declarativePluginToYaml.d.ts +10 -0
- package/esm/from/declarativePluginToYaml.d.ts.map +1 -0
- package/esm/from/declarativePluginToYaml.js +26 -0
- package/esm/from/declarativePluginToYaml.js.map +1 -0
- package/esm/from/declarativeVisualisationToYaml.d.ts +64 -0
- package/esm/from/declarativeVisualisationToYaml.d.ts.map +1 -0
- package/esm/from/declarativeVisualisationToYaml.js +1513 -0
- package/esm/from/declarativeVisualisationToYaml.js.map +1 -0
- package/esm/index.d.ts +18 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +22 -0
- package/esm/index.js.map +1 -0
- package/esm/schemas/types.d.ts +32 -0
- package/esm/schemas/types.d.ts.map +1 -0
- package/esm/schemas/types.js +3 -0
- package/esm/schemas/types.js.map +1 -0
- package/esm/schemas/v1/metadata.d.ts +7277 -0
- package/esm/schemas/v1/metadata.d.ts.map +1 -0
- package/esm/schemas/v1/metadata.js +3 -0
- package/esm/schemas/v1/metadata.js.map +1 -0
- package/esm/sdk-code-convertors.d.ts +7861 -0
- package/esm/to/yamlAttributeHierarchyToDeclarative.d.ts +5 -0
- package/esm/to/yamlAttributeHierarchyToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlAttributeHierarchyToDeclarative.js +16 -0
- package/esm/to/yamlAttributeHierarchyToDeclarative.js.map +1 -0
- package/esm/to/yamlDashboardToDeclarative.d.ts +29 -0
- package/esm/to/yamlDashboardToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlDashboardToDeclarative.js +732 -0
- package/esm/to/yamlDashboardToDeclarative.js.map +1 -0
- package/esm/to/yamlDatasetToDeclarative.d.ts +41 -0
- package/esm/to/yamlDatasetToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlDatasetToDeclarative.js +346 -0
- package/esm/to/yamlDatasetToDeclarative.js.map +1 -0
- package/esm/to/yamlDateDatasetToDeclarative.d.ts +5 -0
- package/esm/to/yamlDateDatasetToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlDateDatasetToDeclarative.js +21 -0
- package/esm/to/yamlDateDatasetToDeclarative.js.map +1 -0
- package/esm/to/yamlMetricToDeclarative.d.ts +5 -0
- package/esm/to/yamlMetricToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlMetricToDeclarative.js +24 -0
- package/esm/to/yamlMetricToDeclarative.js.map +1 -0
- package/esm/to/yamlPluginToDeclarative.d.ts +5 -0
- package/esm/to/yamlPluginToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlPluginToDeclarative.js +17 -0
- package/esm/to/yamlPluginToDeclarative.js.map +1 -0
- package/esm/to/yamlVisualisationToDeclarative.d.ts +31 -0
- package/esm/to/yamlVisualisationToDeclarative.d.ts.map +1 -0
- package/esm/to/yamlVisualisationToDeclarative.js +1048 -0
- package/esm/to/yamlVisualisationToDeclarative.js.map +1 -0
- package/esm/tsdoc-metadata.json +11 -0
- package/esm/types.d.ts +66 -0
- package/esm/types.d.ts.map +1 -0
- package/esm/types.js +22 -0
- package/esm/types.js.map +1 -0
- package/esm/utils/configUtils.d.ts +20 -0
- package/esm/utils/configUtils.d.ts.map +1 -0
- package/esm/utils/configUtils.js +312 -0
- package/esm/utils/configUtils.js.map +1 -0
- package/esm/utils/convertBucketToTitle.d.ts +116 -0
- package/esm/utils/convertBucketToTitle.d.ts.map +1 -0
- package/esm/utils/convertBucketToTitle.js +370 -0
- package/esm/utils/convertBucketToTitle.js.map +1 -0
- package/esm/utils/customUrl.d.ts +4 -0
- package/esm/utils/customUrl.d.ts.map +1 -0
- package/esm/utils/customUrl.js +31 -0
- package/esm/utils/customUrl.js.map +1 -0
- package/esm/utils/dateUtils.d.ts +5 -0
- package/esm/utils/dateUtils.d.ts.map +1 -0
- package/esm/utils/dateUtils.js +43 -0
- package/esm/utils/dateUtils.js.map +1 -0
- package/esm/utils/errors.d.ts +35 -0
- package/esm/utils/errors.d.ts.map +1 -0
- package/esm/utils/errors.js +65 -0
- package/esm/utils/errors.js.map +1 -0
- package/esm/utils/filterUtils.d.ts +3 -0
- package/esm/utils/filterUtils.d.ts.map +1 -0
- package/esm/utils/filterUtils.js +26 -0
- package/esm/utils/filterUtils.js.map +1 -0
- package/esm/utils/granularityUtils.d.ts +17 -0
- package/esm/utils/granularityUtils.d.ts.map +1 -0
- package/esm/utils/granularityUtils.js +1434 -0
- package/esm/utils/granularityUtils.js.map +1 -0
- package/esm/utils/locationUtils.d.ts +11 -0
- package/esm/utils/locationUtils.d.ts.map +1 -0
- package/esm/utils/locationUtils.js +75 -0
- package/esm/utils/locationUtils.js.map +1 -0
- package/esm/utils/nameUtils.d.ts +7 -0
- package/esm/utils/nameUtils.d.ts.map +1 -0
- package/esm/utils/nameUtils.js +37 -0
- package/esm/utils/nameUtils.js.map +1 -0
- package/esm/utils/permissionUtils.d.ts +29 -0
- package/esm/utils/permissionUtils.d.ts.map +1 -0
- package/esm/utils/permissionUtils.js +82 -0
- package/esm/utils/permissionUtils.js.map +1 -0
- package/esm/utils/sharedUtils.d.ts +21 -0
- package/esm/utils/sharedUtils.d.ts.map +1 -0
- package/esm/utils/sharedUtils.js +63 -0
- package/esm/utils/sharedUtils.js.map +1 -0
- package/esm/utils/texts.d.ts +8 -0
- package/esm/utils/texts.d.ts.map +1 -0
- package/esm/utils/texts.js +47 -0
- package/esm/utils/texts.js.map +1 -0
- package/esm/utils/typeGuards.d.ts +51 -0
- package/esm/utils/typeGuards.d.ts.map +1 -0
- package/esm/utils/typeGuards.js +286 -0
- package/esm/utils/typeGuards.js.map +1 -0
- package/esm/utils/yamlUtils.d.ts +28 -0
- package/esm/utils/yamlUtils.d.ts.map +1 -0
- package/esm/utils/yamlUtils.js +163 -0
- package/esm/utils/yamlUtils.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// (C) 2023-2026 GoodData Corporation
|
|
2
|
+
export { CoreErrorCode };
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
var CoreErrorCode;
|
|
7
|
+
(function (CoreErrorCode) {
|
|
8
|
+
//convertors
|
|
9
|
+
CoreErrorCode["BucketItemTypeNotSupported"] = "core.bucketItemTypeNotSupported";
|
|
10
|
+
CoreErrorCode["FilterItemTypeNotSupported"] = "core.filterItemTypeNotSupported";
|
|
11
|
+
CoreErrorCode["ItemNotSupported"] = "core.itemNotSupported";
|
|
12
|
+
CoreErrorCode["ReferenceTypeNotSupported"] = "core.referenceTypeNotSupported";
|
|
13
|
+
CoreErrorCode["VisualizationNotSupported"] = "core.visualizationNotSupported";
|
|
14
|
+
CoreErrorCode["LayerTypeNotSupported"] = "core.layerTypeNotSupported";
|
|
15
|
+
CoreErrorCode["MultipleDateDataSets"] = "core.multipleDateDataSets";
|
|
16
|
+
CoreErrorCode["OnlyOneDateDatasetAllowed"] = "core.onlyOneDateDatasetAllowed";
|
|
17
|
+
CoreErrorCode["OnlyOneAttributeItemAllowed"] = "core.onlyOneAttributeItemAllowed";
|
|
18
|
+
CoreErrorCode["MultipleCommonDateFilters"] = "core.multipleCommonDateFilters";
|
|
19
|
+
CoreErrorCode["DuplicateFilterLocalIdentifier"] = "core.duplicateFilterLocalIdentifier";
|
|
20
|
+
CoreErrorCode["DuplicateTabIdentifier"] = "core.duplicateTabIdentifier";
|
|
21
|
+
})(CoreErrorCode || (CoreErrorCode = {}));
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export const CoreErrorMessages = {
|
|
26
|
+
[CoreErrorCode.BucketItemTypeNotSupported]: "Report item type is not supported. Item: {0}",
|
|
27
|
+
[CoreErrorCode.FilterItemTypeNotSupported]: "Filter item type is not supported. Item: {0}",
|
|
28
|
+
[CoreErrorCode.ReferenceTypeNotSupported]: "Reference type is not supported. Item: {0}",
|
|
29
|
+
[CoreErrorCode.ItemNotSupported]: "Item is not supported. Item: {0}",
|
|
30
|
+
[CoreErrorCode.VisualizationNotSupported]: "Visualisation is not supported. Url: {0}",
|
|
31
|
+
[CoreErrorCode.LayerTypeNotSupported]: "Layer type is not supported. Type: {0}",
|
|
32
|
+
[CoreErrorCode.MultipleDateDataSets]: "Multiple date datasets are not supported. Item: {0}",
|
|
33
|
+
[CoreErrorCode.OnlyOneDateDatasetAllowed]: `Dashboard filters contains more filters with same date dataset "{0}".`,
|
|
34
|
+
[CoreErrorCode.OnlyOneAttributeItemAllowed]: `Dashboard filters contains more filters with same attribute or label "{0}".`,
|
|
35
|
+
[CoreErrorCode.MultipleCommonDateFilters]: `Multiple usage of common date filters in dashboard. Define exactly one date filter that has no date dataset defined.`,
|
|
36
|
+
[CoreErrorCode.DuplicateFilterLocalIdentifier]: `Duplicate filter local identifier "{0}". Each filter must have a unique local identifier across a dashboard tab, including filters in groups.`,
|
|
37
|
+
[CoreErrorCode.DuplicateTabIdentifier]: `Duplicate tab identifier "{0}". Each tab must have a unique identifier within the dashboard.`,
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export const CoreErrorTypes = {
|
|
43
|
+
[CoreErrorCode.BucketItemTypeNotSupported]: "BucketItemTypeNotSupported",
|
|
44
|
+
[CoreErrorCode.FilterItemTypeNotSupported]: "FilterItemTypeNotSupported",
|
|
45
|
+
[CoreErrorCode.ReferenceTypeNotSupported]: "ReferenceTypeNotSupported",
|
|
46
|
+
[CoreErrorCode.ItemNotSupported]: "ItemNotSupported",
|
|
47
|
+
[CoreErrorCode.VisualizationNotSupported]: "VisualizationNotSupported",
|
|
48
|
+
[CoreErrorCode.LayerTypeNotSupported]: "LayerTypeNotSupported",
|
|
49
|
+
[CoreErrorCode.MultipleDateDataSets]: "MultipleDateDataSets",
|
|
50
|
+
[CoreErrorCode.OnlyOneDateDatasetAllowed]: "OnlyOneDateDatasetAllowed",
|
|
51
|
+
[CoreErrorCode.OnlyOneAttributeItemAllowed]: "OnlyOneAttributeItemAllowed",
|
|
52
|
+
[CoreErrorCode.MultipleCommonDateFilters]: "MultipleCommonDateFilters",
|
|
53
|
+
[CoreErrorCode.DuplicateFilterLocalIdentifier]: "DuplicateFilterLocalIdentifier",
|
|
54
|
+
[CoreErrorCode.DuplicateTabIdentifier]: "DuplicateTabIdentifier",
|
|
55
|
+
};
|
|
56
|
+
export function newError(code, params = []) {
|
|
57
|
+
const err = new Error(buildMessage(CoreErrorMessages[code], params));
|
|
58
|
+
err.type = CoreErrorTypes[code];
|
|
59
|
+
err.code = code;
|
|
60
|
+
return err;
|
|
61
|
+
}
|
|
62
|
+
export function buildMessage(message, params) {
|
|
63
|
+
return params.reduce((msg, param, index) => msg.replace(new RegExp(`\\{${index}}`, "gi"), param), message);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterUtils.d.ts","sourceRoot":"","sources":["../../src/utils/filterUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAErE,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,YAAY,GAAG,cAAc,EACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,SAkBxC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// (C) 2023-2026 GoodData Corporation
|
|
2
|
+
import { convertGranularityToId, parseGranularityValue } from "./granularityUtils.js";
|
|
3
|
+
export function parseDateValues(entities, label, values) {
|
|
4
|
+
const [type, objId] = label.split("/");
|
|
5
|
+
const id = objId || type;
|
|
6
|
+
const [dateDatasetId, gran] = id.split(".");
|
|
7
|
+
const dateDatasetEntity = entities.find((e) => e.type === "date" && e.id === dateDatasetId);
|
|
8
|
+
if (dateDatasetEntity?.data) {
|
|
9
|
+
const dateDataset = dateDatasetEntity.data;
|
|
10
|
+
const exists = dateDataset.granularities
|
|
11
|
+
?.map((g) => convertGranularityToId(g))
|
|
12
|
+
.find((g) => g === gran);
|
|
13
|
+
if (exists) {
|
|
14
|
+
return convertDateValues(gran, values);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return values;
|
|
18
|
+
}
|
|
19
|
+
function convertDateValues(gran, values) {
|
|
20
|
+
const granularity = gran;
|
|
21
|
+
// Filter out null/undefined but preserve empty strings which are valid attribute values
|
|
22
|
+
return values
|
|
23
|
+
.map((v) => parseGranularityValue(granularity, v))
|
|
24
|
+
.filter((v) => v !== null && v !== undefined);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=filterUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterUtils.js","sourceRoot":"","sources":["../../src/utils/filterUtils.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAItF,MAAM,UAAU,eAAe,CAC3B,QAAuC,EACvC,KAAa,EACb,MAAqC,EACvC;IACE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC;IACzB,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE5C,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;IAC5F,IAAI,iBAAiB,EAAE,IAAI,EAAE,CAAC;QAC1B,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAmB,CAAC;QAC1D,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa;YACpC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;aACtC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QAE7B,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAAA,CACjB;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,MAAqC,EAAE;IAC5E,MAAM,WAAW,GAAG,IAAiD,CAAC;IACtE,wFAAwF;IACxF,OAAO,MAAM;SACR,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;SACjD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC;AAAA,CACrD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DeclarativeDateDataset } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type DateAttributeGranularity } from "@gooddata/sdk-model";
|
|
3
|
+
import type { DateDataset } from "../schemas/v1/metadata.js";
|
|
4
|
+
export declare function convertGranularity(gran: Required<DateDataset>["granularities"][number] | any): DateAttributeGranularity | null;
|
|
5
|
+
export declare function parseGranularity(gran: DateAttributeGranularity | null): Required<DateDataset>["granularities"][number] | null;
|
|
6
|
+
export declare function convertGranularityToId(gran: Required<DateDataset>["granularities"][number] | string): string;
|
|
7
|
+
export declare function convertGranularityToDeclarativeDatasetGranularity(gran: Required<DateDataset>["granularities"][number]): DeclarativeDateDataset["granularities"][number];
|
|
8
|
+
export declare function parseGranularityValue(gran: ReturnType<typeof convertGranularityToId>, value: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* Determine the correct type for an ID based on whether it has a granularity suffix
|
|
11
|
+
* and whether the base ID is in the dates list
|
|
12
|
+
* @param id - The ID to check
|
|
13
|
+
* @param datesId - Array of date dataset IDs
|
|
14
|
+
* @returns "attribute" if has suffix, "date" if base ID is in datesId, otherwise "attribute"
|
|
15
|
+
*/
|
|
16
|
+
export declare function determineTypeForId(id: string, datesId: string[]): "attribute" | "date";
|
|
17
|
+
//# sourceMappingURL=granularityUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"granularityUtils.d.ts","sourceRoot":"","sources":["../../src/utils/granularityUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,GAC3D,wBAAwB,GAAG,IAAI,CAwDjC;AAED,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,wBAAwB,GAAG,IAAI,GACtC,QAAQ,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAyDvD;AAED,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,GAC9D,MAAM,CAuDR;AAED,wBAAgB,iDAAiD,CAC7D,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,GACrD,sBAAsB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAoDjD;AAsnCD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,EAAE,KAAK,EAAE,GAAG,OA6BhG;AAuCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,MAAM,CAKtF"}
|