@gooddata/sdk-ui-catalog 11.51.0-alpha.4 → 11.51.0

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 (90) hide show
  1. package/esm/localization/bundles/de-DE.localization-bundle.d.ts +7 -0
  2. package/esm/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
  3. package/esm/localization/bundles/de-DE.localization-bundle.js +9 -2
  4. package/esm/localization/bundles/en-AU.localization-bundle.d.ts +7 -0
  5. package/esm/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
  6. package/esm/localization/bundles/en-AU.localization-bundle.js +9 -2
  7. package/esm/localization/bundles/en-GB.localization-bundle.d.ts +7 -0
  8. package/esm/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
  9. package/esm/localization/bundles/en-GB.localization-bundle.js +9 -2
  10. package/esm/localization/bundles/en-US.localization-bundle.d.ts +24 -0
  11. package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
  12. package/esm/localization/bundles/en-US.localization-bundle.js +27 -3
  13. package/esm/localization/bundles/es-419.localization-bundle.d.ts +7 -0
  14. package/esm/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
  15. package/esm/localization/bundles/es-419.localization-bundle.js +9 -2
  16. package/esm/localization/bundles/es-ES.localization-bundle.d.ts +7 -0
  17. package/esm/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
  18. package/esm/localization/bundles/es-ES.localization-bundle.js +9 -2
  19. package/esm/localization/bundles/fi-FI.localization-bundle.d.ts +7 -0
  20. package/esm/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
  21. package/esm/localization/bundles/fi-FI.localization-bundle.js +9 -2
  22. package/esm/localization/bundles/fr-CA.localization-bundle.d.ts +7 -0
  23. package/esm/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
  24. package/esm/localization/bundles/fr-CA.localization-bundle.js +9 -2
  25. package/esm/localization/bundles/fr-FR.localization-bundle.d.ts +7 -0
  26. package/esm/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
  27. package/esm/localization/bundles/fr-FR.localization-bundle.js +9 -2
  28. package/esm/localization/bundles/id-ID.localization-bundle.d.ts +7 -0
  29. package/esm/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
  30. package/esm/localization/bundles/id-ID.localization-bundle.js +9 -2
  31. package/esm/localization/bundles/it-IT.localization-bundle.d.ts +7 -0
  32. package/esm/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
  33. package/esm/localization/bundles/it-IT.localization-bundle.js +9 -2
  34. package/esm/localization/bundles/ja-JP.localization-bundle.d.ts +7 -0
  35. package/esm/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
  36. package/esm/localization/bundles/ja-JP.localization-bundle.js +9 -2
  37. package/esm/localization/bundles/ko-KR.localization-bundle.d.ts +7 -0
  38. package/esm/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
  39. package/esm/localization/bundles/ko-KR.localization-bundle.js +9 -2
  40. package/esm/localization/bundles/nl-NL.localization-bundle.d.ts +7 -0
  41. package/esm/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
  42. package/esm/localization/bundles/nl-NL.localization-bundle.js +9 -2
  43. package/esm/localization/bundles/pl-PL.localization-bundle.d.ts +7 -0
  44. package/esm/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
  45. package/esm/localization/bundles/pl-PL.localization-bundle.js +9 -2
  46. package/esm/localization/bundles/pt-BR.localization-bundle.d.ts +7 -0
  47. package/esm/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
  48. package/esm/localization/bundles/pt-BR.localization-bundle.js +9 -2
  49. package/esm/localization/bundles/pt-PT.localization-bundle.d.ts +7 -0
  50. package/esm/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
  51. package/esm/localization/bundles/pt-PT.localization-bundle.js +9 -2
  52. package/esm/localization/bundles/ru-RU.localization-bundle.d.ts +7 -0
  53. package/esm/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
  54. package/esm/localization/bundles/ru-RU.localization-bundle.js +9 -2
  55. package/esm/localization/bundles/sl-SI.localization-bundle.d.ts +7 -0
  56. package/esm/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
  57. package/esm/localization/bundles/sl-SI.localization-bundle.js +9 -2
  58. package/esm/localization/bundles/th-TH.localization-bundle.d.ts +7 -0
  59. package/esm/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
  60. package/esm/localization/bundles/th-TH.localization-bundle.js +9 -2
  61. package/esm/localization/bundles/tr-TR.localization-bundle.d.ts +7 -0
  62. package/esm/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
  63. package/esm/localization/bundles/tr-TR.localization-bundle.js +9 -2
  64. package/esm/localization/bundles/uk-UA.localization-bundle.d.ts +7 -0
  65. package/esm/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
  66. package/esm/localization/bundles/uk-UA.localization-bundle.js +9 -2
  67. package/esm/localization/bundles/vi-VN.localization-bundle.d.ts +7 -0
  68. package/esm/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
  69. package/esm/localization/bundles/vi-VN.localization-bundle.js +9 -2
  70. package/esm/localization/bundles/zh-HK.localization-bundle.d.ts +7 -0
  71. package/esm/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
  72. package/esm/localization/bundles/zh-HK.localization-bundle.js +9 -2
  73. package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts +7 -0
  74. package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
  75. package/esm/localization/bundles/zh-Hans.localization-bundle.js +9 -2
  76. package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts +7 -0
  77. package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
  78. package/esm/localization/bundles/zh-Hant.localization-bundle.js +9 -2
  79. package/esm/parameter/parameterCompletions.d.ts +1 -1
  80. package/esm/parameter/parameterCompletions.d.ts.map +1 -1
  81. package/esm/parameter/parameterCompletions.js +50 -23
  82. package/esm/parameter/parameterDescriptor.d.ts.map +1 -1
  83. package/esm/parameter/parameterDescriptor.js +8 -0
  84. package/esm/parameter/parameterSchema.d.ts +55 -15
  85. package/esm/parameter/parameterSchema.d.ts.map +1 -1
  86. package/esm/parameter/parameterSchema.js +60 -38
  87. package/esm/parameter/parameterValidation.d.ts +2 -2
  88. package/esm/parameter/parameterValidation.d.ts.map +1 -1
  89. package/esm/parameter/parameterValidation.js +7 -5
  90. package/package.json +15 -15
