@gooddata/sdk-ui-catalog 11.68.0-alpha.1 → 11.68.0-alpha.10

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 (139) hide show
  1. package/LICENSE +26 -4
  2. package/NOTICE +15673 -0
  3. package/README.md +1 -1
  4. package/esm/asCode/AsCodeDialog.d.ts.map +1 -1
  5. package/esm/asCode/AsCodeDialog.js +7 -5
  6. package/esm/asCode/AsCodeEditorBody.d.ts +6 -6
  7. package/esm/asCode/AsCodeEditorBody.d.ts.map +1 -1
  8. package/esm/asCode/AsCodeEditorBody.js +13 -6
  9. package/esm/asCode/descriptor.d.ts +23 -2
  10. package/esm/asCode/descriptor.d.ts.map +1 -1
  11. package/esm/asCode/descriptor.js +8 -0
  12. package/esm/asCode/keyCompletions.d.ts +12 -0
  13. package/esm/asCode/keyCompletions.d.ts.map +1 -0
  14. package/esm/asCode/keyCompletions.js +58 -0
  15. package/esm/asCode/schemaKeys.d.ts +13 -0
  16. package/esm/asCode/schemaKeys.d.ts.map +1 -0
  17. package/esm/asCode/schemaKeys.js +45 -0
  18. package/esm/asCode/validateYaml.d.ts +28 -25
  19. package/esm/asCode/validateYaml.d.ts.map +1 -1
  20. package/esm/asCode/validateYaml.js +34 -11
  21. package/esm/catalogDetail/hooks/useCatalogItemUpdate.d.ts.map +1 -1
  22. package/esm/catalogDetail/hooks/useCatalogItemUpdate.js +2 -2
  23. package/esm/computedAttribute/computedAttributeCompletions.d.ts +1 -7
  24. package/esm/computedAttribute/computedAttributeCompletions.d.ts.map +1 -1
  25. package/esm/computedAttribute/computedAttributeCompletions.js +2 -19
  26. package/esm/computedAttribute/computedAttributeDescriptor.d.ts.map +1 -1
  27. package/esm/computedAttribute/computedAttributeDescriptor.js +2 -2
  28. package/esm/computedAttribute/computedAttributeSchema.d.ts +2 -6
  29. package/esm/computedAttribute/computedAttributeSchema.d.ts.map +1 -1
  30. package/esm/computedAttribute/computedAttributeSchema.js +2 -8
  31. package/esm/computedAttribute/computedAttributeValidation.d.ts +3 -3
  32. package/esm/computedAttribute/computedAttributeValidation.d.ts.map +1 -1
  33. package/esm/computedAttribute/computedAttributeValidation.js +32 -44
  34. package/esm/filter/FilterContext.d.ts.map +1 -1
  35. package/esm/filter/FilterContext.js +9 -9
  36. package/esm/filter/StaticFilter.js +3 -3
  37. package/esm/index.d.ts +1 -1
  38. package/esm/index.d.ts.map +1 -1
  39. package/esm/localization/bundles/de-DE.localization-bundle.d.ts +1 -0
  40. package/esm/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
  41. package/esm/localization/bundles/de-DE.localization-bundle.js +6 -5
  42. package/esm/localization/bundles/en-AU.localization-bundle.d.ts +1 -0
  43. package/esm/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
  44. package/esm/localization/bundles/en-AU.localization-bundle.js +6 -5
  45. package/esm/localization/bundles/en-GB.localization-bundle.d.ts +1 -0
  46. package/esm/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
  47. package/esm/localization/bundles/en-GB.localization-bundle.js +6 -5
  48. package/esm/localization/bundles/en-US.localization-bundle.js +4 -4
  49. package/esm/localization/bundles/es-419.localization-bundle.d.ts +1 -0
  50. package/esm/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
  51. package/esm/localization/bundles/es-419.localization-bundle.js +6 -5
  52. package/esm/localization/bundles/es-ES.localization-bundle.d.ts +1 -0
  53. package/esm/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
  54. package/esm/localization/bundles/es-ES.localization-bundle.js +6 -5
  55. package/esm/localization/bundles/fi-FI.localization-bundle.d.ts +1 -0
  56. package/esm/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
  57. package/esm/localization/bundles/fi-FI.localization-bundle.js +6 -5
  58. package/esm/localization/bundles/fr-CA.localization-bundle.d.ts +1 -0
  59. package/esm/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
  60. package/esm/localization/bundles/fr-CA.localization-bundle.js +6 -5
  61. package/esm/localization/bundles/fr-FR.localization-bundle.d.ts +1 -0
  62. package/esm/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
  63. package/esm/localization/bundles/fr-FR.localization-bundle.js +6 -5
  64. package/esm/localization/bundles/id-ID.localization-bundle.d.ts +1 -0
  65. package/esm/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
  66. package/esm/localization/bundles/id-ID.localization-bundle.js +6 -5
  67. package/esm/localization/bundles/it-IT.localization-bundle.d.ts +1 -0
  68. package/esm/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
  69. package/esm/localization/bundles/it-IT.localization-bundle.js +9 -8
  70. package/esm/localization/bundles/ja-JP.localization-bundle.d.ts +1 -0
  71. package/esm/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
  72. package/esm/localization/bundles/ja-JP.localization-bundle.js +6 -5
  73. package/esm/localization/bundles/ko-KR.localization-bundle.d.ts +1 -0
  74. package/esm/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
  75. package/esm/localization/bundles/ko-KR.localization-bundle.js +6 -5
  76. package/esm/localization/bundles/nl-NL.localization-bundle.d.ts +1 -0
  77. package/esm/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
  78. package/esm/localization/bundles/nl-NL.localization-bundle.js +6 -5
  79. package/esm/localization/bundles/pl-PL.localization-bundle.d.ts +1 -0
  80. package/esm/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
  81. package/esm/localization/bundles/pl-PL.localization-bundle.js +6 -5
  82. package/esm/localization/bundles/pt-BR.localization-bundle.d.ts +1 -0
  83. package/esm/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
  84. package/esm/localization/bundles/pt-BR.localization-bundle.js +6 -5
  85. package/esm/localization/bundles/pt-PT.localization-bundle.d.ts +1 -0
  86. package/esm/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
  87. package/esm/localization/bundles/pt-PT.localization-bundle.js +6 -5
  88. package/esm/localization/bundles/ru-RU.localization-bundle.d.ts +1 -0
  89. package/esm/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
  90. package/esm/localization/bundles/ru-RU.localization-bundle.js +6 -5
  91. package/esm/localization/bundles/sl-SI.localization-bundle.d.ts +1 -0
  92. package/esm/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
  93. package/esm/localization/bundles/sl-SI.localization-bundle.js +6 -5
  94. package/esm/localization/bundles/th-TH.localization-bundle.d.ts +1 -0
  95. package/esm/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
  96. package/esm/localization/bundles/th-TH.localization-bundle.js +6 -5
  97. package/esm/localization/bundles/tr-TR.localization-bundle.d.ts +1 -0
  98. package/esm/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
  99. package/esm/localization/bundles/tr-TR.localization-bundle.js +6 -5
  100. package/esm/localization/bundles/uk-UA.localization-bundle.d.ts +1 -0
  101. package/esm/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
  102. package/esm/localization/bundles/uk-UA.localization-bundle.js +6 -5
  103. package/esm/localization/bundles/vi-VN.localization-bundle.d.ts +1 -0
  104. package/esm/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
  105. package/esm/localization/bundles/vi-VN.localization-bundle.js +6 -5
  106. package/esm/localization/bundles/zh-HK.localization-bundle.d.ts +1 -0
  107. package/esm/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
  108. package/esm/localization/bundles/zh-HK.localization-bundle.js +6 -5
  109. package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts +1 -0
  110. package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
  111. package/esm/localization/bundles/zh-Hans.localization-bundle.js +6 -5
  112. package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts +1 -0
  113. package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
  114. package/esm/localization/bundles/zh-Hant.localization-bundle.js +7 -6
  115. package/esm/localization/translations.d.ts.map +1 -1
  116. package/esm/localization/translations.js +3 -3
  117. package/esm/metric/metricCompletions.d.ts +1 -7
  118. package/esm/metric/metricCompletions.d.ts.map +1 -1
  119. package/esm/metric/metricCompletions.js +2 -16
  120. package/esm/metric/metricDescriptor.d.ts.map +1 -1
  121. package/esm/metric/metricDescriptor.js +2 -2
  122. package/esm/metric/metricSchema.d.ts +2 -6
  123. package/esm/metric/metricSchema.d.ts.map +1 -1
  124. package/esm/metric/metricSchema.js +2 -8
  125. package/esm/metric/metricValidation.d.ts +3 -3
  126. package/esm/metric/metricValidation.d.ts.map +1 -1
  127. package/esm/metric/metricValidation.js +12 -18
  128. package/esm/parameter/parameterCompletions.d.ts.map +1 -1
  129. package/esm/parameter/parameterCompletions.js +19 -6
  130. package/esm/parameter/parameterDescriptor.d.ts.map +1 -1
  131. package/esm/parameter/parameterDescriptor.js +5 -8
  132. package/esm/parameter/parameterSchema.d.ts +2 -7
  133. package/esm/parameter/parameterSchema.d.ts.map +1 -1
  134. package/esm/parameter/parameterSchema.js +1 -40
  135. package/esm/parameter/parameterValidation.d.ts +3 -2
  136. package/esm/parameter/parameterValidation.d.ts.map +1 -1
  137. package/esm/parameter/parameterValidation.js +26 -36
  138. package/esm/sdk-ui-catalog.d.ts +19 -2
  139. package/package.json +18 -17
