@gooddata/sdk-code-convertors 11.63.0-alpha.0 → 11.63.0-alpha.2
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/declarativePublisherTypesV2.d.ts +27 -0
- package/esm/declarativePublisherTypesV2.d.ts.map +1 -0
- package/esm/declarativePublisherTypesV2.js +2 -0
- package/esm/fillPublisherIdsV2.d.ts +16 -0
- package/esm/fillPublisherIdsV2.d.ts.map +1 -0
- package/esm/fillPublisherIdsV2.js +149 -0
- package/esm/from/declarativePublisherDocumentPageToYaml.d.ts +3 -10
- package/esm/from/declarativePublisherDocumentPageToYaml.d.ts.map +1 -1
- package/esm/from/declarativePublisherDocumentPageToYaml.js +12 -25
- package/esm/from/declarativePublisherDocumentToYaml.d.ts +5 -5
- package/esm/from/declarativePublisherDocumentToYaml.d.ts.map +1 -1
- package/esm/from/declarativePublisherDocumentToYaml.js +2 -1
- package/esm/from/declarativePublisherEntityToYamlV2.d.ts +52 -0
- package/esm/from/declarativePublisherEntityToYamlV2.d.ts.map +1 -0
- package/esm/from/declarativePublisherEntityToYamlV2.js +216 -0
- package/esm/index.d.ts +6 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +4 -0
- package/esm/schemas/types.d.ts +17 -1
- package/esm/schemas/types.d.ts.map +1 -1
- package/esm/sdk-code-convertors.d.ts +187 -14
- package/esm/to/yamlPublisherDocumentPageToDeclarative.d.ts +4 -11
- package/esm/to/yamlPublisherDocumentPageToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlPublisherDocumentPageToDeclarative.js +2 -17
- package/esm/to/yamlPublisherDocumentToDeclarative.d.ts +4 -4
- package/esm/to/yamlPublisherDocumentToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlPublisherDocumentToDeclarative.js +2 -1
- package/esm/to/yamlPublisherEntityToDeclarativeV2.d.ts +34 -0
- package/esm/to/yamlPublisherEntityToDeclarativeV2.d.ts.map +1 -0
- package/esm/to/yamlPublisherEntityToDeclarativeV2.js +190 -0
- package/esm/utils/errors.d.ts +6 -1
- package/esm/utils/errors.d.ts.map +1 -1
- package/esm/utils/errors.js +15 -0
- package/esm/utils/keyCase.d.ts +24 -0
- package/esm/utils/keyCase.d.ts.map +1 -0
- package/esm/utils/keyCase.js +28 -0
- package/esm/utils/publisherContentV2.d.ts +25 -0
- package/esm/utils/publisherContentV2.d.ts.map +1 -0
- package/esm/utils/publisherContentV2.js +33 -0
- package/esm/utils/publisherFilters.d.ts +50 -0
- package/esm/utils/publisherFilters.d.ts.map +1 -0
- package/esm/utils/publisherFilters.js +122 -0
- package/esm/utils/publisherPeriodV2.d.ts +7 -0
- package/esm/utils/publisherPeriodV2.d.ts.map +1 -0
- package/esm/utils/publisherPeriodV2.js +34 -0
- package/esm/utils/publisherVersionV2.d.ts +9 -0
- package/esm/utils/publisherVersionV2.d.ts.map +1 -0
- package/esm/utils/publisherVersionV2.js +10 -0
- package/esm/utils/texts.d.ts +1 -0
- package/esm/utils/texts.d.ts.map +1 -1
- package/esm/utils/texts.js +5 -0
- package/esm/validateDeclarativePublisherEntityV2.d.ts +10 -0
- package/esm/validateDeclarativePublisherEntityV2.d.ts.map +1 -0
- package/esm/validateDeclarativePublisherEntityV2.js +34 -0
- package/package.json +6 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IPublisherValidationIssueV2 } from "@gooddata/sdk-model";
|
|
2
|
+
/**
|
|
3
|
+
* Validates a stored v2 document, document template or page template, named by the bare `id` the
|
|
4
|
+
* declarative API stores. It runs the sdk-model validator, and an issue on the reference is reported
|
|
5
|
+
* on `id`.
|
|
6
|
+
*
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateDeclarativePublisherEntityV2(entity: unknown): IPublisherValidationIssueV2[];
|
|
10
|
+
//# sourceMappingURL=validateDeclarativePublisherEntityV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateDeclarativePublisherEntityV2.d.ts","sourceRoot":"","sources":["../src/validateDeclarativePublisherEntityV2.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,2BAA2B,EAAoC,MAAM,qBAAqB,CAAC;AAYzG;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,OAAO,GAAG,2BAA2B,EAAE,CAgBnG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { idRef, validatePublisherEntityV2 } from "@gooddata/sdk-model";
|
|
3
|
+
function isRecord(value) {
|
|
4
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5
|
+
}
|
|
6
|
+
function onId(issue) {
|
|
7
|
+
return issue.path === "ref" || issue.path.startsWith("ref.")
|
|
8
|
+
? { ...issue, path: `id${issue.path.slice("ref".length)}` }
|
|
9
|
+
: issue;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validates a stored v2 document, document template or page template, named by the bare `id` the
|
|
13
|
+
* declarative API stores. It runs the sdk-model validator, and an issue on the reference is reported
|
|
14
|
+
* on `id`.
|
|
15
|
+
*
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export function validateDeclarativePublisherEntityV2(entity) {
|
|
19
|
+
if (!isRecord(entity)) {
|
|
20
|
+
return validatePublisherEntityV2(entity);
|
|
21
|
+
}
|
|
22
|
+
const { id, ref, ...rest } = entity;
|
|
23
|
+
const isNamed = typeof id === "string" && id !== "";
|
|
24
|
+
const keyIssues = [
|
|
25
|
+
...(ref === undefined ? [] : [{ path: "ref", message: 'Unknown key "ref".' }]),
|
|
26
|
+
...(id === undefined
|
|
27
|
+
? [{ path: "id", message: 'Missing required key "id".' }]
|
|
28
|
+
: isNamed
|
|
29
|
+
? []
|
|
30
|
+
: [{ path: "id", message: `Expected a non-empty string, got ${JSON.stringify(id)}.` }]),
|
|
31
|
+
];
|
|
32
|
+
const named = isNamed ? { ...rest, ref: idRef(id) } : rest;
|
|
33
|
+
return [...keyIssues, ...validatePublisherEntityV2(named).map(onId)];
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-code-convertors",
|
|
3
|
-
"version": "11.63.0-alpha.
|
|
3
|
+
"version": "11.63.0-alpha.2",
|
|
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.1",
|
|
28
28
|
"yaml": "2.8.3",
|
|
29
|
-
"@gooddata/api-client-tiger": "11.63.0-alpha.
|
|
30
|
-
"@gooddata/sdk-code-schemas": "11.63.0-alpha.
|
|
31
|
-
"@gooddata/sdk-model": "11.63.0-alpha.
|
|
29
|
+
"@gooddata/api-client-tiger": "11.63.0-alpha.2",
|
|
30
|
+
"@gooddata/sdk-code-schemas": "11.63.0-alpha.2",
|
|
31
|
+
"@gooddata/sdk-model": "11.63.0-alpha.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-extractor": "7.59.2",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"oxlint-tsgolint": "7.0.2001",
|
|
49
49
|
"typescript": "7.0.2",
|
|
50
50
|
"vitest": "5.0.4",
|
|
51
|
-
"@gooddata/eslint-config": "11.63.0-alpha.
|
|
52
|
-
"@gooddata/oxlint-config": "11.63.0-alpha.
|
|
51
|
+
"@gooddata/eslint-config": "11.63.0-alpha.2",
|
|
52
|
+
"@gooddata/oxlint-config": "11.63.0-alpha.2"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"_phase:build": "npm run build",
|