@gooddata/sdk-code-convertors 11.30.0-alpha.1 → 11.30.0-alpha.3
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/esm/utils/dateUtils.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { convertGranularityToId } from "./granularityUtils.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isDateFilter } from "./typeGuards.js";
|
|
4
4
|
import { createIdentifier } from "./yamlUtils.js";
|
|
5
5
|
export function mapDateAttribute(query, field) {
|
|
6
6
|
let filter;
|
|
7
7
|
Object.keys(query.filter_by ?? {}).forEach((key) => {
|
|
8
8
|
const filterFound = query.filter_by[key];
|
|
9
|
-
if (
|
|
9
|
+
if (isDateFilter(filterFound) && filterFound.using === field.date_filter) {
|
|
10
10
|
filter = {
|
|
11
11
|
type: "date_filter",
|
|
12
12
|
granularity: filterFound.granularity,
|
|
@@ -17,7 +17,7 @@ export function mapDateAttribute(query, field) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
if (filter) {
|
|
20
|
-
return createIdentifier(`${filter.using}.${convertGranularityToId(filter.granularity)}`, { forceType: "attribute" });
|
|
20
|
+
return createIdentifier(`${filter.using}.${convertGranularityToId((filter.granularity ?? "YEAR"))}`, { forceType: "attribute" });
|
|
21
21
|
}
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
@@ -25,7 +25,7 @@ export function mapDateDataset(query, field) {
|
|
|
25
25
|
let filter;
|
|
26
26
|
Object.keys(query.filter_by ?? {}).forEach((key) => {
|
|
27
27
|
const filterFound = query.filter_by[key];
|
|
28
|
-
if (
|
|
28
|
+
if (isDateFilter(filterFound) && filterFound.using === field.date_filter) {
|
|
29
29
|
filter = {
|
|
30
30
|
type: "date_filter",
|
|
31
31
|
granularity: filterFound.granularity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtils.js","sourceRoot":"","sources":["../../src/utils/dateUtils.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAWrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dateUtils.js","sourceRoot":"","sources":["../../src/utils/dateUtils.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAWrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,UAAU,gBAAgB,CAAC,KAAY,EAAE,KAAqB,EAA8B;IAC9F,IAAI,MAA8B,CAAC;IACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,KAAK,CAAC,SAAU,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,YAAY,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;YACvE,MAAM,GAAG;gBACL,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,WAAW,CAAC,WAAW;gBACpC,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,EAAE,EAAE,WAAW,CAAC,EAAE;gBAClB,KAAK,EAAE,WAAW,EAAE,KAAK;aACd,CAAC;QACpB,CAAC;IAAA,CACJ,CAAC,CAAC;IAEH,IAAI,MAAM,EAAE,CAAC;QACT,OAAO,gBAAgB,CACnB,GAAG,MAAM,CAAC,KAAK,IAAI,sBAAsB,CACrC,CAAC,MAAM,CAAC,WAAW,IAAI,MAAM,CAAmD,CACnF,EAAE,EACH,EAAE,SAAS,EAAE,WAAW,EAAE,CAC7B,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACf;AAED,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,KAAgC,EAA8B;IACvG,IAAI,MAA8B,CAAC;IAEnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,KAAK,CAAC,SAAU,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,YAAY,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;YACvE,MAAM,GAAG;gBACL,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,WAAW,CAAC,WAAW;gBACpC,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,EAAE,EAAE,WAAW,CAAC,EAAE;gBAClB,KAAK,EAAE,WAAW,EAAE,KAAK;aACd,CAAC;QACpB,CAAC;IAAA,CACJ,CAAC,CAAC;IAEH,IAAI,MAAM,EAAE,CAAC;QACT,OAAO,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-code-convertors",
|
|
3
|
-
"version": "11.30.0-alpha.
|
|
3
|
+
"version": "11.30.0-alpha.3",
|
|
4
4
|
"description": "GoodData AAC declarative converters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"uuid": "11.1.0",
|
|
28
28
|
"yaml": "^2.2.2",
|
|
29
|
-
"@gooddata/api-client-tiger": "11.30.0-alpha.
|
|
30
|
-
"@gooddata/sdk-code-schemas": "11.30.0-alpha.
|
|
31
|
-
"@gooddata/sdk-model": "11.30.0-alpha.
|
|
29
|
+
"@gooddata/api-client-tiger": "11.30.0-alpha.3",
|
|
30
|
+
"@gooddata/sdk-code-schemas": "11.30.0-alpha.3",
|
|
31
|
+
"@gooddata/sdk-model": "11.30.0-alpha.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-extractor": "^7.55.2",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"oxlint-tsgolint": "0.11.4",
|
|
51
51
|
"typescript": "5.9.3",
|
|
52
52
|
"vitest": "4.1.0",
|
|
53
|
-
"@gooddata/oxlint-config": "11.30.0-alpha.
|
|
54
|
-
"@gooddata/eslint-config": "11.30.0-alpha.
|
|
53
|
+
"@gooddata/oxlint-config": "11.30.0-alpha.3",
|
|
54
|
+
"@gooddata/eslint-config": "11.30.0-alpha.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"_phase:build": "npm run build",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"test-once": "vitest run",
|
|
74
74
|
"build-wasm": "bash wasm/build.sh",
|
|
75
75
|
"test-wasm": "bash wasm/test.sh",
|
|
76
|
-
"generate-python-types": "uv run
|
|
77
|
-
"generate-python-types-check": "uv run
|
|
76
|
+
"generate-python-types": "uv run python/scripts/generate_types.py",
|
|
77
|
+
"generate-python-types-check": "uv run python/scripts/generate_types.py --check"
|
|
78
78
|
}
|
|
79
79
|
}
|