@@ -1 +1 @@
1
- {"version":3,"file":"parameterDescriptor.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterDescriptor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AAQ9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA2FrE;;GAEG;AACH,eAAO,MAAM,mBAAmB,gHAwC9B,CAAC"}
1
+ {"version":3,"file":"parameterDescriptor.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterDescriptor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AAS9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA2FrE;;GAEG;AACH,eAAO,MAAM,mBAAmB,gHAwC9B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { useMemo } from "react";
3
3
  import { defineMessages, useIntl } from "react-intl";
4
- import { defineAsCodeDescriptor, fixedIdentifierOf, } from "../asCode/descriptor.js";
4
+ import { defineAsCodeDescriptor, fixedIdentifierOf, toAsCodeFailure, } from "../asCode/descriptor.js";
5
5
  import { ObjectTypes } from "../objectType/constants.js";
6
6
  import { PARAMETER_FEATURE_FLAG, useEnabledParameterTypes } from "./gate.js";
7
7
  import { createParameterCompletions } from "./parameterCompletions.js";
@@ -72,13 +72,10 @@ function useParameterEditing() {
72
72
  });
73
73
  return result.isValid
74
74
  ? { isValid: true, definition: result.parameter }
75
- : {
76
- isValid: false,
77
- error: intl.formatMessage(errorMessages[result.errorCode], {
78
- type: result.type,
79
- enabledTypes: intl.formatList(enabledTypes, { type: "conjunction" }),
80
- }),
81
- };
75
+ : toAsCodeFailure(result, intl.formatMessage(errorMessages[result.errorCode], {
76
+ type: result.type,
77
+ enabledTypes: intl.formatList(enabledTypes, { type: "conjunction" }),
78
+ }));
82
79
  },