@@ -1,5 +1,30 @@
1
1
  import * as z from "zod/mini";
2
2
  import type { ParameterType } from "@gooddata/sdk-model";
3
+ /**
4
+ * Codes carried by schema issues via `issue.message`; `classifySchemaError` routes each to the
5
+ * equally named validation error code, so every entry needs a localized message wired up.
6
+ */
7
+ export declare const schemaErrorCodes: readonly ["invalidConstraintRange", "invalidAllowedValue", "invalidAllowedValueTitle", "duplicateAllowedValues", "emptyAllowedValues", "constraintsAllowedValuesExclusive", "unsupportedCardinality", "invalidDefaultValue"];
8
+ export type SchemaErrorCode = (typeof schemaErrorCodes)[number];
9
+ export type ParameterSchemaInput = z.input<typeof parameterSchema>;
10
+ export type ParameterSchema = z.infer<typeof parameterSchema>;
11
+ export type ParameterSchemaKeys = Record<string, SchemaKeysEntry>;
12
+ /** Child keys reachable under a parent key: directly in its mapping, or inside each item of its sequence. */
13
+ export type SchemaKeysEntry = {
14
+ kind: "mapping" | "sequence";
15
+ keys: string[];
16
+ };
17
+ /** Parent key → child-key entry for the schema restricted to `enabledTypes`; powers YAML editor autocompletion. */
18
+ export declare function parameterSchemaKeys(enabledTypes: ParameterType[]): ParameterSchemaKeys;
19
+ /** Runtime validation schema restricted to the enabled types; the static types stay the full union. */
20
+ export declare function buildParameterSchema(enabledTypes: ParameterType[]): z.ZodMiniObject<{
21
+ definition: z.ZodMiniDiscriminatedUnion<readonly [z.core.$ZodTypeDiscriminable, ...z.core.$ZodTypeDiscriminable[]], "type">;
22
+ type: z.ZodMiniDefault<z.ZodMiniLiteral<"parameter">>;
23
+ id: z.ZodMiniOptional<z.ZodMiniString<string>>;
24
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
25
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
26
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
27
+ }, z.core.$strict>;
3
28
  /** Full-union schema: single source for the editor vocabulary and the exported types, independent of the flag. */
4
29
  declare const parameterSchema: z.ZodMiniObject<{
5
30
  type: z.ZodMiniDefault<z.ZodMiniLiteral<"parameter">>;
@@ -14,27 +39,42 @@ declare const parameterSchema: z.ZodMiniObject<{
14
39
  min: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
15
40
  max: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
16
41
  }, z.core.$strict>>;
17
- }, z.core.$strict>, z.ZodMiniObject<{
42
+ }, z.core.$strict>, z.ZodMiniPipe<z.ZodMiniObject<{
18
43
  type: z.ZodMiniLiteral<"STRING">;
19
44
  defaultValue: z.ZodMiniString<string>;
20
45
  constraints: z.ZodMiniOptional<z.ZodMiniObject<{
21
46
  minLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
22
47
  maxLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
48
+ allowedValues: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
49
+ value: z.ZodMiniString<string>;
50
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
51
+ }, z.core.$strict>>>;
23
52
  }, z.core.$strict>>;
