@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.
Files changed (237) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +42 -0
  3. package/esm/configs/areaChart.d.ts +113 -0
  4. package/esm/configs/areaChart.d.ts.map +1 -0
  5. package/esm/configs/areaChart.js +232 -0
  6. package/esm/configs/areaChart.js.map +1 -0
  7. package/esm/configs/barChart.d.ts +101 -0
  8. package/esm/configs/barChart.d.ts.map +1 -0
  9. package/esm/configs/barChart.js +210 -0
  10. package/esm/configs/barChart.js.map +1 -0
  11. package/esm/configs/bubbleChart.d.ts +93 -0
  12. package/esm/configs/bubbleChart.d.ts.map +1 -0
  13. package/esm/configs/bubbleChart.js +186 -0
  14. package/esm/configs/bubbleChart.js.map +1 -0
  15. package/esm/configs/bulletChart.d.ts +87 -0
  16. package/esm/configs/bulletChart.d.ts.map +1 -0
  17. package/esm/configs/bulletChart.js +174 -0
  18. package/esm/configs/bulletChart.js.map +1 -0
  19. package/esm/configs/columnChart.d.ts +101 -0
  20. package/esm/configs/columnChart.d.ts.map +1 -0
  21. package/esm/configs/columnChart.js +210 -0
  22. package/esm/configs/columnChart.js.map +1 -0
  23. package/esm/configs/comboChart.d.ts +155 -0
  24. package/esm/configs/comboChart.d.ts.map +1 -0
  25. package/esm/configs/comboChart.js +355 -0
  26. package/esm/configs/comboChart.js.map +1 -0
  27. package/esm/configs/dependencyWheelChart.d.ts +37 -0
  28. package/esm/configs/dependencyWheelChart.d.ts.map +1 -0
  29. package/esm/configs/dependencyWheelChart.js +81 -0
  30. package/esm/configs/dependencyWheelChart.js.map +1 -0
  31. package/esm/configs/donutChart.d.ts +47 -0
  32. package/esm/configs/donutChart.d.ts.map +1 -0
  33. package/esm/configs/donutChart.js +96 -0
  34. package/esm/configs/donutChart.js.map +1 -0
  35. package/esm/configs/funnelChart.d.ts +47 -0
  36. package/esm/configs/funnelChart.d.ts.map +1 -0
  37. package/esm/configs/funnelChart.js +96 -0
  38. package/esm/configs/funnelChart.js.map +1 -0
  39. package/esm/configs/geoAreaChart.d.ts +62 -0
  40. package/esm/configs/geoAreaChart.d.ts.map +1 -0
  41. package/esm/configs/geoAreaChart.js +123 -0
  42. package/esm/configs/geoAreaChart.js.map +1 -0
  43. package/esm/configs/geoChart.d.ts +49 -0
  44. package/esm/configs/geoChart.d.ts.map +1 -0
  45. package/esm/configs/geoChart.js +157 -0
  46. package/esm/configs/geoChart.js.map +1 -0
  47. package/esm/configs/headlineChart.d.ts +89 -0
  48. package/esm/configs/headlineChart.d.ts.map +1 -0
  49. package/esm/configs/headlineChart.js +124 -0
  50. package/esm/configs/headlineChart.js.map +1 -0
  51. package/esm/configs/heatmapChart.d.ts +75 -0
  52. package/esm/configs/heatmapChart.d.ts.map +1 -0
  53. package/esm/configs/heatmapChart.js +158 -0
  54. package/esm/configs/heatmapChart.js.map +1 -0
  55. package/esm/configs/lineChart.d.ts +135 -0
  56. package/esm/configs/lineChart.d.ts.map +1 -0
  57. package/esm/configs/lineChart.js +294 -0
  58. package/esm/configs/lineChart.js.map +1 -0
  59. package/esm/configs/pieChart.d.ts +47 -0
  60. package/esm/configs/pieChart.d.ts.map +1 -0
  61. package/esm/configs/pieChart.js +96 -0
  62. package/esm/configs/pieChart.js.map +1 -0
  63. package/esm/configs/pyramidChart.d.ts +47 -0
  64. package/esm/configs/pyramidChart.d.ts.map +1 -0
  65. package/esm/configs/pyramidChart.js +96 -0
  66. package/esm/configs/pyramidChart.js.map +1 -0
  67. package/esm/configs/repeaterChart.d.ts +36 -0
  68. package/esm/configs/repeaterChart.d.ts.map +1 -0
  69. package/esm/configs/repeaterChart.js +104 -0
  70. package/esm/configs/repeaterChart.js.map +1 -0
  71. package/esm/configs/sankeyChart.d.ts +39 -0
  72. package/esm/configs/sankeyChart.d.ts.map +1 -0
  73. package/esm/configs/sankeyChart.js +84 -0
  74. package/esm/configs/sankeyChart.js.map +1 -0
  75. package/esm/configs/scatterChart.d.ts +95 -0
  76. package/esm/configs/scatterChart.d.ts.map +1 -0
  77. package/esm/configs/scatterChart.js +198 -0
  78. package/esm/configs/scatterChart.js.map +1 -0
  79. package/esm/configs/table.d.ts +61 -0
  80. package/esm/configs/table.d.ts.map +1 -0
  81. package/esm/configs/table.js +169 -0
  82. package/esm/configs/table.js.map +1 -0
  83. package/esm/configs/treemapChart.d.ts +47 -0
  84. package/esm/configs/treemapChart.d.ts.map +1 -0
  85. package/esm/configs/treemapChart.js +96 -0
  86. package/esm/configs/treemapChart.js.map +1 -0
  87. package/esm/configs/types.d.ts +93 -0
  88. package/esm/configs/types.d.ts.map +1 -0
  89. package/esm/configs/types.js +3 -0
  90. package/esm/configs/types.js.map +1 -0
  91. package/esm/configs/utils.d.ts +12 -0
  92. package/esm/configs/utils.d.ts.map +1 -0
  93. package/esm/configs/utils.js +76 -0
  94. package/esm/configs/utils.js.map +1 -0
  95. package/esm/configs/waterfallChart.d.ts +109 -0
  96. package/esm/configs/waterfallChart.d.ts.map +1 -0
  97. package/esm/configs/waterfallChart.js +214 -0
  98. package/esm/configs/waterfallChart.js.map +1 -0
  99. package/esm/conts.d.ts +9 -0
  100. package/esm/conts.d.ts.map +1 -0
  101. package/esm/conts.js +41 -0
  102. package/esm/conts.js.map +1 -0
  103. package/esm/execution/buildAfmExecution.d.ts +5 -0
  104. package/esm/execution/buildAfmExecution.d.ts.map +1 -0
  105. package/esm/execution/buildAfmExecution.js +374 -0
  106. package/esm/execution/buildAfmExecution.js.map +1 -0
  107. package/esm/from/declarativeAttributeHierarchyToYaml.d.ts +12 -0
  108. package/esm/from/declarativeAttributeHierarchyToYaml.d.ts.map +1 -0
  109. package/esm/from/declarativeAttributeHierarchyToYaml.js +26 -0
  110. package/esm/from/declarativeAttributeHierarchyToYaml.js.map +1 -0
  111. package/esm/from/declarativeDashboardToYaml.d.ts +59 -0
  112. package/esm/from/declarativeDashboardToYaml.d.ts.map +1 -0
  113. package/esm/from/declarativeDashboardToYaml.js +771 -0
  114. package/esm/from/declarativeDashboardToYaml.js.map +1 -0
  115. package/esm/from/declarativeDatasetToYaml.d.ts +9 -0
  116. package/esm/from/declarativeDatasetToYaml.d.ts.map +1 -0
  117. package/esm/from/declarativeDatasetToYaml.js +239 -0
  118. package/esm/from/declarativeDatasetToYaml.js.map +1 -0
  119. package/esm/from/declarativeDateInstanceToYaml.d.ts +8 -0
  120. package/esm/from/declarativeDateInstanceToYaml.d.ts.map +1 -0
  121. package/esm/from/declarativeDateInstanceToYaml.js +30 -0
  122. package/esm/from/declarativeDateInstanceToYaml.js.map +1 -0
  123. package/esm/from/declarativeMetricToYaml.d.ts +8 -0
  124. package/esm/from/declarativeMetricToYaml.d.ts.map +1 -0
  125. package/esm/from/declarativeMetricToYaml.js +34 -0
  126. package/esm/from/declarativeMetricToYaml.js.map +1 -0
  127. package/esm/from/declarativePluginToYaml.d.ts +10 -0
  128. package/esm/from/declarativePluginToYaml.d.ts.map +1 -0
  129. package/esm/from/declarativePluginToYaml.js +26 -0
  130. package/esm/from/declarativePluginToYaml.js.map +1 -0
  131. package/esm/from/declarativeVisualisationToYaml.d.ts +64 -0
  132. package/esm/from/declarativeVisualisationToYaml.d.ts.map +1 -0
  133. package/esm/from/declarativeVisualisationToYaml.js +1513 -0
  134. package/esm/from/declarativeVisualisationToYaml.js.map +1 -0
  135. package/esm/index.d.ts +18 -0
  136. package/esm/index.d.ts.map +1 -0
  137. package/esm/index.js +22 -0
  138. package/esm/index.js.map +1 -0
  139. package/esm/schemas/types.d.ts +32 -0
  140. package/esm/schemas/types.d.ts.map +1 -0
  141. package/esm/schemas/types.js +3 -0
  142. package/esm/schemas/types.js.map +1 -0
  143. package/esm/schemas/v1/metadata.d.ts +7277 -0
  144. package/esm/schemas/v1/metadata.d.ts.map +1 -0
  145. package/esm/schemas/v1/metadata.js +3 -0
  146. package/esm/schemas/v1/metadata.js.map +1 -0
  147. package/esm/sdk-code-convertors.d.ts +7861 -0
  148. package/esm/to/yamlAttributeHierarchyToDeclarative.d.ts +5 -0
  149. package/esm/to/yamlAttributeHierarchyToDeclarative.d.ts.map +1 -0
  150. package/esm/to/yamlAttributeHierarchyToDeclarative.js +16 -0
  151. package/esm/to/yamlAttributeHierarchyToDeclarative.js.map +1 -0
  152. package/esm/to/yamlDashboardToDeclarative.d.ts +29 -0
  153. package/esm/to/yamlDashboardToDeclarative.d.ts.map +1 -0
  154. package/esm/to/yamlDashboardToDeclarative.js +732 -0
  155. package/esm/to/yamlDashboardToDeclarative.js.map +1 -0
  156. package/esm/to/yamlDatasetToDeclarative.d.ts +41 -0
  157. package/esm/to/yamlDatasetToDeclarative.d.ts.map +1 -0
  158. package/esm/to/yamlDatasetToDeclarative.js +346 -0
  159. package/esm/to/yamlDatasetToDeclarative.js.map +1 -0
  160. package/esm/to/yamlDateDatasetToDeclarative.d.ts +5 -0
  161. package/esm/to/yamlDateDatasetToDeclarative.d.ts.map +1 -0
  162. package/esm/to/yamlDateDatasetToDeclarative.js +21 -0
  163. package/esm/to/yamlDateDatasetToDeclarative.js.map +1 -0
  164. package/esm/to/yamlMetricToDeclarative.d.ts +5 -0
  165. package/esm/to/yamlMetricToDeclarative.d.ts.map +1 -0
  166. package/esm/to/yamlMetricToDeclarative.js +24 -0
  167. package/esm/to/yamlMetricToDeclarative.js.map +1 -0
  168. package/esm/to/yamlPluginToDeclarative.d.ts +5 -0
  169. package/esm/to/yamlPluginToDeclarative.d.ts.map +1 -0
  170. package/esm/to/yamlPluginToDeclarative.js +17 -0
  171. package/esm/to/yamlPluginToDeclarative.js.map +1 -0
  172. package/esm/to/yamlVisualisationToDeclarative.d.ts +31 -0
  173. package/esm/to/yamlVisualisationToDeclarative.d.ts.map +1 -0
  174. package/esm/to/yamlVisualisationToDeclarative.js +1048 -0
  175. package/esm/to/yamlVisualisationToDeclarative.js.map +1 -0
  176. package/esm/tsdoc-metadata.json +11 -0
  177. package/esm/types.d.ts +66 -0
  178. package/esm/types.d.ts.map +1 -0
  179. package/esm/types.js +22 -0
  180. package/esm/types.js.map +1 -0
  181. package/esm/utils/configUtils.d.ts +20 -0
  182. package/esm/utils/configUtils.d.ts.map +1 -0
  183. package/esm/utils/configUtils.js +312 -0
  184. package/esm/utils/configUtils.js.map +1 -0
  185. package/esm/utils/convertBucketToTitle.d.ts +116 -0
  186. package/esm/utils/convertBucketToTitle.d.ts.map +1 -0
  187. package/esm/utils/convertBucketToTitle.js +370 -0
  188. package/esm/utils/convertBucketToTitle.js.map +1 -0
  189. package/esm/utils/customUrl.d.ts +4 -0
  190. package/esm/utils/customUrl.d.ts.map +1 -0
  191. package/esm/utils/customUrl.js +31 -0
  192. package/esm/utils/customUrl.js.map +1 -0
  193. package/esm/utils/dateUtils.d.ts +5 -0
  194. package/esm/utils/dateUtils.d.ts.map +1 -0
  195. package/esm/utils/dateUtils.js +43 -0
  196. package/esm/utils/dateUtils.js.map +1 -0
  197. package/esm/utils/errors.d.ts +35 -0
  198. package/esm/utils/errors.d.ts.map +1 -0
  199. package/esm/utils/errors.js +65 -0
  200. package/esm/utils/errors.js.map +1 -0
  201. package/esm/utils/filterUtils.d.ts +3 -0
  202. package/esm/utils/filterUtils.d.ts.map +1 -0
  203. package/esm/utils/filterUtils.js +26 -0
  204. package/esm/utils/filterUtils.js.map +1 -0
  205. package/esm/utils/granularityUtils.d.ts +17 -0
  206. package/esm/utils/granularityUtils.d.ts.map +1 -0
  207. package/esm/utils/granularityUtils.js +1434 -0
  208. package/esm/utils/granularityUtils.js.map +1 -0
  209. package/esm/utils/locationUtils.d.ts +11 -0
  210. package/esm/utils/locationUtils.d.ts.map +1 -0
  211. package/esm/utils/locationUtils.js +75 -0
  212. package/esm/utils/locationUtils.js.map +1 -0
  213. package/esm/utils/nameUtils.d.ts +7 -0
  214. package/esm/utils/nameUtils.d.ts.map +1 -0
  215. package/esm/utils/nameUtils.js +37 -0
  216. package/esm/utils/nameUtils.js.map +1 -0
  217. package/esm/utils/permissionUtils.d.ts +29 -0
  218. package/esm/utils/permissionUtils.d.ts.map +1 -0
  219. package/esm/utils/permissionUtils.js +82 -0
  220. package/esm/utils/permissionUtils.js.map +1 -0
  221. package/esm/utils/sharedUtils.d.ts +21 -0
  222. package/esm/utils/sharedUtils.d.ts.map +1 -0
  223. package/esm/utils/sharedUtils.js +63 -0
  224. package/esm/utils/sharedUtils.js.map +1 -0
  225. package/esm/utils/texts.d.ts +8 -0
  226. package/esm/utils/texts.d.ts.map +1 -0
  227. package/esm/utils/texts.js +47 -0
  228. package/esm/utils/texts.js.map +1 -0
  229. package/esm/utils/typeGuards.d.ts +51 -0
  230. package/esm/utils/typeGuards.d.ts.map +1 -0
  231. package/esm/utils/typeGuards.js +286 -0
  232. package/esm/utils/typeGuards.js.map +1 -0
  233. package/esm/utils/yamlUtils.d.ts +28 -0
  234. package/esm/utils/yamlUtils.d.ts.map +1 -0
  235. package/esm/utils/yamlUtils.js +163 -0
  236. package/esm/utils/yamlUtils.js.map +1 -0
  237. 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,3 @@
1
+ import { type ExportEntities, type FromEntities } from "../types.js";
2
+ export declare function parseDateValues(entities: FromEntities | ExportEntities, label: string, values: (string | number | boolean)[]): any[];
3
+ //# sourceMappingURL=filterUtils.d.ts.map
@@ -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"}