83
80
  }), [completionSource, enabledTypes, intl]);
84
81
  }
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod/mini";
2
2
  import type { ParameterType } from "@gooddata/sdk-model";
3
3
  import type { AacSchemaParity, AssertAacParity } from "../asCode/aacParity.js";
4
+ import { type SchemaKeys } from "../asCode/schemaKeys.js";
4
5
  import type { ObjectTypes } from "../objectType/constants.js";
5
6
  /**
6
7
  * Codes carried by schema issues via `issue.message`; `classifySchemaError` routes each to the
@@ -12,14 +13,8 @@ export type ParameterSchemaInput = z.input<typeof parameterSchema>;
12
13
  export type ParameterSchema = z.infer<typeof parameterSchema>;
13
14
  /** Fails the build when this schema drifts from the AAC `parameter` document type. */
14
15
  export type ParameterAacParity = AssertAacParity<AacSchemaParity<typeof ObjectTypes.PARAMETER, ParameterSchema>>;
15
- export type ParameterSchemaKeys = Record<string, SchemaKeysEntry>;
16
- /** Child keys reachable under a parent key: directly in its mapping, or inside each item of its sequence. */
17
- export type SchemaKeysEntry = {
18
- kind: "mapping" | "sequence";
19
- keys: string[];
20
- };
21
16
  /** Parent key → child-key entry for the schema restricted to `enabledTypes`; powers YAML editor autocompletion. */
22
- export declare function parameterSchemaKeys(enabledTypes: ParameterType[]): ParameterSchemaKeys;
17
+ export declare function parameterSchemaKeys(enabledTypes: ParameterType[]): SchemaKeys;
23
18
  /** Runtime validation schema restricted to the enabled types; the static types stay the full union. */