24
- }, z.core.$strict>], "type">;
25
- }, z.core.$strict>;
26
- export type ParameterSchemaInput = z.input<typeof parameterSchema>;
27
- export type ParameterSchema = z.infer<typeof parameterSchema>;
28
- /** Parent key → allowed child keys for the schema restricted to `enabledTypes`; powers YAML editor autocompletion. */
29
- export declare function parameterSchemaKeys(enabledTypes: ParameterType[]): Record<string, string[]>;
30
- /** Runtime validation schema restricted to the enabled types; the static types stay the full union. */
31
- export declare function buildParameterSchema(enabledTypes: ParameterType[]): z.ZodMiniObject<{
32
- type: z.ZodMiniDefault<z.ZodMiniLiteral<"parameter">>;
33
- id: z.ZodMiniOptional<z.ZodMiniString<string>>;
34
- title: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
- description: z.ZodMiniOptional<z.ZodMiniString<string>>;
36
- tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
37
- definition: z.ZodMiniDiscriminatedUnion<readonly [z.core.$ZodTypeDiscriminable, ...z.core.$ZodTypeDiscriminable[]], "type">;
53
+ cardinality: z.ZodMiniOptional<z.ZodMiniLiteral<"multi" | "single">>;
54
+ }, z.core.$strict>, z.ZodMiniTransform<{
55
+ type: "STRING";
56
+ defaultValue: string;
57
+ constraints?: {
58
+ minLength?: number | undefined;
59
+ maxLength?: number | undefined;
60
+ allowedValues?: {
61
+ value: string;
62
+ title?: string | undefined;
63
+ }[] | undefined;
64
+ } | undefined;
65
+ }, {
66
+ type: "STRING";
67
+ defaultValue: string;
68
+ constraints?: {
69
+ minLength?: number | undefined;
70
+ maxLength?: number | undefined;
71
+ allowedValues?: {
72
+ value: string;
73
+ title?: string | undefined;
74
+ }[] | undefined;
75
+ } | undefined;
76
+ cardinality?: "multi" | "single" | undefined;
77
+ }>>], "type">;
38
78
  }, z.core.$strict>;
39
79
  export {};
40
80
  //# sourceMappingURL=parameterSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parameterSchema.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterSchema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoDzD,kHAAkH;AAClH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;kBAOnB,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACnE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,wHAAsH;AACtH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAE3F;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,aAAa,EAAE;;;;;;;mBAMjE"}
1
+ {"version":3,"file":"parameterSchema.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterSchema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,8NASnB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACnE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAElE,6GAA6G;AAC7G,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,qHAAmH;AACnH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,aAAa,EAAE,GAAG,mBAAmB,CAEtF;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,aAAa,EAAE;;;;;;;mBAMjE;AAkFD,kHAAkH;AAClH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOnB,CAAC"}
@@ -1,39 +1,53 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { union } from "lodash-es";
3
3
  import * as z from "zod/mini";
4
+ /**
5
+ * Codes carried by schema issues via `issue.message`; `classifySchemaError` routes each to the
6
+ * equally named validation error code, so every entry needs a localized message wired up.
7
+ */
8
+ export const schemaErrorCodes = [
9
+ "invalidConstraintRange",
10
+ "invalidAllowedValue",
11
+ "invalidAllowedValueTitle",
12
+ "duplicateAllowedValues",
13
+ "emptyAllowedValues",
14
+ "constraintsAllowedValuesExclusive",
15
+ "unsupportedCardinality",
16
+ "invalidDefaultValue",
17
+ ];
18
+ /** Parent key → child-key entry for the schema restricted to `enabledTypes`; powers YAML editor autocompletion. */
19
+ export function parameterSchemaKeys(enabledTypes) {
20
+ return deriveSchemaKeys(buildParameterSchema(enabledTypes));
21
+ }
22
+ /** Runtime validation schema restricted to the enabled types; the static types stay the full union. */
23
+ export function buildParameterSchema(enabledTypes) {
24
+ // Re-spread to a non-empty tuple: `discriminatedUnion` requires it and it preserves the inferred union.
25
+ const [first, ...rest] = enabledTypes.map((type) => definitionSchemas[type]);
26
+ return z.extend(parameterSchema, {
27
+ definition: z.discriminatedUnion("type", [first, ...rest]),
28
+ });
29
+ }
4
30
  const numberConstraintsSchema = z
5
31
  .strictObject({
6
32
  min: z.optional(z.number()),
7
33
  max: z.optional(z.number()),
8
34
  })
9
- .check((ctx) => {
10
- const { min, max } = ctx.value;
11
- if (min !== undefined && max !== undefined && min > max) {
12
- ctx.issues.push({
13
- code: "custom",
14
- message: "invalidConstraintRange",
15
- input: ctx.value,
16
- path: [],
17
- });
18
- }
19
- });
35
+ .check(rule("invalidConstraintRange", ({ min, max }) => min === undefined || max === undefined || min <= max));
20
36
  const lengthSchema = z.int().check(z.nonnegative());
37
+ const allowedValueSchema = z
38
+ .strictObject({
39
+ value: z.string("invalidAllowedValue"),
40
+ title: z.optional(z.string("invalidAllowedValueTitle")),
41
+ })
42
+ .check(rule("invalidAllowedValue", ({ value }) => value !== ""), rule("invalidAllowedValueTitle", ({ value, title }) => (title ?? value).trim() !== ""));
43
+ const allowedValuesSchema = z.array(allowedValueSchema).check(rule("emptyAllowedValues", (entries) => entries.length > 0), rule("duplicateAllowedValues", (entries) => allUnique(entries.map((entry) => entry.value))), rule("duplicateAllowedValues", (entries) => allUnique(entries.map((entry) => entry.title ?? entry.value))));
21
44
  const stringConstraintsSchema = z
22
45
  .strictObject({
23
46
  minLength: z.optional(lengthSchema),
24
47
  maxLength: z.optional(lengthSchema),
48
+ allowedValues: z.optional(allowedValuesSchema),
25
49
  })
26
- .check((ctx) => {
27
- const { minLength, maxLength } = ctx.value;
28
- if (minLength !== undefined && maxLength !== undefined && minLength > maxLength) {
29
- ctx.issues.push({
30
- code: "custom",
31
- message: "invalidConstraintRange",
32
- input: ctx.value,
33
- path: [],
34
- });
35
- }
36
- });
50
+ .check(rule("invalidConstraintRange", ({ minLength, maxLength }) => minLength === undefined || maxLength === undefined || minLength <= maxLength), rule("constraintsAllowedValuesExclusive", ({ minLength, maxLength, allowedValues }) => allowedValues === undefined || (minLength === undefined && maxLength === undefined)));
37
51
  /** One arm per model type; `satisfies` breaks the build if the model gains a type without an arm. */