24
19
  export declare function buildParameterSchema(enabledTypes: ParameterType[]): z.ZodMiniObject<{
25
20
  definition: z.ZodMiniDiscriminatedUnion<readonly [z.core.$ZodTypeDiscriminable<string>, ...z.core.$ZodTypeDiscriminable<string>[]], "type">;
@@ -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;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,gBAAgB,YACzB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,mCAAmC,EACnC,wBAAwB,EACxB,qBAAqB,CACf,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,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC5C,eAAe,CAAC,OAAO,WAAW,CAAC,SAAS,EAAE,eAAe,CAAC,CACjE,CAAC;AAEF,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,mHAAmH;AACnH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,aAAa,EAAE,GAAG,mBAAmB,CAEtF;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,aAAa,EAAE;;;;;;;mBAMjE;AAuFD,kHAAkH;AAClH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOnB,CAAC"}
1
+ {"version":3,"file":"parameterSchema.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterSchema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,gBAAgB,YACzB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,mCAAmC,EACnC,wBAAwB,EACxB,qBAAqB,CACf,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,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC5C,eAAe,CAAC,OAAO,WAAW,CAAC,SAAS,EAAE,eAAe,CAAC,CACjE,CAAC;AAEF,mHAAmH;AACnH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,aAAa,EAAE,GAAG,UAAU,CAE7E;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,aAAa,EAAE;;;;;;;mBAMjE;AAuFD,kHAAkH;AAClH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOnB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // (C) 2026 GoodData Corporation
2
- import { union } from "lodash-es";
3
2
  import * as z from "zod/mini";
3
+ import { deriveSchemaKeys } from "../asCode/schemaKeys.js";
4
4
  /**
5
5
  * Codes carried by schema issues via `issue.message`; `classifySchemaError` routes each to the
6
6
  * equally named validation error code, so every entry needs a localized message wired up.
@@ -82,42 +82,3 @@ function rule(code, predicate, path) {
82
82
  function allUnique(items) {
83
83
  return new Set(items).size === items.length;
84
84
  }
85
- /** Map of parent key → child-key entry; an array-of-objects child is recorded as a `sequence` entry. */
86
- function deriveSchemaKeys(schema, parentKey = "", kind = "mapping", result = {}) {
87
- for (const object of objectSchemasOf(schema)) {
88
- const { shape } = object._zod.def;
89
- result[parentKey] = { kind, keys: union(result[parentKey]?.keys, Object.keys(shape)) };
90
- for (const [key, child] of Object.entries(shape)) {
91
- const inner = unwrap(child);
92
- if (inner._zod.def.type === "array") {
93
- const element = unwrap(inner._zod.def.element);
94
- deriveSchemaKeys(element, key, "sequence", result);
95
- }
96
- else {
97
- deriveSchemaKeys(inner, key, "mapping", result);
98
- }
99
- }
100
- }
101
- return result;
102
- }
103
- /** Object schemas reachable from `schema`, flattening a discriminated union into its arms. */
104
- function objectSchemasOf(schema) {
105
- const { def } = schema._zod;
106
- if (def.type === "object") {
107
- return [schema];
108
- }
109
- if (def.type === "union") {
110
- return def.options.flatMap((option) => objectSchemasOf(unwrap(option)));
111
- }
112
- return [];
113
- }
114
- function unwrap(schema) {
115
- const { type } = schema._zod.def;
116
- if (type === "optional" || type === "default") {
117
- return unwrap(schema._zod.def.innerType);
118
- }
119
- if (type === "pipe") {
120
- return unwrap(schema._zod.def.in);
121
- }
122
- return schema;
123
- }
@@ -1,10 +1,11 @@
1
1
  import type { ParameterType } from "@gooddata/sdk-model";
2
+ import { type YamlValidationFailure } from "../asCode/validateYaml.js";
2
3
  import { type ParameterSchema, type SchemaErrorCode } from "./parameterSchema.js";
3
4
  export type ParameterValidationResult = {
4
5
  isValid: true;
5
6
  parameter: ParameterSchema;
6
- } | {
7
- isValid: false;
7
+ } | YamlValidationFailure<ParameterFailure>;
8
+ type ParameterFailure = {
8
9
  errorCode: ParameterValidationErrorCode;
9
10
  type?: ParameterType;
10
11
  };
@@ -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,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,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
+ {"version":3,"file":"parameterValidation.d.ts","sourceRoot":"","sources":["../../src/parameter/parameterValidation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,KAAK,qBAAqB,EAAgB,MAAM,2BAA2B,CAAC;AAErF,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,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;AAE9C,KAAK,gBAAgB,GAAG;IAAE,SAAS,EAAE,4BAA4B,CAAC;IAAC,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,4BAA4B,GAClC,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,aAAa,GACb,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,CAW3B"}
@@ -5,40 +5,37 @@ export function validateParameterYaml(value, options) {
5
5
  const result = validateYaml(value, {
6
6
  schema: buildParameterSchema(options.enabledTypes),
7
7
  fixedIdentifier: options.fixedIdentifier,
8
+ classifyIssue: classifyParameterIssue,
8
9
  });
9
- if (result.ok) {
10
+ if (result.isValid) {
10
11
  return { isValid: true, parameter: result.data };
11
12
  }
12
- return result.kind === "schema"
13
- ? classifySchemaError(result.error, readDeclaredType(result.parsed))
14
- : invalid(result.kind);
13
+ return result;
15
14
  }
16
- function classifySchemaError(error, declaredType) {
17
- for (const issue of error.issues) {
18
- const path = issue.path.map(String).join(".");
19
- if (isSchemaErrorCode(issue.message)) {
20
- return invalid(issue.message, declaredType);
21
- }
22
- // The object's own `type`, not the model type inside `definition`. A mistyped one is easy to
23
- // make and impossible to spot in a generic structure error, so it gets its own message naming
24
- // the one value the field accepts.
25
- if (path === "type") {
26
- return invalid("invalidType");
27
- }
28
- if (path === "definition.type") {
29
- return invalid("unsupportedType");
30
- }
31
- if (path === "definition.defaultValue") {
32
- return invalid("invalidDefaultValue", declaredType);
33
- }
34
- if (path.startsWith("definition.constraints")) {
35
- return invalid("invalidConstraints", declaredType);
36
- }
37
- if (path === "tags" || path.startsWith("tags.")) {
38
- return invalid("invalidTags");
39
- }
15
+ function classifyParameterIssue(path, parsed, issue) {
16
+ const declaredType = readDeclaredType(parsed);
17
+ if (isSchemaErrorCode(issue.message)) {
18
+ return { errorCode: issue.message, type: declaredType };
40
19
  }
41
- return invalid("invalidStructure");
20
+ // The object's own `type`, not the model type inside `definition`. A mistyped one is easy to
21
+ // make and impossible to spot in a generic structure error, so it gets its own message naming
22
+ // the one value the field accepts.
23
+ if (path === "type") {
24
+ return { errorCode: "invalidType" };
25
+ }
26
+ if (path === "definition.type") {
27
+ return { errorCode: "unsupportedType" };
28
+ }
29
+ if (path === "definition.defaultValue") {
30
+ return { errorCode: "invalidDefaultValue", type: declaredType };
31
+ }
32
+ if (path.startsWith("definition.constraints")) {
33
+ return { errorCode: "invalidConstraints", type: declaredType };
34
+ }
35
+ if (path === "tags" || path.startsWith("tags.")) {
36
+ return { errorCode: "invalidTags" };
37
+ }
38
+ return undefined;
42
39
  }
43
40
  const schemaErrorCodeSet = new Set(schemaErrorCodes);
44
41
  function isSchemaErrorCode(message) {
@@ -55,10 +52,3 @@ function readDeclaredType(parsed) {
55
52
  const { type } = definition;
56
53
  return type === "NUMBER" || type === "STRING" ? type : undefined;
57
54
  }
58
- function invalid(code, type) {
59
- return {
60
- isValid: false,
61
- errorCode: code,
62
- type,
63
- };
64
- }
@@ -38,6 +38,23 @@ export declare function AnalyticsCatalogDetailContent({ backend, workspace, loca
38
38
  */
39
39
  export declare function AnalyticsCatalogFilter<T>(props: IAnalyticsCatalogFilterProps<T>): JSX.Element;
40
40
 
41
+ /**
42
+ * Where a value sits in the document, as object keys and array indexes.
43
+ * @internal
44
+ */
45
+ export declare type AsCodeDocumentPath = ReadonlyArray<string | number>;
46
+
47
+ /**
48
+ * The field a failure marks in the editor: the value at `path`, or with `target: "key"` the key that
49
+ * names it, as for an unknown key. A failure without a path (empty or malformed document) has nothing
50
+ * to mark and shows only as a banner.
51
+ * @internal
52
+ */
53
+ export declare type AsCodeFieldMark = {
54
+ path?: AsCodeDocumentPath;
55
+ target?: "key";
56
+ };
57
+
41
58
  /** @internal */
42
59
  export declare type AsCodeSerialization = {
43
60
  yaml: string;
@@ -52,10 +69,10 @@ export declare type AsCodeSerialization = {
52
69
  export declare type AsCodeValidation<TDef> = {
53
70
  isValid: true;
54
71
  definition: TDef;
55
- } | {
72
+ } | ({
56
73
  isValid: false;
57
74
  error: string;
58
- };
75
+ } & AsCodeFieldMark);
59
76
 
60
77
  /**
61
78
  * Identity rule per flow: `edit` keeps `fixedIdentifier`; `duplicate` accepts and ignores any id (the
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-catalog",
3
- "version": "11.68.0-alpha.1",
3
+ "version": "11.68.0-alpha.10",
4
4
  "description": "GoodData SDK - Analytics Catalog",
5
- "license": "MIT",
5
+ "license": "LicenseRef-LICENSE",
6
6
  "author": "GoodData Corporation",
7
7
  "repository": {
8
8
  "type": "git",
@@ -15,7 +15,8 @@
15
15
  "esm/**/*.d.ts",
16
16
  "esm/**/*.map",
17
17
  "esm/**/*.svg",
18
- "styles"
18
+ "styles",
19
+ "NOTICE"
19
20
  ],
20
21
  "type": "module",
21
22
  "sideEffects": [
@@ -40,15 +41,15 @@
40
41
  "tslib": "2.8.1",
41
42
  "yaml": "2.9.1",
42
43
  "zod": "4.6.7",
43
- "@gooddata/sdk-backend-spi": "11.68.0-alpha.1",
44
- "@gooddata/sdk-model": "11.68.0-alpha.1",
45
- "@gooddata/sdk-code-schemas": "11.68.0-alpha.1",
46
- "@gooddata/sdk-ui": "11.68.0-alpha.1",
47
- "@gooddata/sdk-ui-ext": "11.68.0-alpha.1",
48
- "@gooddata/sdk-ui-kit": "11.68.0-alpha.1",
49
- "@gooddata/sdk-ui-theme-provider": "11.68.0-alpha.1",
50
- "@gooddata/sdk-ui-semantic-search": "11.68.0-alpha.1",
51
- "@gooddata/util": "11.68.0-alpha.1"
44
+ "@gooddata/sdk-backend-spi": "11.68.0-alpha.10",
45
+ "@gooddata/sdk-code-schemas": "11.68.0-alpha.10",
46
+ "@gooddata/sdk-ui": "11.68.0-alpha.10",
47
+ "@gooddata/sdk-model": "11.68.0-alpha.10",
48
+ "@gooddata/sdk-ui-ext": "11.68.0-alpha.10",
49
+ "@gooddata/sdk-ui-kit": "11.68.0-alpha.10",
50
+ "@gooddata/sdk-ui-theme-provider": "11.68.0-alpha.10",
51
+ "@gooddata/sdk-ui-semantic-search": "11.68.0-alpha.10",
52
+ "@gooddata/util": "11.68.0-alpha.10"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@microsoft/api-documenter": "7.30.20",
@@ -84,11 +85,11 @@
84
85
  "stylelint": "16.26.1",
85
86
  "typescript": "7.0.2",
86
87
  "vitest": "5.0.4",
87
- "@gooddata/eslint-config": "11.68.0-alpha.1",
88
- "@gooddata/oxlint-config": "11.68.0-alpha.1",
89
- "@gooddata/i18n-toolkit": "11.68.0-alpha.1",
90
- "@gooddata/stylelint-config": "11.68.0-alpha.1",
91
- "@gooddata/sdk-backend-mockingbird": "11.68.0-alpha.1"
88
+ "@gooddata/i18n-toolkit": "11.68.0-alpha.10",
89
+ "@gooddata/eslint-config": "11.68.0-alpha.10",
90
+ "@gooddata/sdk-backend-mockingbird": "11.68.0-alpha.10",
91
+ "@gooddata/stylelint-config": "11.68.0-alpha.10",
92
+ "@gooddata/oxlint-config": "11.68.0-alpha.10"
92
93
  },
93
94
  "peerDependencies": {
94
95
  "react": "^18.0.0 || ^19.0.0",