38
52
  const definitionSchemas = {
39
53
  NUMBER: z.strictObject({
@@ -41,11 +55,15 @@ const definitionSchemas = {
41
55
  defaultValue: z.number(),
42
56
  constraints: z.optional(numberConstraintsSchema),
43
57
  }),
44
- STRING: z.strictObject({
58
+ STRING: z.pipe(z
59
+ .strictObject({
45
60
  type: z.literal("STRING"),
46
61
  defaultValue: z.string(),
47
62
  constraints: z.optional(stringConstraintsSchema),
48
- }),
63
+ cardinality: z.optional(z.literal(["single", "multi"], "unsupportedCardinality")),
64
+ })
65
+ .check(rule("unsupportedCardinality", ({ cardinality }) => cardinality !== "multi", ["cardinality"]), rule("invalidDefaultValue", ({ defaultValue, constraints }) => !constraints?.allowedValues?.length ||
66
+ constraints.allowedValues.some((allowed) => allowed.value === defaultValue), ["defaultValue"])), z.transform(({ cardinality: _cardinality, ...definition }) => definition)),
49
67
  };
50
68
  /** Full-union schema: single source for the editor vocabulary and the exported types, independent of the flag. */
51
69
  const parameterSchema = z.strictObject({
@@ -56,25 +74,26 @@ const parameterSchema = z.strictObject({
56
74
  tags: z.optional(z.array(z.string())),
57
75
  definition: z.discriminatedUnion("type", [definitionSchemas.NUMBER, definitionSchemas.STRING]),
58
76
  });
59
- /** Parent key allowed child keys for the schema restricted to `enabledTypes`; powers YAML editor autocompletion. */
60
- export function parameterSchemaKeys(enabledTypes) {
61
- return deriveSchemaKeys(buildParameterSchema(enabledTypes));
77
+ function rule(code, predicate, path) {
78
+ return z.refine(predicate, { message: code, path });
62
79
  }
63
- /** Runtime validation schema restricted to the enabled types; the static types stay the full union. */
64
- export function buildParameterSchema(enabledTypes) {
65
- // Re-spread to a non-empty tuple: `discriminatedUnion` requires it and it preserves the inferred union.
66
- const [first, ...rest] = enabledTypes.map((type) => definitionSchemas[type]);
67
- return z.extend(parameterSchema, {
68
- definition: z.discriminatedUnion("type", [first, ...rest]),
69
- });
80
+ function allUnique(items) {
81
+ return new Set(items).size === items.length;
70
82
  }
71
- /** Map of parent key → allowed child keys. */
72
- function deriveSchemaKeys(schema, parentKey = "", result = {}) {
83
+ /** Map of parent key → child-key entry; an array-of-objects child is recorded as a `sequence` entry. */
84
+ function deriveSchemaKeys(schema, parentKey = "", kind = "mapping", result = {}) {
73
85
  for (const object of objectSchemasOf(schema)) {
74
86
  const { shape } = object._zod.def;
75
- result[parentKey] = union(result[parentKey], Object.keys(shape));
87
+ result[parentKey] = { kind, keys: union(result[parentKey]?.keys, Object.keys(shape)) };
76
88
  for (const [key, child] of Object.entries(shape)) {
77
- deriveSchemaKeys(unwrap(child), key, result);
89
+ const inner = unwrap(child);
90
+ if (inner._zod.def.type === "array") {
91
+ const element = unwrap(inner._zod.def.element);
92
+ deriveSchemaKeys(element, key, "sequence", result);
93
+ }
94
+ else {
95
+ deriveSchemaKeys(inner, key, "mapping", result);
96
+ }
78
97
  }
79
98
  }
80
99
  return result;
@@ -95,5 +114,8 @@ function unwrap(schema) {
95
114
  if (type === "optional" || type === "default") {
96
115
  return unwrap(schema._zod.def.innerType);
97
116
  }
117
+ if (type === "pipe") {
118
+ return unwrap(schema._zod.def.in);
119
+ }
98
120
  return schema;
99
121
  }
@@ -1,5 +1,5 @@
1
1
  import type { ParameterType } from "@gooddata/sdk-model";
2
- import { type ParameterSchema } from "./parameterSchema.js";
2
+ import { type ParameterSchema, type SchemaErrorCode } from "./parameterSchema.js";
3
3
  export type ParameterValidationResult = {
4
4
  isValid: true;
5
5
  parameter: ParameterSchema;
@@ -8,7 +8,7 @@ export type ParameterValidationResult = {
8
8
  errorCode: ParameterValidationErrorCode;
9
9
  type?: ParameterType;
10
10
  };
11
- export type ParameterValidationErrorCode = "empty" | "syntax" | "invalidStructure" | "idImmutable" | "unsupportedType" | "invalidDefaultValue" | "invalidConstraints" | "invalidConstraintRange" | "invalidTags";
11
+ export type ParameterValidationErrorCode = "empty" | "syntax" | "invalidStructure" | "idImmutable" | "unsupportedType" | "invalidDefaultValue" | "invalidConstraints" | "invalidTags" | SchemaErrorCode;
12
12
  type ValidateParameterYamlOptions = {
13
13
  enabledTypes: ParameterType[];
14
14
  fixedIdentifier?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"parameterValidation.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterValidation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,sBAAsB,CAAC;AAElF,MAAM,MAAM,yBAAyB,GAC/B;IACI,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,eAAe,CAAC;CAC9B,GACD;IACI,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,4BAA4B,CAAC;IACxC,IAAI,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC;AAER,MAAM,MAAM,4BAA4B,GAClC,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,aAAa,GACb,iBAAiB,GACjB,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,aAAa,CAAC;AAEpB,KAAK,4BAA4B,GAAG;IAChC,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,4BAA4B,GACtC,yBAAyB,CAY3B"}
1
+ {"version":3,"file":"parameterValidation.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterValidation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,eAAe,EAGvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,yBAAyB,GAC/B;IACI,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,eAAe,CAAC;CAC9B,GACD;IACI,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,4BAA4B,CAAC;IACxC,IAAI,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC;AAER,MAAM,MAAM,4BAA4B,GAClC,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,aAAa,GACb,iBAAiB,GACjB,qBAAqB,GACrB,oBAAoB,GACpB,aAAa,GACb,eAAe,CAAC;AAEtB,KAAK,4BAA4B,GAAG;IAChC,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,4BAA4B,GACtC,yBAAyB,CAY3B"}
@@ -1,6 +1,6 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { validateYaml } from "../asCode/validateYaml.js";
3
- import { buildParameterSchema } from "./parameterSchema.js";
3
+ import { buildParameterSchema, schemaErrorCodes, } from "./parameterSchema.js";
4
4
  export function validateParameterYaml(value, options) {
5
5
  const result = validateYaml(value, {
6
6
  schema: buildParameterSchema(options.enabledTypes),
@@ -16,10 +16,8 @@ export function validateParameterYaml(value, options) {
16
16
  function classifySchemaError(error, declaredType) {
17
17
  for (const issue of error.issues) {
18
18
  const path = issue.path.map(String).join(".");
19
- if (issue.code === "custom") {
20
- if (issue.message === "invalidConstraintRange") {
21
- return invalid("invalidConstraintRange", declaredType);
22
- }
19
+ if (isSchemaErrorCode(issue.message)) {
20
+ return invalid(issue.message, declaredType);
23
21
  }
24
22
  if (path === "definition.type") {
25
23
  return invalid("unsupportedType");
@@ -36,6 +34,10 @@ function classifySchemaError(error, declaredType) {
36
34
  }
37
35
  return invalid("invalidStructure");
38
36
  }
37
+ const schemaErrorCodeSet = new Set(schemaErrorCodes);
38
+ function isSchemaErrorCode(message) {
39
+ return schemaErrorCodeSet.has(message);
40
+ }
39
41
  function readDeclaredType(parsed) {
40
42
  if (!parsed || typeof parsed !== "object") {
41
43
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-catalog",
3
- "version": "11.51.0-alpha.4",
3
+ "version": "11.51.0",
4
4
  "description": "GoodData SDK - Analytics Catalog",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -41,15 +41,15 @@
41
41
  "tslib": "2.8.1",
42
42
  "yaml": "2.8.3",
43
43
  "zod": "4.3.6",
44
- "@gooddata/sdk-backend-spi": "11.51.0-alpha.4",
45
- "@gooddata/sdk-model": "11.51.0-alpha.4",
46
- "@gooddata/sdk-code-schemas": "11.51.0-alpha.4",
47
- "@gooddata/sdk-ui": "11.51.0-alpha.4",
48
- "@gooddata/sdk-ui-ext": "11.51.0-alpha.4",
49
- "@gooddata/sdk-ui-semantic-search": "11.51.0-alpha.4",
50
- "@gooddata/sdk-ui-kit": "11.51.0-alpha.4",
51
- "@gooddata/sdk-ui-theme-provider": "11.51.0-alpha.4",
52
- "@gooddata/util": "11.51.0-alpha.4"
44
+ "@gooddata/sdk-backend-spi": "11.51.0",
45
+ "@gooddata/sdk-model": "11.51.0",
46
+ "@gooddata/sdk-code-schemas": "11.51.0",
47
+ "@gooddata/sdk-ui-ext": "11.51.0",
48
+ "@gooddata/sdk-ui": "11.51.0",
49
+ "@gooddata/sdk-ui-kit": "11.51.0",
50
+ "@gooddata/sdk-ui-semantic-search": "11.51.0",
51
+ "@gooddata/util": "11.51.0",
52
+ "@gooddata/sdk-ui-theme-provider": "11.51.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@microsoft/api-documenter": "^7.17.0",
@@ -89,11 +89,11 @@
89
89
  "typescript": "5.9.3",
90
90
  "vitest": "4.1.8",
91
91
  "vitest-dom": "0.1.1",
92
- "@gooddata/eslint-config": "11.51.0-alpha.4",
93
- "@gooddata/i18n-toolkit": "11.51.0-alpha.4",
94
- "@gooddata/oxlint-config": "11.51.0-alpha.4",
95
- "@gooddata/stylelint-config": "11.51.0-alpha.4",
96
- "@gooddata/sdk-backend-mockingbird": "11.51.0-alpha.4"
92
+ "@gooddata/eslint-config": "11.51.0",
93
+ "@gooddata/i18n-toolkit": "11.51.0",
94
+ "@gooddata/oxlint-config": "11.51.0",
95
+ "@gooddata/sdk-backend-mockingbird": "11.51.0",
96
+ "@gooddata/stylelint-config": "11.51.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "react": "^18.0.0 || ^19.0.0",